/* Generated by Cython 0.25.1 */

/* BEGIN: Cython Metadata
{
    "distutils": {
        "depends": []
    },
    "module_name": "kapok.uavsarc"
}
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 < 0x03020000)
    #error Cython requires Python 2.6+ or Python 3.2+.
#else
#define CYTHON_ABI "0_25_1"
#include <stddef.h>
#ifndef offsetof
  #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
#endif
#if !defined(WIN32) && !defined(MS_WINDOWS)
  #ifndef __stdcall
    #define __stdcall
  #endif
  #ifndef __cdecl
    #define __cdecl
  #endif
  #ifndef __fastcall
    #define __fastcall
  #endif
#endif
#ifndef DL_IMPORT
  #define DL_IMPORT(t) t
#endif
#ifndef DL_EXPORT
  #define DL_EXPORT(t) t
#endif
#ifndef HAVE_LONG_LONG
  #if PY_VERSION_HEX >= 0x03030000 || (PY_MAJOR_VERSION == 2 && 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_ASYNC_SLOTS
  #define CYTHON_USE_ASYNC_SLOTS 0
  #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
#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_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
#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_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
#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
#endif
#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
  #define Py_OptimizeFlag 0
#endif
#define __PYX_BUILD_PY_SSIZE_T "n"
#define CYTHON_FORMAT_SSIZE_T "z"
#if PY_MAJOR_VERSION < 3
  #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
  #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
          PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
  #define __Pyx_DefaultClassType PyClass_Type
#else
  #define __Pyx_BUILTIN_MODULE_NAME "builtins"
  #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
          PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
  #define __Pyx_DefaultClassType PyType_Type
#endif
#ifndef Py_TPFLAGS_CHECKTYPES
  #define Py_TPFLAGS_CHECKTYPES 0
#endif
#ifndef Py_TPFLAGS_HAVE_INDEX
  #define Py_TPFLAGS_HAVE_INDEX 0
#endif
#ifndef Py_TPFLAGS_HAVE_NEWBUFFER
  #define Py_TPFLAGS_HAVE_NEWBUFFER 0
#endif
#ifndef Py_TPFLAGS_HAVE_FINALIZE
  #define Py_TPFLAGS_HAVE_FINALIZE 0
#endif
#ifndef METH_FASTCALL
  #define METH_FASTCALL 0x80
  typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject **args,
                                              Py_ssize_t nargs, PyObject *kwnames);
#else
  #define __Pyx_PyCFunctionFast _PyCFunctionFast
#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)))
#else
#define __Pyx_PyFastCFunction_Check(func) 0
#endif
#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
  #define CYTHON_PEP393_ENABLED 1
  #define __Pyx_PyUnicode_READY(op)       (likely(PyUnicode_IS_READY(op)) ?\
                                              0 : _PyUnicode_Ready((PyObject *)(op)))
  #define __Pyx_PyUnicode_GET_LENGTH(u)   PyUnicode_GET_LENGTH(u)
  #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
  #define __Pyx_PyUnicode_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
#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_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
#define __Pyx_PyString_FormatSafe(a, b)   ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
#define __Pyx_PyUnicode_FormatSafe(a, b)  ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
#if PY_MAJOR_VERSION >= 3
  #define __Pyx_PyString_Format(a, b)  PyUnicode_Format(a, b)
#else
  #define __Pyx_PyString_Format(a, b)  PyString_Format(a, b)
#endif
#if PY_MAJOR_VERSION < 3 && !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
#endif
#if PY_MAJOR_VERSION >= 3
  #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
  #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
#else
  #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
  #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
#endif
#ifndef PySet_CheckExact
  #define PySet_CheckExact(obj)        (Py_TYPE(obj) == &PySet_Type)
#endif
#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
#define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
#if PY_MAJOR_VERSION >= 3
  #define PyIntObject                  PyLongObject
  #define PyInt_Type                   PyLong_Type
  #define PyInt_Check(op)              PyLong_Check(op)
  #define PyInt_CheckExact(op)         PyLong_CheckExact(op)
  #define PyInt_FromString             PyLong_FromString
  #define PyInt_FromUnicode            PyLong_FromUnicode
  #define PyInt_FromLong               PyLong_FromLong
  #define PyInt_FromSize_t             PyLong_FromSize_t
  #define PyInt_FromSsize_t            PyLong_FromSsize_t
  #define PyInt_AsLong                 PyLong_AsLong
  #define PyInt_AS_LONG                PyLong_AS_LONG
  #define PyInt_AsSsize_t              PyLong_AsSsize_t
  #define PyInt_AsUnsignedLongMask     PyLong_AsUnsignedLongMask
  #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
  #define PyNumber_Int                 PyNumber_Long
#endif
#if PY_MAJOR_VERSION >= 3
  #define PyBoolObject                 PyLongObject
#endif
#if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
  #ifndef PyUnicode_InternFromString
    #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
  #endif
#endif
#if PY_VERSION_HEX < 0x030200A4
  typedef long Py_hash_t;
  #define __Pyx_PyInt_FromHash_t PyInt_FromLong
  #define __Pyx_PyInt_AsHash_t   PyInt_AsLong
#else
  #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
  #define __Pyx_PyInt_AsHash_t   PyInt_AsSsize_t
#endif
#if PY_MAJOR_VERSION >= 3
  #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func))
#else
  #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
#endif
#if 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
    typedef struct {
        unaryfunc am_await;
        unaryfunc am_aiter;
        unaryfunc am_anext;
    } __Pyx_PyAsyncMethodsStruct;
    #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
  #endif
#else
  #define __Pyx_PyType_AsAsync(obj) NULL
#endif
#ifndef CYTHON_RESTRICT
  #if defined(__GNUC__)
    #define CYTHON_RESTRICT __restrict__
  #elif defined(_MSC_VER) && _MSC_VER >= 1400
    #define CYTHON_RESTRICT __restrict
  #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
    #define CYTHON_RESTRICT restrict
  #else
    #define CYTHON_RESTRICT
  #endif
#endif
#define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)

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

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

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

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

#define __PYX_HAVE__kapok__uavsarc
#define __PYX_HAVE_API__kapok__uavsarc
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include "numpy/arrayobject.h"
#include "numpy/ufuncobject.h"
#ifdef _OPENMP
#include <omp.h>
#endif /* _OPENMP */

#ifdef PYREX_WITHOUT_ASSERTIONS
#define CYTHON_WITHOUT_ASSERTIONS
#endif

#ifndef CYTHON_UNUSED
# if defined(__GNUC__)
#   if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
#     define CYTHON_UNUSED __attribute__ ((__unused__))
#   else
#     define CYTHON_UNUSED
#   endif
# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
#   define CYTHON_UNUSED __attribute__ ((__unused__))
# else
#   define CYTHON_UNUSED
# endif
#endif
#ifndef CYTHON_NCP_UNUSED
# if CYTHON_COMPILING_IN_CPYTHON
#  define CYTHON_NCP_UNUSED
# else
#  define CYTHON_NCP_UNUSED CYTHON_UNUSED
# endif
#endif
typedef struct {PyObject **p; 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_DEFAULT 0
#define __PYX_DEFAULT_STRING_ENCODING ""
#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
#define __Pyx_uchar_cast(c) ((unsigned char)c)
#define __Pyx_long_cast(x) ((long)x)
#define __Pyx_fits_Py_ssize_t(v, type, is_signed)  (\
    (sizeof(type) < sizeof(Py_ssize_t))  ||\
    (sizeof(type) > sizeof(Py_ssize_t) &&\
          likely(v < (type)PY_SSIZE_T_MAX ||\
                 v == (type)PY_SSIZE_T_MAX)  &&\
          (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
                                v == (type)PY_SSIZE_T_MIN)))  ||\
    (sizeof(type) == sizeof(Py_ssize_t) &&\
          (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
                               v == (type)PY_SSIZE_T_MAX)))  )
#if defined (__cplusplus) && __cplusplus >= 201103L
    #include <cstdlib>
    #define __Pyx_sst_abs(value) std::abs(value)
#elif SIZEOF_INT >= SIZEOF_SIZE_T
    #define __Pyx_sst_abs(value) abs(value)
#elif SIZEOF_LONG >= SIZEOF_SIZE_T
    #define __Pyx_sst_abs(value) labs(value)
#elif defined (_MSC_VER) && defined (_M_X64)
    #define __Pyx_sst_abs(value) _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 char* __Pyx_PyObject_AsString(PyObject*);
static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
#define __Pyx_PyBytes_FromString        PyBytes_FromString
#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
#if PY_MAJOR_VERSION < 3
    #define __Pyx_PyStr_FromString        __Pyx_PyBytes_FromString
    #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
#else
    #define __Pyx_PyStr_FromString        __Pyx_PyUnicode_FromString
    #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
#endif
#define __Pyx_PyObject_AsSString(s)    ((signed char*) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_AsUString(s)    ((unsigned char*) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_FromCString(s)  __Pyx_PyObject_FromString((const char*)s)
#define __Pyx_PyBytes_FromCString(s)   __Pyx_PyBytes_FromString((const char*)s)
#define __Pyx_PyByteArray_FromCString(s)   __Pyx_PyByteArray_FromString((const char*)s)
#define __Pyx_PyStr_FromCString(s)     __Pyx_PyStr_FromString((const char*)s)
#define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
#if PY_MAJOR_VERSION < 3
static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u)
{
    const Py_UNICODE *u_end = u;
    while (*u_end++) ;
    return (size_t)(u_end - u - 1);
}
#else
#define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen
#endif
#define __Pyx_PyUnicode_FromUnicode(u)       PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
#define __Pyx_PyUnicode_AsUnicode            PyUnicode_AsUnicode
#define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
#define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
#define __Pyx_PyBool_FromLong(b) ((b) ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False))
static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
#if CYTHON_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));
    if (!__PYX_DEFAULT_STRING_ENCODING) goto bad;
    strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
    Py_DECREF(default_encoding);
    return 0;
bad:
    Py_XDECREF(default_encoding);
    return -1;
}
#endif
#endif


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

static PyObject *__pyx_m;
static PyObject *__pyx_d;
static PyObject *__pyx_b;
static PyObject *__pyx_empty_tuple;
static PyObject *__pyx_empty_bytes;
static 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[] = {
  "kapok\\uavsarc.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;


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

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

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

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

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

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

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

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

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

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

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

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

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

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

/* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":754
 * 
 * ctypedef npy_ulong      uint_t
 * ctypedef npy_ulonglong  ulong_t             # <<<<<<<<<<<<<<
 * ctypedef npy_ulonglong  ulonglong_t
 * 
 */
typedef npy_ulonglong __pyx_t_5numpy_ulong_t;

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

/* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":757
 * ctypedef npy_ulonglong  ulonglong_t
 * 
 * ctypedef npy_intp       intp_t             # <<<<<<<<<<<<<<
 * ctypedef npy_uintp      uintp_t
 * 
 */
typedef npy_intp __pyx_t_5numpy_intp_t;

/* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":758
 * 
 * ctypedef npy_intp       intp_t
 * ctypedef npy_uintp      uintp_t             # <<<<<<<<<<<<<<
 * 
 * ctypedef npy_double     float_t
 */
typedef npy_uintp __pyx_t_5numpy_uintp_t;

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

/* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":761
 * 
 * ctypedef npy_double     float_t
 * ctypedef npy_double     double_t             # <<<<<<<<<<<<<<
 * ctypedef npy_longdouble longdouble_t
 * 
 */
typedef npy_double __pyx_t_5numpy_double_t;

/* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":762
 * ctypedef npy_double     float_t
 * ctypedef npy_double     double_t
 * ctypedef npy_longdouble longdouble_t             # <<<<<<<<<<<<<<
 * 
 * ctypedef npy_cfloat      cfloat_t
 */
typedef npy_longdouble __pyx_t_5numpy_longdouble_t;
/* 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 ---*/

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

/* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":765
 * 
 * ctypedef npy_cfloat      cfloat_t
 * ctypedef npy_cdouble     cdouble_t             # <<<<<<<<<<<<<<
 * ctypedef npy_clongdouble clongdouble_t
 * 
 */
typedef npy_cdouble __pyx_t_5numpy_cdouble_t;

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

/* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":768
 * ctypedef npy_clongdouble clongdouble_t
 * 
 * ctypedef npy_cdouble     complex_t             # <<<<<<<<<<<<<<
 * 
 * cdef inline object PyArray_MultiIterNew1(a):
 */
typedef npy_cdouble __pyx_t_5numpy_complex_t;

/* --- 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) {
    PyTypeObject* tp = Py_TYPE(obj);
    if (likely(tp->tp_getattro))
        return tp->tp_getattro(obj, attr_name);
#if PY_MAJOR_VERSION < 3
    if (likely(tp->tp_getattr))
        return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
#endif
    return PyObject_GetAttr(obj, attr_name);
}
#else
#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
#endif

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

/* GetModuleGlobalName.proto */
static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name);

/* 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

/* 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, int nargs, PyObject *kwargs);
#else
#define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs)
#endif
#endif

/* 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

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

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

/* PyThreadStateGet.proto */
#if CYTHON_FAST_THREAD_STATE
#define __Pyx_PyThreadState_declare  PyThreadState *__pyx_tstate;
#define __Pyx_PyThreadState_assign  __pyx_tstate = PyThreadState_GET();
#else
#define __Pyx_PyThreadState_declare
#define __Pyx_PyThreadState_assign
#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

/* 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

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

/* 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 CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
                                                     int is_list, int wraparound, int boundscheck);

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

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

/* PyObjectCallMethod1.proto */
static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg);

/* append.proto */
static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x);

/* PyIntBinop.proto */
#if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_PyInt_TrueDivideObjC(PyObject *op1, PyObject *op2, long intval, int inplace);
#else
#define __Pyx_PyInt_TrueDivideObjC(op1, op2, intval, inplace)\
    (inplace ? PyNumber_InPlaceTrueDivide(op1, op2) : PyNumber_TrueDivide(op1, op2))
#endif

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

/* 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

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

/* SliceObject.proto */
static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(
        PyObject* obj, Py_ssize_t cstart, Py_ssize_t cstop,
        PyObject** py_start, PyObject** py_stop, PyObject** py_slice,
        int has_cstart, int has_cstop, int wraparound);

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

/* PyIntBinop.proto */
#if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_PyInt_EqObjC(PyObject *op1, PyObject *op2, long intval, int inplace);
#else
#define __Pyx_PyInt_EqObjC(op1, op2, intval, inplace)\
    PyObject_RichCompare(op1, op2, Py_EQ)
    #endif

/* PyIntBinop.proto */
#if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_PyInt_RemainderObjC(PyObject *op1, PyObject *op2, long intval, int inplace);
#else
#define __Pyx_PyInt_RemainderObjC(op1, op2, intval, inplace)\
    (inplace ? PyNumber_InPlaceRemainder(op1, op2) : PyNumber_Remainder(op1, op2))
#endif

/* None.proto */
static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname);

/* SliceObject.proto */
#define __Pyx_PyObject_DelSlice(obj, cstart, cstop, py_start, py_stop, py_slice, has_cstart, has_cstop, wraparound)\
    __Pyx_PyObject_SetSlice(obj, (PyObject*)NULL, cstart, cstop, py_start, py_stop, py_slice, has_cstart, has_cstop, wraparound)
static CYTHON_INLINE int __Pyx_PyObject_SetSlice(
        PyObject* obj, PyObject* value, Py_ssize_t cstart, Py_ssize_t cstop,
        PyObject** py_start, PyObject** py_stop, PyObject** py_slice,
        int has_cstart, int has_cstop, int wraparound);

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

/* BufferFormatCheck.proto */
static CYTHON_INLINE int  __Pyx_GetBufferAndValidate(Py_buffer* buf, PyObject* obj,
    __Pyx_TypeInfo* dtype, int flags, int nd, int cast, __Pyx_BufFmt_StackElem* stack);
static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info);
static 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); // PROTO

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

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

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

/* PyErrFetchRestore.proto */
#if CYTHON_FAST_THREAD_STATE
#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);
#else
#define __Pyx_ErrRestoreWithState(type, value, tb)  PyErr_Restore(type, value, tb)
#define __Pyx_ErrFetchWithState(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

/* 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) {
    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);
}
#else
#define __Pyx_PyObject_DelAttrStr(o,n)   PyObject_DelAttr(o,n)
#define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v)
#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

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

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

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

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

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

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

/* CythonFunction.proto */
#define __Pyx_CyFunction_USED 1
#include <structmember.h>
#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_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);

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

/* 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


/* None.proto */
static Py_ssize_t __Pyx_zeros[] = {0, 0, 0, 0, 0, 0, 0, 0};
static Py_ssize_t __Pyx_minusones[] = {-1, -1, -1, -1, -1, -1, -1, -1};

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

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

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

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

/* 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_int(int value);

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

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

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

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

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

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

/* PyIdentifierFromString.proto */
#if !defined(__Pyx_PyIdentifier_FromString)
#if PY_MAJOR_VERSION < 3
  #define __Pyx_PyIdentifier_FromString(s) PyString_FromString(s)
#else
  #define __Pyx_PyIdentifier_FromString(s) PyUnicode_FromString(s)
#endif
#endif

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

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

/* 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 'libc.stdlib' */

/* Module declarations from 'numpy' */

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

/* Module declarations from 'cython' */

/* Module declarations from 'kapok.uavsarc' */
static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t = { "float64_t", NULL, sizeof(__pyx_t_5numpy_float64_t), { 0 }, 0, 'R', 0, 0 };
#define __Pyx_MODULE_NAME "kapok.uavsarc"
int __pyx_module_is_main_kapok__uavsarc = 0;

/* Implementation of 'kapok.uavsarc' */
static PyObject *__pyx_builtin_object;
static PyObject *__pyx_builtin_print;
static PyObject *__pyx_builtin_range;
static PyObject *__pyx_builtin_enumerate;
static PyObject *__pyx_builtin_open;
static PyObject *__pyx_builtin_ValueError;
static PyObject *__pyx_builtin_RuntimeError;
static PyObject *__pyx_builtin_ImportError;
static const char __pyx_k_S[] = "S";
static const char __pyx_k_c[] = "c";
static const char __pyx_k_f[] = "f";
static const char __pyx_k_n[] = "n";
static const char __pyx_k_r[] = "r";
static const char __pyx_k_s[] = "_*_s";
static const char __pyx_k_w[] = "w";
static const char __pyx_k_x[] = "x";
static const char __pyx_k_HH[] = "HH";
static const char __pyx_k_HV[] = "HV";
static const char __pyx_k_VV[] = "VV";
static const char __pyx_k_az[] = "az";
static const char __pyx_k_fd[] = "fd";
static const char __pyx_k_hh[] = "hh";
static const char __pyx_k_kz[] = "kz";
static const char __pyx_k_np[] = "np";
static const char __pyx_k_os[] = "os";
static const char __pyx_k_pi[] = "pi";
static const char __pyx_k_tr[] = "tr";
static const char __pyx_k_2x8[] = "_2x8";
static const char __pyx_k_Ann[] = "Ann";
static const char __pyx_k_URL[] = "URL";
static const char __pyx_k__16[] = ")";
static const char __pyx_k__27[] = ").";
static const char __pyx_k__28[] = ".";
static const char __pyx_k__30[] = "";
static const char __pyx_k__31[] = "/";
static const char __pyx_k__33[] = "*";
static const char __pyx_k__34[] = "*_";
static const char __pyx_k__37[] = "-";
static const char __pyx_k__38[] = " / ";
static const char __pyx_k__39[] = " (";
static const char __pyx_k__40[] = "%). (";
static const char __pyx_k__41[] = ". (";
static const char __pyx_k__42[] = ")     ";
static const char __pyx_k__43[] = "\r";
static const char __pyx_k__46[] = ",";
static const char __pyx_k__47[] = "). (";
static const char __pyx_k_abs[] = "abs";
static const char __pyx_k_ann[] = "ann";
static const char __pyx_k_col[] = "col";
static const char __pyx_k_cov[] = "cov";
static const char __pyx_k_dem[] = "dem";
static const char __pyx_k_dim[] = "dim";
static const char __pyx_k_doc[] = "__doc__";
static const char __pyx_k_dpi[] = "dpi";
static const char __pyx_k_end[] = "end";
static const char __pyx_k_inc[] = "inc";
static const char __pyx_k_int[] = "int";
static const char __pyx_k_lat[] = "lat";
static const char __pyx_k_lkv[] = "lkv_";
static const char __pyx_k_llh[] = "llh_";
static const char __pyx_k_lon[] = "lon";
static const char __pyx_k_max[] = "max";
static const char __pyx_k_num[] = "num";
static const char __pyx_k_plt[] = "plt";
static const char __pyx_k_pol[] = "pol";
static const char __pyx_k_pos[] = "pos";
static const char __pyx_k_row[] = "row";
static const char __pyx_k_s_2[] = "*s";
static const char __pyx_k_seg[] = "seg";
static const char __pyx_k_sin[] = "sin";
static const char __pyx_k_slc[] = "slc_";
static const char __pyx_k_sum[] = "sum";
static const char __pyx_k_tan[] = "tan";
static const char __pyx_k_url[] = "url";
static const char __pyx_k_val[] = "val";
static const char __pyx_k_File[] = "File";
static const char __pyx_k_L090[] = "_L090";
static const char __pyx_k__177[] = "\n";
static const char __pyx_k__179[] = "=";
static const char __pyx_k__181[] = ";";
static const char __pyx_k_axis[] = "axis";
static const char __pyx_k_cmap[] = "cmap";
static const char __pyx_k_conj[] = "conj";
static const char __pyx_k_file[] = "file";
static const char __pyx_k_glob[] = "glob";
static const char __pyx_k_gray[] = "gray";
static const char __pyx_k_gzip[] = "gzip";
static const char __pyx_k_h5py[] = "h5py";
static const char __pyx_k_iend[] = "iend";
static const char __pyx_k_init[] = "__init__";
static const char __pyx_k_kz_2[] = "*.kz";
static const char __pyx_k_load[] = "load";
static const char __pyx_k_main[] = "__main__";
static const char __pyx_k_mode[] = "mode";
static const char __pyx_k_norm[] = "norm";
static const char __pyx_k_open[] = "open";
static const char __pyx_k_path[] = "path";
static const char __pyx_k_read[] = "read";
static const char __pyx_k_real[] = "real";
static const char __pyx_k_self[] = "self";
static const char __pyx_k_sign[] = "sign";
static const char __pyx_k_site[] = "site";
static const char __pyx_k_slca[] = "slca";
static const char __pyx_k_slcb[] = "slcb";
static const char __pyx_k_sqrt[] = "sqrt";
static const char __pyx_k_temp[] = "temp";
static const char __pyx_k_test[] = "__test__";
static const char __pyx_k_time[] = "time";
static const char __pyx_k_vmax[] = "vmax";
static const char __pyx_k_vmin[] = "vmin";
static const char __pyx_k_zoom[] = "zoom";
static const char __pyx_k_Scene[] = "Scene";
static const char __pyx_k_array[] = "array";
static const char __pyx_k_attrs[] = "attrs";
static const char __pyx_k_az_ml[] = "az_ml";
static const char __pyx_k_azend[] = "azend";
static const char __pyx_k_azoff[] = "azoff";
static const char __pyx_k_basis[] = "basis";
static const char __pyx_k_close[] = "close";
static const char __pyx_k_ctime[] = "ctime";
static const char __pyx_k_dtype[] = "dtype";
static const char __pyx_k_file2[] = "file2";
static const char __pyx_k_float[] = "float";
static const char __pyx_k_floor[] = "floor";
static const char __pyx_k_flush[] = "flush";
static const char __pyx_k_int32[] = "int32";
static const char __pyx_k_kapok[] = "kapok";
static const char __pyx_k_label[] = "label";
static const char __pyx_k_lkv_2[] = "lkv";
static const char __pyx_k_lkvmm[] = "lkvmm";
static const char __pyx_k_llh_2[] = "llh";
static const char __pyx_k_log10[] = "log10";
static const char __pyx_k_mlook[] = "mlook";
static const char __pyx_k_mlwin[] = "mlwin";
static const char __pyx_k_numpy[] = "numpy";
static const char __pyx_k_posmm[] = "posmm";
static const char __pyx_k_print[] = "print";
static const char __pyx_k_query[] = "query";
static const char __pyx_k_range[] = "range";
static const char __pyx_k_round[] = "round";
static const char __pyx_k_shape[] = "shape";
static const char __pyx_k_slc_2[] = "slc";
static const char __pyx_k_smwin[] = "smwin";
static const char __pyx_k_split[] = "split";
static const char __pyx_k_strip[] = "strip";
static const char __pyx_k_tight[] = "tight";
static const char __pyx_k_track[] = "track";
static const char __pyx_k_units[] = "units";
static const char __pyx_k_upper[] = "upper";
static const char __pyx_k_where[] = "where";
static const char __pyx_k_zeros[] = "zeros";
static const char __pyx_k_UAVSAR[] = "UAVSAR";
static const char __pyx_k_append[] = "append";
static const char __pyx_k_arccos[] = "arccos";
static const char __pyx_k_aspect[] = "aspect";
static const char __pyx_k_astype[] = "astype";
static const char __pyx_k_azsize[] = "azsize";
static const char __pyx_k_cumsum[] = "cumsum";
static const char __pyx_k_extent[] = "extent";
static const char __pyx_k_figure[] = "figure";
static const char __pyx_k_import[] = "__import__";
static const char __pyx_k_imshow[] = "imshow";
static const char __pyx_k_infile[] = "infile";
static const char __pyx_k_insert[] = "insert";
static const char __pyx_k_istart[] = "istart";
static const char __pyx_k_kzcalc[] = "kzcalc";
static const char __pyx_k_linalg[] = "linalg";
static const char __pyx_k_memmap[] = "memmap";
static const char __pyx_k_meters[] = "meters";
static const char __pyx_k_module[] = "__module__";
static const char __pyx_k_num_bl[] = "num_bl";
static const char __pyx_k_object[] = "object";
static const char __pyx_k_offset[] = "offset";
static const char __pyx_k_peghdg[] = "peghdg";
static const char __pyx_k_peglat[] = "peglat";
static const char __pyx_k_peglon[] = "peglon";
static const char __pyx_k_rsplit[] = "rsplit";
static const char __pyx_k_sensor[] = "sensor";
static const char __pyx_k_slcnum[] = "slcnum";
static const char __pyx_k_smooth[] = "smooth";
static const char __pyx_k_square[] = "square";
static const char __pyx_k_sstart[] = "sstart";
static const char __pyx_k_subset[] = "subset";
static const char __pyx_k_tracks[] = "tracks";
static const char __pyx_k_vstack[] = "vstack";
static const char __pyx_k_xlabel[] = "xlabel";
static const char __pyx_k_ylabel[] = "ylabel";
static const char __pyx_k_1x1_slc[] = "_1x1.slc";
static const char __pyx_k_1x4_slc[] = "_*_1x4.slc";
static const char __pyx_k_2x8_slc[] = "_2x8.slc";
static const char __pyx_k_4x1_slc[] = "_4x1.slc";
static const char __pyx_k_azslope[] = "azslope";
static const char __pyx_k_azstart[] = "azstart";
static const char __pyx_k_basesch[] = "basesch";
static const char __pyx_k_degrees[] = "degrees";
static const char __pyx_k_dim_slc[] = "dim_slc";
static const char __pyx_k_dirname[] = "dirname";
static const char __pyx_k_float32[] = "float32";
static const char __pyx_k_float64[] = "float64";
static const char __pyx_k_inc_ref[] = "inc_ref";
static const char __pyx_k_isclose[] = "isclose";
static const char __pyx_k_keyword[] = "keyword";
static const char __pyx_k_kz_cols[] = "kz_cols";
static const char __pyx_k_kz_rows[] = "kz_rows";
static const char __pyx_k_kz_temp[] = "kz_temp";
static const char __pyx_k_lkvname[] = "lkvname";
static const char __pyx_k_llh2enu[] = "llh2enu";
static const char __pyx_k_llhname[] = "llhname";
static const char __pyx_k_loadtxt[] = "loadtxt";
static const char __pyx_k_nearest[] = "nearest";
static const char __pyx_k_newaxis[] = "newaxis";
static const char __pyx_k_num_pol[] = "num_pol";
static const char __pyx_k_os_path[] = "os.path";
static const char __pyx_k_outfile[] = "outfile";
static const char __pyx_k_prepare[] = "__prepare__";
static const char __pyx_k_qlimage[] = "qlimage";
static const char __pyx_k_radians[] = "radians";
static const char __pyx_k_rngsize[] = "rngsize";
static const char __pyx_k_savefig[] = "savefig";
static const char __pyx_k_sbounds[] = "sbounds";
static const char __pyx_k_sch2enu[] = "sch2enu";
static const char __pyx_k_seg_end[] = "seg_end";
static const char __pyx_k_shuffle[] = "shuffle";
static const char __pyx_k_spacing[] = "spacing";
static const char __pyx_k_1x1_Rows[] = "_1x1 Rows";
static const char __pyx_k_1x4_Rows[] = "_1x4 Rows";
static const char __pyx_k_2x8_Rows[] = "_2x8 Rows";
static const char __pyx_k_Aborting[] = "\".  Aborting.";
static const char __pyx_k_Latitude[] = "Latitude";
static const char __pyx_k_azbounds[] = "azbounds";
static const char __pyx_k_azllhend[] = "azllhend";
static const char __pyx_k_azposend[] = "azposend";
static const char __pyx_k_base_enu[] = "base_enu";
static const char __pyx_k_basefile[] = "basefile";
static const char __pyx_k_baseline[] = "*.baseline";
static const char __pyx_k_colorbar[] = "colorbar";
static const char __pyx_k_datapath[] = "datapath";
static const char __pyx_k_file_alt[] = "file_alt";
static const char __pyx_k_gradient[] = "gradient";
static const char __pyx_k_indexing[] = "indexing";
static const char __pyx_k_linspace[] = "linspace";
static const char __pyx_k_lkv_cols[] = "lkv_cols";
static const char __pyx_k_lkv_rows[] = "lkv_rows";
static const char __pyx_k_llh_cols[] = "llh_cols";
static const char __pyx_k_llh_rows[] = "llh_rows";
static const char __pyx_k_maxsplit[] = "maxsplit";
static const char __pyx_k_qualname[] = "__qualname__";
static const char __pyx_k_rngslope[] = "rngslope";
static const char __pyx_k_savefile[] = "savefile";
static const char __pyx_k_slcfiles[] = "slcfiles";
static const char __pyx_k_slcstack[] = "slcstack";
static const char __pyx_k_sspacing[] = "sspacing";
static const char __pyx_k_tempdiff[] = "tempdiff";
static const char __pyx_k_tracklkv[] = "tracklkv";
static const char __pyx_k_velocity[] = "velocity";
static const char __pyx_k_1x1_slc_2[] = "_*_1x1.slc";
static const char __pyx_k_2x8_slc_2[] = "_*_2x8.slc";
static const char __pyx_k_Ann_query[] = "Ann.query";
static const char __pyx_k_Longitude[] = "Longitude";
static const char __pyx_k_az_vector[] = "az_vector";
static const char __pyx_k_azend_slc[] = "azend_slc";
static const char __pyx_k_baselinep[] = "baselinep";
static const char __pyx_k_calcslope[] = "calcslope";
static const char __pyx_k_complex64[] = "complex64";
static const char __pyx_k_enumerate[] = "enumerate";
static const char __pyx_k_kapok_lib[] = "kapok.lib";
static const char __pyx_k_kz_buffer[] = "kz_buffer";
static const char __pyx_k_lkvrowend[] = "lkvrowend";
static const char __pyx_k_metaclass[] = "__metaclass__";
static const char __pyx_k_ml_window[] = "ml_window";
static const char __pyx_k_mlwin_lkv[] = "mlwin_lkv";
static const char __pyx_k_overwrite[] = "overwrite";
static const char __pyx_k_processor[] = "processor";
static const char __pyx_k_quicklook[] = "quicklook";
static const char __pyx_k_rngbounds[] = "rngbounds";
static const char __pyx_k_rngllhend[] = "rngllhend";
static const char __pyx_k_seg_start[] = "seg_start";
static const char __pyx_k_slcwindow[] = "slcwindow";
static const char __pyx_k_sm_window[] = "sm_window";
static const char __pyx_k_sqrt_2_HV[] = "sqrt(2)*HV";
static const char __pyx_k_stackline[] = "stackline";
static const char __pyx_k_Ann___init[] = "Ann.__init__";
static const char __pyx_k_Stack_Name[] = "Stack Name";
static const char __pyx_k_ValueError[] = "ValueError";
static const char __pyx_k_azllhstart[] = "azllhstart";
static const char __pyx_k_azposstart[] = "azposstart";
static const char __pyx_k_azsize_slc[] = "azsize_slc";
static const char __pyx_k_baseline_2[] = "baseline";
static const char __pyx_k_byteoffset[] = "byteoffset";
static const char __pyx_k_inc_buffer[] = "inc_buffer";
static const char __pyx_k_kzvertical[] = "kzvertical";
static const char __pyx_k_lkvtrimend[] = "lkvtrimend";
static const char __pyx_k_lookcrossv[] = "lookcrossv";
static const char __pyx_k_num_blocks[] = "num_blocks";
static const char __pyx_k_num_tracks[] = "num_tracks";
static const char __pyx_k_pad_inches[] = "pad_inches";
static const char __pyx_k_production[] = "production";
static const char __pyx_k_stack_name[] = "stack_name";
static const char __pyx_k_stackline1[] = "stackline1";
static const char __pyx_k_startswith[] = "startswith";
static const char __pyx_k_tracknames[] = "tracknames";
static const char __pyx_k_wavelength[] = "wavelength";
static const char __pyx_k_2x8_Columns[] = "_2x8 Columns";
static const char __pyx_k_ImportError[] = "ImportError";
static const char __pyx_k_Peg_Heading[] = "Peg Heading";
static const char __pyx_k_Range_Index[] = "Range Index";
static const char __pyx_k_azllhoffset[] = "azllhoffset";
static const char __pyx_k_azstart_slc[] = "azstart_slc";
static const char __pyx_k_bbox_inches[] = "bbox_inches";
static const char __pyx_k_compression[] = "compression";
static const char __pyx_k_description[] = "description";
static const char __pyx_k_findsegment[] = "findsegment";
static const char __pyx_k_getslcblock[] = "getslcblock";
static const char __pyx_k_lkvrowstart[] = "lkvrowstart";
static const char __pyx_k_peg_heading[] = "peg_heading";
static const char __pyx_k_refvelocity[] = "refvelocity";
static const char __pyx_k_rngllhstart[] = "rngllhstart";
static const char __pyx_k_rngsize_slc[] = "rngsize_slc";
static const char __pyx_k_Peg_Latitude[] = "Peg Latitude";
static const char __pyx_k_RuntimeError[] = "RuntimeError";
static const char __pyx_k_azoffset_end[] = "azoffset_end";
static const char __pyx_k_incident_lkv[] = "incident_lkv";
static const char __pyx_k_lkvtrimstart[] = "lkvtrimstart";
static const char __pyx_k_num_segments[] = "num_segments";
static const char __pyx_k_peg_latitude[] = "peg_latitude";
static const char __pyx_k_rngllhoffset[] = "rngllhoffset";
static const char __pyx_k_tight_layout[] = "tight_layout";
static const char __pyx_k_Azimuth_Index[] = "Azimuth Index";
static const char __pyx_k_Peg_Longitude[] = "Peg Longitude";
static const char __pyx_k_Processor_DEM[] = "Processor DEM";
static const char __pyx_k_azsize_slc1x1[] = "azsize_slc1x1";
static const char __pyx_k_baselinepsign[] = "baselinepsign";
static const char __pyx_k_interpolation[] = "interpolation";
static const char __pyx_k_kapok_uavsarc[] = "kapok.uavsarc";
static const char __pyx_k_lexicographic[] = "lexicographic";
static const char __pyx_k_num_baselines[] = "num_baselines";
static const char __pyx_k_peg_longitude[] = "peg_longitude";
static const char __pyx_k_proj_reflkv_v[] = "proj_reflkv_v";
static const char __pyx_k_radians_meter[] = "radians/meter";
static const char __pyx_k_Backscatter_dB[] = " Backscatter (dB)";
static const char __pyx_k_azoffset_start[] = "azoffset_start";
static const char __pyx_k_create_dataset[] = "create_dataset";
static const char __pyx_k_rngsize_slc1x1[] = "rngsize_slc1x1";
static const char __pyx_k_slc_1_1x1_Rows[] = "slc_1_1x1 Rows";
static const char __pyx_k_slc_1_1x4_Rows[] = "slc_1_1x4 Rows";
static const char __pyx_k_slc_1_8x2_Rows[] = "slc_1_8x2 Rows";
static const char __pyx_k_slope_corrected[] = "slope_corrected";
static const char __pyx_k_Average_Altitude[] = "Average Altitude";
static const char __pyx_k_Site_Description[] = "Site Description";
static const char __pyx_k_average_altitude[] = "average_altitude";
static const char __pyx_k_compression_opts[] = "compression_opts";
static const char __pyx_k_num_cov_elements[] = "num_cov_elements";
static const char __pyx_k_range_bounds_slc[] = "range_bounds_slc";
static const char __pyx_k_Center_Wavelength[] = "Center Wavelength";
static const char __pyx_k_Covariance_Matrix[] = "Covariance Matrix";
static const char __pyx_k_height_dot_normal[] = "height_dot_normal";
static const char __pyx_k_matplotlib_pyplot[] = "matplotlib.pyplot";
static const char __pyx_k_proj_lkv_velocity[] = "proj_lkv_velocity";
static const char __pyx_k_slc_1_1x1_Columns[] = "slc_1_1x1 Columns";
static const char __pyx_k_slc_1_1x4_Columns[] = "slc_1_1x4 Columns";
static const char __pyx_k_slc_1_2x8_Columns[] = "slc_1_2x8 Columns";
static const char __pyx_k_Number_of_Segments[] = "Number of Segments";
static const char __pyx_k_azimuth_bounds_slc[] = "azimuth_bounds_slc";
static const char __pyx_k_and_reference_track[] = " and reference track. (";
static const char __pyx_k_kapok_uavsar_load_URL[] = "kapok.uavsar.load | URL: ";
static const char __pyx_k_slc_1_1x1_mag_row_addr[] = "slc_1_1x1_mag.row_addr";
static const char __pyx_k_slc_1_1x1_mag_row_mult[] = "slc_1_1x1_mag.row_mult";
static const char __pyx_k_cov_azimuth_pixel_spacing[] = "cov_azimuth_pixel_spacing";
static const char __pyx_k_slc_azimuth_pixel_spacing[] = "slc_azimuth_pixel_spacing";
static const char __pyx_k_Image_Starting_Slant_Range[] = "Image Starting Slant Range";
static const char __pyx_k_image_starting_slant_range[] = "image_starting_slant_range";
static const char __pyx_k_kapok_uavsar_load_Complete[] = "kapok.uavsar.load | Complete. (";
static const char __pyx_k_kapok_uavsar_load_Stack_ID[] = "kapok.uavsar.load | Stack ID: ";
static const char __pyx_k_1x1_SLC_Range_Pixel_Spacing[] = "1x1 SLC Range Pixel Spacing";
static const char __pyx_k_ndarray_is_not_C_contiguous[] = "ndarray is not C contiguous";
static const char __pyx_k_scipy_ndimage_interpolation[] = "scipy.ndimage.interpolation";
static const char __pyx_k_1x1_SLC_Azimuth_Pixel_Spacing[] = "1x1 SLC Azimuth Pixel Spacing";
static const char __pyx_k_cov_slant_range_pixel_spacing[] = "cov_slant_range_pixel_spacing";
static const char __pyx_k_slc_slant_range_pixel_spacing[] = "slc_slant_range_pixel_spacing";
static const char __pyx_k_is_larger_than_the_size_of_the[] = " is larger than the size of the data.  Returning maximum index.";
static const char __pyx_k_kapok_uavsar_load_Loading_SLCs[] = "kapok.uavsar.load | Loading SLCs: ";
static const char __pyx_k_Reference_Track_Incidence_Angle[] = "Reference Track Incidence Angle";
static const char __pyx_k_greater_than_number_of_SLC_colu[] = ") greater than number of SLC columns (";
static const char __pyx_k_greater_than_number_of_SLC_line[] = ") greater than number of SLC lines (";
static const char __pyx_k_is_less_than_zero_Setting_lower[] = ") is less than zero.  Setting lower azimuth bound to zero.";
static const char __pyx_k_kapok_uavsar_load_Cannot_create[] = "kapok.uavsar.load | Cannot create new HDF5 file. Check if path is valid. Aborting.";
static const char __pyx_k_kapok_uavsar_load_Importing_DEM[] = "kapok.uavsar.load | Importing DEM heights. (";
static const char __pyx_k_kapok_uavsar_load_Invalid_range[] = "kapok.uavsar.load | Invalid range bounds.  Must be ascending.  Aborting.";
static const char __pyx_k_kapok_uavsar_load_Lower_azimuth[] = "kapok.uavsar.load | Lower azimuth bound (";
static const char __pyx_k_kapok_uavsar_load_Setting_upper[] = "kapok.uavsar.load | Setting upper azimuth bound to ";
static const char __pyx_k_kapok_uavsar_load_Upper_azimuth[] = "kapok.uavsar.load | Upper azimuth bound (";
static const char __pyx_k_kapok_uavsar_quicklook_Too_many[] = "kapok.uavsar.quicklook | Too many SLC files matching pattern: \"";
static const char __pyx_k_kz_Attempting_to_calculate_kz_f[] = "*.kz\".  Attempting to calculate kz from .baseline files.";
static const char __pyx_k_numpy_core_multiarray_failed_to[] = "numpy.core.multiarray failed to import";
static const char __pyx_k_unknown_dtype_code_in_numpy_pxd[] = "unknown dtype code in numpy.pxd (%d)";
static const char __pyx_k_C_Users_Michael_Dropbox_kapok_re[] = "C:\\Users\\Michael\\Dropbox\\kapok_release\\kapok\\uavsarc.pyx";
static const char __pyx_k_Class_for_loading_and_interactin[] = "Class for loading and interacting with a UAVSAR annotation file.";
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_Interferometric_Vertical_Wavenum[] = "Interferometric Vertical Wavenumber";
static const char __pyx_k_Non_native_byte_order_not_suppor[] = "Non-native byte order not supported";
static const char __pyx_k_Number_of_Azimuth_Looks_in_2x8_S[] = "Number of Azimuth Looks in 2x8 SLC";
static const char __pyx_k_Number_of_Range_Looks_in_2x8_SLC[] = "Number of Range Looks in 2x8 SLC";
static const char __pyx_k_UAVSAR_Data_Import_Cython_Functi[] = "UAVSAR Data Import Cython Functions\n    \n    Module for importing UAVSAR data.  These are Cython functions imported by\n    the main kapok.uavsar module.\n    \n    Author: Michael Denbina\n    \n    Copyright 2016 California Institute of Technology.  All rights reserved.\n    United States Government Sponsorship acknowledged.\n    \n    This program is free software: you can redistribute it and/or modify\n    it under the terms of the GNU General Public License as published by\n    the Free Software Foundation, either version 3 of the License, or\n    (at your option) any later version.\n    \n    This program is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU General Public License for more details.\n    \n    You should have received a copy of the GNU General Public License\n    along with this program.  If not, see <http://www.gnu.org/licenses/>.\n\n";
static const char __pyx_k_kapok_uavsar_fingsegment_SLC_row[] = "kapok.uavsar.fingsegment | SLC row index of ";
static const char __pyx_k_kapok_uavsar_getslcblock_file2_a[] = "kapok.uavsar.getslcblock: \"file2\" argument specified, but \"azsize\" argument missing. Aborting.";
static const char __pyx_k_kapok_uavsar_load_Adjusting_kz_t[] = "kapok.uavsar.load | Adjusting kz to use vertical direction. (";
static const char __pyx_k_kapok_uavsar_load_Boxcar_averagi[] = "kapok.uavsar.load | Boxcar averaging covariance matrix. (";
static const char __pyx_k_kapok_uavsar_load_Calculating_co[] = "kapok.uavsar.load | Calculating covariance matrix for rows ";
static const char __pyx_k_kapok_uavsar_load_Calculating_in[] = "kapok.uavsar.load | Calculating incidence angle values from reference track look vector. (";
static const char __pyx_k_kapok_uavsar_load_Calculating_kz[] = "kapok.uavsar.load | Calculating kz between track ";
static const char __pyx_k_kapok_uavsar_load_Calculating_ma[] = "kapok.uavsar.load | Calculating matrix element: (";
static const char __pyx_k_kapok_uavsar_load_Cannot_find_LK[] = "kapok.uavsar.load | Cannot find LKV file matching pattern: \"";
static const char __pyx_k_kapok_uavsar_load_Cannot_find_LL[] = "kapok.uavsar.load | Cannot find LLH file matching pattern: \"";
static const char __pyx_k_kapok_uavsar_load_Cannot_find_SL[] = "kapok.uavsar.load | Cannot find SLC file matching pattern: \"";
static const char __pyx_k_kapok_uavsar_load_Cannot_find_ba[] = "kapok.uavsar.load | Cannot find .baseline file matching pattern: \"";
static const char __pyx_k_kapok_uavsar_load_Cannot_find_kz[] = "kapok.uavsar.load | Cannot find .kz file matching pattern: \"";
static const char __pyx_k_kapok_uavsar_load_Cannot_find_tr[] = "kapok.uavsar.load | Cannot find track names in UAVSAR annotation file.  Aborting.";
static const char __pyx_k_kapok_uavsar_load_Cannot_load_UA[] = "kapok.uavsar.load | Cannot load UAVSAR annotation file. Aborting.";
static const char __pyx_k_kapok_uavsar_load_Covariance_mat[] = "kapok.uavsar.load | Covariance matrix calculation complete. (";
static const char __pyx_k_kapok_uavsar_load_Importing_kz_b[] = "kapok.uavsar.load | Importing kz between track ";
static const char __pyx_k_kapok_uavsar_load_Importing_lati[] = "kapok.uavsar.load | Importing latitude values. (";
static const char __pyx_k_kapok_uavsar_load_Importing_long[] = "kapok.uavsar.load | Importing longitude values. (";
static const char __pyx_k_kapok_uavsar_load_Importing_meta[] = "kapok.uavsar.load | Importing metadata. (";
static const char __pyx_k_kapok_uavsar_load_Invalid_azimut[] = "kapok.uavsar.load | Invalid azimuth bounds.  Must be ascending.  Aborting.";
static const char __pyx_k_kapok_uavsar_load_Lower_range_bo[] = "kapok.uavsar.load | Lower range bound (";
static const char __pyx_k_kapok_uavsar_load_Site_Descripti[] = "kapok.uavsar.load | Site Description: ";
static const char __pyx_k_kapok_uavsar_load_Too_many_LKV_f[] = "kapok.uavsar.load | Too many LKV files matching pattern: \"";
static const char __pyx_k_kapok_uavsar_load_Too_many_LLH_f[] = "kapok.uavsar.load | Too many LLH files matching pattern: \"";
static const char __pyx_k_kapok_uavsar_load_Too_many_SLC_f[] = "kapok.uavsar.load | Too many SLC files matching pattern: \"";
static const char __pyx_k_kapok_uavsar_load_Upper_range_bo[] = "kapok.uavsar.load | Upper range bound (";
static const char __pyx_k_kapok_uavsar_quicklook_Cannot_fi[] = "kapok.uavsar.quicklook | Cannot find track names in UAVSAR annotation file.  Aborting.";
static const char __pyx_k_kapok_uavsar_quicklook_Cannot_lo[] = "kapok.uavsar.quicklook | Cannot load UAVSAR annotation file. Aborting.";
static const char __pyx_k_ndarray_is_not_Fortran_contiguou[] = "ndarray is not Fortran contiguous";
static const char __pyx_k_numpy_core_umath_failed_to_impor[] = "numpy.core.umath failed to import";
static const char __pyx_k_kapok_uavsar_load_Cannot_create_2[] = "kapok.uavsar.load | Cannot create new HDF5 file. Check if path is valid and ensure file does not already exist. Aborting.";
static const char __pyx_k_kapok_uavsar_load_Setting_upper_2[] = "kapok.uavsar.load | Setting upper range bound to ";
static const char __pyx_k_Format_string_allocated_too_shor_2[] = "Format string allocated too short.";
static const char __pyx_k_kapok_uavsar_quicklook_Cannot_fi_2[] = "kapok.uavsar.quicklook | Cannot find SLC file matching pattern: \"";
static PyObject *__pyx_kp_u_1x1_Rows;
static PyObject *__pyx_kp_u_1x1_SLC_Azimuth_Pixel_Spacing;
static PyObject *__pyx_kp_u_1x1_SLC_Range_Pixel_Spacing;
static PyObject *__pyx_kp_u_1x1_slc;
static PyObject *__pyx_kp_u_1x1_slc_2;
static PyObject *__pyx_kp_u_1x4_Rows;
static PyObject *__pyx_kp_u_1x4_slc;
static PyObject *__pyx_n_u_2x8;
static PyObject *__pyx_kp_u_2x8_Columns;
static PyObject *__pyx_kp_u_2x8_Rows;
static PyObject *__pyx_kp_u_2x8_slc;
static PyObject *__pyx_kp_u_2x8_slc_2;
static PyObject *__pyx_kp_u_4x1_slc;
static PyObject *__pyx_kp_u_Aborting;
static PyObject *__pyx_n_s_Ann;
static PyObject *__pyx_n_s_Ann___init;
static PyObject *__pyx_n_s_Ann_query;
static PyObject *__pyx_kp_u_Average_Altitude;
static PyObject *__pyx_kp_u_Azimuth_Index;
static PyObject *__pyx_kp_u_Backscatter_dB;
static PyObject *__pyx_kp_s_C_Users_Michael_Dropbox_kapok_re;
static PyObject *__pyx_kp_u_Center_Wavelength;
static PyObject *__pyx_kp_s_Class_for_loading_and_interactin;
static PyObject *__pyx_kp_u_Covariance_Matrix;
static PyObject *__pyx_n_s_File;
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_u_HH;
static PyObject *__pyx_n_u_HV;
static PyObject *__pyx_kp_u_Image_Starting_Slant_Range;
static PyObject *__pyx_n_s_ImportError;
static PyObject *__pyx_kp_u_Interferometric_Vertical_Wavenum;
static PyObject *__pyx_n_u_L090;
static PyObject *__pyx_n_u_Latitude;
static PyObject *__pyx_n_u_Longitude;
static PyObject *__pyx_kp_u_Non_native_byte_order_not_suppor;
static PyObject *__pyx_kp_u_Number_of_Azimuth_Looks_in_2x8_S;
static PyObject *__pyx_kp_u_Number_of_Range_Looks_in_2x8_SLC;
static PyObject *__pyx_kp_u_Number_of_Segments;
static PyObject *__pyx_kp_u_Peg_Heading;
static PyObject *__pyx_kp_u_Peg_Latitude;
static PyObject *__pyx_kp_u_Peg_Longitude;
static PyObject *__pyx_kp_u_Processor_DEM;
static PyObject *__pyx_kp_u_Range_Index;
static PyObject *__pyx_kp_u_Reference_Track_Incidence_Angle;
static PyObject *__pyx_n_s_RuntimeError;
static PyObject *__pyx_n_u_S;
static PyObject *__pyx_n_s_Scene;
static PyObject *__pyx_kp_u_Site_Description;
static PyObject *__pyx_kp_u_Stack_Name;
static PyObject *__pyx_n_u_UAVSAR;
static PyObject *__pyx_n_u_URL;
static PyObject *__pyx_n_u_VV;
static PyObject *__pyx_n_s_ValueError;
static PyObject *__pyx_kp_u__16;
static PyObject *__pyx_kp_u__177;
static PyObject *__pyx_kp_u__179;
static PyObject *__pyx_kp_u__181;
static PyObject *__pyx_kp_u__27;
static PyObject *__pyx_kp_u__28;
static PyObject *__pyx_kp_u__30;
static PyObject *__pyx_kp_u__31;
static PyObject *__pyx_n_s__33;
static PyObject *__pyx_kp_u__33;
static PyObject *__pyx_kp_u__34;
static PyObject *__pyx_kp_u__37;
static PyObject *__pyx_kp_u__38;
static PyObject *__pyx_kp_u__39;
static PyObject *__pyx_kp_u__40;
static PyObject *__pyx_kp_u__41;
static PyObject *__pyx_kp_u__42;
static PyObject *__pyx_kp_u__43;
static PyObject *__pyx_kp_u__46;
static PyObject *__pyx_kp_u__47;
static PyObject *__pyx_n_s_abs;
static PyObject *__pyx_kp_u_and_reference_track;
static PyObject *__pyx_n_s_ann;
static PyObject *__pyx_n_s_append;
static PyObject *__pyx_n_s_arccos;
static PyObject *__pyx_n_s_array;
static PyObject *__pyx_n_s_aspect;
static PyObject *__pyx_n_s_astype;
static PyObject *__pyx_n_s_attrs;
static PyObject *__pyx_n_u_average_altitude;
static PyObject *__pyx_n_s_axis;
static PyObject *__pyx_n_s_az;
static PyObject *__pyx_n_s_az_ml;
static PyObject *__pyx_n_s_az_vector;
static PyObject *__pyx_n_s_azbounds;
static PyObject *__pyx_n_s_azend;
static PyObject *__pyx_n_s_azend_slc;
static PyObject *__pyx_n_u_azimuth_bounds_slc;
static PyObject *__pyx_n_s_azllhend;
static PyObject *__pyx_n_s_azllhoffset;
static PyObject *__pyx_n_s_azllhstart;
static PyObject *__pyx_n_s_azoff;
static PyObject *__pyx_n_s_azoffset_end;
static PyObject *__pyx_n_s_azoffset_start;
static PyObject *__pyx_n_s_azposend;
static PyObject *__pyx_n_s_azposstart;
static PyObject *__pyx_n_s_azsize;
static PyObject *__pyx_n_s_azsize_slc;
static PyObject *__pyx_n_s_azsize_slc1x1;
static PyObject *__pyx_n_s_azslope;
static PyObject *__pyx_n_s_azstart;
static PyObject *__pyx_n_s_azstart_slc;
static PyObject *__pyx_n_s_base_enu;
static PyObject *__pyx_n_s_basefile;
static PyObject *__pyx_kp_u_baseline;
static PyObject *__pyx_n_s_baseline_2;
static PyObject *__pyx_n_s_baselinep;
static PyObject *__pyx_n_s_baselinepsign;
static PyObject *__pyx_n_s_basesch;
static PyObject *__pyx_n_u_basis;
static PyObject *__pyx_n_s_bbox_inches;
static PyObject *__pyx_n_s_byteoffset;
static PyObject *__pyx_n_u_c;
static PyObject *__pyx_n_s_calcslope;
static PyObject *__pyx_n_s_close;
static PyObject *__pyx_n_s_cmap;
static PyObject *__pyx_n_s_col;
static PyObject *__pyx_n_s_colorbar;
static PyObject *__pyx_n_u_complex64;
static PyObject *__pyx_n_s_compression;
static PyObject *__pyx_n_u_compression;
static PyObject *__pyx_n_s_compression_opts;
static PyObject *__pyx_n_u_compression_opts;
static PyObject *__pyx_n_s_conj;
static PyObject *__pyx_n_s_cov;
static PyObject *__pyx_n_u_cov;
static PyObject *__pyx_n_u_cov_azimuth_pixel_spacing;
static PyObject *__pyx_n_u_cov_slant_range_pixel_spacing;
static PyObject *__pyx_n_s_create_dataset;
static PyObject *__pyx_n_s_ctime;
static PyObject *__pyx_n_s_cumsum;
static PyObject *__pyx_n_s_datapath;
static PyObject *__pyx_n_u_degrees;
static PyObject *__pyx_n_s_dem;
static PyObject *__pyx_n_u_dem;
static PyObject *__pyx_n_u_description;
static PyObject *__pyx_n_u_dim;
static PyObject *__pyx_n_u_dim_slc;
static PyObject *__pyx_n_s_dirname;
static PyObject *__pyx_n_s_doc;
static PyObject *__pyx_n_s_dpi;
static PyObject *__pyx_n_s_dtype;
static PyObject *__pyx_n_s_end;
static PyObject *__pyx_n_s_enumerate;
static PyObject *__pyx_n_s_extent;
static PyObject *__pyx_n_s_f;
static PyObject *__pyx_n_s_fd;
static PyObject *__pyx_n_s_figure;
static PyObject *__pyx_n_s_file;
static PyObject *__pyx_n_s_file2;
static PyObject *__pyx_n_s_file_alt;
static PyObject *__pyx_n_s_findsegment;
static PyObject *__pyx_n_u_float;
static PyObject *__pyx_n_u_float32;
static PyObject *__pyx_n_u_float64;
static PyObject *__pyx_n_s_floor;
static PyObject *__pyx_n_s_flush;
static PyObject *__pyx_n_s_getslcblock;
static PyObject *__pyx_n_s_glob;
static PyObject *__pyx_n_s_gradient;
static PyObject *__pyx_n_u_gray;
static PyObject *__pyx_kp_u_greater_than_number_of_SLC_colu;
static PyObject *__pyx_kp_u_greater_than_number_of_SLC_line;
static PyObject *__pyx_n_u_gzip;
static PyObject *__pyx_n_s_h5py;
static PyObject *__pyx_n_s_height_dot_normal;
static PyObject *__pyx_n_u_hh;
static PyObject *__pyx_n_s_iend;
static PyObject *__pyx_n_u_image_starting_slant_range;
static PyObject *__pyx_n_s_import;
static PyObject *__pyx_n_s_imshow;
static PyObject *__pyx_n_s_inc;
static PyObject *__pyx_n_u_inc;
static PyObject *__pyx_n_s_inc_buffer;
static PyObject *__pyx_n_s_inc_ref;
static PyObject *__pyx_n_s_incident_lkv;
static PyObject *__pyx_n_u_indexing;
static PyObject *__pyx_n_s_infile;
static PyObject *__pyx_n_s_init;
static PyObject *__pyx_n_s_insert;
static PyObject *__pyx_n_u_int;
static PyObject *__pyx_n_u_int32;
static PyObject *__pyx_n_s_interpolation;
static PyObject *__pyx_kp_u_is_larger_than_the_size_of_the;
static PyObject *__pyx_kp_u_is_less_than_zero_Setting_lower;
static PyObject *__pyx_n_s_isclose;
static PyObject *__pyx_n_s_istart;
static PyObject *__pyx_n_s_kapok;
static PyObject *__pyx_n_s_kapok_lib;
static PyObject *__pyx_kp_u_kapok_uavsar_fingsegment_SLC_row;
static PyObject *__pyx_kp_u_kapok_uavsar_getslcblock_file2_a;
static PyObject *__pyx_kp_u_kapok_uavsar_load_Adjusting_kz_t;
static PyObject *__pyx_kp_u_kapok_uavsar_load_Boxcar_averagi;
static PyObject *__pyx_kp_u_kapok_uavsar_load_Calculating_co;
static PyObject *__pyx_kp_u_kapok_uavsar_load_Calculating_in;
static PyObject *__pyx_kp_u_kapok_uavsar_load_Calculating_kz;
static PyObject *__pyx_kp_u_kapok_uavsar_load_Calculating_ma;
static PyObject *__pyx_kp_u_kapok_uavsar_load_Cannot_create;
static PyObject *__pyx_kp_u_kapok_uavsar_load_Cannot_create_2;
static PyObject *__pyx_kp_u_kapok_uavsar_load_Cannot_find_LK;
static PyObject *__pyx_kp_u_kapok_uavsar_load_Cannot_find_LL;
static PyObject *__pyx_kp_u_kapok_uavsar_load_Cannot_find_SL;
static PyObject *__pyx_kp_u_kapok_uavsar_load_Cannot_find_ba;
static PyObject *__pyx_kp_u_kapok_uavsar_load_Cannot_find_kz;
static PyObject *__pyx_kp_u_kapok_uavsar_load_Cannot_find_tr;
static PyObject *__pyx_kp_u_kapok_uavsar_load_Cannot_load_UA;
static PyObject *__pyx_kp_u_kapok_uavsar_load_Complete;
static PyObject *__pyx_kp_u_kapok_uavsar_load_Covariance_mat;
static PyObject *__pyx_kp_u_kapok_uavsar_load_Importing_DEM;
static PyObject *__pyx_kp_u_kapok_uavsar_load_Importing_kz_b;
static PyObject *__pyx_kp_u_kapok_uavsar_load_Importing_lati;
static PyObject *__pyx_kp_u_kapok_uavsar_load_Importing_long;
static PyObject *__pyx_kp_u_kapok_uavsar_load_Importing_meta;
static PyObject *__pyx_kp_u_kapok_uavsar_load_Invalid_azimut;
static PyObject *__pyx_kp_u_kapok_uavsar_load_Invalid_range;
static PyObject *__pyx_kp_u_kapok_uavsar_load_Loading_SLCs;
static PyObject *__pyx_kp_u_kapok_uavsar_load_Lower_azimuth;
static PyObject *__pyx_kp_u_kapok_uavsar_load_Lower_range_bo;
static PyObject *__pyx_kp_u_kapok_uavsar_load_Setting_upper;
static PyObject *__pyx_kp_u_kapok_uavsar_load_Setting_upper_2;
static PyObject *__pyx_kp_u_kapok_uavsar_load_Site_Descripti;
static PyObject *__pyx_kp_u_kapok_uavsar_load_Stack_ID;
static PyObject *__pyx_kp_u_kapok_uavsar_load_Too_many_LKV_f;
static PyObject *__pyx_kp_u_kapok_uavsar_load_Too_many_LLH_f;
static PyObject *__pyx_kp_u_kapok_uavsar_load_Too_many_SLC_f;
static PyObject *__pyx_kp_u_kapok_uavsar_load_URL;
static PyObject *__pyx_kp_u_kapok_uavsar_load_Upper_azimuth;
static PyObject *__pyx_kp_u_kapok_uavsar_load_Upper_range_bo;
static PyObject *__pyx_kp_u_kapok_uavsar_quicklook_Cannot_fi;
static PyObject *__pyx_kp_u_kapok_uavsar_quicklook_Cannot_fi_2;
static PyObject *__pyx_kp_u_kapok_uavsar_quicklook_Cannot_lo;
static PyObject *__pyx_kp_u_kapok_uavsar_quicklook_Too_many;
static PyObject *__pyx_n_s_kapok_uavsarc;
static PyObject *__pyx_n_s_keyword;
static PyObject *__pyx_n_s_kz;
static PyObject *__pyx_n_u_kz;
static PyObject *__pyx_kp_u_kz_2;
static PyObject *__pyx_kp_u_kz_Attempting_to_calculate_kz_f;
static PyObject *__pyx_n_s_kz_buffer;
static PyObject *__pyx_n_s_kz_cols;
static PyObject *__pyx_n_s_kz_rows;
static PyObject *__pyx_n_s_kz_temp;
static PyObject *__pyx_n_s_kzcalc;
static PyObject *__pyx_n_s_kzvertical;
static PyObject *__pyx_n_s_label;
static PyObject *__pyx_n_s_lat;
static PyObject *__pyx_n_u_lat;
static PyObject *__pyx_n_u_lexicographic;
static PyObject *__pyx_n_s_linalg;
static PyObject *__pyx_n_s_linspace;
static PyObject *__pyx_n_u_lkv;
static PyObject *__pyx_n_s_lkv_2;
static PyObject *__pyx_n_s_lkv_cols;
static PyObject *__pyx_n_s_lkv_rows;
static PyObject *__pyx_n_s_lkvmm;
static PyObject *__pyx_n_s_lkvname;
static PyObject *__pyx_n_s_lkvrowend;
static PyObject *__pyx_n_s_lkvrowstart;
static PyObject *__pyx_n_s_lkvtrimend;
static PyObject *__pyx_n_s_lkvtrimstart;
static PyObject *__pyx_n_u_llh;
static PyObject *__pyx_n_s_llh2enu;
static PyObject *__pyx_n_s_llh_2;
static PyObject *__pyx_n_s_llh_cols;
static PyObject *__pyx_n_s_llh_rows;
static PyObject *__pyx_n_s_llhname;
static PyObject *__pyx_n_s_load;
static PyObject *__pyx_n_s_loadtxt;
static PyObject *__pyx_n_s_log10;
static PyObject *__pyx_n_s_lon;
static PyObject *__pyx_n_u_lon;
static PyObject *__pyx_n_s_lookcrossv;
static PyObject *__pyx_n_s_main;
static PyObject *__pyx_n_s_matplotlib_pyplot;
static PyObject *__pyx_n_s_max;
static PyObject *__pyx_n_s_maxsplit;
static PyObject *__pyx_n_s_memmap;
static PyObject *__pyx_n_s_metaclass;
static PyObject *__pyx_n_u_meters;
static PyObject *__pyx_n_u_ml_window;
static PyObject *__pyx_n_s_mlook;
static PyObject *__pyx_n_s_mlwin;
static PyObject *__pyx_n_s_mlwin_lkv;
static PyObject *__pyx_n_s_mode;
static PyObject *__pyx_n_s_module;
static PyObject *__pyx_n_s_n;
static PyObject *__pyx_kp_u_ndarray_is_not_C_contiguous;
static PyObject *__pyx_kp_u_ndarray_is_not_Fortran_contiguou;
static PyObject *__pyx_n_u_nearest;
static PyObject *__pyx_n_s_newaxis;
static PyObject *__pyx_n_s_norm;
static PyObject *__pyx_n_s_np;
static PyObject *__pyx_n_s_num;
static PyObject *__pyx_n_u_num_baselines;
static PyObject *__pyx_n_s_num_bl;
static PyObject *__pyx_n_s_num_blocks;
static PyObject *__pyx_n_s_num_cov_elements;
static PyObject *__pyx_n_s_num_pol;
static PyObject *__pyx_n_u_num_pol;
static PyObject *__pyx_n_s_num_segments;
static PyObject *__pyx_n_s_num_tracks;
static PyObject *__pyx_n_u_num_tracks;
static PyObject *__pyx_n_s_numpy;
static PyObject *__pyx_kp_u_numpy_core_multiarray_failed_to;
static PyObject *__pyx_kp_u_numpy_core_umath_failed_to_impor;
static PyObject *__pyx_n_s_object;
static PyObject *__pyx_n_s_offset;
static PyObject *__pyx_n_s_open;
static PyObject *__pyx_n_s_os;
static PyObject *__pyx_n_s_os_path;
static PyObject *__pyx_n_s_outfile;
static PyObject *__pyx_n_s_overwrite;
static PyObject *__pyx_n_s_pad_inches;
static PyObject *__pyx_n_s_path;
static PyObject *__pyx_n_u_peg_heading;
static PyObject *__pyx_n_u_peg_latitude;
static PyObject *__pyx_n_u_peg_longitude;
static PyObject *__pyx_n_s_peghdg;
static PyObject *__pyx_n_s_peglat;
static PyObject *__pyx_n_s_peglon;
static PyObject *__pyx_n_s_pi;
static PyObject *__pyx_n_s_plt;
static PyObject *__pyx_n_s_pol;
static PyObject *__pyx_n_u_pol;
static PyObject *__pyx_n_s_pos;
static PyObject *__pyx_n_s_posmm;
static PyObject *__pyx_n_s_prepare;
static PyObject *__pyx_n_s_print;
static PyObject *__pyx_n_u_processor;
static PyObject *__pyx_n_u_production;
static PyObject *__pyx_n_s_proj_lkv_velocity;
static PyObject *__pyx_n_s_proj_reflkv_v;
static PyObject *__pyx_n_s_qlimage;
static PyObject *__pyx_n_s_qualname;
static PyObject *__pyx_n_s_query;
static PyObject *__pyx_n_s_quicklook;
static PyObject *__pyx_n_u_r;
static PyObject *__pyx_n_s_radians;
static PyObject *__pyx_n_u_radians;
static PyObject *__pyx_kp_u_radians_meter;
static PyObject *__pyx_n_s_range;
static PyObject *__pyx_n_u_range_bounds_slc;
static PyObject *__pyx_n_s_read;
static PyObject *__pyx_n_s_real;
static PyObject *__pyx_n_s_refvelocity;
static PyObject *__pyx_n_s_rngbounds;
static PyObject *__pyx_n_s_rngllhend;
static PyObject *__pyx_n_s_rngllhoffset;
static PyObject *__pyx_n_s_rngllhstart;
static PyObject *__pyx_n_s_rngsize;
static PyObject *__pyx_n_s_rngsize_slc;
static PyObject *__pyx_n_s_rngsize_slc1x1;
static PyObject *__pyx_n_s_rngslope;
static PyObject *__pyx_n_s_round;
static PyObject *__pyx_n_s_row;
static PyObject *__pyx_n_s_rsplit;
static PyObject *__pyx_kp_u_s;
static PyObject *__pyx_kp_u_s_2;
static PyObject *__pyx_n_s_savefig;
static PyObject *__pyx_n_s_savefile;
static PyObject *__pyx_n_s_sbounds;
static PyObject *__pyx_n_s_sch2enu;
static PyObject *__pyx_n_s_scipy_ndimage_interpolation;
static PyObject *__pyx_n_s_seg;
static PyObject *__pyx_n_s_seg_end;
static PyObject *__pyx_n_s_seg_start;
static PyObject *__pyx_n_s_self;
static PyObject *__pyx_n_u_sensor;
static PyObject *__pyx_n_s_shape;
static PyObject *__pyx_n_s_shuffle;
static PyObject *__pyx_n_s_sign;
static PyObject *__pyx_n_s_sin;
static PyObject *__pyx_n_u_site;
static PyObject *__pyx_n_u_slc;
static PyObject *__pyx_kp_u_slc_1_1x1_Columns;
static PyObject *__pyx_kp_u_slc_1_1x1_Rows;
static PyObject *__pyx_kp_u_slc_1_1x1_mag_row_addr;
static PyObject *__pyx_kp_u_slc_1_1x1_mag_row_mult;
static PyObject *__pyx_kp_u_slc_1_1x4_Columns;
static PyObject *__pyx_kp_u_slc_1_1x4_Rows;
static PyObject *__pyx_kp_u_slc_1_2x8_Columns;
static PyObject *__pyx_kp_u_slc_1_8x2_Rows;
static PyObject *__pyx_n_s_slc_2;
static PyObject *__pyx_n_u_slc_azimuth_pixel_spacing;
static PyObject *__pyx_n_u_slc_slant_range_pixel_spacing;
static PyObject *__pyx_n_s_slca;
static PyObject *__pyx_n_s_slcb;
static PyObject *__pyx_n_s_slcfiles;
static PyObject *__pyx_n_s_slcnum;
static PyObject *__pyx_n_s_slcstack;
static PyObject *__pyx_n_s_slcwindow;
static PyObject *__pyx_n_u_slope_corrected;
static PyObject *__pyx_n_u_sm_window;
static PyObject *__pyx_n_s_smooth;
static PyObject *__pyx_n_s_smwin;
static PyObject *__pyx_n_s_spacing;
static PyObject *__pyx_n_s_split;
static PyObject *__pyx_n_s_sqrt;
static PyObject *__pyx_kp_u_sqrt_2_HV;
static PyObject *__pyx_n_s_square;
static PyObject *__pyx_n_s_sspacing;
static PyObject *__pyx_n_s_sstart;
static PyObject *__pyx_n_u_stack_name;
static PyObject *__pyx_n_u_stackline;
static PyObject *__pyx_n_u_stackline1;
static PyObject *__pyx_n_s_startswith;
static PyObject *__pyx_n_s_strip;
static PyObject *__pyx_n_u_subset;
static PyObject *__pyx_n_s_sum;
static PyObject *__pyx_n_s_tan;
static PyObject *__pyx_n_s_temp;
static PyObject *__pyx_n_s_tempdiff;
static PyObject *__pyx_n_s_test;
static PyObject *__pyx_n_u_tight;
static PyObject *__pyx_n_s_tight_layout;
static PyObject *__pyx_n_s_time;
static PyObject *__pyx_n_s_tr;
static PyObject *__pyx_n_u_track;
static PyObject *__pyx_n_s_tracklkv;
static PyObject *__pyx_n_s_tracknames;
static PyObject *__pyx_n_s_tracks;
static PyObject *__pyx_n_u_tracks;
static PyObject *__pyx_n_u_units;
static PyObject *__pyx_kp_u_unknown_dtype_code_in_numpy_pxd;
static PyObject *__pyx_n_s_upper;
static PyObject *__pyx_n_u_url;
static PyObject *__pyx_n_s_val;
static PyObject *__pyx_n_s_velocity;
static PyObject *__pyx_n_s_vmax;
static PyObject *__pyx_n_s_vmin;
static PyObject *__pyx_n_s_vstack;
static PyObject *__pyx_n_u_w;
static PyObject *__pyx_n_s_wavelength;
static PyObject *__pyx_n_u_wavelength;
static PyObject *__pyx_n_s_where;
static PyObject *__pyx_n_u_x;
static PyObject *__pyx_n_s_xlabel;
static PyObject *__pyx_n_s_ylabel;
static PyObject *__pyx_n_s_zeros;
static PyObject *__pyx_n_s_zoom;
static PyObject *__pyx_pf_5kapok_7uavsarc_load(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_infile, PyObject *__pyx_v_outfile, PyObject *__pyx_v_mlwin, PyObject *__pyx_v_smwin, PyObject *__pyx_v_azbounds, PyObject *__pyx_v_rngbounds, PyObject *__pyx_v_tracks, PyObject *__pyx_v_compression, PyObject *__pyx_v_compression_opts, PyObject *__pyx_v_num_blocks, PyObject *__pyx_v_kzcalc, PyObject *__pyx_v_kzvertical, PyObject *__pyx_v_overwrite); /* proto */
static PyObject *__pyx_pf_5kapok_7uavsarc_3Ann___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_file); /* proto */
static PyObject *__pyx_pf_5kapok_7uavsarc_3Ann_2query(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_keyword); /* proto */
static PyObject *__pyx_pf_5kapok_7uavsarc_2findsegment(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_az, PyObject *__pyx_v_azsize); /* proto */
static PyObject *__pyx_pf_5kapok_7uavsarc_4getslcblock(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_file, PyObject *__pyx_v_rngsize, PyObject *__pyx_v_azstart, PyObject *__pyx_v_azend, PyObject *__pyx_v_rngbounds, PyObject *__pyx_v_file2, PyObject *__pyx_v_azsize); /* proto */
static PyObject *__pyx_pf_5kapok_7uavsarc_6quicklook(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_infile, PyObject *__pyx_v_tr, PyObject *__pyx_v_pol, PyObject *__pyx_v_mlwin, PyObject *__pyx_v_savefile); /* 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_1;
static PyObject *__pyx_float_1e9;
static PyObject *__pyx_float_0_25;
static PyObject *__pyx_float_1eneg_5;
static PyObject *__pyx_float_1eneg_10;
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_8;
static PyObject *__pyx_int_10;
static PyObject *__pyx_int_20;
static PyObject *__pyx_int_40;
static PyObject *__pyx_int_100;
static PyObject *__pyx_int_125;
static PyObject *__pyx_int_1000;
static PyObject *__pyx_int_neg_1;
static PyObject *__pyx_int_neg_25;
static PyObject *__pyx_tuple_;
static PyObject *__pyx_tuple__2;
static PyObject *__pyx_tuple__3;
static PyObject *__pyx_tuple__4;
static PyObject *__pyx_tuple__5;
static PyObject *__pyx_tuple__6;
static PyObject *__pyx_tuple__7;
static PyObject *__pyx_tuple__8;
static PyObject *__pyx_tuple__9;
static PyObject *__pyx_slice__36;
static PyObject *__pyx_slice__48;
static PyObject *__pyx_slice__50;
static PyObject *__pyx_slice__51;
static PyObject *__pyx_slice__52;
static PyObject *__pyx_slice__53;
static PyObject *__pyx_slice__56;
static PyObject *__pyx_slice__57;
static PyObject *__pyx_slice__58;
static PyObject *__pyx_slice__59;
static PyObject *__pyx_slice__60;
static PyObject *__pyx_slice__62;
static PyObject *__pyx_slice__63;
static PyObject *__pyx_slice__65;
static PyObject *__pyx_slice__66;
static PyObject *__pyx_slice__71;
static PyObject *__pyx_slice__72;
static PyObject *__pyx_slice__73;
static PyObject *__pyx_slice__74;
static PyObject *__pyx_slice__75;
static PyObject *__pyx_slice__76;
static PyObject *__pyx_slice__78;
static PyObject *__pyx_slice__79;
static PyObject *__pyx_slice__80;
static PyObject *__pyx_slice__81;
static PyObject *__pyx_slice__82;
static PyObject *__pyx_slice__83;
static PyObject *__pyx_slice__84;
static PyObject *__pyx_slice__86;
static PyObject *__pyx_slice__88;
static PyObject *__pyx_slice__89;
static PyObject *__pyx_slice__90;
static PyObject *__pyx_slice__91;
static PyObject *__pyx_slice__92;
static PyObject *__pyx_slice__94;
static PyObject *__pyx_slice__95;
static PyObject *__pyx_slice__96;
static PyObject *__pyx_slice__98;
static PyObject *__pyx_slice__99;
static PyObject *__pyx_tuple__10;
static PyObject *__pyx_tuple__11;
static PyObject *__pyx_tuple__12;
static PyObject *__pyx_tuple__13;
static PyObject *__pyx_tuple__14;
static PyObject *__pyx_tuple__15;
static PyObject *__pyx_tuple__17;
static PyObject *__pyx_tuple__18;
static PyObject *__pyx_tuple__19;
static PyObject *__pyx_tuple__20;
static PyObject *__pyx_tuple__21;
static PyObject *__pyx_tuple__22;
static PyObject *__pyx_tuple__23;
static PyObject *__pyx_tuple__24;
static PyObject *__pyx_tuple__25;
static PyObject *__pyx_tuple__26;
static PyObject *__pyx_tuple__29;
static PyObject *__pyx_tuple__32;
static PyObject *__pyx_tuple__35;
static PyObject *__pyx_tuple__44;
static PyObject *__pyx_tuple__45;
static PyObject *__pyx_tuple__49;
static PyObject *__pyx_tuple__54;
static PyObject *__pyx_tuple__55;
static PyObject *__pyx_tuple__61;
static PyObject *__pyx_tuple__64;
static PyObject *__pyx_tuple__67;
static PyObject *__pyx_tuple__68;
static PyObject *__pyx_tuple__69;
static PyObject *__pyx_tuple__70;
static PyObject *__pyx_tuple__77;
static PyObject *__pyx_tuple__85;
static PyObject *__pyx_tuple__87;
static PyObject *__pyx_tuple__93;
static PyObject *__pyx_tuple__97;
static PyObject *__pyx_slice__100;
static PyObject *__pyx_slice__102;
static PyObject *__pyx_slice__103;
static PyObject *__pyx_slice__104;
static PyObject *__pyx_slice__106;
static PyObject *__pyx_slice__107;
static PyObject *__pyx_slice__108;
static PyObject *__pyx_slice__110;
static PyObject *__pyx_slice__111;
static PyObject *__pyx_slice__112;
static PyObject *__pyx_slice__114;
static PyObject *__pyx_slice__115;
static PyObject *__pyx_slice__116;
static PyObject *__pyx_slice__117;
static PyObject *__pyx_slice__118;
static PyObject *__pyx_slice__119;
static PyObject *__pyx_slice__120;
static PyObject *__pyx_slice__121;
static PyObject *__pyx_slice__122;
static PyObject *__pyx_slice__123;
static PyObject *__pyx_slice__124;
static PyObject *__pyx_slice__125;
static PyObject *__pyx_slice__127;
static PyObject *__pyx_slice__128;
static PyObject *__pyx_slice__130;
static PyObject *__pyx_slice__131;
static PyObject *__pyx_slice__133;
static PyObject *__pyx_slice__134;
static PyObject *__pyx_slice__136;
static PyObject *__pyx_slice__137;
static PyObject *__pyx_slice__139;
static PyObject *__pyx_slice__140;
static PyObject *__pyx_slice__142;
static PyObject *__pyx_slice__143;
static PyObject *__pyx_slice__145;
static PyObject *__pyx_slice__146;
static PyObject *__pyx_slice__148;
static PyObject *__pyx_slice__149;
static PyObject *__pyx_slice__151;
static PyObject *__pyx_slice__152;
static PyObject *__pyx_slice__154;
static PyObject *__pyx_slice__155;
static PyObject *__pyx_slice__157;
static PyObject *__pyx_slice__158;
static PyObject *__pyx_slice__160;
static PyObject *__pyx_slice__161;
static PyObject *__pyx_slice__163;
static PyObject *__pyx_slice__164;
static PyObject *__pyx_slice__166;
static PyObject *__pyx_slice__167;
static PyObject *__pyx_slice__169;
static PyObject *__pyx_slice__170;
static PyObject *__pyx_slice__171;
static PyObject *__pyx_slice__172;
static PyObject *__pyx_slice__173;
static PyObject *__pyx_slice__174;
static PyObject *__pyx_slice__175;
static PyObject *__pyx_slice__176;
static PyObject *__pyx_slice__185;
static PyObject *__pyx_slice__186;
static PyObject *__pyx_slice__188;
static PyObject *__pyx_slice__189;
static PyObject *__pyx_slice__209;
static PyObject *__pyx_slice__210;
static PyObject *__pyx_tuple__101;
static PyObject *__pyx_tuple__105;
static PyObject *__pyx_tuple__109;
static PyObject *__pyx_tuple__113;
static PyObject *__pyx_tuple__126;
static PyObject *__pyx_tuple__129;
static PyObject *__pyx_tuple__132;
static PyObject *__pyx_tuple__135;
static PyObject *__pyx_tuple__138;
static PyObject *__pyx_tuple__141;
static PyObject *__pyx_tuple__144;
static PyObject *__pyx_tuple__147;
static PyObject *__pyx_tuple__150;
static PyObject *__pyx_tuple__153;
static PyObject *__pyx_tuple__156;
static PyObject *__pyx_tuple__159;
static PyObject *__pyx_tuple__162;
static PyObject *__pyx_tuple__165;
static PyObject *__pyx_tuple__168;
static PyObject *__pyx_tuple__178;
static PyObject *__pyx_tuple__180;
static PyObject *__pyx_tuple__182;
static PyObject *__pyx_tuple__183;
static PyObject *__pyx_tuple__184;
static PyObject *__pyx_tuple__187;
static PyObject *__pyx_tuple__190;
static PyObject *__pyx_tuple__191;
static PyObject *__pyx_tuple__192;
static PyObject *__pyx_tuple__193;
static PyObject *__pyx_tuple__194;
static PyObject *__pyx_tuple__195;
static PyObject *__pyx_tuple__196;
static PyObject *__pyx_tuple__197;
static PyObject *__pyx_tuple__198;
static PyObject *__pyx_tuple__199;
static PyObject *__pyx_tuple__200;
static PyObject *__pyx_tuple__201;
static PyObject *__pyx_tuple__202;
static PyObject *__pyx_tuple__203;
static PyObject *__pyx_tuple__204;
static PyObject *__pyx_tuple__205;
static PyObject *__pyx_tuple__206;
static PyObject *__pyx_tuple__207;
static PyObject *__pyx_tuple__208;
static PyObject *__pyx_tuple__211;
static PyObject *__pyx_tuple__212;
static PyObject *__pyx_tuple__213;
static PyObject *__pyx_tuple__214;
static PyObject *__pyx_tuple__215;
static PyObject *__pyx_tuple__216;
static PyObject *__pyx_tuple__217;
static PyObject *__pyx_tuple__218;
static PyObject *__pyx_tuple__219;
static PyObject *__pyx_tuple__220;
static PyObject *__pyx_tuple__221;
static PyObject *__pyx_tuple__222;
static PyObject *__pyx_tuple__224;
static PyObject *__pyx_tuple__226;
static PyObject *__pyx_tuple__228;
static PyObject *__pyx_tuple__230;
static PyObject *__pyx_tuple__232;
static PyObject *__pyx_codeobj__223;
static PyObject *__pyx_codeobj__225;
static PyObject *__pyx_codeobj__227;
static PyObject *__pyx_codeobj__229;
static PyObject *__pyx_codeobj__231;
static PyObject *__pyx_codeobj__233;

/* "kapok/uavsarc.pyx":45
 * 
 * 
 * def load(infile, outfile, mlwin=(20,5), smwin=(1,1), azbounds=None,             # <<<<<<<<<<<<<<
 *          rngbounds=None, tracks=None, compression='gzip',
 *          compression_opts=4, num_blocks=20, kzcalc=False, kzvertical=True,
 */

/* Python wrapper */
static PyObject *__pyx_pw_5kapok_7uavsarc_1load(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5kapok_7uavsarc_load[] = "Load a UAVSAR dataset into the Kapok format, and save it to target HDF5\n    file.\n    \n    Arguments:\n        infile (str): Path and filename of a UAVSAR .ann file containing the\n            metadata for a UAVSAR SLC stack.\n        outfile (str): Path and filename for the saved HDF5 dataset.\n        mlwin: Tuple containing the multilooking window sizes in azimuth and\n            slant range (in that order).  div=(12,3) results in multilooking\n            using a window of 12 pixels in azimuth and 3 pixels in slant range.\n            Within the window, all SLC pixels are averaged into a single\n            covariance matrix, reducing the size of the data.  The size of the\n            incidence angle, latitude, longitude, and other rasters are also\n            reduced by the same factor.  Default: (20,5).\n        smwin: Tuple containing boxcar moving average window sizes in azimuth\n            and slant range (in that order).  Each covariance matrix will be\n            smoothed using this window, without reducing the number of pixels\n            in the data.  Smoothing is performed after multilooking, if both\n            are specified.  Default: (1,1).\n        azbounds: List containing starting and ending SLC azimuth index for\n            desired subset.  Data outside these bounds will not be loaded.\n            Default is to import all data.\n        rngbounds: List containing starting and ending SLC range index for\n            desired subset.  Data outside these bounds will not be loaded.\n            Default is to import all data.\n        tracks: List containing desired track indices to import.  For example,\n            tracks=[0,1] will import only the first two tracks listed in the\n            annotation file.  Default: All tracks imported.\n        compression (str): Compression keyword used when creating the HDF5\n            datasets to store the covariance matrix, incidence angle, kz,\n            and DEM heights.  Default: 'gzip'.""\n        compression_opts (int): Compression option value used when creating\n            the HDF5 datasets.  Number from 0 to 9, with 9 being maximum\n            compression.  Default: 4.\n        num_blocks (int): Number of blocks to use for splitting up the\n            covariance matrix calculation.  Should be a positive integer\n            >= 1.  Higher numbers use less memory, but will be slower.\n            Default: 15.\n        kzcalc (bool): Set to True if you wish to calculate the kz from the\n            .baseline and .lkv files.  Set to False if you have UAVSAR .kz\n            files you wish to import.  Note that even if this argument is\n            set to False, if matching .kz files are not found, this function\n            will print a warning and calculate the kz from the geometry.\n            Note: The UAVSAR provided .kz files are corrected for the ground\n            topography.  The kz values calculated by this script are not.\n            During the model inversion procedure as called in\n            kapok.Scene.inv(), the calculated kz will be corrected for the\n            effects of the range-facing terrain slope angle (but not the\n            azimuth-facing terrain slope angle, or the squint angle), if\n            the rngslope keyword is supplied to that function.\n            If the imported .kz files are used, no further correction is\n            necessary, so kapok.Scene.inv() will use the kz values as is.\n            Default: False.\n        kzvertical (bool): If this flag is True, and kzcalc is False, the\n            kz values imported from the UAVSAR stack files will be assumed to\n            be kz values for measuring height perpendicular to the ground\n            surface.  This flag will change the kz values to use the vertical\n            direction.  This flag will have no effect if kzcalc is True, or\n            if the .kz files cannot be found, as the kz values calculated by\n            this function are always fo""r the vertical direction.\n            Default: True.\n        overwrite (bool): Set to True to overwrite an existing Kapok HDF5\n            file if necessary.  Default: False.\n            \n    Returns:\n        scene: A Kapok scene object pointing to the newly created HDF5 file.\n    \n    ";
static PyMethodDef __pyx_mdef_5kapok_7uavsarc_1load = {"load", (PyCFunction)__pyx_pw_5kapok_7uavsarc_1load, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5kapok_7uavsarc_load};
static PyObject *__pyx_pw_5kapok_7uavsarc_1load(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_infile = 0;
  PyObject *__pyx_v_outfile = 0;
  PyObject *__pyx_v_mlwin = 0;
  PyObject *__pyx_v_smwin = 0;
  PyObject *__pyx_v_azbounds = 0;
  PyObject *__pyx_v_rngbounds = 0;
  PyObject *__pyx_v_tracks = 0;
  PyObject *__pyx_v_compression = 0;
  PyObject *__pyx_v_compression_opts = 0;
  PyObject *__pyx_v_num_blocks = 0;
  PyObject *__pyx_v_kzcalc = 0;
  PyObject *__pyx_v_kzvertical = 0;
  PyObject *__pyx_v_overwrite = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("load (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_infile,&__pyx_n_s_outfile,&__pyx_n_s_mlwin,&__pyx_n_s_smwin,&__pyx_n_s_azbounds,&__pyx_n_s_rngbounds,&__pyx_n_s_tracks,&__pyx_n_s_compression,&__pyx_n_s_compression_opts,&__pyx_n_s_num_blocks,&__pyx_n_s_kzcalc,&__pyx_n_s_kzvertical,&__pyx_n_s_overwrite,0};
    PyObject* values[13] = {0,0,0,0,0,0,0,0,0,0,0,0,0};
    values[2] = ((PyObject *)__pyx_tuple_);
    values[3] = ((PyObject *)__pyx_tuple__2);
    values[4] = ((PyObject *)Py_None);

    /* "kapok/uavsarc.pyx":46
 * 
 * def load(infile, outfile, mlwin=(20,5), smwin=(1,1), azbounds=None,
 *          rngbounds=None, tracks=None, compression='gzip',             # <<<<<<<<<<<<<<
 *          compression_opts=4, num_blocks=20, kzcalc=False, kzvertical=True,
 *          overwrite=False):
 */
    values[5] = ((PyObject *)Py_None);
    values[6] = ((PyObject *)Py_None);
    values[7] = ((PyObject *)__pyx_n_u_gzip);
    values[8] = ((PyObject *)__pyx_int_4);
    values[9] = ((PyObject *)__pyx_int_20);

    /* "kapok/uavsarc.pyx":47
 * def load(infile, outfile, mlwin=(20,5), smwin=(1,1), azbounds=None,
 *          rngbounds=None, tracks=None, compression='gzip',
 *          compression_opts=4, num_blocks=20, kzcalc=False, kzvertical=True,             # <<<<<<<<<<<<<<
 *          overwrite=False):
 *     """Load a UAVSAR dataset into the Kapok format, and save it to target HDF5
 */
    values[10] = ((PyObject *)Py_False);
    values[11] = ((PyObject *)Py_True);

    /* "kapok/uavsarc.pyx":48
 *          rngbounds=None, tracks=None, compression='gzip',
 *          compression_opts=4, num_blocks=20, kzcalc=False, kzvertical=True,
 *          overwrite=False):             # <<<<<<<<<<<<<<
 *     """Load a UAVSAR dataset into the Kapok format, and save it to target HDF5
 *     file.
 */
    values[12] = ((PyObject *)Py_False);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
        case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
        case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
        case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_infile)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_outfile)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("load", 0, 2, 13, 1); __PYX_ERR(0, 45, __pyx_L3_error)
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mlwin);
          if (value) { values[2] = value; kw_args--; }
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_smwin);
          if (value) { values[3] = value; kw_args--; }
        }
        case  4:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_azbounds);
          if (value) { values[4] = value; kw_args--; }
        }
        case  5:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_rngbounds);
          if (value) { values[5] = value; kw_args--; }
        }
        case  6:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_tracks);
          if (value) { values[6] = value; kw_args--; }
        }
        case  7:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_compression);
          if (value) { values[7] = value; kw_args--; }
        }
        case  8:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_compression_opts);
          if (value) { values[8] = value; kw_args--; }
        }
        case  9:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_num_blocks);
          if (value) { values[9] = value; kw_args--; }
        }
        case 10:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_kzcalc);
          if (value) { values[10] = value; kw_args--; }
        }
        case 11:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_kzvertical);
          if (value) { values[11] = value; kw_args--; }
        }
        case 12:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_overwrite);
          if (value) { values[12] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "load") < 0)) __PYX_ERR(0, 45, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
        case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
        case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
        case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_infile = values[0];
    __pyx_v_outfile = values[1];
    __pyx_v_mlwin = values[2];
    __pyx_v_smwin = values[3];
    __pyx_v_azbounds = values[4];
    __pyx_v_rngbounds = values[5];
    __pyx_v_tracks = values[6];
    __pyx_v_compression = values[7];
    __pyx_v_compression_opts = values[8];
    __pyx_v_num_blocks = values[9];
    __pyx_v_kzcalc = values[10];
    __pyx_v_kzvertical = values[11];
    __pyx_v_overwrite = values[12];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("load", 0, 2, 13, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 45, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("kapok.uavsarc.load", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5kapok_7uavsarc_load(__pyx_self, __pyx_v_infile, __pyx_v_outfile, __pyx_v_mlwin, __pyx_v_smwin, __pyx_v_azbounds, __pyx_v_rngbounds, __pyx_v_tracks, __pyx_v_compression, __pyx_v_compression_opts, __pyx_v_num_blocks, __pyx_v_kzcalc, __pyx_v_kzvertical, __pyx_v_overwrite);

  /* "kapok/uavsarc.pyx":45
 * 
 * 
 * def load(infile, outfile, mlwin=(20,5), smwin=(1,1), azbounds=None,             # <<<<<<<<<<<<<<
 *          rngbounds=None, tracks=None, compression='gzip',
 *          compression_opts=4, num_blocks=20, kzcalc=False, kzvertical=True,
 */

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

static PyObject *__pyx_pf_5kapok_7uavsarc_load(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_infile, PyObject *__pyx_v_outfile, PyObject *__pyx_v_mlwin, PyObject *__pyx_v_smwin, PyObject *__pyx_v_azbounds, PyObject *__pyx_v_rngbounds, PyObject *__pyx_v_tracks, PyObject *__pyx_v_compression, PyObject *__pyx_v_compression_opts, PyObject *__pyx_v_num_blocks, PyObject *__pyx_v_kzcalc, PyObject *__pyx_v_kzvertical, PyObject *__pyx_v_overwrite) {
  PyObject *__pyx_v_ann = NULL;
  PyObject *__pyx_v_f = NULL;
  unsigned int __pyx_v_n;
  unsigned int __pyx_v_tr;
  PyObject *__pyx_v_rngsize_slc = NULL;
  PyObject *__pyx_v_num_segments = NULL;
  PyObject *__pyx_v_azsize_slc = NULL;
  PyObject *__pyx_v_temp = NULL;
  PyObject *__pyx_v_num = NULL;
  PyObject *__pyx_v_tracknames = NULL;
  PyObject *__pyx_v_num_tracks = NULL;
  PyObject *__pyx_v_num_bl = NULL;
  PyObject *__pyx_v_num_pol = NULL;
  PyObject *__pyx_v_num_cov_elements = NULL;
  PyObject *__pyx_v_peglat = NULL;
  PyObject *__pyx_v_peglon = NULL;
  PyObject *__pyx_v_peghdg = NULL;
  PyObject *__pyx_v_azsize = NULL;
  PyObject *__pyx_v_rngsize = NULL;
  PyObject *__pyx_v_datapath = NULL;
  PyObject *__pyx_v_slcfiles = NULL;
  PyObject *__pyx_v_seg = NULL;
  PyObject *__pyx_v_pol = NULL;
  PyObject *__pyx_v_file = NULL;
  PyObject *__pyx_v_cov = NULL;
  PyObject *__pyx_v_az_vector = NULL;
  unsigned int __pyx_v_seg_start;
  unsigned int __pyx_v_seg_end;
  unsigned int __pyx_v_row;
  unsigned int __pyx_v_col;
  unsigned long __pyx_v_azstart;
  unsigned long __pyx_v_azend;
  unsigned long __pyx_v_azstart_slc;
  unsigned long __pyx_v_azend_slc;
  unsigned long __pyx_v_azoffset_start;
  unsigned long __pyx_v_azoffset_end;
  PyObject *__pyx_v_slcnum = NULL;
  PyObject *__pyx_v_slc = NULL;
  PyObject *__pyx_v_file2 = NULL;
  PyObject *__pyx_v_slcstack = NULL;
  PyObject *__pyx_v_llh = NULL;
  PyObject *__pyx_v_mlwin_lkv = NULL;
  PyObject *__pyx_v_llhname = NULL;
  PyObject *__pyx_v_llh_rows = NULL;
  PyObject *__pyx_v_llh_cols = NULL;
  PyObject *__pyx_v_azllhstart = NULL;
  PyObject *__pyx_v_azllhend = NULL;
  PyObject *__pyx_v_azllhoffset = NULL;
  PyObject *__pyx_v_rngllhstart = NULL;
  PyObject *__pyx_v_rngllhend = NULL;
  PyObject *__pyx_v_rngllhoffset = NULL;
  PyObject *__pyx_v_lat = NULL;
  PyObject *__pyx_v_lon = NULL;
  PyObject *__pyx_v_dem = NULL;
  PyObject *__pyx_v_posmm = NULL;
  PyObject *__pyx_v_lkvmm = NULL;
  PyObject *__pyx_v_lkvname = NULL;
  PyObject *__pyx_v_lkv_rows = NULL;
  PyObject *__pyx_v_lkv_cols = NULL;
  PyObject *__pyx_v_wavelength = NULL;
  PyObject *__pyx_v_sstart = NULL;
  PyObject *__pyx_v_sspacing = NULL;
  PyObject *__pyx_v_sbounds = NULL;
  PyObject *__pyx_v_refvelocity = NULL;
  PyObject *__pyx_v_proj_reflkv_v = NULL;
  PyObject *__pyx_v_incident_lkv = NULL;
  PyObject *__pyx_v_inc_ref = NULL;
  PyObject *__pyx_v_inc = NULL;
  PyObject *__pyx_v_kz = NULL;
  PyArrayObject *__pyx_v_lkv = 0;
  PyArrayObject *__pyx_v_pos = 0;
  PyArrayObject *__pyx_v_inc_buffer = 0;
  PyArrayObject *__pyx_v_kz_buffer = 0;
  PyArrayObject *__pyx_v_tracklkv = 0;
  PyArrayObject *__pyx_v_velocity = 0;
  PyArrayObject *__pyx_v_lookcrossv = 0;
  CYTHON_UNUSED PyArrayObject *__pyx_v_tempdiff = 0;
  CYTHON_UNUSED PyArrayObject *__pyx_v_proj_lkv_velocity = 0;
  PyArrayObject *__pyx_v_base_enu = 0;
  PyArrayObject *__pyx_v_baseline = 0;
  PyArrayObject *__pyx_v_baselinep = 0;
  PyArrayObject *__pyx_v_baselinepsign = 0;
  unsigned long __pyx_v_az_ml;
  unsigned long __pyx_v_lkvrowstart;
  unsigned long __pyx_v_lkvrowend;
  unsigned long __pyx_v_lkvtrimstart;
  unsigned long __pyx_v_lkvtrimend;
  PyObject *__pyx_v_kz_temp = NULL;
  PyObject *__pyx_v_file_alt = NULL;
  PyObject *__pyx_v_kz_rows = NULL;
  PyObject *__pyx_v_kz_cols = NULL;
  PyObject *__pyx_v_calcslope = NULL;
  PyObject *__pyx_v_spacing = NULL;
  PyObject *__pyx_v_rngslope = NULL;
  PyObject *__pyx_v_azslope = NULL;
  PyObject *__pyx_v_height_dot_normal = NULL;
  PyObject *__pyx_v_basefile = NULL;
  PyObject *__pyx_v_basesch = NULL;
  PyObject *__pyx_v_istart = NULL;
  PyObject *__pyx_v_iend = NULL;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_base_enu;
  __Pyx_Buffer __pyx_pybuffer_base_enu;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_baseline;
  __Pyx_Buffer __pyx_pybuffer_baseline;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_baselinep;
  __Pyx_Buffer __pyx_pybuffer_baselinep;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_baselinepsign;
  __Pyx_Buffer __pyx_pybuffer_baselinepsign;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_inc_buffer;
  __Pyx_Buffer __pyx_pybuffer_inc_buffer;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_kz_buffer;
  __Pyx_Buffer __pyx_pybuffer_kz_buffer;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_lkv;
  __Pyx_Buffer __pyx_pybuffer_lkv;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_lookcrossv;
  __Pyx_Buffer __pyx_pybuffer_lookcrossv;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_pos;
  __Pyx_Buffer __pyx_pybuffer_pos;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_proj_lkv_velocity;
  __Pyx_Buffer __pyx_pybuffer_proj_lkv_velocity;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_tempdiff;
  __Pyx_Buffer __pyx_pybuffer_tempdiff;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_tracklkv;
  __Pyx_Buffer __pyx_pybuffer_tracklkv;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_velocity;
  __Pyx_Buffer __pyx_pybuffer_velocity;
  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;
  long __pyx_t_10;
  unsigned int __pyx_t_11;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  int __pyx_t_14;
  Py_ssize_t __pyx_t_15;
  int __pyx_t_16;
  PyObject *(*__pyx_t_17)(PyObject *);
  Py_ssize_t __pyx_t_18;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  Py_ssize_t __pyx_t_21;
  unsigned long __pyx_t_22;
  PyObject *(*__pyx_t_23)(PyObject *);
  unsigned int __pyx_t_24;
  PyObject *(*__pyx_t_25)(PyObject *);
  long __pyx_t_26;
  unsigned int __pyx_t_27;
  PyObject *__pyx_t_28 = NULL;
  PyObject *__pyx_t_29 = NULL;
  PyArrayObject *__pyx_t_30 = NULL;
  PyArrayObject *__pyx_t_31 = NULL;
  PyArrayObject *__pyx_t_32 = NULL;
  PyArrayObject *__pyx_t_33 = NULL;
  PyArrayObject *__pyx_t_34 = NULL;
  PyArrayObject *__pyx_t_35 = NULL;
  PyArrayObject *__pyx_t_36 = NULL;
  PyArrayObject *__pyx_t_37 = NULL;
  PyArrayObject *__pyx_t_38 = NULL;
  PyArrayObject *__pyx_t_39 = NULL;
  PyArrayObject *__pyx_t_40 = NULL;
  PyArrayObject *__pyx_t_41 = NULL;
  PyArrayObject *__pyx_t_42 = NULL;
  PyObject *__pyx_t_43 = NULL;
  unsigned long __pyx_t_44;
  __Pyx_RefNannySetupContext("load", 0);
  __Pyx_INCREF(__pyx_v_azbounds);
  __Pyx_INCREF(__pyx_v_rngbounds);
  __Pyx_INCREF(__pyx_v_tracks);
  __Pyx_INCREF(__pyx_v_kzcalc);
  __pyx_pybuffer_lkv.pybuffer.buf = NULL;
  __pyx_pybuffer_lkv.refcount = 0;
  __pyx_pybuffernd_lkv.data = NULL;
  __pyx_pybuffernd_lkv.rcbuffer = &__pyx_pybuffer_lkv;
  __pyx_pybuffer_pos.pybuffer.buf = NULL;
  __pyx_pybuffer_pos.refcount = 0;
  __pyx_pybuffernd_pos.data = NULL;
  __pyx_pybuffernd_pos.rcbuffer = &__pyx_pybuffer_pos;
  __pyx_pybuffer_inc_buffer.pybuffer.buf = NULL;
  __pyx_pybuffer_inc_buffer.refcount = 0;
  __pyx_pybuffernd_inc_buffer.data = NULL;
  __pyx_pybuffernd_inc_buffer.rcbuffer = &__pyx_pybuffer_inc_buffer;
  __pyx_pybuffer_kz_buffer.pybuffer.buf = NULL;
  __pyx_pybuffer_kz_buffer.refcount = 0;
  __pyx_pybuffernd_kz_buffer.data = NULL;
  __pyx_pybuffernd_kz_buffer.rcbuffer = &__pyx_pybuffer_kz_buffer;
  __pyx_pybuffer_tracklkv.pybuffer.buf = NULL;
  __pyx_pybuffer_tracklkv.refcount = 0;
  __pyx_pybuffernd_tracklkv.data = NULL;
  __pyx_pybuffernd_tracklkv.rcbuffer = &__pyx_pybuffer_tracklkv;
  __pyx_pybuffer_velocity.pybuffer.buf = NULL;
  __pyx_pybuffer_velocity.refcount = 0;
  __pyx_pybuffernd_velocity.data = NULL;
  __pyx_pybuffernd_velocity.rcbuffer = &__pyx_pybuffer_velocity;
  __pyx_pybuffer_lookcrossv.pybuffer.buf = NULL;
  __pyx_pybuffer_lookcrossv.refcount = 0;
  __pyx_pybuffernd_lookcrossv.data = NULL;
  __pyx_pybuffernd_lookcrossv.rcbuffer = &__pyx_pybuffer_lookcrossv;
  __pyx_pybuffer_tempdiff.pybuffer.buf = NULL;
  __pyx_pybuffer_tempdiff.refcount = 0;
  __pyx_pybuffernd_tempdiff.data = NULL;
  __pyx_pybuffernd_tempdiff.rcbuffer = &__pyx_pybuffer_tempdiff;
  __pyx_pybuffer_proj_lkv_velocity.pybuffer.buf = NULL;
  __pyx_pybuffer_proj_lkv_velocity.refcount = 0;
  __pyx_pybuffernd_proj_lkv_velocity.data = NULL;
  __pyx_pybuffernd_proj_lkv_velocity.rcbuffer = &__pyx_pybuffer_proj_lkv_velocity;
  __pyx_pybuffer_base_enu.pybuffer.buf = NULL;
  __pyx_pybuffer_base_enu.refcount = 0;
  __pyx_pybuffernd_base_enu.data = NULL;
  __pyx_pybuffernd_base_enu.rcbuffer = &__pyx_pybuffer_base_enu;
  __pyx_pybuffer_baseline.pybuffer.buf = NULL;
  __pyx_pybuffer_baseline.refcount = 0;
  __pyx_pybuffernd_baseline.data = NULL;
  __pyx_pybuffernd_baseline.rcbuffer = &__pyx_pybuffer_baseline;
  __pyx_pybuffer_baselinep.pybuffer.buf = NULL;
  __pyx_pybuffer_baselinep.refcount = 0;
  __pyx_pybuffernd_baselinep.data = NULL;
  __pyx_pybuffernd_baselinep.rcbuffer = &__pyx_pybuffer_baselinep;
  __pyx_pybuffer_baselinepsign.pybuffer.buf = NULL;
  __pyx_pybuffer_baselinepsign.refcount = 0;
  __pyx_pybuffernd_baselinepsign.data = NULL;
  __pyx_pybuffernd_baselinepsign.rcbuffer = &__pyx_pybuffer_baselinepsign;

  /* "kapok/uavsarc.pyx":118
 *     """
 *     # Load the annotation file.
 *     try:             # <<<<<<<<<<<<<<
 *         ann = Ann(infile)
 *     except:
 */
  {
    __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:*/ {

      /* "kapok/uavsarc.pyx":119
 *     # Load the annotation file.
 *     try:
 *         ann = Ann(infile)             # <<<<<<<<<<<<<<
 *     except:
 *         print('kapok.uavsar.load | Cannot load UAVSAR annotation file. Aborting.')
 */
      __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_Ann); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 119, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __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);
        }
      }
      if (!__pyx_t_6) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_infile); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 119, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_5)) {
          PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_v_infile};
          __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 119, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_GOTREF(__pyx_t_4);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
          PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_v_infile};
          __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 119, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_GOTREF(__pyx_t_4);
        } else
        #endif
        {
          __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 119, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL;
          __Pyx_INCREF(__pyx_v_infile);
          __Pyx_GIVEREF(__pyx_v_infile);
          PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_v_infile);
          __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 119, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_v_ann = __pyx_t_4;
      __pyx_t_4 = 0;

      /* "kapok/uavsarc.pyx":118
 *     """
 *     # Load the annotation file.
 *     try:             # <<<<<<<<<<<<<<
 *         ann = Ann(infile)
 *     except:
 */
    }
    __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_L10_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "kapok/uavsarc.pyx":120
 *     try:
 *         ann = Ann(infile)
 *     except:             # <<<<<<<<<<<<<<
 *         print('kapok.uavsar.load | Cannot load UAVSAR annotation file. Aborting.')
 *         return
 */
    /*except:*/ {
      __Pyx_AddTraceback("kapok.uavsarc.load", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_5, &__pyx_t_7) < 0) __PYX_ERR(0, 120, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_7);

      /* "kapok/uavsarc.pyx":121
 *         ann = Ann(infile)
 *     except:
 *         print('kapok.uavsar.load | Cannot load UAVSAR annotation file. Aborting.')             # <<<<<<<<<<<<<<
 *         return
 * 
 */
      __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 121, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

      /* "kapok/uavsarc.pyx":122
 *     except:
 *         print('kapok.uavsar.load | Cannot load UAVSAR annotation file. Aborting.')
 *         return             # <<<<<<<<<<<<<<
 * 
 * 
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_r = Py_None; __Pyx_INCREF(Py_None);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L6_except_return;
    }
    __pyx_L5_except_error:;

    /* "kapok/uavsarc.pyx":118
 *     """
 *     # Load the annotation file.
 *     try:             # <<<<<<<<<<<<<<
 *         ann = Ann(infile)
 *     except:
 */
    __Pyx_PyThreadState_assign
    __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_PyThreadState_assign
    __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_L10_try_end:;
  }

  /* "kapok/uavsarc.pyx":126
 * 
 *     # Create the HDF5 file.
 *     if overwrite:             # <<<<<<<<<<<<<<
 *         try:
 *             f = h5py.File(outfile,'w')
 */
  __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_overwrite); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 126, __pyx_L1_error)
  if (__pyx_t_8) {

    /* "kapok/uavsarc.pyx":127
 *     # Create the HDF5 file.
 *     if overwrite:
 *         try:             # <<<<<<<<<<<<<<
 *             f = h5py.File(outfile,'w')
 *         except:
 */
    {
      __Pyx_PyThreadState_declare
      __Pyx_PyThreadState_assign
      __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_2, &__pyx_t_1);
      __Pyx_XGOTREF(__pyx_t_3);
      __Pyx_XGOTREF(__pyx_t_2);
      __Pyx_XGOTREF(__pyx_t_1);
      /*try:*/ {

        /* "kapok/uavsarc.pyx":128
 *     if overwrite:
 *         try:
 *             f = h5py.File(outfile,'w')             # <<<<<<<<<<<<<<
 *         except:
 *             print('kapok.uavsar.load | Cannot create new HDF5 file. Check if path is valid. Aborting.')
 */
        __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_h5py); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 128, __pyx_L14_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_File); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 128, __pyx_L14_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = NULL;
        __pyx_t_9 = 0;
        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_9 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_4)) {
          PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_outfile, __pyx_n_u_w};
          __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 128, __pyx_L14_error)
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_GOTREF(__pyx_t_7);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
          PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_outfile, __pyx_n_u_w};
          __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 128, __pyx_L14_error)
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_GOTREF(__pyx_t_7);
        } else
        #endif
        {
          __pyx_t_6 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 128, __pyx_L14_error)
          __Pyx_GOTREF(__pyx_t_6);
          if (__pyx_t_5) {
            __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
          }
          __Pyx_INCREF(__pyx_v_outfile);
          __Pyx_GIVEREF(__pyx_v_outfile);
          PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_9, __pyx_v_outfile);
          __Pyx_INCREF(__pyx_n_u_w);
          __Pyx_GIVEREF(__pyx_n_u_w);
          PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_9, __pyx_n_u_w);
          __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 128, __pyx_L14_error)
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        }
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_v_f = __pyx_t_7;
        __pyx_t_7 = 0;

        /* "kapok/uavsarc.pyx":127
 *     # Create the HDF5 file.
 *     if overwrite:
 *         try:             # <<<<<<<<<<<<<<
 *             f = h5py.File(outfile,'w')
 *         except:
 */
      }
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L21_try_end;
      __pyx_L14_error:;
      __Pyx_PyThreadState_assign
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;

      /* "kapok/uavsarc.pyx":129
 *         try:
 *             f = h5py.File(outfile,'w')
 *         except:             # <<<<<<<<<<<<<<
 *             print('kapok.uavsar.load | Cannot create new HDF5 file. Check if path is valid. Aborting.')
 *             return
 */
      /*except:*/ {
        __Pyx_AddTraceback("kapok.uavsarc.load", __pyx_clineno, __pyx_lineno, __pyx_filename);
        if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_4, &__pyx_t_6) < 0) __PYX_ERR(0, 129, __pyx_L16_except_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_GOTREF(__pyx_t_6);

        /* "kapok/uavsarc.pyx":130
 *             f = h5py.File(outfile,'w')
 *         except:
 *             print('kapok.uavsar.load | Cannot create new HDF5 file. Check if path is valid. Aborting.')             # <<<<<<<<<<<<<<
 *             return
 *     else:
 */
        __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 130, __pyx_L16_except_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

        /* "kapok/uavsarc.pyx":131
 *         except:
 *             print('kapok.uavsar.load | Cannot create new HDF5 file. Check if path is valid. Aborting.')
 *             return             # <<<<<<<<<<<<<<
 *     else:
 *         try:
 */
        __Pyx_XDECREF(__pyx_r);
        __pyx_r = Py_None; __Pyx_INCREF(Py_None);
        __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_L17_except_return;
      }
      __pyx_L16_except_error:;

      /* "kapok/uavsarc.pyx":127
 *     # Create the HDF5 file.
 *     if overwrite:
 *         try:             # <<<<<<<<<<<<<<
 *             f = h5py.File(outfile,'w')
 *         except:
 */
      __Pyx_PyThreadState_assign
      __Pyx_XGIVEREF(__pyx_t_3);
      __Pyx_XGIVEREF(__pyx_t_2);
      __Pyx_XGIVEREF(__pyx_t_1);
      __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_2, __pyx_t_1);
      goto __pyx_L1_error;
      __pyx_L17_except_return:;
      __Pyx_PyThreadState_assign
      __Pyx_XGIVEREF(__pyx_t_3);
      __Pyx_XGIVEREF(__pyx_t_2);
      __Pyx_XGIVEREF(__pyx_t_1);
      __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_2, __pyx_t_1);
      goto __pyx_L0;
      __pyx_L21_try_end:;
    }

    /* "kapok/uavsarc.pyx":126
 * 
 *     # Create the HDF5 file.
 *     if overwrite:             # <<<<<<<<<<<<<<
 *         try:
 *             f = h5py.File(outfile,'w')
 */
    goto __pyx_L13;
  }

  /* "kapok/uavsarc.pyx":133
 *             return
 *     else:
 *         try:             # <<<<<<<<<<<<<<
 *             f = h5py.File(outfile,'x')
 *         except:
 */
  /*else*/ {
    {
      __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:*/ {

        /* "kapok/uavsarc.pyx":134
 *     else:
 *         try:
 *             f = h5py.File(outfile,'x')             # <<<<<<<<<<<<<<
 *         except:
 *             print('kapok.uavsar.load | Cannot create new HDF5 file. Check if path is valid and ensure file does not already exist. Aborting.')
 */
        __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_h5py); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 134, __pyx_L24_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_File); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 134, __pyx_L24_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_4 = NULL;
        __pyx_t_9 = 0;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_7);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_7, function);
            __pyx_t_9 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_7)) {
          PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_outfile, __pyx_n_u_x};
          __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 134, __pyx_L24_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_6);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
          PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_outfile, __pyx_n_u_x};
          __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 134, __pyx_L24_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_6);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 134, __pyx_L24_error)
          __Pyx_GOTREF(__pyx_t_5);
          if (__pyx_t_4) {
            __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          }
          __Pyx_INCREF(__pyx_v_outfile);
          __Pyx_GIVEREF(__pyx_v_outfile);
          PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_9, __pyx_v_outfile);
          __Pyx_INCREF(__pyx_n_u_x);
          __Pyx_GIVEREF(__pyx_n_u_x);
          PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_9, __pyx_n_u_x);
          __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 134, __pyx_L24_error)
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_v_f = __pyx_t_6;
        __pyx_t_6 = 0;

        /* "kapok/uavsarc.pyx":133
 *             return
 *     else:
 *         try:             # <<<<<<<<<<<<<<
 *             f = h5py.File(outfile,'x')
 *         except:
 */
      }
      __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_L31_try_end;
      __pyx_L24_error:;
      __Pyx_PyThreadState_assign
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;

      /* "kapok/uavsarc.pyx":135
 *         try:
 *             f = h5py.File(outfile,'x')
 *         except:             # <<<<<<<<<<<<<<
 *             print('kapok.uavsar.load | Cannot create new HDF5 file. Check if path is valid and ensure file does not already exist. Aborting.')
 *             return
 */
      /*except:*/ {
        __Pyx_AddTraceback("kapok.uavsarc.load", __pyx_clineno, __pyx_lineno, __pyx_filename);
        if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_7, &__pyx_t_5) < 0) __PYX_ERR(0, 135, __pyx_L26_except_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_GOTREF(__pyx_t_5);

        /* "kapok/uavsarc.pyx":136
 *             f = h5py.File(outfile,'x')
 *         except:
 *             print('kapok.uavsar.load | Cannot create new HDF5 file. Check if path is valid and ensure file does not already exist. Aborting.')             # <<<<<<<<<<<<<<
 *             return
 * 
 */
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 136, __pyx_L26_except_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

        /* "kapok/uavsarc.pyx":137
 *         except:
 *             print('kapok.uavsar.load | Cannot create new HDF5 file. Check if path is valid and ensure file does not already exist. Aborting.')
 *             return             # <<<<<<<<<<<<<<
 * 
 * 
 */
        __Pyx_XDECREF(__pyx_r);
        __pyx_r = Py_None; __Pyx_INCREF(Py_None);
        __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;
        goto __pyx_L27_except_return;
      }
      __pyx_L26_except_error:;

      /* "kapok/uavsarc.pyx":133
 *             return
 *     else:
 *         try:             # <<<<<<<<<<<<<<
 *             f = h5py.File(outfile,'x')
 *         except:
 */
      __Pyx_PyThreadState_assign
      __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_L27_except_return:;
      __Pyx_PyThreadState_assign
      __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_L31_try_end:;
    }
  }
  __pyx_L13:;

  /* "kapok/uavsarc.pyx":143
 * 
 *     # Get SLC dimensions and number of segments.
 *     rngsize_slc = ann.query('slc_1_1x1 Columns')             # <<<<<<<<<<<<<<
 *     num_segments = ann.query('Number of Segments')
 *     if num_segments > 1:
 */
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_ann, __pyx_n_s_query); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 143, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 143, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_v_rngsize_slc = __pyx_t_7;
  __pyx_t_7 = 0;

  /* "kapok/uavsarc.pyx":144
 *     # Get SLC dimensions and number of segments.
 *     rngsize_slc = ann.query('slc_1_1x1 Columns')
 *     num_segments = ann.query('Number of Segments')             # <<<<<<<<<<<<<<
 *     if num_segments > 1:
 *         azsize_slc = np.zeros(num_segments,dtype='int32')
 */
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_ann, __pyx_n_s_query); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 144, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 144, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_v_num_segments = __pyx_t_5;
  __pyx_t_5 = 0;

  /* "kapok/uavsarc.pyx":145
 *     rngsize_slc = ann.query('slc_1_1x1 Columns')
 *     num_segments = ann.query('Number of Segments')
 *     if num_segments > 1:             # <<<<<<<<<<<<<<
 *         azsize_slc = np.zeros(num_segments,dtype='int32')
 *         for n in range(num_segments):
 */
  __pyx_t_5 = PyObject_RichCompare(__pyx_v_num_segments, __pyx_int_1, Py_GT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 145, __pyx_L1_error)
  __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 145, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__pyx_t_8) {

    /* "kapok/uavsarc.pyx":146
 *     num_segments = ann.query('Number of Segments')
 *     if num_segments > 1:
 *         azsize_slc = np.zeros(num_segments,dtype='int32')             # <<<<<<<<<<<<<<
 *         for n in range(num_segments):
 *             azsize_slc[n] = ann.query('slc_'+str(n+1)+'_1x1 Rows')
 */
    __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 146, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_zeros); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 146, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 146, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_INCREF(__pyx_v_num_segments);
    __Pyx_GIVEREF(__pyx_v_num_segments);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_num_segments);
    __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 146, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_n_u_int32) < 0) __PYX_ERR(0, 146, __pyx_L1_error)
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 146, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_v_azsize_slc = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "kapok/uavsarc.pyx":147
 *     if num_segments > 1:
 *         azsize_slc = np.zeros(num_segments,dtype='int32')
 *         for n in range(num_segments):             # <<<<<<<<<<<<<<
 *             azsize_slc[n] = ann.query('slc_'+str(n+1)+'_1x1 Rows')
 *     else:
 */
    __pyx_t_10 = __Pyx_PyInt_As_long(__pyx_v_num_segments); if (unlikely((__pyx_t_10 == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 147, __pyx_L1_error)
    for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) {
      __pyx_v_n = __pyx_t_11;

      /* "kapok/uavsarc.pyx":148
 *         azsize_slc = np.zeros(num_segments,dtype='int32')
 *         for n in range(num_segments):
 *             azsize_slc[n] = ann.query('slc_'+str(n+1)+'_1x1 Rows')             # <<<<<<<<<<<<<<
 *     else:
 *         azsize_slc = ann.query('slc_1_1x1 Rows')
 */
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_ann, __pyx_n_s_query); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 148, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_5 = __Pyx_PyInt_From_long((__pyx_v_n + 1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 148, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 148, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5);
      __pyx_t_5 = 0;
      __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)(&PyUnicode_Type)), __pyx_t_7, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 148, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = __Pyx_PyUnicode_Concat(__pyx_n_u_slc, __pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 148, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = __Pyx_PyUnicode_Concat(__pyx_t_7, __pyx_kp_u_1x1_Rows); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 148, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(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);
        }
      }
      if (!__pyx_t_7) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 148, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_5};
          __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 148, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_5};
          __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 148, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        } else
        #endif
        {
          __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 148, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_7); __pyx_t_7 = NULL;
          __Pyx_GIVEREF(__pyx_t_5);
          PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_5);
          __pyx_t_5 = 0;
          __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_12, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 148, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(__Pyx_SetItemInt(__pyx_v_azsize_slc, __pyx_v_n, __pyx_t_4, unsigned int, 0, __Pyx_PyInt_From_unsigned_int, 0, 0, 1) < 0)) __PYX_ERR(0, 148, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }

    /* "kapok/uavsarc.pyx":145
 *     rngsize_slc = ann.query('slc_1_1x1 Columns')
 *     num_segments = ann.query('Number of Segments')
 *     if num_segments > 1:             # <<<<<<<<<<<<<<
 *         azsize_slc = np.zeros(num_segments,dtype='int32')
 *         for n in range(num_segments):
 */
    goto __pyx_L34;
  }

  /* "kapok/uavsarc.pyx":150
 *             azsize_slc[n] = ann.query('slc_'+str(n+1)+'_1x1 Rows')
 *     else:
 *         azsize_slc = ann.query('slc_1_1x1 Rows')             # <<<<<<<<<<<<<<
 * 
 * 
 */
  /*else*/ {
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_ann, __pyx_n_s_query); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 150, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 150, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_v_azsize_slc = __pyx_t_6;
    __pyx_t_6 = 0;
  }
  __pyx_L34:;

  /* "kapok/uavsarc.pyx":154
 * 
 *     # Get track filenames and number of tracks.
 *     temp = ann.query('stackline1')             # <<<<<<<<<<<<<<
 *     num = 1
 *     if temp is not None:
 */
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_ann, __pyx_n_s_query); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 154, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 154, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_v_temp = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "kapok/uavsarc.pyx":155
 *     # Get track filenames and number of tracks.
 *     temp = ann.query('stackline1')
 *     num = 1             # <<<<<<<<<<<<<<
 *     if temp is not None:
 *         tracknames = [temp.split('_L090')[0]]
 */
  __Pyx_INCREF(__pyx_int_1);
  __pyx_v_num = __pyx_int_1;

  /* "kapok/uavsarc.pyx":156
 *     temp = ann.query('stackline1')
 *     num = 1
 *     if temp is not None:             # <<<<<<<<<<<<<<
 *         tracknames = [temp.split('_L090')[0]]
 *         num += 1
 */
  __pyx_t_8 = (__pyx_v_temp != Py_None);
  __pyx_t_13 = (__pyx_t_8 != 0);
  if (__pyx_t_13) {

    /* "kapok/uavsarc.pyx":157
 *     num = 1
 *     if temp is not None:
 *         tracknames = [temp.split('_L090')[0]]             # <<<<<<<<<<<<<<
 *         num += 1
 *         temp = ann.query('stackline'+str(num))
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_temp, __pyx_n_s_split); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 157, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 157, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_6, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 157, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = PyList_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 157, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_4);
    PyList_SET_ITEM(__pyx_t_6, 0, __pyx_t_4);
    __pyx_t_4 = 0;
    __pyx_v_tracknames = __pyx_t_6;
    __pyx_t_6 = 0;

    /* "kapok/uavsarc.pyx":158
 *     if temp is not None:
 *         tracknames = [temp.split('_L090')[0]]
 *         num += 1             # <<<<<<<<<<<<<<
 *         temp = ann.query('stackline'+str(num))
 *         while temp is not None:
 */
    __pyx_t_6 = __Pyx_PyInt_AddObjC(__pyx_v_num, __pyx_int_1, 1, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 158, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF_SET(__pyx_v_num, __pyx_t_6);
    __pyx_t_6 = 0;

    /* "kapok/uavsarc.pyx":159
 *         tracknames = [temp.split('_L090')[0]]
 *         num += 1
 *         temp = ann.query('stackline'+str(num))             # <<<<<<<<<<<<<<
 *         while temp is not None:
 *             tracknames.append(temp.split('_L090')[0])
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_ann, __pyx_n_s_query); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 159, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_12 = PyTuple_New(1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 159, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_INCREF(__pyx_v_num);
    __Pyx_GIVEREF(__pyx_v_num);
    PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_v_num);
    __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)(&PyUnicode_Type)), __pyx_t_12, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 159, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __pyx_t_12 = __Pyx_PyUnicode_Concat(__pyx_n_u_stackline, __pyx_t_5); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 159, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    if (!__pyx_t_5) {
      __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_12); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 159, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __Pyx_GOTREF(__pyx_t_6);
    } else {
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_4)) {
        PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_12};
        __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 159, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
        PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_12};
        __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 159, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      } else
      #endif
      {
        __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 159, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
        __Pyx_GIVEREF(__pyx_t_12);
        PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_12);
        __pyx_t_12 = 0;
        __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 159, __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;
    __Pyx_DECREF_SET(__pyx_v_temp, __pyx_t_6);
    __pyx_t_6 = 0;

    /* "kapok/uavsarc.pyx":160
 *         num += 1
 *         temp = ann.query('stackline'+str(num))
 *         while temp is not None:             # <<<<<<<<<<<<<<
 *             tracknames.append(temp.split('_L090')[0])
 *             num += 1
 */
    while (1) {
      __pyx_t_13 = (__pyx_v_temp != Py_None);
      __pyx_t_8 = (__pyx_t_13 != 0);
      if (!__pyx_t_8) break;

      /* "kapok/uavsarc.pyx":161
 *         temp = ann.query('stackline'+str(num))
 *         while temp is not None:
 *             tracknames.append(temp.split('_L090')[0])             # <<<<<<<<<<<<<<
 *             num += 1
 *             temp = ann.query('stackline'+str(num))
 */
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_temp, __pyx_n_s_split); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 161, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 161, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_4, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 161, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_14 = __Pyx_PyObject_Append(__pyx_v_tracknames, __pyx_t_6); if (unlikely(__pyx_t_14 == -1)) __PYX_ERR(0, 161, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

      /* "kapok/uavsarc.pyx":162
 *         while temp is not None:
 *             tracknames.append(temp.split('_L090')[0])
 *             num += 1             # <<<<<<<<<<<<<<
 *             temp = ann.query('stackline'+str(num))
 *     else:
 */
      __pyx_t_6 = __Pyx_PyInt_AddObjC(__pyx_v_num, __pyx_int_1, 1, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 162, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF_SET(__pyx_v_num, __pyx_t_6);
      __pyx_t_6 = 0;

      /* "kapok/uavsarc.pyx":163
 *             tracknames.append(temp.split('_L090')[0])
 *             num += 1
 *             temp = ann.query('stackline'+str(num))             # <<<<<<<<<<<<<<
 *     else:
 *         print('kapok.uavsar.load | Cannot find track names in UAVSAR annotation file.  Aborting.')
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_ann, __pyx_n_s_query); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 163, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 163, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_INCREF(__pyx_v_num);
      __Pyx_GIVEREF(__pyx_v_num);
      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_num);
      __pyx_t_12 = __Pyx_PyObject_Call(((PyObject *)(&PyUnicode_Type)), __pyx_t_7, NULL); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 163, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = __Pyx_PyUnicode_Concat(__pyx_n_u_stackline, __pyx_t_12); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 163, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __pyx_t_12 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_12)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_12);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
        }
      }
      if (!__pyx_t_12) {
        __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 163, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_GOTREF(__pyx_t_6);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_4)) {
          PyObject *__pyx_temp[2] = {__pyx_t_12, __pyx_t_7};
          __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 163, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
          PyObject *__pyx_temp[2] = {__pyx_t_12, __pyx_t_7};
          __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 163, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 163, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_12); __pyx_t_12 = NULL;
          __Pyx_GIVEREF(__pyx_t_7);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_7);
          __pyx_t_7 = 0;
          __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 163, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF_SET(__pyx_v_temp, __pyx_t_6);
      __pyx_t_6 = 0;
    }

    /* "kapok/uavsarc.pyx":156
 *     temp = ann.query('stackline1')
 *     num = 1
 *     if temp is not None:             # <<<<<<<<<<<<<<
 *         tracknames = [temp.split('_L090')[0]]
 *         num += 1
 */
    goto __pyx_L37;
  }

  /* "kapok/uavsarc.pyx":165
 *             temp = ann.query('stackline'+str(num))
 *     else:
 *         print('kapok.uavsar.load | Cannot find track names in UAVSAR annotation file.  Aborting.')             # <<<<<<<<<<<<<<
 *         return
 * 
 */
  /*else*/ {
    __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 165, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "kapok/uavsarc.pyx":166
 *     else:
 *         print('kapok.uavsar.load | Cannot find track names in UAVSAR annotation file.  Aborting.')
 *         return             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;
  }
  __pyx_L37:;

  /* "kapok/uavsarc.pyx":170
 * 
 *     # Subset track names if desired tracks were specified:
 *     tracknames = np.array(tracknames)             # <<<<<<<<<<<<<<
 *     if tracks is not None:
 *         tracks = np.array(tracks,dtype='int')
 */
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 170, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_array); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 170, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
    }
  }
  if (!__pyx_t_4) {
    __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_tracknames); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 170, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
  } else {
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_5)) {
      PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_tracknames};
      __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 170, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_GOTREF(__pyx_t_6);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
      PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_tracknames};
      __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 170, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_GOTREF(__pyx_t_6);
    } else
    #endif
    {
      __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 170, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4); __pyx_t_4 = NULL;
      __Pyx_INCREF(__pyx_v_tracknames);
      __Pyx_GIVEREF(__pyx_v_tracknames);
      PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_v_tracknames);
      __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 170, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF_SET(__pyx_v_tracknames, __pyx_t_6);
  __pyx_t_6 = 0;

  /* "kapok/uavsarc.pyx":171
 *     # Subset track names if desired tracks were specified:
 *     tracknames = np.array(tracknames)
 *     if tracks is not None:             # <<<<<<<<<<<<<<
 *         tracks = np.array(tracks,dtype='int')
 *         tracknames = tracknames[tracks]
 */
  __pyx_t_8 = (__pyx_v_tracks != Py_None);
  __pyx_t_13 = (__pyx_t_8 != 0);
  if (__pyx_t_13) {

    /* "kapok/uavsarc.pyx":172
 *     tracknames = np.array(tracknames)
 *     if tracks is not None:
 *         tracks = np.array(tracks,dtype='int')             # <<<<<<<<<<<<<<
 *         tracknames = tracknames[tracks]
 * 
 */
    __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 172, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_array); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 172, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 172, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_INCREF(__pyx_v_tracks);
    __Pyx_GIVEREF(__pyx_v_tracks);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_tracks);
    __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 172, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_dtype, __pyx_n_u_int) < 0) __PYX_ERR(0, 172, __pyx_L1_error)
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 172, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __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_SET(__pyx_v_tracks, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "kapok/uavsarc.pyx":173
 *     if tracks is not None:
 *         tracks = np.array(tracks,dtype='int')
 *         tracknames = tracknames[tracks]             # <<<<<<<<<<<<<<
 * 
 *     num_tracks = len(tracknames) # Number of Tracks
 */
    __pyx_t_4 = PyObject_GetItem(__pyx_v_tracknames, __pyx_v_tracks); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 173, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF_SET(__pyx_v_tracknames, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "kapok/uavsarc.pyx":171
 *     # Subset track names if desired tracks were specified:
 *     tracknames = np.array(tracknames)
 *     if tracks is not None:             # <<<<<<<<<<<<<<
 *         tracks = np.array(tracks,dtype='int')
 *         tracknames = tracknames[tracks]
 */
  }

  /* "kapok/uavsarc.pyx":175
 *         tracknames = tracknames[tracks]
 * 
 *     num_tracks = len(tracknames) # Number of Tracks             # <<<<<<<<<<<<<<
 *     num_bl = int(num_tracks * (num_tracks-1) / 2) # Number of Baselines
 *     num_pol = int(3) # Number of Polarizations (HH, sqrt(2)*HV, VV)
 */
  __pyx_t_15 = PyObject_Length(__pyx_v_tracknames); if (unlikely(__pyx_t_15 == -1)) __PYX_ERR(0, 175, __pyx_L1_error)
  __pyx_t_4 = PyInt_FromSsize_t(__pyx_t_15); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 175, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_v_num_tracks = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "kapok/uavsarc.pyx":176
 * 
 *     num_tracks = len(tracknames) # Number of Tracks
 *     num_bl = int(num_tracks * (num_tracks-1) / 2) # Number of Baselines             # <<<<<<<<<<<<<<
 *     num_pol = int(3) # Number of Polarizations (HH, sqrt(2)*HV, VV)
 *     num_cov_elements = num_tracks*num_pol # Number of Covariance Matrix Elements in Each Row
 */
  __pyx_t_4 = __Pyx_PyInt_SubtractObjC(__pyx_v_num_tracks, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 176, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_7 = PyNumber_Multiply(__pyx_v_num_tracks, __pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 176, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyInt_TrueDivideObjC(__pyx_t_7, __pyx_int_2, 2, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 176, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = __Pyx_PyNumber_Int(__pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 176, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_num_bl = __pyx_t_7;
  __pyx_t_7 = 0;

  /* "kapok/uavsarc.pyx":177
 *     num_tracks = len(tracknames) # Number of Tracks
 *     num_bl = int(num_tracks * (num_tracks-1) / 2) # Number of Baselines
 *     num_pol = int(3) # Number of Polarizations (HH, sqrt(2)*HV, VV)             # <<<<<<<<<<<<<<
 *     num_cov_elements = num_tracks*num_pol # Number of Covariance Matrix Elements in Each Row
 * 
 */
  __pyx_t_7 = __Pyx_PyNumber_Int(__pyx_int_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 177, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_v_num_pol = __pyx_t_7;
  __pyx_t_7 = 0;

  /* "kapok/uavsarc.pyx":178
 *     num_bl = int(num_tracks * (num_tracks-1) / 2) # Number of Baselines
 *     num_pol = int(3) # Number of Polarizations (HH, sqrt(2)*HV, VV)
 *     num_cov_elements = num_tracks*num_pol # Number of Covariance Matrix Elements in Each Row             # <<<<<<<<<<<<<<
 * 
 *     f.attrs['stack_name'] = ann.query('Stack Name')
 */
  __pyx_t_7 = PyNumber_Multiply(__pyx_v_num_tracks, __pyx_v_num_pol); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 178, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_v_num_cov_elements = __pyx_t_7;
  __pyx_t_7 = 0;

  /* "kapok/uavsarc.pyx":180
 *     num_cov_elements = num_tracks*num_pol # Number of Covariance Matrix Elements in Each Row
 * 
 *     f.attrs['stack_name'] = ann.query('Stack Name')             # <<<<<<<<<<<<<<
 *     f.attrs['site'] = ann.query('Site Description')
 *     f.attrs['url'] = ann.query('URL')
 */
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_ann, __pyx_n_s_query); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 180, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 180, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_attrs); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 180, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (unlikely(PyObject_SetItem(__pyx_t_7, __pyx_n_u_stack_name, __pyx_t_4) < 0)) __PYX_ERR(0, 180, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "kapok/uavsarc.pyx":181
 * 
 *     f.attrs['stack_name'] = ann.query('Stack Name')
 *     f.attrs['site'] = ann.query('Site Description')             # <<<<<<<<<<<<<<
 *     f.attrs['url'] = ann.query('URL')
 *     f.attrs['sensor'] = 'UAVSAR'
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_ann, __pyx_n_s_query); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 181, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 181, __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_f, __pyx_n_s_attrs); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 181, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (unlikely(PyObject_SetItem(__pyx_t_4, __pyx_n_u_site, __pyx_t_7) < 0)) __PYX_ERR(0, 181, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "kapok/uavsarc.pyx":182
 *     f.attrs['stack_name'] = ann.query('Stack Name')
 *     f.attrs['site'] = ann.query('Site Description')
 *     f.attrs['url'] = ann.query('URL')             # <<<<<<<<<<<<<<
 *     f.attrs['sensor'] = 'UAVSAR'
 *     f.attrs['processor'] = 'production'
 */
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_ann, __pyx_n_s_query); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 182, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 182, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_attrs); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 182, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (unlikely(PyObject_SetItem(__pyx_t_7, __pyx_n_u_url, __pyx_t_4) < 0)) __PYX_ERR(0, 182, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "kapok/uavsarc.pyx":183
 *     f.attrs['site'] = ann.query('Site Description')
 *     f.attrs['url'] = ann.query('URL')
 *     f.attrs['sensor'] = 'UAVSAR'             # <<<<<<<<<<<<<<
 *     f.attrs['processor'] = 'production'
 * 
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_attrs); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 183, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (unlikely(PyObject_SetItem(__pyx_t_4, __pyx_n_u_sensor, __pyx_n_u_UAVSAR) < 0)) __PYX_ERR(0, 183, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "kapok/uavsarc.pyx":184
 *     f.attrs['url'] = ann.query('URL')
 *     f.attrs['sensor'] = 'UAVSAR'
 *     f.attrs['processor'] = 'production'             # <<<<<<<<<<<<<<
 * 
 *     print('kapok.uavsar.load | Stack ID: '+f.attrs['stack_name'])
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_attrs); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 184, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (unlikely(PyObject_SetItem(__pyx_t_4, __pyx_n_u_processor, __pyx_n_u_production) < 0)) __PYX_ERR(0, 184, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "kapok/uavsarc.pyx":186
 *     f.attrs['processor'] = 'production'
 * 
 *     print('kapok.uavsar.load | Stack ID: '+f.attrs['stack_name'])             # <<<<<<<<<<<<<<
 *     print('kapok.uavsar.load | Site Description: '+f.attrs['site'])
 *     print('kapok.uavsar.load | URL: '+f.attrs['url'])
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_attrs); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 186, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_7 = PyObject_GetItem(__pyx_t_4, __pyx_n_u_stack_name); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 186, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyNumber_Add(__pyx_kp_u_kapok_uavsar_load_Stack_ID, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 186, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 186, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4);
  __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 186, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "kapok/uavsarc.pyx":187
 * 
 *     print('kapok.uavsar.load | Stack ID: '+f.attrs['stack_name'])
 *     print('kapok.uavsar.load | Site Description: '+f.attrs['site'])             # <<<<<<<<<<<<<<
 *     print('kapok.uavsar.load | URL: '+f.attrs['url'])
 * 
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_attrs); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 187, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_7 = PyObject_GetItem(__pyx_t_4, __pyx_n_u_site); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 187, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyNumber_Add(__pyx_kp_u_kapok_uavsar_load_Site_Descripti, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 187, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 187, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4);
  __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 187, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "kapok/uavsarc.pyx":188
 *     print('kapok.uavsar.load | Stack ID: '+f.attrs['stack_name'])
 *     print('kapok.uavsar.load | Site Description: '+f.attrs['site'])
 *     print('kapok.uavsar.load | URL: '+f.attrs['url'])             # <<<<<<<<<<<<<<
 * 
 *     print('kapok.uavsar.load | Importing metadata. ('+time.ctime()+')')
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_attrs); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 188, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_7 = PyObject_GetItem(__pyx_t_4, __pyx_n_u_url); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 188, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyNumber_Add(__pyx_kp_u_kapok_uavsar_load_URL, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 188, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 188, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4);
  __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 188, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "kapok/uavsarc.pyx":190
 *     print('kapok.uavsar.load | URL: '+f.attrs['url'])
 * 
 *     print('kapok.uavsar.load | Importing metadata. ('+time.ctime()+')')             # <<<<<<<<<<<<<<
 * 
 *     f.attrs['average_altitude'] = ann.query('Average Altitude')
 */
  __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_time); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 190, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_ctime); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 190, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __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);
    }
  }
  if (__pyx_t_7) {
    __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 190, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  } else {
    __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 190, __pyx_L1_error)
  }
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = PyNumber_Add(__pyx_kp_u_kapok_uavsar_load_Importing_meta, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 190, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyNumber_Add(__pyx_t_6, __pyx_kp_u__16); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 190, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 190, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4);
  __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 190, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "kapok/uavsarc.pyx":192
 *     print('kapok.uavsar.load | Importing metadata. ('+time.ctime()+')')
 * 
 *     f.attrs['average_altitude'] = ann.query('Average Altitude')             # <<<<<<<<<<<<<<
 *     f.attrs['image_starting_slant_range'] = ann.query('Image Starting Slant Range')*1000
 *     f.attrs['slc_azimuth_pixel_spacing'] = ann.query('1x1 SLC Azimuth Pixel Spacing')
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_ann, __pyx_n_s_query); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 192, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 192, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_attrs); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 192, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (unlikely(PyObject_SetItem(__pyx_t_4, __pyx_n_u_average_altitude, __pyx_t_6) < 0)) __PYX_ERR(0, 192, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "kapok/uavsarc.pyx":193
 * 
 *     f.attrs['average_altitude'] = ann.query('Average Altitude')
 *     f.attrs['image_starting_slant_range'] = ann.query('Image Starting Slant Range')*1000             # <<<<<<<<<<<<<<
 *     f.attrs['slc_azimuth_pixel_spacing'] = ann.query('1x1 SLC Azimuth Pixel Spacing')
 *     f.attrs['slc_slant_range_pixel_spacing'] = ann.query('1x1 SLC Range Pixel Spacing')
 */
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_ann, __pyx_n_s_query); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 193, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 193, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = PyNumber_Multiply(__pyx_t_4, __pyx_int_1000); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 193, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_attrs); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 193, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (unlikely(PyObject_SetItem(__pyx_t_4, __pyx_n_u_image_starting_slant_range, __pyx_t_6) < 0)) __PYX_ERR(0, 193, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "kapok/uavsarc.pyx":194
 *     f.attrs['average_altitude'] = ann.query('Average Altitude')
 *     f.attrs['image_starting_slant_range'] = ann.query('Image Starting Slant Range')*1000
 *     f.attrs['slc_azimuth_pixel_spacing'] = ann.query('1x1 SLC Azimuth Pixel Spacing')             # <<<<<<<<<<<<<<
 *     f.attrs['slc_slant_range_pixel_spacing'] = ann.query('1x1 SLC Range Pixel Spacing')
 *     f.attrs['cov_azimuth_pixel_spacing'] = ann.query('1x1 SLC Azimuth Pixel Spacing') * mlwin[0]
 */
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_ann, __pyx_n_s_query); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 194, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 194, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_attrs); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 194, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (unlikely(PyObject_SetItem(__pyx_t_6, __pyx_n_u_slc_azimuth_pixel_spacing, __pyx_t_4) < 0)) __PYX_ERR(0, 194, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "kapok/uavsarc.pyx":195
 *     f.attrs['image_starting_slant_range'] = ann.query('Image Starting Slant Range')*1000
 *     f.attrs['slc_azimuth_pixel_spacing'] = ann.query('1x1 SLC Azimuth Pixel Spacing')
 *     f.attrs['slc_slant_range_pixel_spacing'] = ann.query('1x1 SLC Range Pixel Spacing')             # <<<<<<<<<<<<<<
 *     f.attrs['cov_azimuth_pixel_spacing'] = ann.query('1x1 SLC Azimuth Pixel Spacing') * mlwin[0]
 *     f.attrs['cov_slant_range_pixel_spacing'] = ann.query('1x1 SLC Range Pixel Spacing') * mlwin[1]
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_ann, __pyx_n_s_query); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 195, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 195, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_attrs); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 195, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (unlikely(PyObject_SetItem(__pyx_t_4, __pyx_n_u_slc_slant_range_pixel_spacing, __pyx_t_6) < 0)) __PYX_ERR(0, 195, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "kapok/uavsarc.pyx":196
 *     f.attrs['slc_azimuth_pixel_spacing'] = ann.query('1x1 SLC Azimuth Pixel Spacing')
 *     f.attrs['slc_slant_range_pixel_spacing'] = ann.query('1x1 SLC Range Pixel Spacing')
 *     f.attrs['cov_azimuth_pixel_spacing'] = ann.query('1x1 SLC Azimuth Pixel Spacing') * mlwin[0]             # <<<<<<<<<<<<<<
 *     f.attrs['cov_slant_range_pixel_spacing'] = ann.query('1x1 SLC Range Pixel Spacing') * mlwin[1]
 * 
 */
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_ann, __pyx_n_s_query); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 196, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 196, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_mlwin, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 196, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = PyNumber_Multiply(__pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 196, __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 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_attrs); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 196, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (unlikely(PyObject_SetItem(__pyx_t_6, __pyx_n_u_cov_azimuth_pixel_spacing, __pyx_t_7) < 0)) __PYX_ERR(0, 196, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "kapok/uavsarc.pyx":197
 *     f.attrs['slc_slant_range_pixel_spacing'] = ann.query('1x1 SLC Range Pixel Spacing')
 *     f.attrs['cov_azimuth_pixel_spacing'] = ann.query('1x1 SLC Azimuth Pixel Spacing') * mlwin[0]
 *     f.attrs['cov_slant_range_pixel_spacing'] = ann.query('1x1 SLC Range Pixel Spacing') * mlwin[1]             # <<<<<<<<<<<<<<
 * 
 *     f.attrs['num_tracks'] = num_tracks
 */
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_ann, __pyx_n_s_query); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 197, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_tuple__22, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 197, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_mlwin, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 197, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_4 = PyNumber_Multiply(__pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 197, __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_f, __pyx_n_s_attrs); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 197, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (unlikely(PyObject_SetItem(__pyx_t_7, __pyx_n_u_cov_slant_range_pixel_spacing, __pyx_t_4) < 0)) __PYX_ERR(0, 197, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "kapok/uavsarc.pyx":199
 *     f.attrs['cov_slant_range_pixel_spacing'] = ann.query('1x1 SLC Range Pixel Spacing') * mlwin[1]
 * 
 *     f.attrs['num_tracks'] = num_tracks             # <<<<<<<<<<<<<<
 *     f.attrs['num_baselines'] = num_bl
 *     f.attrs['tracks'] = np.array(tracknames,dtype='S')
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_attrs); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 199, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (unlikely(PyObject_SetItem(__pyx_t_4, __pyx_n_u_num_tracks, __pyx_v_num_tracks) < 0)) __PYX_ERR(0, 199, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "kapok/uavsarc.pyx":200
 * 
 *     f.attrs['num_tracks'] = num_tracks
 *     f.attrs['num_baselines'] = num_bl             # <<<<<<<<<<<<<<
 *     f.attrs['tracks'] = np.array(tracknames,dtype='S')
 * 
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_attrs); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 200, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (unlikely(PyObject_SetItem(__pyx_t_4, __pyx_n_u_num_baselines, __pyx_v_num_bl) < 0)) __PYX_ERR(0, 200, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "kapok/uavsarc.pyx":201
 *     f.attrs['num_tracks'] = num_tracks
 *     f.attrs['num_baselines'] = num_bl
 *     f.attrs['tracks'] = np.array(tracknames,dtype='S')             # <<<<<<<<<<<<<<
 * 
 *     f.attrs['compression'] = compression
 */
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 201, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_array); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 201, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 201, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF(__pyx_v_tracknames);
  __Pyx_GIVEREF(__pyx_v_tracknames);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_tracknames);
  __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 201, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_n_u_S) < 0) __PYX_ERR(0, 201, __pyx_L1_error)
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 201, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_attrs); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 201, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (unlikely(PyObject_SetItem(__pyx_t_6, __pyx_n_u_tracks, __pyx_t_5) < 0)) __PYX_ERR(0, 201, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "kapok/uavsarc.pyx":203
 *     f.attrs['tracks'] = np.array(tracknames,dtype='S')
 * 
 *     f.attrs['compression'] = compression             # <<<<<<<<<<<<<<
 *     f.attrs['compression_opts'] = compression_opts
 * 
 */
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_attrs); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 203, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (unlikely(PyObject_SetItem(__pyx_t_5, __pyx_n_u_compression, __pyx_v_compression) < 0)) __PYX_ERR(0, 203, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "kapok/uavsarc.pyx":204
 * 
 *     f.attrs['compression'] = compression
 *     f.attrs['compression_opts'] = compression_opts             # <<<<<<<<<<<<<<
 * 
 *     # Get SCH Peg from Annotation File
 */
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_attrs); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 204, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (unlikely(PyObject_SetItem(__pyx_t_5, __pyx_n_u_compression_opts, __pyx_v_compression_opts) < 0)) __PYX_ERR(0, 204, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "kapok/uavsarc.pyx":207
 * 
 *     # Get SCH Peg from Annotation File
 *     peglat = ann.query('Peg Latitude')             # <<<<<<<<<<<<<<
 *     peglon = ann.query('Peg Longitude')
 *     peghdg = ann.query('Peg Heading')
 */
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_ann, __pyx_n_s_query); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 207, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__23, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 207, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_v_peglat = __pyx_t_6;
  __pyx_t_6 = 0;

  /* "kapok/uavsarc.pyx":208
 *     # Get SCH Peg from Annotation File
 *     peglat = ann.query('Peg Latitude')
 *     peglon = ann.query('Peg Longitude')             # <<<<<<<<<<<<<<
 *     peghdg = ann.query('Peg Heading')
 *     f.attrs['peg_latitude'] = peglat
 */
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_ann, __pyx_n_s_query); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 208, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__24, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 208, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_v_peglon = __pyx_t_5;
  __pyx_t_5 = 0;

  /* "kapok/uavsarc.pyx":209
 *     peglat = ann.query('Peg Latitude')
 *     peglon = ann.query('Peg Longitude')
 *     peghdg = ann.query('Peg Heading')             # <<<<<<<<<<<<<<
 *     f.attrs['peg_latitude'] = peglat
 *     f.attrs['peg_longitude'] = peglon
 */
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_ann, __pyx_n_s_query); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 209, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__25, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 209, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_v_peghdg = __pyx_t_6;
  __pyx_t_6 = 0;

  /* "kapok/uavsarc.pyx":210
 *     peglon = ann.query('Peg Longitude')
 *     peghdg = ann.query('Peg Heading')
 *     f.attrs['peg_latitude'] = peglat             # <<<<<<<<<<<<<<
 *     f.attrs['peg_longitude'] = peglon
 *     f.attrs['peg_heading'] = peghdg
 */
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_attrs); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 210, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (unlikely(PyObject_SetItem(__pyx_t_6, __pyx_n_u_peg_latitude, __pyx_v_peglat) < 0)) __PYX_ERR(0, 210, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "kapok/uavsarc.pyx":211
 *     peghdg = ann.query('Peg Heading')
 *     f.attrs['peg_latitude'] = peglat
 *     f.attrs['peg_longitude'] = peglon             # <<<<<<<<<<<<<<
 *     f.attrs['peg_heading'] = peghdg
 * 
 */
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_attrs); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 211, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (unlikely(PyObject_SetItem(__pyx_t_6, __pyx_n_u_peg_longitude, __pyx_v_peglon) < 0)) __PYX_ERR(0, 211, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "kapok/uavsarc.pyx":212
 *     f.attrs['peg_latitude'] = peglat
 *     f.attrs['peg_longitude'] = peglon
 *     f.attrs['peg_heading'] = peghdg             # <<<<<<<<<<<<<<
 * 
 *     # Save in attributes as degrees, but convert to radians for coordinate transformation functions.
 */
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_attrs); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 212, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (unlikely(PyObject_SetItem(__pyx_t_6, __pyx_n_u_peg_heading, __pyx_v_peghdg) < 0)) __PYX_ERR(0, 212, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "kapok/uavsarc.pyx":215
 * 
 *     # Save in attributes as degrees, but convert to radians for coordinate transformation functions.
 *     peglat = np.radians(peglat)             # <<<<<<<<<<<<<<
 *     peglon = np.radians(peglon)
 *     peghdg = np.radians(peghdg)
 */
  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 215, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_radians); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 215, __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);
    }
  }
  if (!__pyx_t_5) {
    __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_peglat); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 215, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
  } else {
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_4)) {
      PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_v_peglat};
      __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 215, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_GOTREF(__pyx_t_6);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
      PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_v_peglat};
      __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 215, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_GOTREF(__pyx_t_6);
    } else
    #endif
    {
      __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 215, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
      __Pyx_INCREF(__pyx_v_peglat);
      __Pyx_GIVEREF(__pyx_v_peglat);
      PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_v_peglat);
      __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 215, __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;
  __Pyx_DECREF_SET(__pyx_v_peglat, __pyx_t_6);
  __pyx_t_6 = 0;

  /* "kapok/uavsarc.pyx":216
 *     # Save in attributes as degrees, but convert to radians for coordinate transformation functions.
 *     peglat = np.radians(peglat)
 *     peglon = np.radians(peglon)             # <<<<<<<<<<<<<<
 *     peghdg = np.radians(peghdg)
 * 
 */
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 216, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_radians); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 216, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_7);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_7, function);
    }
  }
  if (!__pyx_t_4) {
    __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_peglon); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 216, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
  } else {
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_7)) {
      PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_peglon};
      __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 216, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_GOTREF(__pyx_t_6);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
      PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_peglon};
      __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 216, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_GOTREF(__pyx_t_6);
    } else
    #endif
    {
      __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 216, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
      __Pyx_INCREF(__pyx_v_peglon);
      __Pyx_GIVEREF(__pyx_v_peglon);
      PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_peglon);
      __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 216, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF_SET(__pyx_v_peglon, __pyx_t_6);
  __pyx_t_6 = 0;

  /* "kapok/uavsarc.pyx":217
 *     peglat = np.radians(peglat)
 *     peglon = np.radians(peglon)
 *     peghdg = np.radians(peghdg)             # <<<<<<<<<<<<<<
 * 
 *     if (azbounds is not None) or (rngbounds is not None):
 */
  __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 217, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_radians); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 217, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __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);
    }
  }
  if (!__pyx_t_7) {
    __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_peghdg); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 217, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
  } else {
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_5)) {
      PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_peghdg};
      __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 217, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_GOTREF(__pyx_t_6);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
      PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_peghdg};
      __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 217, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_GOTREF(__pyx_t_6);
    } else
    #endif
    {
      __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 217, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_7); __pyx_t_7 = NULL;
      __Pyx_INCREF(__pyx_v_peghdg);
      __Pyx_GIVEREF(__pyx_v_peghdg);
      PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_peghdg);
      __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 217, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF_SET(__pyx_v_peghdg, __pyx_t_6);
  __pyx_t_6 = 0;

  /* "kapok/uavsarc.pyx":219
 *     peghdg = np.radians(peghdg)
 * 
 *     if (azbounds is not None) or (rngbounds is not None):             # <<<<<<<<<<<<<<
 *         f.attrs['subset'] = True
 *     else:
 */
  __pyx_t_8 = (__pyx_v_azbounds != Py_None);
  __pyx_t_16 = (__pyx_t_8 != 0);
  if (!__pyx_t_16) {
  } else {
    __pyx_t_13 = __pyx_t_16;
    goto __pyx_L42_bool_binop_done;
  }
  __pyx_t_16 = (__pyx_v_rngbounds != Py_None);
  __pyx_t_8 = (__pyx_t_16 != 0);
  __pyx_t_13 = __pyx_t_8;
  __pyx_L42_bool_binop_done:;
  if (__pyx_t_13) {

    /* "kapok/uavsarc.pyx":220
 * 
 *     if (azbounds is not None) or (rngbounds is not None):
 *         f.attrs['subset'] = True             # <<<<<<<<<<<<<<
 *     else:
 *         f.attrs['subset'] = False
 */
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_attrs); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 220, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (unlikely(PyObject_SetItem(__pyx_t_6, __pyx_n_u_subset, Py_True) < 0)) __PYX_ERR(0, 220, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "kapok/uavsarc.pyx":219
 *     peghdg = np.radians(peghdg)
 * 
 *     if (azbounds is not None) or (rngbounds is not None):             # <<<<<<<<<<<<<<
 *         f.attrs['subset'] = True
 *     else:
 */
    goto __pyx_L41;
  }

  /* "kapok/uavsarc.pyx":222
 *         f.attrs['subset'] = True
 *     else:
 *         f.attrs['subset'] = False             # <<<<<<<<<<<<<<
 * 
 * 
 */
  /*else*/ {
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_attrs); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 222, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (unlikely(PyObject_SetItem(__pyx_t_6, __pyx_n_u_subset, Py_False) < 0)) __PYX_ERR(0, 222, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
  __pyx_L41:;

  /* "kapok/uavsarc.pyx":226
 * 
 *     # Check azimuth bounds for validity.
 *     if azbounds is None:             # <<<<<<<<<<<<<<
 *         azbounds = [0,np.sum(azsize_slc)]
 * 
 */
  __pyx_t_13 = (__pyx_v_azbounds == Py_None);
  __pyx_t_8 = (__pyx_t_13 != 0);
  if (__pyx_t_8) {

    /* "kapok/uavsarc.pyx":227
 *     # Check azimuth bounds for validity.
 *     if azbounds is None:
 *         azbounds = [0,np.sum(azsize_slc)]             # <<<<<<<<<<<<<<
 * 
 *     if azbounds[1] <= azbounds[0]:
 */
    __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 227, __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, 227, __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);
      }
    }
    if (!__pyx_t_5) {
      __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_azsize_slc); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 227, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
    } else {
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_4)) {
        PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_v_azsize_slc};
        __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 227, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_6);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
        PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_v_azsize_slc};
        __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 227, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_6);
      } else
      #endif
      {
        __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 227, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
        __Pyx_INCREF(__pyx_v_azsize_slc);
        __Pyx_GIVEREF(__pyx_v_azsize_slc);
        PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_v_azsize_slc);
        __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 227, __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;
    __pyx_t_4 = PyList_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 227, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_int_0);
    __Pyx_GIVEREF(__pyx_int_0);
    PyList_SET_ITEM(__pyx_t_4, 0, __pyx_int_0);
    __Pyx_GIVEREF(__pyx_t_6);
    PyList_SET_ITEM(__pyx_t_4, 1, __pyx_t_6);
    __pyx_t_6 = 0;
    __Pyx_DECREF_SET(__pyx_v_azbounds, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "kapok/uavsarc.pyx":226
 * 
 *     # Check azimuth bounds for validity.
 *     if azbounds is None:             # <<<<<<<<<<<<<<
 *         azbounds = [0,np.sum(azsize_slc)]
 * 
 */
  }

  /* "kapok/uavsarc.pyx":229
 *         azbounds = [0,np.sum(azsize_slc)]
 * 
 *     if azbounds[1] <= azbounds[0]:             # <<<<<<<<<<<<<<
 *         print('kapok.uavsar.load | Invalid azimuth bounds.  Must be ascending.  Aborting.')
 *         return
 */
  __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_azbounds, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 229, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_azbounds, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 229, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = PyObject_RichCompare(__pyx_t_4, __pyx_t_6, Py_LE); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 229, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 229, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (__pyx_t_8) {

    /* "kapok/uavsarc.pyx":230
 * 
 *     if azbounds[1] <= azbounds[0]:
 *         print('kapok.uavsar.load | Invalid azimuth bounds.  Must be ascending.  Aborting.')             # <<<<<<<<<<<<<<
 *         return
 * 
 */
    __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_tuple__26, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 230, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

    /* "kapok/uavsarc.pyx":231
 *     if azbounds[1] <= azbounds[0]:
 *         print('kapok.uavsar.load | Invalid azimuth bounds.  Must be ascending.  Aborting.')
 *         return             # <<<<<<<<<<<<<<
 * 
 *     if azbounds[0] < 0:
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "kapok/uavsarc.pyx":229
 *         azbounds = [0,np.sum(azsize_slc)]
 * 
 *     if azbounds[1] <= azbounds[0]:             # <<<<<<<<<<<<<<
 *         print('kapok.uavsar.load | Invalid azimuth bounds.  Must be ascending.  Aborting.')
 *         return
 */
  }

  /* "kapok/uavsarc.pyx":233
 *         return
 * 
 *     if azbounds[0] < 0:             # <<<<<<<<<<<<<<
 *         print('kapok.uavsar.load | Lower azimuth bound ('+str(azbounds[0])+') is less than zero.  Setting lower azimuth bound to zero.')
 *         azbounds[0] = 0
 */
  __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_azbounds, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 233, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_6 = PyObject_RichCompare(__pyx_t_7, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 233, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 233, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (__pyx_t_8) {

    /* "kapok/uavsarc.pyx":234
 * 
 *     if azbounds[0] < 0:
 *         print('kapok.uavsar.load | Lower azimuth bound ('+str(azbounds[0])+') is less than zero.  Setting lower azimuth bound to zero.')             # <<<<<<<<<<<<<<
 *         azbounds[0] = 0
 * 
 */
    __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_azbounds, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 234, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 234, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6);
    __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyObject_Call(((PyObject *)(&PyUnicode_Type)), __pyx_t_7, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 234, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = __Pyx_PyUnicode_Concat(__pyx_kp_u_kapok_uavsar_load_Lower_azimuth, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 234, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyUnicode_Concat(__pyx_t_7, __pyx_kp_u_is_less_than_zero_Setting_lower); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 234, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 234, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6);
    __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_t_7, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 234, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "kapok/uavsarc.pyx":235
 *     if azbounds[0] < 0:
 *         print('kapok.uavsar.load | Lower azimuth bound ('+str(azbounds[0])+') is less than zero.  Setting lower azimuth bound to zero.')
 *         azbounds[0] = 0             # <<<<<<<<<<<<<<
 * 
 *     if azbounds[1] > np.sum(azsize_slc):
 */
    if (unlikely(__Pyx_SetItemInt(__pyx_v_azbounds, 0, __pyx_int_0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1) < 0)) __PYX_ERR(0, 235, __pyx_L1_error)

    /* "kapok/uavsarc.pyx":233
 *         return
 * 
 *     if azbounds[0] < 0:             # <<<<<<<<<<<<<<
 *         print('kapok.uavsar.load | Lower azimuth bound ('+str(azbounds[0])+') is less than zero.  Setting lower azimuth bound to zero.')
 *         azbounds[0] = 0
 */
  }

  /* "kapok/uavsarc.pyx":237
 *         azbounds[0] = 0
 * 
 *     if azbounds[1] > np.sum(azsize_slc):             # <<<<<<<<<<<<<<
 *         print('kapok.uavsar.load | Upper azimuth bound ('+str(azbounds[1])+') greater than number of SLC lines ('+str(azsize_slc)+').')
 *         print('kapok.uavsar.load | Setting upper azimuth bound to '+str(azsize_slc)+'.')
 */
  __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_azbounds, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 237, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 237, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_sum); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 237, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
    }
  }
  if (!__pyx_t_4) {
    __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_azsize_slc); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 237, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
  } else {
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_5)) {
      PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_azsize_slc};
      __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 237, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_GOTREF(__pyx_t_7);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
      PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_azsize_slc};
      __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 237, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_GOTREF(__pyx_t_7);
    } else
    #endif
    {
      __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 237, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_4); __pyx_t_4 = NULL;
      __Pyx_INCREF(__pyx_v_azsize_slc);
      __Pyx_GIVEREF(__pyx_v_azsize_slc);
      PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_v_azsize_slc);
      __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_12, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 237, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyObject_RichCompare(__pyx_t_6, __pyx_t_7, Py_GT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 237, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 237, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__pyx_t_8) {

    /* "kapok/uavsarc.pyx":238
 * 
 *     if azbounds[1] > np.sum(azsize_slc):
 *         print('kapok.uavsar.load | Upper azimuth bound ('+str(azbounds[1])+') greater than number of SLC lines ('+str(azsize_slc)+').')             # <<<<<<<<<<<<<<
 *         print('kapok.uavsar.load | Setting upper azimuth bound to '+str(azsize_slc)+'.')
 *         azbounds[1] = np.sum(azsize_slc)
 */
    __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_azbounds, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 238, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 238, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5);
    __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)(&PyUnicode_Type)), __pyx_t_7, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 238, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = __Pyx_PyUnicode_Concat(__pyx_kp_u_kapok_uavsar_load_Upper_azimuth, __pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 238, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyUnicode_Concat(__pyx_t_7, __pyx_kp_u_greater_than_number_of_SLC_line); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 238, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 238, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_INCREF(__pyx_v_azsize_slc);
    __Pyx_GIVEREF(__pyx_v_azsize_slc);
    PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_azsize_slc);
    __pyx_t_6 = __Pyx_PyObject_Call(((PyObject *)(&PyUnicode_Type)), __pyx_t_7, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 238, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = __Pyx_PyUnicode_Concat(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 238, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyUnicode_Concat(__pyx_t_7, __pyx_kp_u__27); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 238, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 238, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6);
    __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_t_7, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 238, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "kapok/uavsarc.pyx":239
 *     if azbounds[1] > np.sum(azsize_slc):
 *         print('kapok.uavsar.load | Upper azimuth bound ('+str(azbounds[1])+') greater than number of SLC lines ('+str(azsize_slc)+').')
 *         print('kapok.uavsar.load | Setting upper azimuth bound to '+str(azsize_slc)+'.')             # <<<<<<<<<<<<<<
 *         azbounds[1] = np.sum(azsize_slc)
 * 
 */
    __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 239, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_INCREF(__pyx_v_azsize_slc);
    __Pyx_GIVEREF(__pyx_v_azsize_slc);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_azsize_slc);
    __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)(&PyUnicode_Type)), __pyx_t_6, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 239, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyUnicode_Concat(__pyx_kp_u_kapok_uavsar_load_Setting_upper, __pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 239, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = __Pyx_PyUnicode_Concat(__pyx_t_6, __pyx_kp_u__28); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 239, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 239, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_7);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_7);
    __pyx_t_7 = 0;
    __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_t_6, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 239, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

    /* "kapok/uavsarc.pyx":240
 *         print('kapok.uavsar.load | Upper azimuth bound ('+str(azbounds[1])+') greater than number of SLC lines ('+str(azsize_slc)+').')
 *         print('kapok.uavsar.load | Setting upper azimuth bound to '+str(azsize_slc)+'.')
 *         azbounds[1] = np.sum(azsize_slc)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 240, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_sum); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 240, __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);
      }
    }
    if (!__pyx_t_6) {
      __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_azsize_slc); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 240, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
    } else {
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_5)) {
        PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_v_azsize_slc};
        __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 240, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_GOTREF(__pyx_t_7);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
        PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_v_azsize_slc};
        __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 240, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_GOTREF(__pyx_t_7);
      } else
      #endif
      {
        __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 240, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_6); __pyx_t_6 = NULL;
        __Pyx_INCREF(__pyx_v_azsize_slc);
        __Pyx_GIVEREF(__pyx_v_azsize_slc);
        PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_v_azsize_slc);
        __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_12, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 240, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      }
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(__Pyx_SetItemInt(__pyx_v_azbounds, 1, __pyx_t_7, long, 1, __Pyx_PyInt_From_long, 0, 0, 1) < 0)) __PYX_ERR(0, 240, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

    /* "kapok/uavsarc.pyx":237
 *         azbounds[0] = 0
 * 
 *     if azbounds[1] > np.sum(azsize_slc):             # <<<<<<<<<<<<<<
 *         print('kapok.uavsar.load | Upper azimuth bound ('+str(azbounds[1])+') greater than number of SLC lines ('+str(azsize_slc)+').')
 *         print('kapok.uavsar.load | Setting upper azimuth bound to '+str(azsize_slc)+'.')
 */
  }

  /* "kapok/uavsarc.pyx":244
 * 
 *     # Check range bounds for validity.
 *     if rngbounds is None:             # <<<<<<<<<<<<<<
 *         rngbounds = [0,rngsize_slc]
 * 
 */
  __pyx_t_8 = (__pyx_v_rngbounds == Py_None);
  __pyx_t_13 = (__pyx_t_8 != 0);
  if (__pyx_t_13) {

    /* "kapok/uavsarc.pyx":245
 *     # Check range bounds for validity.
 *     if rngbounds is None:
 *         rngbounds = [0,rngsize_slc]             # <<<<<<<<<<<<<<
 * 
 *     if rngbounds[1] <= rngbounds[0]:
 */
    __pyx_t_7 = PyList_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 245, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_INCREF(__pyx_int_0);
    __Pyx_GIVEREF(__pyx_int_0);
    PyList_SET_ITEM(__pyx_t_7, 0, __pyx_int_0);
    __Pyx_INCREF(__pyx_v_rngsize_slc);
    __Pyx_GIVEREF(__pyx_v_rngsize_slc);
    PyList_SET_ITEM(__pyx_t_7, 1, __pyx_v_rngsize_slc);
    __Pyx_DECREF_SET(__pyx_v_rngbounds, __pyx_t_7);
    __pyx_t_7 = 0;

    /* "kapok/uavsarc.pyx":244
 * 
 *     # Check range bounds for validity.
 *     if rngbounds is None:             # <<<<<<<<<<<<<<
 *         rngbounds = [0,rngsize_slc]
 * 
 */
  }

  /* "kapok/uavsarc.pyx":247
 *         rngbounds = [0,rngsize_slc]
 * 
 *     if rngbounds[1] <= rngbounds[0]:             # <<<<<<<<<<<<<<
 *         print('kapok.uavsar.load | Invalid range bounds.  Must be ascending.  Aborting.')
 *         return
 */
  __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_rngbounds, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 247, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_rngbounds, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 247, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_12 = PyObject_RichCompare(__pyx_t_7, __pyx_t_5, Py_LE); __Pyx_XGOTREF(__pyx_t_12); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 247, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_12); if (unlikely(__pyx_t_13 < 0)) __PYX_ERR(0, 247, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  if (__pyx_t_13) {

    /* "kapok/uavsarc.pyx":248
 * 
 *     if rngbounds[1] <= rngbounds[0]:
 *         print('kapok.uavsar.load | Invalid range bounds.  Must be ascending.  Aborting.')             # <<<<<<<<<<<<<<
 *         return
 * 
 */
    __pyx_t_12 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_tuple__29, NULL); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 248, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;

    /* "kapok/uavsarc.pyx":249
 *     if rngbounds[1] <= rngbounds[0]:
 *         print('kapok.uavsar.load | Invalid range bounds.  Must be ascending.  Aborting.')
 *         return             # <<<<<<<<<<<<<<
 * 
 *     if rngbounds[0] < 0:
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "kapok/uavsarc.pyx":247
 *         rngbounds = [0,rngsize_slc]
 * 
 *     if rngbounds[1] <= rngbounds[0]:             # <<<<<<<<<<<<<<
 *         print('kapok.uavsar.load | Invalid range bounds.  Must be ascending.  Aborting.')
 *         return
 */
  }

  /* "kapok/uavsarc.pyx":251
 *         return
 * 
 *     if rngbounds[0] < 0:             # <<<<<<<<<<<<<<
 *         print('kapok.uavsar.load | Lower range bound ('+str(rngbounds[0])+') is less than zero.  Setting lower azimuth bound to zero.')
 *         rngbounds[0] = 0
 */
  __pyx_t_12 = __Pyx_GetItemInt(__pyx_v_rngbounds, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 251, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_5 = PyObject_RichCompare(__pyx_t_12, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 251, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_13 < 0)) __PYX_ERR(0, 251, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__pyx_t_13) {

    /* "kapok/uavsarc.pyx":252
 * 
 *     if rngbounds[0] < 0:
 *         print('kapok.uavsar.load | Lower range bound ('+str(rngbounds[0])+') is less than zero.  Setting lower azimuth bound to zero.')             # <<<<<<<<<<<<<<
 *         rngbounds[0] = 0
 * 
 */
    __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_rngbounds, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 252, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_12 = PyTuple_New(1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 252, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_5);
    __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)(&PyUnicode_Type)), __pyx_t_12, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 252, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __pyx_t_12 = __Pyx_PyUnicode_Concat(__pyx_kp_u_kapok_uavsar_load_Lower_range_bo, __pyx_t_5); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 252, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyUnicode_Concat(__pyx_t_12, __pyx_kp_u_is_less_than_zero_Setting_lower); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 252, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __pyx_t_12 = PyTuple_New(1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 252, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_5);
    __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_t_12, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 252, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "kapok/uavsarc.pyx":253
 *     if rngbounds[0] < 0:
 *         print('kapok.uavsar.load | Lower range bound ('+str(rngbounds[0])+') is less than zero.  Setting lower azimuth bound to zero.')
 *         rngbounds[0] = 0             # <<<<<<<<<<<<<<
 * 
 *     if rngbounds[1] > rngsize_slc:
 */
    if (unlikely(__Pyx_SetItemInt(__pyx_v_rngbounds, 0, __pyx_int_0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1) < 0)) __PYX_ERR(0, 253, __pyx_L1_error)

    /* "kapok/uavsarc.pyx":251
 *         return
 * 
 *     if rngbounds[0] < 0:             # <<<<<<<<<<<<<<
 *         print('kapok.uavsar.load | Lower range bound ('+str(rngbounds[0])+') is less than zero.  Setting lower azimuth bound to zero.')
 *         rngbounds[0] = 0
 */
  }

  /* "kapok/uavsarc.pyx":255
 *         rngbounds[0] = 0
 * 
 *     if rngbounds[1] > rngsize_slc:             # <<<<<<<<<<<<<<
 *         print('kapok.uavsar.load | Upper range bound ('+str(rngbounds[1])+') greater than number of SLC columns ('+str(rngsize_slc)+').')
 *         print('kapok.uavsar.load | Setting upper range bound to '+str(rngsize_slc)+'.')
 */
  __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_rngbounds, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 255, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_12 = PyObject_RichCompare(__pyx_t_5, __pyx_v_rngsize_slc, Py_GT); __Pyx_XGOTREF(__pyx_t_12); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 255, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_12); if (unlikely(__pyx_t_13 < 0)) __PYX_ERR(0, 255, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  if (__pyx_t_13) {

    /* "kapok/uavsarc.pyx":256
 * 
 *     if rngbounds[1] > rngsize_slc:
 *         print('kapok.uavsar.load | Upper range bound ('+str(rngbounds[1])+') greater than number of SLC columns ('+str(rngsize_slc)+').')             # <<<<<<<<<<<<<<
 *         print('kapok.uavsar.load | Setting upper range bound to '+str(rngsize_slc)+'.')
 *         rngbounds[1] = rngsize_slc
 */
    __pyx_t_12 = __Pyx_GetItemInt(__pyx_v_rngbounds, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 256, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 256, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_12);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_12);
    __pyx_t_12 = 0;
    __pyx_t_12 = __Pyx_PyObject_Call(((PyObject *)(&PyUnicode_Type)), __pyx_t_5, NULL); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 256, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyUnicode_Concat(__pyx_kp_u_kapok_uavsar_load_Upper_range_bo, __pyx_t_12); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 256, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __pyx_t_12 = __Pyx_PyUnicode_Concat(__pyx_t_5, __pyx_kp_u_greater_than_number_of_SLC_colu); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 256, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 256, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_INCREF(__pyx_v_rngsize_slc);
    __Pyx_GIVEREF(__pyx_v_rngsize_slc);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_rngsize_slc);
    __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)(&PyUnicode_Type)), __pyx_t_5, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 256, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyUnicode_Concat(__pyx_t_12, __pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 256, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = __Pyx_PyUnicode_Concat(__pyx_t_5, __pyx_kp_u__27); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 256, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 256, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_7);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_7);
    __pyx_t_7 = 0;
    __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_t_5, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 256, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

    /* "kapok/uavsarc.pyx":257
 *     if rngbounds[1] > rngsize_slc:
 *         print('kapok.uavsar.load | Upper range bound ('+str(rngbounds[1])+') greater than number of SLC columns ('+str(rngsize_slc)+').')
 *         print('kapok.uavsar.load | Setting upper range bound to '+str(rngsize_slc)+'.')             # <<<<<<<<<<<<<<
 *         rngbounds[1] = rngsize_slc
 * 
 */
    __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 257, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_INCREF(__pyx_v_rngsize_slc);
    __Pyx_GIVEREF(__pyx_v_rngsize_slc);
    PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_rngsize_slc);
    __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)(&PyUnicode_Type)), __pyx_t_7, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 257, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = __Pyx_PyUnicode_Concat(__pyx_kp_u_kapok_uavsar_load_Setting_upper_2, __pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 257, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyUnicode_Concat(__pyx_t_7, __pyx_kp_u__28); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 257, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 257, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5);
    __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_t_7, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 257, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "kapok/uavsarc.pyx":258
 *         print('kapok.uavsar.load | Upper range bound ('+str(rngbounds[1])+') greater than number of SLC columns ('+str(rngsize_slc)+').')
 *         print('kapok.uavsar.load | Setting upper range bound to '+str(rngsize_slc)+'.')
 *         rngbounds[1] = rngsize_slc             # <<<<<<<<<<<<<<
 * 
 * 
 */
    if (unlikely(__Pyx_SetItemInt(__pyx_v_rngbounds, 1, __pyx_v_rngsize_slc, long, 1, __Pyx_PyInt_From_long, 0, 0, 1) < 0)) __PYX_ERR(0, 258, __pyx_L1_error)

    /* "kapok/uavsarc.pyx":255
 *         rngbounds[0] = 0
 * 
 *     if rngbounds[1] > rngsize_slc:             # <<<<<<<<<<<<<<
 *         print('kapok.uavsar.load | Upper range bound ('+str(rngbounds[1])+') greater than number of SLC columns ('+str(rngsize_slc)+').')
 *         print('kapok.uavsar.load | Setting upper range bound to '+str(rngsize_slc)+'.')
 */
  }

  /* "kapok/uavsarc.pyx":262
 * 
 *     # Multi-looked, subsetted, image dimensions:
 *     azsize = (azbounds[1]-azbounds[0]) // mlwin[0]             # <<<<<<<<<<<<<<
 *     rngsize = (rngbounds[1]-rngbounds[0]) // mlwin[1]
 *     f.attrs['dim'] = (azsize, rngsize)
 */
  __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_azbounds, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 262, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_azbounds, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 262, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_12 = PyNumber_Subtract(__pyx_t_5, __pyx_t_7); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 262, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_mlwin, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 262, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_5 = PyNumber_FloorDivide(__pyx_t_12, __pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 262, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_v_azsize = __pyx_t_5;
  __pyx_t_5 = 0;

  /* "kapok/uavsarc.pyx":263
 *     # Multi-looked, subsetted, image dimensions:
 *     azsize = (azbounds[1]-azbounds[0]) // mlwin[0]
 *     rngsize = (rngbounds[1]-rngbounds[0]) // mlwin[1]             # <<<<<<<<<<<<<<
 *     f.attrs['dim'] = (azsize, rngsize)
 *     f.attrs['dim_slc'] = (int(np.sum(azsize_slc)),rngsize_slc)
 */
  __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_rngbounds, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 263, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_rngbounds, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 263, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_12 = PyNumber_Subtract(__pyx_t_5, __pyx_t_7); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 263, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_mlwin, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 263, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_5 = PyNumber_FloorDivide(__pyx_t_12, __pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 263, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_v_rngsize = __pyx_t_5;
  __pyx_t_5 = 0;

  /* "kapok/uavsarc.pyx":264
 *     azsize = (azbounds[1]-azbounds[0]) // mlwin[0]
 *     rngsize = (rngbounds[1]-rngbounds[0]) // mlwin[1]
 *     f.attrs['dim'] = (azsize, rngsize)             # <<<<<<<<<<<<<<
 *     f.attrs['dim_slc'] = (int(np.sum(azsize_slc)),rngsize_slc)
 *     f.attrs['ml_window'] = mlwin
 */
  __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 264, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_INCREF(__pyx_v_azsize);
  __Pyx_GIVEREF(__pyx_v_azsize);
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_azsize);
  __Pyx_INCREF(__pyx_v_rngsize);
  __Pyx_GIVEREF(__pyx_v_rngsize);
  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_rngsize);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_attrs); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 264, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (unlikely(PyObject_SetItem(__pyx_t_7, __pyx_n_u_dim, __pyx_t_5) < 0)) __PYX_ERR(0, 264, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "kapok/uavsarc.pyx":265
 *     rngsize = (rngbounds[1]-rngbounds[0]) // mlwin[1]
 *     f.attrs['dim'] = (azsize, rngsize)
 *     f.attrs['dim_slc'] = (int(np.sum(azsize_slc)),rngsize_slc)             # <<<<<<<<<<<<<<
 *     f.attrs['ml_window'] = mlwin
 *     f.attrs['sm_window'] = smwin
 */
  __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 265, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_sum); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 265, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_12))) {
    __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_12);
    if (likely(__pyx_t_7)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_12, function);
    }
  }
  if (!__pyx_t_7) {
    __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_v_azsize_slc); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 265, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
  } else {
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_12)) {
      PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_azsize_slc};
      __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 265, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_GOTREF(__pyx_t_5);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) {
      PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_azsize_slc};
      __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 265, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_GOTREF(__pyx_t_5);
    } else
    #endif
    {
      __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 265, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_7); __pyx_t_7 = NULL;
      __Pyx_INCREF(__pyx_v_azsize_slc);
      __Pyx_GIVEREF(__pyx_v_azsize_slc);
      PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_azsize_slc);
      __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 265, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __pyx_t_12 = __Pyx_PyNumber_Int(__pyx_t_5); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 265, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 265, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_12);
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_12);
  __Pyx_INCREF(__pyx_v_rngsize_slc);
  __Pyx_GIVEREF(__pyx_v_rngsize_slc);
  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_rngsize_slc);
  __pyx_t_12 = 0;
  __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_attrs); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 265, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  if (unlikely(PyObject_SetItem(__pyx_t_12, __pyx_n_u_dim_slc, __pyx_t_5) < 0)) __PYX_ERR(0, 265, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "kapok/uavsarc.pyx":266
 *     f.attrs['dim'] = (azsize, rngsize)
 *     f.attrs['dim_slc'] = (int(np.sum(azsize_slc)),rngsize_slc)
 *     f.attrs['ml_window'] = mlwin             # <<<<<<<<<<<<<<
 *     f.attrs['sm_window'] = smwin
 *     f.attrs['azimuth_bounds_slc'] = azbounds
 */
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_attrs); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 266, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (unlikely(PyObject_SetItem(__pyx_t_5, __pyx_n_u_ml_window, __pyx_v_mlwin) < 0)) __PYX_ERR(0, 266, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "kapok/uavsarc.pyx":267
 *     f.attrs['dim_slc'] = (int(np.sum(azsize_slc)),rngsize_slc)
 *     f.attrs['ml_window'] = mlwin
 *     f.attrs['sm_window'] = smwin             # <<<<<<<<<<<<<<
 *     f.attrs['azimuth_bounds_slc'] = azbounds
 *     f.attrs['range_bounds_slc'] = rngbounds
 */
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_attrs); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 267, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (unlikely(PyObject_SetItem(__pyx_t_5, __pyx_n_u_sm_window, __pyx_v_smwin) < 0)) __PYX_ERR(0, 267, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "kapok/uavsarc.pyx":268
 *     f.attrs['ml_window'] = mlwin
 *     f.attrs['sm_window'] = smwin
 *     f.attrs['azimuth_bounds_slc'] = azbounds             # <<<<<<<<<<<<<<
 *     f.attrs['range_bounds_slc'] = rngbounds
 * 
 */
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_attrs); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 268, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (unlikely(PyObject_SetItem(__pyx_t_5, __pyx_n_u_azimuth_bounds_slc, __pyx_v_azbounds) < 0)) __PYX_ERR(0, 268, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "kapok/uavsarc.pyx":269
 *     f.attrs['sm_window'] = smwin
 *     f.attrs['azimuth_bounds_slc'] = azbounds
 *     f.attrs['range_bounds_slc'] = rngbounds             # <<<<<<<<<<<<<<
 * 
 *     # Path containing SLCs and other files (assume in same folder as .ann):
 */
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_attrs); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 269, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (unlikely(PyObject_SetItem(__pyx_t_5, __pyx_n_u_range_bounds_slc, __pyx_v_rngbounds) < 0)) __PYX_ERR(0, 269, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "kapok/uavsarc.pyx":272
 * 
 *     # Path containing SLCs and other files (assume in same folder as .ann):
 *     datapath = os.path.dirname(infile)             # <<<<<<<<<<<<<<
 *     if datapath != '':
 *         datapath = datapath + '/'
 */
  __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 272, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_path); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 272, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_dirname); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 272, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_12);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_12, function);
    }
  }
  if (!__pyx_t_6) {
    __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_v_infile); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 272, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
  } else {
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_12)) {
      PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_v_infile};
      __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 272, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_GOTREF(__pyx_t_5);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) {
      PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_v_infile};
      __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 272, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_GOTREF(__pyx_t_5);
    } else
    #endif
    {
      __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 272, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL;
      __Pyx_INCREF(__pyx_v_infile);
      __Pyx_GIVEREF(__pyx_v_infile);
      PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_v_infile);
      __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_7, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 272, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __pyx_v_datapath = __pyx_t_5;
  __pyx_t_5 = 0;

  /* "kapok/uavsarc.pyx":273
 *     # Path containing SLCs and other files (assume in same folder as .ann):
 *     datapath = os.path.dirname(infile)
 *     if datapath != '':             # <<<<<<<<<<<<<<
 *         datapath = datapath + '/'
 * 
 */
  __pyx_t_13 = (__Pyx_PyUnicode_Equals(__pyx_v_datapath, __pyx_kp_u__30, Py_NE)); if (unlikely(__pyx_t_13 < 0)) __PYX_ERR(0, 273, __pyx_L1_error)
  if (__pyx_t_13) {

    /* "kapok/uavsarc.pyx":274
 *     datapath = os.path.dirname(infile)
 *     if datapath != '':
 *         datapath = datapath + '/'             # <<<<<<<<<<<<<<
 * 
 *     # Get filenames of SLCs for each track, in polarization order HH, HV, VV.
 */
    __pyx_t_5 = PyNumber_Add(__pyx_v_datapath, __pyx_kp_u__31); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 274, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF_SET(__pyx_v_datapath, __pyx_t_5);
    __pyx_t_5 = 0;

    /* "kapok/uavsarc.pyx":273
 *     # Path containing SLCs and other files (assume in same folder as .ann):
 *     datapath = os.path.dirname(infile)
 *     if datapath != '':             # <<<<<<<<<<<<<<
 *         datapath = datapath + '/'
 * 
 */
  }

  /* "kapok/uavsarc.pyx":277
 * 
 *     # Get filenames of SLCs for each track, in polarization order HH, HV, VV.
 *     slcfiles = []             # <<<<<<<<<<<<<<
 *     for seg in range(num_segments):
 *         for tr in range(num_tracks):
 */
  __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 277, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_v_slcfiles = ((PyObject*)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "kapok/uavsarc.pyx":278
 *     # Get filenames of SLCs for each track, in polarization order HH, HV, VV.
 *     slcfiles = []
 *     for seg in range(num_segments):             # <<<<<<<<<<<<<<
 *         for tr in range(num_tracks):
 *             for pol in ['HH','HV','VV']:
 */
  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 278, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_INCREF(__pyx_v_num_segments);
  __Pyx_GIVEREF(__pyx_v_num_segments);
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_num_segments);
  __pyx_t_12 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_5, NULL); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 278, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (likely(PyList_CheckExact(__pyx_t_12)) || PyTuple_CheckExact(__pyx_t_12)) {
    __pyx_t_5 = __pyx_t_12; __Pyx_INCREF(__pyx_t_5); __pyx_t_15 = 0;
    __pyx_t_17 = NULL;
  } else {
    __pyx_t_15 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_12); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 278, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_17 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 278, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  for (;;) {
    if (likely(!__pyx_t_17)) {
      if (likely(PyList_CheckExact(__pyx_t_5))) {
        if (__pyx_t_15 >= PyList_GET_SIZE(__pyx_t_5)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_12 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_15); __Pyx_INCREF(__pyx_t_12); __pyx_t_15++; if (unlikely(0 < 0)) __PYX_ERR(0, 278, __pyx_L1_error)
        #else
        __pyx_t_12 = PySequence_ITEM(__pyx_t_5, __pyx_t_15); __pyx_t_15++; if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 278, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        #endif
      } else {
        if (__pyx_t_15 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_12 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_15); __Pyx_INCREF(__pyx_t_12); __pyx_t_15++; if (unlikely(0 < 0)) __PYX_ERR(0, 278, __pyx_L1_error)
        #else
        __pyx_t_12 = PySequence_ITEM(__pyx_t_5, __pyx_t_15); __pyx_t_15++; if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 278, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        #endif
      }
    } else {
      __pyx_t_12 = __pyx_t_17(__pyx_t_5);
      if (unlikely(!__pyx_t_12)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 278, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_12);
    }
    __Pyx_XDECREF_SET(__pyx_v_seg, __pyx_t_12);
    __pyx_t_12 = 0;

    /* "kapok/uavsarc.pyx":279
 *     slcfiles = []
 *     for seg in range(num_segments):
 *         for tr in range(num_tracks):             # <<<<<<<<<<<<<<
 *             for pol in ['HH','HV','VV']:
 *                 file = glob(datapath+tracknames[tr]+'*'+pol+'_*_s'+str(seg+1)+'_1x1.slc')
 */
    __pyx_t_10 = __Pyx_PyInt_As_long(__pyx_v_num_tracks); if (unlikely((__pyx_t_10 == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 279, __pyx_L1_error)
    for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) {
      __pyx_v_tr = __pyx_t_11;

      /* "kapok/uavsarc.pyx":280
 *     for seg in range(num_segments):
 *         for tr in range(num_tracks):
 *             for pol in ['HH','HV','VV']:             # <<<<<<<<<<<<<<
 *                 file = glob(datapath+tracknames[tr]+'*'+pol+'_*_s'+str(seg+1)+'_1x1.slc')
 * 
 */
      __pyx_t_12 = __pyx_tuple__32; __Pyx_INCREF(__pyx_t_12); __pyx_t_18 = 0;
      for (;;) {
        if (__pyx_t_18 >= 3) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_12, __pyx_t_18); __Pyx_INCREF(__pyx_t_7); __pyx_t_18++; if (unlikely(0 < 0)) __PYX_ERR(0, 280, __pyx_L1_error)
        #else
        __pyx_t_7 = PySequence_ITEM(__pyx_t_12, __pyx_t_18); __pyx_t_18++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 280, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        #endif
        __Pyx_XDECREF_SET(__pyx_v_pol, ((PyObject*)__pyx_t_7));
        __pyx_t_7 = 0;

        /* "kapok/uavsarc.pyx":281
 *         for tr in range(num_tracks):
 *             for pol in ['HH','HV','VV']:
 *                 file = glob(datapath+tracknames[tr]+'*'+pol+'_*_s'+str(seg+1)+'_1x1.slc')             # <<<<<<<<<<<<<<
 * 
 *                 if len(file) == 1:
 */
        __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_glob); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 281, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_tracknames, __pyx_v_tr, unsigned int, 0, __Pyx_PyInt_From_unsigned_int, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 281, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_19 = PyNumber_Add(__pyx_v_datapath, __pyx_t_4); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 281, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_19);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_4 = PyNumber_Add(__pyx_t_19, __pyx_kp_u__33); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 281, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
        __pyx_t_19 = PyNumber_Add(__pyx_t_4, __pyx_v_pol); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 281, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_19);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_4 = PyNumber_Add(__pyx_t_19, __pyx_kp_u_s); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 281, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
        __pyx_t_19 = __Pyx_PyInt_AddObjC(__pyx_v_seg, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 281, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_19);
        __pyx_t_20 = PyTuple_New(1); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 281, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_20);
        __Pyx_GIVEREF(__pyx_t_19);
        PyTuple_SET_ITEM(__pyx_t_20, 0, __pyx_t_19);
        __pyx_t_19 = 0;
        __pyx_t_19 = __Pyx_PyObject_Call(((PyObject *)(&PyUnicode_Type)), __pyx_t_20, NULL); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 281, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_19);
        __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
        __pyx_t_20 = PyNumber_Add(__pyx_t_4, __pyx_t_19); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 281, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_20);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
        __pyx_t_19 = PyNumber_Add(__pyx_t_20, __pyx_kp_u_1x1_slc); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 281, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_19);
        __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
        __pyx_t_20 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_20 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_20)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_20);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
          }
        }
        if (!__pyx_t_20) {
          __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_19); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 281, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
          __Pyx_GOTREF(__pyx_t_7);
        } else {
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_20, __pyx_t_19};
            __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 281, __pyx_L1_error)
            __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0;
            __Pyx_GOTREF(__pyx_t_7);
            __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_20, __pyx_t_19};
            __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 281, __pyx_L1_error)
            __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0;
            __Pyx_GOTREF(__pyx_t_7);
            __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
          } else
          #endif
          {
            __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 281, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_GIVEREF(__pyx_t_20); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_20); __pyx_t_20 = NULL;
            __Pyx_GIVEREF(__pyx_t_19);
            PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_t_19);
            __pyx_t_19 = 0;
            __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_4, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 281, __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_XDECREF_SET(__pyx_v_file, __pyx_t_7);
        __pyx_t_7 = 0;

        /* "kapok/uavsarc.pyx":283
 *                 file = glob(datapath+tracknames[tr]+'*'+pol+'_*_s'+str(seg+1)+'_1x1.slc')
 * 
 *                 if len(file) == 1:             # <<<<<<<<<<<<<<
 *                     slcfiles.append(file[0])
 *                 elif len(file) > 1:
 */
        __pyx_t_21 = PyObject_Length(__pyx_v_file); if (unlikely(__pyx_t_21 == -1)) __PYX_ERR(0, 283, __pyx_L1_error)
        __pyx_t_13 = ((__pyx_t_21 == 1) != 0);
        if (__pyx_t_13) {

          /* "kapok/uavsarc.pyx":284
 * 
 *                 if len(file) == 1:
 *                     slcfiles.append(file[0])             # <<<<<<<<<<<<<<
 *                 elif len(file) > 1:
 *                     print('kapok.uavsar.load | Too many SLC files matching pattern: "'+datapath+tracknames[tr]+'*_'+pol+'_*_1x1.slc'+'".  Aborting.')
 */
          __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_file, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 284, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
          __pyx_t_14 = __Pyx_PyList_Append(__pyx_v_slcfiles, __pyx_t_7); if (unlikely(__pyx_t_14 == -1)) __PYX_ERR(0, 284, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

          /* "kapok/uavsarc.pyx":283
 *                 file = glob(datapath+tracknames[tr]+'*'+pol+'_*_s'+str(seg+1)+'_1x1.slc')
 * 
 *                 if len(file) == 1:             # <<<<<<<<<<<<<<
 *                     slcfiles.append(file[0])
 *                 elif len(file) > 1:
 */
          goto __pyx_L59;
        }

        /* "kapok/uavsarc.pyx":285
 *                 if len(file) == 1:
 *                     slcfiles.append(file[0])
 *                 elif len(file) > 1:             # <<<<<<<<<<<<<<
 *                     print('kapok.uavsar.load | Too many SLC files matching pattern: "'+datapath+tracknames[tr]+'*_'+pol+'_*_1x1.slc'+'".  Aborting.')
 *                     return
 */
        __pyx_t_21 = PyObject_Length(__pyx_v_file); if (unlikely(__pyx_t_21 == -1)) __PYX_ERR(0, 285, __pyx_L1_error)
        __pyx_t_13 = ((__pyx_t_21 > 1) != 0);
        if (__pyx_t_13) {

          /* "kapok/uavsarc.pyx":286
 *                     slcfiles.append(file[0])
 *                 elif len(file) > 1:
 *                     print('kapok.uavsar.load | Too many SLC files matching pattern: "'+datapath+tracknames[tr]+'*_'+pol+'_*_1x1.slc'+'".  Aborting.')             # <<<<<<<<<<<<<<
 *                     return
 *                 else:
 */
          __pyx_t_7 = PyNumber_Add(__pyx_kp_u_kapok_uavsar_load_Too_many_SLC_f, __pyx_v_datapath); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 286, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
          __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_tracknames, __pyx_v_tr, unsigned int, 0, __Pyx_PyInt_From_unsigned_int, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 286, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          __pyx_t_4 = PyNumber_Add(__pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 286, __pyx_L1_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_t_6 = PyNumber_Add(__pyx_t_4, __pyx_kp_u__34); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 286, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __pyx_t_4 = PyNumber_Add(__pyx_t_6, __pyx_v_pol); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 286, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          __pyx_t_6 = PyNumber_Add(__pyx_t_4, __pyx_kp_u_1x1_slc_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 286, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __pyx_t_4 = PyNumber_Add(__pyx_t_6, __pyx_kp_u_Aborting); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 286, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 286, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_GIVEREF(__pyx_t_4);
          PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4);
          __pyx_t_4 = 0;
          __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 286, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

          /* "kapok/uavsarc.pyx":287
 *                 elif len(file) > 1:
 *                     print('kapok.uavsar.load | Too many SLC files matching pattern: "'+datapath+tracknames[tr]+'*_'+pol+'_*_1x1.slc'+'".  Aborting.')
 *                     return             # <<<<<<<<<<<<<<
 *                 else:
 *                     print('kapok.uavsar.load | Cannot find SLC file matching pattern: "'+datapath+tracknames[tr]+'*_'+pol+'_*_1x1.slc'+'".  Aborting.')
 */
          __Pyx_XDECREF(__pyx_r);
          __pyx_r = Py_None; __Pyx_INCREF(Py_None);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          goto __pyx_L0;

          /* "kapok/uavsarc.pyx":285
 *                 if len(file) == 1:
 *                     slcfiles.append(file[0])
 *                 elif len(file) > 1:             # <<<<<<<<<<<<<<
 *                     print('kapok.uavsar.load | Too many SLC files matching pattern: "'+datapath+tracknames[tr]+'*_'+pol+'_*_1x1.slc'+'".  Aborting.')
 *                     return
 */
        }

        /* "kapok/uavsarc.pyx":289
 *                     return
 *                 else:
 *                     print('kapok.uavsar.load | Cannot find SLC file matching pattern: "'+datapath+tracknames[tr]+'*_'+pol+'_*_1x1.slc'+'".  Aborting.')             # <<<<<<<<<<<<<<
 *                     return
 * 
 */
        /*else*/ {
          __pyx_t_4 = PyNumber_Add(__pyx_kp_u_kapok_uavsar_load_Cannot_find_SL, __pyx_v_datapath); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 289, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_tracknames, __pyx_v_tr, unsigned int, 0, __Pyx_PyInt_From_unsigned_int, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 289, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          __pyx_t_7 = PyNumber_Add(__pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 289, __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_t_7, __pyx_kp_u__34); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 289, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __pyx_t_7 = PyNumber_Add(__pyx_t_6, __pyx_v_pol); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 289, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          __pyx_t_6 = PyNumber_Add(__pyx_t_7, __pyx_kp_u_1x1_slc_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 289, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __pyx_t_7 = PyNumber_Add(__pyx_t_6, __pyx_kp_u_Aborting); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 289, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 289, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_GIVEREF(__pyx_t_7);
          PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_7);
          __pyx_t_7 = 0;
          __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_t_6, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 289, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

          /* "kapok/uavsarc.pyx":290
 *                 else:
 *                     print('kapok.uavsar.load | Cannot find SLC file matching pattern: "'+datapath+tracknames[tr]+'*_'+pol+'_*_1x1.slc'+'".  Aborting.')
 *                     return             # <<<<<<<<<<<<<<
 * 
 * 
 */
          __Pyx_XDECREF(__pyx_r);
          __pyx_r = Py_None; __Pyx_INCREF(Py_None);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          goto __pyx_L0;
        }
        __pyx_L59:;

        /* "kapok/uavsarc.pyx":280
 *     for seg in range(num_segments):
 *         for tr in range(num_tracks):
 *             for pol in ['HH','HV','VV']:             # <<<<<<<<<<<<<<
 *                 file = glob(datapath+tracknames[tr]+'*'+pol+'_*_s'+str(seg+1)+'_1x1.slc')
 * 
 */
      }
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    }

    /* "kapok/uavsarc.pyx":278
 *     # Get filenames of SLCs for each track, in polarization order HH, HV, VV.
 *     slcfiles = []
 *     for seg in range(num_segments):             # <<<<<<<<<<<<<<
 *         for tr in range(num_tracks):
 *             for pol in ['HH','HV','VV']:
 */
  }
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "kapok/uavsarc.pyx":294
 * 
 *     # Initialize covariance matrix dataset in HDF5 file:
 *     cov = f.create_dataset('cov', (azsize, rngsize, num_cov_elements, num_cov_elements), dtype='complex64', compression=compression, shuffle=True, compression_opts=compression_opts)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_create_dataset); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 294, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_12 = PyTuple_New(4); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 294, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __Pyx_INCREF(__pyx_v_azsize);
  __Pyx_GIVEREF(__pyx_v_azsize);
  PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_v_azsize);
  __Pyx_INCREF(__pyx_v_rngsize);
  __Pyx_GIVEREF(__pyx_v_rngsize);
  PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_v_rngsize);
  __Pyx_INCREF(__pyx_v_num_cov_elements);
  __Pyx_GIVEREF(__pyx_v_num_cov_elements);
  PyTuple_SET_ITEM(__pyx_t_12, 2, __pyx_v_num_cov_elements);
  __Pyx_INCREF(__pyx_v_num_cov_elements);
  __Pyx_GIVEREF(__pyx_v_num_cov_elements);
  PyTuple_SET_ITEM(__pyx_t_12, 3, __pyx_v_num_cov_elements);
  __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 294, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_INCREF(__pyx_n_u_cov);
  __Pyx_GIVEREF(__pyx_n_u_cov);
  PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_n_u_cov);
  __Pyx_GIVEREF(__pyx_t_12);
  PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_12);
  __pyx_t_12 = 0;
  __pyx_t_12 = PyDict_New(); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 294, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_dtype, __pyx_n_u_complex64) < 0) __PYX_ERR(0, 294, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_compression, __pyx_v_compression) < 0) __PYX_ERR(0, 294, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_shuffle, Py_True) < 0) __PYX_ERR(0, 294, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_compression_opts, __pyx_v_compression_opts) < 0) __PYX_ERR(0, 294, __pyx_L1_error)
  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, __pyx_t_12); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 294, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __pyx_v_cov = __pyx_t_6;
  __pyx_t_6 = 0;

  /* "kapok/uavsarc.pyx":298
 * 
 *     # Calculate covariance matrix.
 *     az_vector = np.round(np.linspace(0, azsize, num=num_blocks+1)).astype('int')             # <<<<<<<<<<<<<<
 *     az_vector[num_blocks] = azsize
 * 
 */
  __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 298, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_round); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 298, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 298, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_linspace); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 298, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __pyx_t_12 = PyTuple_New(2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 298, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __Pyx_INCREF(__pyx_int_0);
  __Pyx_GIVEREF(__pyx_int_0);
  PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_int_0);
  __Pyx_INCREF(__pyx_v_azsize);
  __Pyx_GIVEREF(__pyx_v_azsize);
  PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_v_azsize);
  __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 298, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_19 = __Pyx_PyInt_AddObjC(__pyx_v_num_blocks, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 298, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_num, __pyx_t_19) < 0) __PYX_ERR(0, 298, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  __pyx_t_19 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_12, __pyx_t_4); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 298, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_7);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_7, function);
    }
  }
  if (!__pyx_t_4) {
    __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_19); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 298, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
    __Pyx_GOTREF(__pyx_t_6);
  } else {
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_7)) {
      PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_19};
      __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 298, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
      PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_19};
      __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 298, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
    } else
    #endif
    {
      __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 298, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_4); __pyx_t_4 = NULL;
      __Pyx_GIVEREF(__pyx_t_19);
      PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_19);
      __pyx_t_19 = 0;
      __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_12, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 298, __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 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_astype); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 298, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_tuple__35, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 298, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_v_az_vector = __pyx_t_6;
  __pyx_t_6 = 0;

  /* "kapok/uavsarc.pyx":299
 *     # Calculate covariance matrix.
 *     az_vector = np.round(np.linspace(0, azsize, num=num_blocks+1)).astype('int')
 *     az_vector[num_blocks] = azsize             # <<<<<<<<<<<<<<
 * 
 *     cdef unsigned int seg_start, seg_end, row, col
 */
  if (unlikely(PyObject_SetItem(__pyx_v_az_vector, __pyx_v_num_blocks, __pyx_v_azsize) < 0)) __PYX_ERR(0, 299, __pyx_L1_error)

  /* "kapok/uavsarc.pyx":304
 *     cdef unsigned long azstart, azend, azstart_slc, azend_slc, azoffset_start, azoffset_end
 * 
 *     for n, azstart in enumerate(az_vector[0:-1]):             # <<<<<<<<<<<<<<
 *         azend = az_vector[n+1]
 *         azstart_slc = azstart*mlwin[0] + azbounds[0]
 */
  __pyx_t_11 = 0;
  __pyx_t_6 = __Pyx_PyObject_GetSlice(__pyx_v_az_vector, 0, -1L, NULL, NULL, &__pyx_slice__36, 1, 1, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 304, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (likely(PyList_CheckExact(__pyx_t_6)) || PyTuple_CheckExact(__pyx_t_6)) {
    __pyx_t_7 = __pyx_t_6; __Pyx_INCREF(__pyx_t_7); __pyx_t_15 = 0;
    __pyx_t_17 = NULL;
  } else {
    __pyx_t_15 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 304, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_17 = Py_TYPE(__pyx_t_7)->tp_iternext; if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 304, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  for (;;) {
    if (likely(!__pyx_t_17)) {
      if (likely(PyList_CheckExact(__pyx_t_7))) {
        if (__pyx_t_15 >= PyList_GET_SIZE(__pyx_t_7)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_6 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_15); __Pyx_INCREF(__pyx_t_6); __pyx_t_15++; if (unlikely(0 < 0)) __PYX_ERR(0, 304, __pyx_L1_error)
        #else
        __pyx_t_6 = PySequence_ITEM(__pyx_t_7, __pyx_t_15); __pyx_t_15++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 304, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        #endif
      } else {
        if (__pyx_t_15 >= PyTuple_GET_SIZE(__pyx_t_7)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_15); __Pyx_INCREF(__pyx_t_6); __pyx_t_15++; if (unlikely(0 < 0)) __PYX_ERR(0, 304, __pyx_L1_error)
        #else
        __pyx_t_6 = PySequence_ITEM(__pyx_t_7, __pyx_t_15); __pyx_t_15++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 304, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        #endif
      }
    } else {
      __pyx_t_6 = __pyx_t_17(__pyx_t_7);
      if (unlikely(!__pyx_t_6)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 304, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_6);
    }
    __pyx_t_22 = __Pyx_PyInt_As_unsigned_long(__pyx_t_6); if (unlikely((__pyx_t_22 == (unsigned long)-1) && PyErr_Occurred())) __PYX_ERR(0, 304, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_v_azstart = __pyx_t_22;
    __pyx_v_n = __pyx_t_11;
    __pyx_t_11 = (__pyx_t_11 + 1);

    /* "kapok/uavsarc.pyx":305
 * 
 *     for n, azstart in enumerate(az_vector[0:-1]):
 *         azend = az_vector[n+1]             # <<<<<<<<<<<<<<
 *         azstart_slc = azstart*mlwin[0] + azbounds[0]
 *         azend_slc = azend*mlwin[0] + azbounds[0]
 */
    __pyx_t_10 = (__pyx_v_n + 1);
    __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_az_vector, __pyx_t_10, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 305, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_22 = __Pyx_PyInt_As_unsigned_long(__pyx_t_6); if (unlikely((__pyx_t_22 == (unsigned long)-1) && PyErr_Occurred())) __PYX_ERR(0, 305, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_v_azend = __pyx_t_22;

    /* "kapok/uavsarc.pyx":306
 *     for n, azstart in enumerate(az_vector[0:-1]):
 *         azend = az_vector[n+1]
 *         azstart_slc = azstart*mlwin[0] + azbounds[0]             # <<<<<<<<<<<<<<
 *         azend_slc = azend*mlwin[0] + azbounds[0]
 *         seg_start, azoffset_start = findsegment(azstart_slc, azsize_slc)
 */
    __pyx_t_6 = __Pyx_PyInt_From_unsigned_long(__pyx_v_azstart); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 306, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_12 = __Pyx_GetItemInt(__pyx_v_mlwin, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 306, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __pyx_t_19 = PyNumber_Multiply(__pyx_t_6, __pyx_t_12); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 306, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_19);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __pyx_t_12 = __Pyx_GetItemInt(__pyx_v_azbounds, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 306, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __pyx_t_6 = PyNumber_Add(__pyx_t_19, __pyx_t_12); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 306, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __pyx_t_22 = __Pyx_PyInt_As_unsigned_long(__pyx_t_6); if (unlikely((__pyx_t_22 == (unsigned long)-1) && PyErr_Occurred())) __PYX_ERR(0, 306, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_v_azstart_slc = __pyx_t_22;

    /* "kapok/uavsarc.pyx":307
 *         azend = az_vector[n+1]
 *         azstart_slc = azstart*mlwin[0] + azbounds[0]
 *         azend_slc = azend*mlwin[0] + azbounds[0]             # <<<<<<<<<<<<<<
 *         seg_start, azoffset_start = findsegment(azstart_slc, azsize_slc)
 *         seg_end, azoffset_end = findsegment(azend_slc, azsize_slc)
 */
    __pyx_t_6 = __Pyx_PyInt_From_unsigned_long(__pyx_v_azend); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 307, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_12 = __Pyx_GetItemInt(__pyx_v_mlwin, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 307, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __pyx_t_19 = PyNumber_Multiply(__pyx_t_6, __pyx_t_12); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 307, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_19);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __pyx_t_12 = __Pyx_GetItemInt(__pyx_v_azbounds, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 307, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __pyx_t_6 = PyNumber_Add(__pyx_t_19, __pyx_t_12); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 307, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __pyx_t_22 = __Pyx_PyInt_As_unsigned_long(__pyx_t_6); if (unlikely((__pyx_t_22 == (unsigned long)-1) && PyErr_Occurred())) __PYX_ERR(0, 307, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_v_azend_slc = __pyx_t_22;

    /* "kapok/uavsarc.pyx":308
 *         azstart_slc = azstart*mlwin[0] + azbounds[0]
 *         azend_slc = azend*mlwin[0] + azbounds[0]
 *         seg_start, azoffset_start = findsegment(azstart_slc, azsize_slc)             # <<<<<<<<<<<<<<
 *         seg_end, azoffset_end = findsegment(azend_slc, azsize_slc)
 * 
 */
    __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_findsegment); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 308, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __pyx_t_19 = __Pyx_PyInt_From_unsigned_long(__pyx_v_azstart_slc); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 308, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_19);
    __pyx_t_4 = NULL;
    __pyx_t_9 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_12))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_12);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_12, function);
        __pyx_t_9 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_12)) {
      PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_19, __pyx_v_azsize_slc};
      __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 308, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) {
      PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_19, __pyx_v_azsize_slc};
      __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 308, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
    } else
    #endif
    {
      __pyx_t_5 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 308, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (__pyx_t_4) {
        __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
      }
      __Pyx_GIVEREF(__pyx_t_19);
      PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_9, __pyx_t_19);
      __Pyx_INCREF(__pyx_v_azsize_slc);
      __Pyx_GIVEREF(__pyx_v_azsize_slc);
      PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_9, __pyx_v_azsize_slc);
      __pyx_t_19 = 0;
      __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 308, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    if ((likely(PyTuple_CheckExact(__pyx_t_6))) || (PyList_CheckExact(__pyx_t_6))) {
      PyObject* sequence = __pyx_t_6;
      #if !CYTHON_COMPILING_IN_PYPY
      Py_ssize_t size = Py_SIZE(sequence);
      #else
      Py_ssize_t size = PySequence_Size(sequence);
      #endif
      if (unlikely(size != 2)) {
        if (size > 2) __Pyx_RaiseTooManyValuesError(2);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        __PYX_ERR(0, 308, __pyx_L1_error)
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_12 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); 
      } else {
        __pyx_t_12 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_5 = PyList_GET_ITEM(sequence, 1); 
      }
      __Pyx_INCREF(__pyx_t_12);
      __Pyx_INCREF(__pyx_t_5);
      #else
      __pyx_t_12 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 308, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 308, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      #endif
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    } else {
      Py_ssize_t index = -1;
      __pyx_t_19 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 308, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_19);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_23 = Py_TYPE(__pyx_t_19)->tp_iternext;
      index = 0; __pyx_t_12 = __pyx_t_23(__pyx_t_19); if (unlikely(!__pyx_t_12)) goto __pyx_L62_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_12);
      index = 1; __pyx_t_5 = __pyx_t_23(__pyx_t_19); if (unlikely(!__pyx_t_5)) goto __pyx_L62_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_5);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_23(__pyx_t_19), 2) < 0) __PYX_ERR(0, 308, __pyx_L1_error)
      __pyx_t_23 = NULL;
      __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
      goto __pyx_L63_unpacking_done;
      __pyx_L62_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
      __pyx_t_23 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(0, 308, __pyx_L1_error)
      __pyx_L63_unpacking_done:;
    }
    __pyx_t_24 = __Pyx_PyInt_As_unsigned_int(__pyx_t_12); if (unlikely((__pyx_t_24 == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(0, 308, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __pyx_t_22 = __Pyx_PyInt_As_unsigned_long(__pyx_t_5); if (unlikely((__pyx_t_22 == (unsigned long)-1) && PyErr_Occurred())) __PYX_ERR(0, 308, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_v_seg_start = __pyx_t_24;
    __pyx_v_azoffset_start = __pyx_t_22;

    /* "kapok/uavsarc.pyx":309
 *         azend_slc = azend*mlwin[0] + azbounds[0]
 *         seg_start, azoffset_start = findsegment(azstart_slc, azsize_slc)
 *         seg_end, azoffset_end = findsegment(azend_slc, azsize_slc)             # <<<<<<<<<<<<<<
 * 
 *         print('kapok.uavsar.load | Calculating covariance matrix for rows '+str(azstart)+'-'+str(azend-1)+' / '+str(azsize-1)+' ('+str(np.round(azstart/azsize*100))+'%). ('+time.ctime()+')')
 */
    __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_findsegment); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 309, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_12 = __Pyx_PyInt_From_unsigned_long(__pyx_v_azend_slc); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 309, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __pyx_t_19 = NULL;
    __pyx_t_9 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_19 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_19)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_19);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
        __pyx_t_9 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_5)) {
      PyObject *__pyx_temp[3] = {__pyx_t_19, __pyx_t_12, __pyx_v_azsize_slc};
      __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 309, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0;
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
      PyObject *__pyx_temp[3] = {__pyx_t_19, __pyx_t_12, __pyx_v_azsize_slc};
      __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 309, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0;
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    } else
    #endif
    {
      __pyx_t_4 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 309, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (__pyx_t_19) {
        __Pyx_GIVEREF(__pyx_t_19); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_19); __pyx_t_19 = NULL;
      }
      __Pyx_GIVEREF(__pyx_t_12);
      PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_9, __pyx_t_12);
      __Pyx_INCREF(__pyx_v_azsize_slc);
      __Pyx_GIVEREF(__pyx_v_azsize_slc);
      PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_9, __pyx_v_azsize_slc);
      __pyx_t_12 = 0;
      __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 309, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if ((likely(PyTuple_CheckExact(__pyx_t_6))) || (PyList_CheckExact(__pyx_t_6))) {
      PyObject* sequence = __pyx_t_6;
      #if !CYTHON_COMPILING_IN_PYPY
      Py_ssize_t size = Py_SIZE(sequence);
      #else
      Py_ssize_t size = PySequence_Size(sequence);
      #endif
      if (unlikely(size != 2)) {
        if (size > 2) __Pyx_RaiseTooManyValuesError(2);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        __PYX_ERR(0, 309, __pyx_L1_error)
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); 
      } else {
        __pyx_t_5 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_4 = PyList_GET_ITEM(sequence, 1); 
      }
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_4);
      #else
      __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 309, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 309, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      #endif
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    } else {
      Py_ssize_t index = -1;
      __pyx_t_12 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 309, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_23 = Py_TYPE(__pyx_t_12)->tp_iternext;
      index = 0; __pyx_t_5 = __pyx_t_23(__pyx_t_12); if (unlikely(!__pyx_t_5)) goto __pyx_L64_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_5);
      index = 1; __pyx_t_4 = __pyx_t_23(__pyx_t_12); if (unlikely(!__pyx_t_4)) goto __pyx_L64_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_4);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_23(__pyx_t_12), 2) < 0) __PYX_ERR(0, 309, __pyx_L1_error)
      __pyx_t_23 = NULL;
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      goto __pyx_L65_unpacking_done;
      __pyx_L64_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __pyx_t_23 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(0, 309, __pyx_L1_error)
      __pyx_L65_unpacking_done:;
    }
    __pyx_t_24 = __Pyx_PyInt_As_unsigned_int(__pyx_t_5); if (unlikely((__pyx_t_24 == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(0, 309, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_22 = __Pyx_PyInt_As_unsigned_long(__pyx_t_4); if (unlikely((__pyx_t_22 == (unsigned long)-1) && PyErr_Occurred())) __PYX_ERR(0, 309, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_v_seg_end = __pyx_t_24;
    __pyx_v_azoffset_end = __pyx_t_22;

    /* "kapok/uavsarc.pyx":311
 *         seg_end, azoffset_end = findsegment(azend_slc, azsize_slc)
 * 
 *         print('kapok.uavsar.load | Calculating covariance matrix for rows '+str(azstart)+'-'+str(azend-1)+' / '+str(azsize-1)+' ('+str(np.round(azstart/azsize*100))+'%). ('+time.ctime()+')')             # <<<<<<<<<<<<<<
 * 
 *         for slcnum in range(0,num_cov_elements):
 */
    __pyx_t_6 = __Pyx_PyInt_From_unsigned_long(__pyx_v_azstart); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 311, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 311, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6);
    __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyObject_Call(((PyObject *)(&PyUnicode_Type)), __pyx_t_4, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 311, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyUnicode_Concat(__pyx_kp_u_kapok_uavsar_load_Calculating_co, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 311, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyUnicode_Concat(__pyx_t_4, __pyx_kp_u__37); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 311, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyInt_From_unsigned_long((__pyx_v_azend - 1)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 311, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 311, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
    __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)(&PyUnicode_Type)), __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 311, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyUnicode_Concat(__pyx_t_6, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 311, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyUnicode_Concat(__pyx_t_5, __pyx_kp_u__38); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 311, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyInt_SubtractObjC(__pyx_v_azsize, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 311, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 311, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5);
    __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)(&PyUnicode_Type)), __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 311, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyUnicode_Concat(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 311, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyUnicode_Concat(__pyx_t_6, __pyx_kp_u__39); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 311, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 311, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_round); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 311, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyInt_From_unsigned_long(__pyx_v_azstart); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 311, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_19 = __Pyx_PyNumber_Divide(__pyx_t_4, __pyx_v_azsize); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 311, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_19);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PyNumber_Multiply(__pyx_t_19, __pyx_int_100); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 311, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
    __pyx_t_19 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_12))) {
      __pyx_t_19 = PyMethod_GET_SELF(__pyx_t_12);
      if (likely(__pyx_t_19)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
        __Pyx_INCREF(__pyx_t_19);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_12, function);
      }
    }
    if (!__pyx_t_19) {
      __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 311, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_GOTREF(__pyx_t_6);
    } else {
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_12)) {
        PyObject *__pyx_temp[2] = {__pyx_t_19, __pyx_t_4};
        __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 311, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0;
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) {
        PyObject *__pyx_temp[2] = {__pyx_t_19, __pyx_t_4};
        __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 311, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0;
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else
      #endif
      {
        __pyx_t_20 = PyTuple_New(1+1); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 311, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_20);
        __Pyx_GIVEREF(__pyx_t_19); PyTuple_SET_ITEM(__pyx_t_20, 0, __pyx_t_19); __pyx_t_19 = NULL;
        __Pyx_GIVEREF(__pyx_t_4);
        PyTuple_SET_ITEM(__pyx_t_20, 0+1, __pyx_t_4);
        __pyx_t_4 = 0;
        __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_20, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 311, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
      }
    }
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __pyx_t_12 = PyTuple_New(1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 311, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_GIVEREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_6);
    __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyObject_Call(((PyObject *)(&PyUnicode_Type)), __pyx_t_12, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 311, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __pyx_t_12 = __Pyx_PyUnicode_Concat(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 311, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyUnicode_Concat(__pyx_t_12, __pyx_kp_u__40); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 311, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_time); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 311, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_20 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_ctime); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 311, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_20);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_20))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_20);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_20);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_20, function);
      }
    }
    if (__pyx_t_5) {
      __pyx_t_12 = __Pyx_PyObject_CallOneArg(__pyx_t_20, __pyx_t_5); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 311, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    } else {
      __pyx_t_12 = __Pyx_PyObject_CallNoArg(__pyx_t_20); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 311, __pyx_L1_error)
    }
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
    __pyx_t_20 = PyNumber_Add(__pyx_t_6, __pyx_t_12); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 311, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_20);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __pyx_t_12 = PyNumber_Add(__pyx_t_20, __pyx_kp_u__16); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 311, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
    __pyx_t_20 = PyTuple_New(1); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 311, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_20);
    __Pyx_GIVEREF(__pyx_t_12);
    PyTuple_SET_ITEM(__pyx_t_20, 0, __pyx_t_12);
    __pyx_t_12 = 0;
    __pyx_t_12 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_t_20, NULL); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 311, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;

    /* "kapok/uavsarc.pyx":313
 *         print('kapok.uavsar.load | Calculating covariance matrix for rows '+str(azstart)+'-'+str(azend-1)+' / '+str(azsize-1)+' ('+str(np.round(azstart/azsize*100))+'%). ('+time.ctime()+')')
 * 
 *         for slcnum in range(0,num_cov_elements):             # <<<<<<<<<<<<<<
 *             print('kapok.uavsar.load | Loading SLCs: '+str(slcnum+1)+'/'+str(num_cov_elements)+'. ('+time.ctime()+')     ', end='\r')
 *             file = slcfiles[slcnum+(seg_start*num_cov_elements)]
 */
    __pyx_t_12 = PyTuple_New(2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 313, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_INCREF(__pyx_int_0);
    __Pyx_GIVEREF(__pyx_int_0);
    PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_int_0);
    __Pyx_INCREF(__pyx_v_num_cov_elements);
    __Pyx_GIVEREF(__pyx_v_num_cov_elements);
    PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_v_num_cov_elements);
    __pyx_t_20 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_12, NULL); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 313, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_20);
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    if (likely(PyList_CheckExact(__pyx_t_20)) || PyTuple_CheckExact(__pyx_t_20)) {
      __pyx_t_12 = __pyx_t_20; __Pyx_INCREF(__pyx_t_12); __pyx_t_18 = 0;
      __pyx_t_25 = NULL;
    } else {
      __pyx_t_18 = -1; __pyx_t_12 = PyObject_GetIter(__pyx_t_20); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 313, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      __pyx_t_25 = Py_TYPE(__pyx_t_12)->tp_iternext; if (unlikely(!__pyx_t_25)) __PYX_ERR(0, 313, __pyx_L1_error)
    }
    __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
    for (;;) {
      if (likely(!__pyx_t_25)) {
        if (likely(PyList_CheckExact(__pyx_t_12))) {
          if (__pyx_t_18 >= PyList_GET_SIZE(__pyx_t_12)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_20 = PyList_GET_ITEM(__pyx_t_12, __pyx_t_18); __Pyx_INCREF(__pyx_t_20); __pyx_t_18++; if (unlikely(0 < 0)) __PYX_ERR(0, 313, __pyx_L1_error)
          #else
          __pyx_t_20 = PySequence_ITEM(__pyx_t_12, __pyx_t_18); __pyx_t_18++; if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 313, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_20);
          #endif
        } else {
          if (__pyx_t_18 >= PyTuple_GET_SIZE(__pyx_t_12)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_20 = PyTuple_GET_ITEM(__pyx_t_12, __pyx_t_18); __Pyx_INCREF(__pyx_t_20); __pyx_t_18++; if (unlikely(0 < 0)) __PYX_ERR(0, 313, __pyx_L1_error)
          #else
          __pyx_t_20 = PySequence_ITEM(__pyx_t_12, __pyx_t_18); __pyx_t_18++; if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 313, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_20);
          #endif
        }
      } else {
        __pyx_t_20 = __pyx_t_25(__pyx_t_12);
        if (unlikely(!__pyx_t_20)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(0, 313, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_20);
      }
      __Pyx_XDECREF_SET(__pyx_v_slcnum, __pyx_t_20);
      __pyx_t_20 = 0;

      /* "kapok/uavsarc.pyx":314
 * 
 *         for slcnum in range(0,num_cov_elements):
 *             print('kapok.uavsar.load | Loading SLCs: '+str(slcnum+1)+'/'+str(num_cov_elements)+'. ('+time.ctime()+')     ', end='\r')             # <<<<<<<<<<<<<<
 *             file = slcfiles[slcnum+(seg_start*num_cov_elements)]
 * 
 */
      __pyx_t_20 = __Pyx_PyInt_AddObjC(__pyx_v_slcnum, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 314, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_20);
      __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 314, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_20);
      PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_20);
      __pyx_t_20 = 0;
      __pyx_t_20 = __Pyx_PyObject_Call(((PyObject *)(&PyUnicode_Type)), __pyx_t_6, NULL); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 314, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_20);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = __Pyx_PyUnicode_Concat(__pyx_kp_u_kapok_uavsar_load_Loading_SLCs, __pyx_t_20); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 314, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
      __pyx_t_20 = __Pyx_PyUnicode_Concat(__pyx_t_6, __pyx_kp_u__31); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 314, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_20);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 314, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_INCREF(__pyx_v_num_cov_elements);
      __Pyx_GIVEREF(__pyx_v_num_cov_elements);
      PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_num_cov_elements);
      __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)(&PyUnicode_Type)), __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 314, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = __Pyx_PyUnicode_Concat(__pyx_t_20, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 314, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = __Pyx_PyUnicode_Concat(__pyx_t_6, __pyx_kp_u__41); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 314, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_20 = __Pyx_GetModuleGlobalName(__pyx_n_s_time); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 314, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_20);
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_20, __pyx_n_s_ctime); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 314, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
      __pyx_t_20 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_20 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_20)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_20);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
        }
      }
      if (__pyx_t_20) {
        __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_20); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 314, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
      } else {
        __pyx_t_6 = __Pyx_PyObject_CallNoArg(__pyx_t_4); 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_t_4 = PyNumber_Add(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 314, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = PyNumber_Add(__pyx_t_4, __pyx_kp_u__42); 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_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 314, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6);
      __pyx_t_6 = 0;
      __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 314, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_end, __pyx_kp_u__43) < 0) __PYX_ERR(0, 314, __pyx_L1_error)
      __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 314, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "kapok/uavsarc.pyx":315
 *         for slcnum in range(0,num_cov_elements):
 *             print('kapok.uavsar.load | Loading SLCs: '+str(slcnum+1)+'/'+str(num_cov_elements)+'. ('+time.ctime()+')     ', end='\r')
 *             file = slcfiles[slcnum+(seg_start*num_cov_elements)]             # <<<<<<<<<<<<<<
 * 
 *             if seg_start == seg_end:
 */
      __pyx_t_5 = __Pyx_PyInt_From_unsigned_int(__pyx_v_seg_start); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 315, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = PyNumber_Multiply(__pyx_t_5, __pyx_v_num_cov_elements); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 315, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = PyNumber_Add(__pyx_v_slcnum, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 315, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = PyObject_GetItem(__pyx_v_slcfiles, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 315, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_XDECREF_SET(__pyx_v_file, __pyx_t_6);
      __pyx_t_6 = 0;

      /* "kapok/uavsarc.pyx":317
 *             file = slcfiles[slcnum+(seg_start*num_cov_elements)]
 * 
 *             if seg_start == seg_end:             # <<<<<<<<<<<<<<
 *                 slc = getslcblock(file, rngsize_slc, azoffset_start, azoffset_end, rngbounds=rngbounds)
 *             else:
 */
      __pyx_t_13 = ((__pyx_v_seg_start == __pyx_v_seg_end) != 0);
      if (__pyx_t_13) {

        /* "kapok/uavsarc.pyx":318
 * 
 *             if seg_start == seg_end:
 *                 slc = getslcblock(file, rngsize_slc, azoffset_start, azoffset_end, rngbounds=rngbounds)             # <<<<<<<<<<<<<<
 *             else:
 *                 file2 = slcfiles[slcnum+(seg_end*num_cov_elements)]
 */
        __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_getslcblock); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 318, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_5 = __Pyx_PyInt_From_unsigned_long(__pyx_v_azoffset_start); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 318, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_4 = __Pyx_PyInt_From_unsigned_long(__pyx_v_azoffset_end); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 318, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_20 = PyTuple_New(4); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 318, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_20);
        __Pyx_INCREF(__pyx_v_file);
        __Pyx_GIVEREF(__pyx_v_file);
        PyTuple_SET_ITEM(__pyx_t_20, 0, __pyx_v_file);
        __Pyx_INCREF(__pyx_v_rngsize_slc);
        __Pyx_GIVEREF(__pyx_v_rngsize_slc);
        PyTuple_SET_ITEM(__pyx_t_20, 1, __pyx_v_rngsize_slc);
        __Pyx_GIVEREF(__pyx_t_5);
        PyTuple_SET_ITEM(__pyx_t_20, 2, __pyx_t_5);
        __Pyx_GIVEREF(__pyx_t_4);
        PyTuple_SET_ITEM(__pyx_t_20, 3, __pyx_t_4);
        __pyx_t_5 = 0;
        __pyx_t_4 = 0;
        __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 318, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_rngbounds, __pyx_v_rngbounds) < 0) __PYX_ERR(0, 318, __pyx_L1_error)
        __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_20, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 318, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_XDECREF_SET(__pyx_v_slc, __pyx_t_5);
        __pyx_t_5 = 0;

        /* "kapok/uavsarc.pyx":317
 *             file = slcfiles[slcnum+(seg_start*num_cov_elements)]
 * 
 *             if seg_start == seg_end:             # <<<<<<<<<<<<<<
 *                 slc = getslcblock(file, rngsize_slc, azoffset_start, azoffset_end, rngbounds=rngbounds)
 *             else:
 */
        goto __pyx_L68;
      }

      /* "kapok/uavsarc.pyx":320
 *                 slc = getslcblock(file, rngsize_slc, azoffset_start, azoffset_end, rngbounds=rngbounds)
 *             else:
 *                 file2 = slcfiles[slcnum+(seg_end*num_cov_elements)]             # <<<<<<<<<<<<<<
 *                 slc = getslcblock(file, rngsize_slc, azoffset_start, azoffset_end, rngbounds=rngbounds, file2=file2, azsize=azsize_slc[seg_start])
 * 
 */
      /*else*/ {
        __pyx_t_5 = __Pyx_PyInt_From_unsigned_int(__pyx_v_seg_end); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 320, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_4 = PyNumber_Multiply(__pyx_t_5, __pyx_v_num_cov_elements); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 320, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = PyNumber_Add(__pyx_v_slcnum, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 320, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_4 = PyObject_GetItem(__pyx_v_slcfiles, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 320, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_XDECREF_SET(__pyx_v_file2, __pyx_t_4);
        __pyx_t_4 = 0;

        /* "kapok/uavsarc.pyx":321
 *             else:
 *                 file2 = slcfiles[slcnum+(seg_end*num_cov_elements)]
 *                 slc = getslcblock(file, rngsize_slc, azoffset_start, azoffset_end, rngbounds=rngbounds, file2=file2, azsize=azsize_slc[seg_start])             # <<<<<<<<<<<<<<
 * 
 *             slc[np.abs(slc) < 1e-5] = 1e-5 # Don't want zero-valued pixels.  Set floor to -100 dB.
 */
        __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_getslcblock); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 321, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_5 = __Pyx_PyInt_From_unsigned_long(__pyx_v_azoffset_start); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 321, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_20 = __Pyx_PyInt_From_unsigned_long(__pyx_v_azoffset_end); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 321, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_20);
        __pyx_t_6 = PyTuple_New(4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 321, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_INCREF(__pyx_v_file);
        __Pyx_GIVEREF(__pyx_v_file);
        PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_file);
        __Pyx_INCREF(__pyx_v_rngsize_slc);
        __Pyx_GIVEREF(__pyx_v_rngsize_slc);
        PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_rngsize_slc);
        __Pyx_GIVEREF(__pyx_t_5);
        PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_5);
        __Pyx_GIVEREF(__pyx_t_20);
        PyTuple_SET_ITEM(__pyx_t_6, 3, __pyx_t_20);
        __pyx_t_5 = 0;
        __pyx_t_20 = 0;
        __pyx_t_20 = PyDict_New(); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 321, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_20);
        if (PyDict_SetItem(__pyx_t_20, __pyx_n_s_rngbounds, __pyx_v_rngbounds) < 0) __PYX_ERR(0, 321, __pyx_L1_error)
        if (PyDict_SetItem(__pyx_t_20, __pyx_n_s_file2, __pyx_v_file2) < 0) __PYX_ERR(0, 321, __pyx_L1_error)
        __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_azsize_slc, __pyx_v_seg_start, unsigned int, 0, __Pyx_PyInt_From_unsigned_int, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 321, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        if (PyDict_SetItem(__pyx_t_20, __pyx_n_s_azsize, __pyx_t_5) < 0) __PYX_ERR(0, 321, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, __pyx_t_20); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 321, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
        __Pyx_XDECREF_SET(__pyx_v_slc, __pyx_t_5);
        __pyx_t_5 = 0;
      }
      __pyx_L68:;

      /* "kapok/uavsarc.pyx":323
 *                 slc = getslcblock(file, rngsize_slc, azoffset_start, azoffset_end, rngbounds=rngbounds, file2=file2, azsize=azsize_slc[seg_start])
 * 
 *             slc[np.abs(slc) < 1e-5] = 1e-5 # Don't want zero-valued pixels.  Set floor to -100 dB.             # <<<<<<<<<<<<<<
 * 
 *             if slcnum == 0:
 */
      __pyx_t_20 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 323, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_20);
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_20, __pyx_n_s_abs); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 323, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
      __pyx_t_20 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_20 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_20)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_20);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
        }
      }
      if (!__pyx_t_20) {
        __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_slc); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 323, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[2] = {__pyx_t_20, __pyx_v_slc};
          __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 323, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0;
          __Pyx_GOTREF(__pyx_t_5);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[2] = {__pyx_t_20, __pyx_v_slc};
          __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 323, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0;
          __Pyx_GOTREF(__pyx_t_5);
        } else
        #endif
        {
          __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 323, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_GIVEREF(__pyx_t_20); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_20); __pyx_t_20 = NULL;
          __Pyx_INCREF(__pyx_v_slc);
          __Pyx_GIVEREF(__pyx_v_slc);
          PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_slc);
          __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 323, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = PyObject_RichCompare(__pyx_t_5, __pyx_float_1eneg_5, Py_LT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 323, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(PyObject_SetItem(__pyx_v_slc, __pyx_t_6, __pyx_float_1eneg_5) < 0)) __PYX_ERR(0, 323, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

      /* "kapok/uavsarc.pyx":325
 *             slc[np.abs(slc) < 1e-5] = 1e-5 # Don't want zero-valued pixels.  Set floor to -100 dB.
 * 
 *             if slcnum == 0:             # <<<<<<<<<<<<<<
 *                 slcstack = np.zeros((num_cov_elements,slc.shape[0],slc.shape[1]),dtype='complex64')
 * 
 */
      __pyx_t_6 = __Pyx_PyInt_EqObjC(__pyx_v_slcnum, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 325, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_13 < 0)) __PYX_ERR(0, 325, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (__pyx_t_13) {

        /* "kapok/uavsarc.pyx":326
 * 
 *             if slcnum == 0:
 *                 slcstack = np.zeros((num_cov_elements,slc.shape[0],slc.shape[1]),dtype='complex64')             # <<<<<<<<<<<<<<
 * 
 *                 if (slcnum % 3) == 1: # HV Polarization
 */
        __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 326, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_zeros); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 326, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_slc, __pyx_n_s_shape); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 326, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_6, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 326, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_slc, __pyx_n_s_shape); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 326, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_20 = __Pyx_GetItemInt(__pyx_t_6, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 326, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_20);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 326, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_INCREF(__pyx_v_num_cov_elements);
        __Pyx_GIVEREF(__pyx_v_num_cov_elements);
        PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_num_cov_elements);
        __Pyx_GIVEREF(__pyx_t_4);
        PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_4);
        __Pyx_GIVEREF(__pyx_t_20);
        PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_20);
        __pyx_t_4 = 0;
        __pyx_t_20 = 0;
        __pyx_t_20 = PyTuple_New(1); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 326, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_20);
        __Pyx_GIVEREF(__pyx_t_6);
        PyTuple_SET_ITEM(__pyx_t_20, 0, __pyx_t_6);
        __pyx_t_6 = 0;
        __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 326, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_n_u_complex64) < 0) __PYX_ERR(0, 326, __pyx_L1_error)
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_20, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 326, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_XDECREF_SET(__pyx_v_slcstack, __pyx_t_4);
        __pyx_t_4 = 0;

        /* "kapok/uavsarc.pyx":328
 *                 slcstack = np.zeros((num_cov_elements,slc.shape[0],slc.shape[1]),dtype='complex64')
 * 
 *                 if (slcnum % 3) == 1: # HV Polarization             # <<<<<<<<<<<<<<
 *                     slcstack[slcnum] = np.sqrt(2)*slc
 *                 else: # HH or VV Polarization
 */
        __pyx_t_4 = __Pyx_PyInt_RemainderObjC(__pyx_v_slcnum, __pyx_int_3, 3, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 328, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_6 = __Pyx_PyInt_EqObjC(__pyx_t_4, __pyx_int_1, 1, 0); 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_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_13 < 0)) __PYX_ERR(0, 328, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (__pyx_t_13) {

          /* "kapok/uavsarc.pyx":329
 * 
 *                 if (slcnum % 3) == 1: # HV Polarization
 *                     slcstack[slcnum] = np.sqrt(2)*slc             # <<<<<<<<<<<<<<
 *                 else: # HH or VV Polarization
 *                     slcstack[slcnum] = slc
 */
          __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 329, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_sqrt); 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 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__44, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 329, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __pyx_t_4 = PyNumber_Multiply(__pyx_t_6, __pyx_v_slc); 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;
          if (unlikely(PyObject_SetItem(__pyx_v_slcstack, __pyx_v_slcnum, __pyx_t_4) < 0)) __PYX_ERR(0, 329, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

          /* "kapok/uavsarc.pyx":328
 *                 slcstack = np.zeros((num_cov_elements,slc.shape[0],slc.shape[1]),dtype='complex64')
 * 
 *                 if (slcnum % 3) == 1: # HV Polarization             # <<<<<<<<<<<<<<
 *                     slcstack[slcnum] = np.sqrt(2)*slc
 *                 else: # HH or VV Polarization
 */
          goto __pyx_L70;
        }

        /* "kapok/uavsarc.pyx":331
 *                     slcstack[slcnum] = np.sqrt(2)*slc
 *                 else: # HH or VV Polarization
 *                     slcstack[slcnum] = slc             # <<<<<<<<<<<<<<
 *             else:
 *                 if (slcnum % 3) == 1: # HV Polarization
 */
        /*else*/ {
          if (unlikely(PyObject_SetItem(__pyx_v_slcstack, __pyx_v_slcnum, __pyx_v_slc) < 0)) __PYX_ERR(0, 331, __pyx_L1_error)
        }
        __pyx_L70:;

        /* "kapok/uavsarc.pyx":325
 *             slc[np.abs(slc) < 1e-5] = 1e-5 # Don't want zero-valued pixels.  Set floor to -100 dB.
 * 
 *             if slcnum == 0:             # <<<<<<<<<<<<<<
 *                 slcstack = np.zeros((num_cov_elements,slc.shape[0],slc.shape[1]),dtype='complex64')
 * 
 */
        goto __pyx_L69;
      }

      /* "kapok/uavsarc.pyx":333
 *                     slcstack[slcnum] = slc
 *             else:
 *                 if (slcnum % 3) == 1: # HV Polarization             # <<<<<<<<<<<<<<
 *                     slcstack[slcnum] = np.sqrt(2)*slc
 *                 else:  # HH or VV Polarization
 */
      /*else*/ {
        __pyx_t_4 = __Pyx_PyInt_RemainderObjC(__pyx_v_slcnum, __pyx_int_3, 3, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 333, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_6 = __Pyx_PyInt_EqObjC(__pyx_t_4, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 333, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_13 < 0)) __PYX_ERR(0, 333, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (__pyx_t_13) {

          /* "kapok/uavsarc.pyx":334
 *             else:
 *                 if (slcnum % 3) == 1: # HV Polarization
 *                     slcstack[slcnum] = np.sqrt(2)*slc             # <<<<<<<<<<<<<<
 *                 else:  # HH or VV Polarization
 *                     slcstack[slcnum] = slc
 */
          __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 334, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_sqrt); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 334, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__45, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 334, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __pyx_t_4 = PyNumber_Multiply(__pyx_t_6, __pyx_v_slc); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 334, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          if (unlikely(!__pyx_v_slcstack)) { __Pyx_RaiseUnboundLocalError("slcstack"); __PYX_ERR(0, 334, __pyx_L1_error) }
          if (unlikely(PyObject_SetItem(__pyx_v_slcstack, __pyx_v_slcnum, __pyx_t_4) < 0)) __PYX_ERR(0, 334, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

          /* "kapok/uavsarc.pyx":333
 *                     slcstack[slcnum] = slc
 *             else:
 *                 if (slcnum % 3) == 1: # HV Polarization             # <<<<<<<<<<<<<<
 *                     slcstack[slcnum] = np.sqrt(2)*slc
 *                 else:  # HH or VV Polarization
 */
          goto __pyx_L71;
        }

        /* "kapok/uavsarc.pyx":336
 *                     slcstack[slcnum] = np.sqrt(2)*slc
 *                 else:  # HH or VV Polarization
 *                     slcstack[slcnum] = slc             # <<<<<<<<<<<<<<
 * 
 * 
 */
        /*else*/ {
          if (unlikely(!__pyx_v_slcstack)) { __Pyx_RaiseUnboundLocalError("slcstack"); __PYX_ERR(0, 336, __pyx_L1_error) }
          if (unlikely(PyObject_SetItem(__pyx_v_slcstack, __pyx_v_slcnum, __pyx_v_slc) < 0)) __PYX_ERR(0, 336, __pyx_L1_error)
        }
        __pyx_L71:;
      }
      __pyx_L69:;

      /* "kapok/uavsarc.pyx":313
 *         print('kapok.uavsar.load | Calculating covariance matrix for rows '+str(azstart)+'-'+str(azend-1)+' / '+str(azsize-1)+' ('+str(np.round(azstart/azsize*100))+'%). ('+time.ctime()+')')
 * 
 *         for slcnum in range(0,num_cov_elements):             # <<<<<<<<<<<<<<
 *             print('kapok.uavsar.load | Loading SLCs: '+str(slcnum+1)+'/'+str(num_cov_elements)+'. ('+time.ctime()+')     ', end='\r')
 *             file = slcfiles[slcnum+(seg_start*num_cov_elements)]
 */
    }
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;

    /* "kapok/uavsarc.pyx":339
 * 
 * 
 *         for row in range(0,num_cov_elements):             # <<<<<<<<<<<<<<
 *             for col in range(row,num_cov_elements):
 *                 print('kapok.uavsar.load | Calculating matrix element: ('+str(row)+','+str(col)+'). ('+time.ctime()+')     ', end='\r')
 */
    __pyx_t_10 = __Pyx_PyInt_As_long(__pyx_v_num_cov_elements); if (unlikely((__pyx_t_10 == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 339, __pyx_L1_error)
    for (__pyx_t_24 = 0; __pyx_t_24 < __pyx_t_10; __pyx_t_24+=1) {
      __pyx_v_row = __pyx_t_24;

      /* "kapok/uavsarc.pyx":340
 * 
 *         for row in range(0,num_cov_elements):
 *             for col in range(row,num_cov_elements):             # <<<<<<<<<<<<<<
 *                 print('kapok.uavsar.load | Calculating matrix element: ('+str(row)+','+str(col)+'). ('+time.ctime()+')     ', end='\r')
 *                 cov[azstart:azend,:,row,col] = mlook(slcstack[row]*np.conj(slcstack[col]),mlwin)
 */
      __pyx_t_26 = __Pyx_PyInt_As_long(__pyx_v_num_cov_elements); if (unlikely((__pyx_t_26 == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 340, __pyx_L1_error)
      for (__pyx_t_27 = __pyx_v_row; __pyx_t_27 < __pyx_t_26; __pyx_t_27+=1) {
        __pyx_v_col = __pyx_t_27;

        /* "kapok/uavsarc.pyx":341
 *         for row in range(0,num_cov_elements):
 *             for col in range(row,num_cov_elements):
 *                 print('kapok.uavsar.load | Calculating matrix element: ('+str(row)+','+str(col)+'). ('+time.ctime()+')     ', end='\r')             # <<<<<<<<<<<<<<
 *                 cov[azstart:azend,:,row,col] = mlook(slcstack[row]*np.conj(slcstack[col]),mlwin)
 * 
 */
        __pyx_t_12 = __Pyx_PyInt_From_unsigned_int(__pyx_v_row); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 341, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 341, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_GIVEREF(__pyx_t_12);
        PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_12);
        __pyx_t_12 = 0;
        __pyx_t_12 = __Pyx_PyObject_Call(((PyObject *)(&PyUnicode_Type)), __pyx_t_4, NULL); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 341, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_4 = __Pyx_PyUnicode_Concat(__pyx_kp_u_kapok_uavsar_load_Calculating_ma, __pyx_t_12); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 341, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_t_12 = __Pyx_PyUnicode_Concat(__pyx_t_4, __pyx_kp_u__46); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 341, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_4 = __Pyx_PyInt_From_unsigned_int(__pyx_v_col); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 341, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 341, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_GIVEREF(__pyx_t_4);
        PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4);
        __pyx_t_4 = 0;
        __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)(&PyUnicode_Type)), __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 341, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_6 = __Pyx_PyUnicode_Concat(__pyx_t_12, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 341, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_4 = __Pyx_PyUnicode_Concat(__pyx_t_6, __pyx_kp_u__47); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 341, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_time); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 341, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_20 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_ctime); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 341, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_20);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_t_12 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_20))) {
          __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_20);
          if (likely(__pyx_t_12)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_20);
            __Pyx_INCREF(__pyx_t_12);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_20, function);
          }
        }
        if (__pyx_t_12) {
          __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_20, __pyx_t_12); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 341, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        } else {
          __pyx_t_6 = __Pyx_PyObject_CallNoArg(__pyx_t_20); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 341, __pyx_L1_error)
        }
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
        __pyx_t_20 = PyNumber_Add(__pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 341, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_20);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_6 = PyNumber_Add(__pyx_t_20, __pyx_kp_u__42); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 341, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
        __pyx_t_20 = PyTuple_New(1); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 341, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_20);
        __Pyx_GIVEREF(__pyx_t_6);
        PyTuple_SET_ITEM(__pyx_t_20, 0, __pyx_t_6);
        __pyx_t_6 = 0;
        __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 341, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_end, __pyx_kp_u__43) < 0) __PYX_ERR(0, 341, __pyx_L1_error)
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_t_20, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 341, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

        /* "kapok/uavsarc.pyx":342
 *             for col in range(row,num_cov_elements):
 *                 print('kapok.uavsar.load | Calculating matrix element: ('+str(row)+','+str(col)+'). ('+time.ctime()+')     ', end='\r')
 *                 cov[azstart:azend,:,row,col] = mlook(slcstack[row]*np.conj(slcstack[col]),mlwin)             # <<<<<<<<<<<<<<
 * 
 * 
 */
        __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_mlook); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 342, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (unlikely(!__pyx_v_slcstack)) { __Pyx_RaiseUnboundLocalError("slcstack"); __PYX_ERR(0, 342, __pyx_L1_error) }
        __pyx_t_20 = __Pyx_GetItemInt(__pyx_v_slcstack, __pyx_v_row, unsigned int, 0, __Pyx_PyInt_From_unsigned_int, 0, 0, 1); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 342, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_20);
        __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 342, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_19 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_conj); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 342, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_19);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (unlikely(!__pyx_v_slcstack)) { __Pyx_RaiseUnboundLocalError("slcstack"); __PYX_ERR(0, 342, __pyx_L1_error) }
        __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_slcstack, __pyx_v_col, unsigned int, 0, __Pyx_PyInt_From_unsigned_int, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 342, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_28 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_19))) {
          __pyx_t_28 = PyMethod_GET_SELF(__pyx_t_19);
          if (likely(__pyx_t_28)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_19);
            __Pyx_INCREF(__pyx_t_28);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_19, function);
          }
        }
        if (!__pyx_t_28) {
          __pyx_t_12 = __Pyx_PyObject_CallOneArg(__pyx_t_19, __pyx_t_5); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 342, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_GOTREF(__pyx_t_12);
        } else {
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_19)) {
            PyObject *__pyx_temp[2] = {__pyx_t_28, __pyx_t_5};
            __pyx_t_12 = __Pyx_PyFunction_FastCall(__pyx_t_19, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 342, __pyx_L1_error)
            __Pyx_XDECREF(__pyx_t_28); __pyx_t_28 = 0;
            __Pyx_GOTREF(__pyx_t_12);
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_19)) {
            PyObject *__pyx_temp[2] = {__pyx_t_28, __pyx_t_5};
            __pyx_t_12 = __Pyx_PyCFunction_FastCall(__pyx_t_19, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 342, __pyx_L1_error)
            __Pyx_XDECREF(__pyx_t_28); __pyx_t_28 = 0;
            __Pyx_GOTREF(__pyx_t_12);
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          } else
          #endif
          {
            __pyx_t_29 = PyTuple_New(1+1); if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 342, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_29);
            __Pyx_GIVEREF(__pyx_t_28); PyTuple_SET_ITEM(__pyx_t_29, 0, __pyx_t_28); __pyx_t_28 = NULL;
            __Pyx_GIVEREF(__pyx_t_5);
            PyTuple_SET_ITEM(__pyx_t_29, 0+1, __pyx_t_5);
            __pyx_t_5 = 0;
            __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_19, __pyx_t_29, NULL); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 342, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_12);
            __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0;
          }
        }
        __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
        __pyx_t_19 = PyNumber_Multiply(__pyx_t_20, __pyx_t_12); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 342, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_19);
        __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_t_12 = NULL;
        __pyx_t_9 = 0;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_12)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_12);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
            __pyx_t_9 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[3] = {__pyx_t_12, __pyx_t_19, __pyx_v_mlwin};
          __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 342, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[3] = {__pyx_t_12, __pyx_t_19, __pyx_v_mlwin};
          __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 342, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
        } else
        #endif
        {
          __pyx_t_20 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 342, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_20);
          if (__pyx_t_12) {
            __Pyx_GIVEREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_20, 0, __pyx_t_12); __pyx_t_12 = NULL;
          }
          __Pyx_GIVEREF(__pyx_t_19);
          PyTuple_SET_ITEM(__pyx_t_20, 0+__pyx_t_9, __pyx_t_19);
          __Pyx_INCREF(__pyx_v_mlwin);
          __Pyx_GIVEREF(__pyx_v_mlwin);
          PyTuple_SET_ITEM(__pyx_t_20, 1+__pyx_t_9, __pyx_v_mlwin);
          __pyx_t_19 = 0;
          __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_20, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 342, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_6 = __Pyx_PyInt_From_unsigned_long(__pyx_v_azstart); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 342, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_20 = __Pyx_PyInt_From_unsigned_long(__pyx_v_azend); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 342, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_20);
        __pyx_t_19 = PySlice_New(__pyx_t_6, __pyx_t_20, Py_None); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 342, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_19);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
        __pyx_t_20 = __Pyx_PyInt_From_unsigned_int(__pyx_v_row); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 342, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_20);
        __pyx_t_6 = __Pyx_PyInt_From_unsigned_int(__pyx_v_col); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 342, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_12 = PyTuple_New(4); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 342, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_GIVEREF(__pyx_t_19);
        PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_19);
        __Pyx_INCREF(__pyx_slice__48);
        __Pyx_GIVEREF(__pyx_slice__48);
        PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_slice__48);
        __Pyx_GIVEREF(__pyx_t_20);
        PyTuple_SET_ITEM(__pyx_t_12, 2, __pyx_t_20);
        __Pyx_GIVEREF(__pyx_t_6);
        PyTuple_SET_ITEM(__pyx_t_12, 3, __pyx_t_6);
        __pyx_t_19 = 0;
        __pyx_t_20 = 0;
        __pyx_t_6 = 0;
        if (unlikely(PyObject_SetItem(__pyx_v_cov, __pyx_t_12, __pyx_t_4) < 0)) __PYX_ERR(0, 342, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      }
    }

    /* "kapok/uavsarc.pyx":304
 *     cdef unsigned long azstart, azend, azstart_slc, azend_slc, azoffset_start, azoffset_end
 * 
 *     for n, azstart in enumerate(az_vector[0:-1]):             # <<<<<<<<<<<<<<
 *         azend = az_vector[n+1]
 *         azstart_slc = azstart*mlwin[0] + azbounds[0]
 */
  }
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "kapok/uavsarc.pyx":345
 * 
 * 
 *     del slcstack             # <<<<<<<<<<<<<<
 *     f.flush()
 * 
 */
  if (unlikely(!__pyx_v_slcstack)) { __Pyx_RaiseUnboundLocalError("slcstack"); __PYX_ERR(0, 345, __pyx_L1_error) }
  __Pyx_DECREF(__pyx_v_slcstack);
  __pyx_v_slcstack = NULL;

  /* "kapok/uavsarc.pyx":346
 * 
 *     del slcstack
 *     f.flush()             # <<<<<<<<<<<<<<
 * 
 *     # Boxcar Smoothing:
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_flush); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 346, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_12 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_12)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_12);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  if (__pyx_t_12) {
    __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_12); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 346, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  } else {
    __pyx_t_7 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 346, __pyx_L1_error)
  }
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "kapok/uavsarc.pyx":349
 * 
 *     # Boxcar Smoothing:
 *     if smwin != (1,1):             # <<<<<<<<<<<<<<
 *         print('kapok.uavsar.load | Boxcar averaging covariance matrix. ('+time.ctime()+')')
 *         for row in range(0,num_cov_elements):
 */
  __pyx_t_7 = PyObject_RichCompare(__pyx_v_smwin, __pyx_tuple__49, Py_NE); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 349, __pyx_L1_error)
  __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_13 < 0)) __PYX_ERR(0, 349, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (__pyx_t_13) {

    /* "kapok/uavsarc.pyx":350
 *     # Boxcar Smoothing:
 *     if smwin != (1,1):
 *         print('kapok.uavsar.load | Boxcar averaging covariance matrix. ('+time.ctime()+')')             # <<<<<<<<<<<<<<
 *         for row in range(0,num_cov_elements):
 *             for col in range(row,num_cov_elements):
 */
    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_time); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 350, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_ctime); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 350, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_12))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_12);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_12, function);
      }
    }
    if (__pyx_t_4) {
      __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 350, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    } else {
      __pyx_t_7 = __Pyx_PyObject_CallNoArg(__pyx_t_12); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 350, __pyx_L1_error)
    }
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __pyx_t_12 = PyNumber_Add(__pyx_kp_u_kapok_uavsar_load_Boxcar_averagi, __pyx_t_7); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 350, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = PyNumber_Add(__pyx_t_12, __pyx_kp_u__16); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 350, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __pyx_t_12 = PyTuple_New(1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 350, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_GIVEREF(__pyx_t_7);
    PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_7);
    __pyx_t_7 = 0;
    __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_t_12, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 350, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

    /* "kapok/uavsarc.pyx":351
 *     if smwin != (1,1):
 *         print('kapok.uavsar.load | Boxcar averaging covariance matrix. ('+time.ctime()+')')
 *         for row in range(0,num_cov_elements):             # <<<<<<<<<<<<<<
 *             for col in range(row,num_cov_elements):
 *                 cov[:,:,row,col] = smooth(cov[:,:,row,col],smwin)
 */
    __pyx_t_10 = __Pyx_PyInt_As_long(__pyx_v_num_cov_elements); if (unlikely((__pyx_t_10 == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 351, __pyx_L1_error)
    for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) {
      __pyx_v_row = __pyx_t_11;

      /* "kapok/uavsarc.pyx":352
 *         print('kapok.uavsar.load | Boxcar averaging covariance matrix. ('+time.ctime()+')')
 *         for row in range(0,num_cov_elements):
 *             for col in range(row,num_cov_elements):             # <<<<<<<<<<<<<<
 *                 cov[:,:,row,col] = smooth(cov[:,:,row,col],smwin)
 * 
 */
      __pyx_t_26 = __Pyx_PyInt_As_long(__pyx_v_num_cov_elements); if (unlikely((__pyx_t_26 == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 352, __pyx_L1_error)
      for (__pyx_t_24 = __pyx_v_row; __pyx_t_24 < __pyx_t_26; __pyx_t_24+=1) {
        __pyx_v_col = __pyx_t_24;

        /* "kapok/uavsarc.pyx":353
 *         for row in range(0,num_cov_elements):
 *             for col in range(row,num_cov_elements):
 *                 cov[:,:,row,col] = smooth(cov[:,:,row,col],smwin)             # <<<<<<<<<<<<<<
 * 
 *     cov.attrs['description'] = 'Covariance Matrix'
 */
        __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_smooth); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 353, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_4 = __Pyx_PyInt_From_unsigned_int(__pyx_v_row); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 353, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_6 = __Pyx_PyInt_From_unsigned_int(__pyx_v_col); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 353, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_20 = PyTuple_New(4); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 353, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_20);
        __Pyx_INCREF(__pyx_slice__50);
        __Pyx_GIVEREF(__pyx_slice__50);
        PyTuple_SET_ITEM(__pyx_t_20, 0, __pyx_slice__50);
        __Pyx_INCREF(__pyx_slice__51);
        __Pyx_GIVEREF(__pyx_slice__51);
        PyTuple_SET_ITEM(__pyx_t_20, 1, __pyx_slice__51);
        __Pyx_GIVEREF(__pyx_t_4);
        PyTuple_SET_ITEM(__pyx_t_20, 2, __pyx_t_4);
        __Pyx_GIVEREF(__pyx_t_6);
        PyTuple_SET_ITEM(__pyx_t_20, 3, __pyx_t_6);
        __pyx_t_4 = 0;
        __pyx_t_6 = 0;
        __pyx_t_6 = PyObject_GetItem(__pyx_v_cov, __pyx_t_20); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 353, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
        __pyx_t_20 = NULL;
        __pyx_t_9 = 0;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_12))) {
          __pyx_t_20 = PyMethod_GET_SELF(__pyx_t_12);
          if (likely(__pyx_t_20)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
            __Pyx_INCREF(__pyx_t_20);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_12, function);
            __pyx_t_9 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_12)) {
          PyObject *__pyx_temp[3] = {__pyx_t_20, __pyx_t_6, __pyx_v_smwin};
          __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 353, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 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_12)) {
          PyObject *__pyx_temp[3] = {__pyx_t_20, __pyx_t_6, __pyx_v_smwin};
          __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 353, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0;
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        } else
        #endif
        {
          __pyx_t_4 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 353, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          if (__pyx_t_20) {
            __Pyx_GIVEREF(__pyx_t_20); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_20); __pyx_t_20 = NULL;
          }
          __Pyx_GIVEREF(__pyx_t_6);
          PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_9, __pyx_t_6);
          __Pyx_INCREF(__pyx_v_smwin);
          __Pyx_GIVEREF(__pyx_v_smwin);
          PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_9, __pyx_v_smwin);
          __pyx_t_6 = 0;
          __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_4, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 353, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        }
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_t_12 = __Pyx_PyInt_From_unsigned_int(__pyx_v_row); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 353, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_4 = __Pyx_PyInt_From_unsigned_int(__pyx_v_col); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 353, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_6 = PyTuple_New(4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 353, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_INCREF(__pyx_slice__52);
        __Pyx_GIVEREF(__pyx_slice__52);
        PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_slice__52);
        __Pyx_INCREF(__pyx_slice__53);
        __Pyx_GIVEREF(__pyx_slice__53);
        PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_slice__53);
        __Pyx_GIVEREF(__pyx_t_12);
        PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_12);
        __Pyx_GIVEREF(__pyx_t_4);
        PyTuple_SET_ITEM(__pyx_t_6, 3, __pyx_t_4);
        __pyx_t_12 = 0;
        __pyx_t_4 = 0;
        if (unlikely(PyObject_SetItem(__pyx_v_cov, __pyx_t_6, __pyx_t_7) < 0)) __PYX_ERR(0, 353, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      }
    }

    /* "kapok/uavsarc.pyx":349
 * 
 *     # Boxcar Smoothing:
 *     if smwin != (1,1):             # <<<<<<<<<<<<<<
 *         print('kapok.uavsar.load | Boxcar averaging covariance matrix. ('+time.ctime()+')')
 *         for row in range(0,num_cov_elements):
 */
  }

  /* "kapok/uavsarc.pyx":355
 *                 cov[:,:,row,col] = smooth(cov[:,:,row,col],smwin)
 * 
 *     cov.attrs['description'] = 'Covariance Matrix'             # <<<<<<<<<<<<<<
 *     cov.attrs['basis'] = 'lexicographic'
 *     cov.attrs['num_pol'] = 3
 */
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_cov, __pyx_n_s_attrs); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 355, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (unlikely(PyObject_SetItem(__pyx_t_7, __pyx_n_u_description, __pyx_kp_u_Covariance_Matrix) < 0)) __PYX_ERR(0, 355, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "kapok/uavsarc.pyx":356
 * 
 *     cov.attrs['description'] = 'Covariance Matrix'
 *     cov.attrs['basis'] = 'lexicographic'             # <<<<<<<<<<<<<<
 *     cov.attrs['num_pol'] = 3
 *     cov.attrs['pol'] = np.array(['HH', 'sqrt(2)*HV', 'VV'],dtype='S')
 */
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_cov, __pyx_n_s_attrs); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 356, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (unlikely(PyObject_SetItem(__pyx_t_7, __pyx_n_u_basis, __pyx_n_u_lexicographic) < 0)) __PYX_ERR(0, 356, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "kapok/uavsarc.pyx":357
 *     cov.attrs['description'] = 'Covariance Matrix'
 *     cov.attrs['basis'] = 'lexicographic'
 *     cov.attrs['num_pol'] = 3             # <<<<<<<<<<<<<<
 *     cov.attrs['pol'] = np.array(['HH', 'sqrt(2)*HV', 'VV'],dtype='S')
 *     print('kapok.uavsar.load | Covariance matrix calculation complete. ('+time.ctime()+')     ')
 */
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_cov, __pyx_n_s_attrs); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 357, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (unlikely(PyObject_SetItem(__pyx_t_7, __pyx_n_u_num_pol, __pyx_int_3) < 0)) __PYX_ERR(0, 357, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "kapok/uavsarc.pyx":358
 *     cov.attrs['basis'] = 'lexicographic'
 *     cov.attrs['num_pol'] = 3
 *     cov.attrs['pol'] = np.array(['HH', 'sqrt(2)*HV', 'VV'],dtype='S')             # <<<<<<<<<<<<<<
 *     print('kapok.uavsar.load | Covariance matrix calculation complete. ('+time.ctime()+')     ')
 * 
 */
  __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 358, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_array); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 358, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = PyList_New(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 358, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_INCREF(__pyx_n_u_HH);
  __Pyx_GIVEREF(__pyx_n_u_HH);
  PyList_SET_ITEM(__pyx_t_7, 0, __pyx_n_u_HH);
  __Pyx_INCREF(__pyx_kp_u_sqrt_2_HV);
  __Pyx_GIVEREF(__pyx_kp_u_sqrt_2_HV);
  PyList_SET_ITEM(__pyx_t_7, 1, __pyx_kp_u_sqrt_2_HV);
  __Pyx_INCREF(__pyx_n_u_VV);
  __Pyx_GIVEREF(__pyx_n_u_VV);
  PyList_SET_ITEM(__pyx_t_7, 2, __pyx_n_u_VV);
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 358, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_7);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_7);
  __pyx_t_7 = 0;
  __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 358, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_dtype, __pyx_n_u_S) < 0) __PYX_ERR(0, 358, __pyx_L1_error)
  __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_4, __pyx_t_7); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 358, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_cov, __pyx_n_s_attrs); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 358, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (unlikely(PyObject_SetItem(__pyx_t_7, __pyx_n_u_pol, __pyx_t_12) < 0)) __PYX_ERR(0, 358, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;

  /* "kapok/uavsarc.pyx":359
 *     cov.attrs['num_pol'] = 3
 *     cov.attrs['pol'] = np.array(['HH', 'sqrt(2)*HV', 'VV'],dtype='S')
 *     print('kapok.uavsar.load | Covariance matrix calculation complete. ('+time.ctime()+')     ')             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_time); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 359, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_ctime); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 359, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_7)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  if (__pyx_t_7) {
    __pyx_t_12 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_7); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 359, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  } else {
    __pyx_t_12 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 359, __pyx_L1_error)
  }
  __Pyx_GOTREF(__pyx_t_12);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyNumber_Add(__pyx_kp_u_kapok_uavsar_load_Covariance_mat, __pyx_t_12); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 359, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __pyx_t_12 = PyNumber_Add(__pyx_t_4, __pyx_kp_u__42); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 359, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 359, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_12);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_12);
  __pyx_t_12 = 0;
  __pyx_t_12 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_t_4, NULL); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 359, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;

  /* "kapok/uavsarc.pyx":363
 * 
 *     # Load LLH files.
 *     llh = None             # <<<<<<<<<<<<<<
 *     mlwin_lkv = (int(ann.query('Number of Azimuth Looks in 2x8 SLC')), int(ann.query('Number of Range Looks in 2x8 SLC')))
 * 
 */
  __Pyx_INCREF(Py_None);
  __pyx_v_llh = Py_None;

  /* "kapok/uavsarc.pyx":364
 *     # Load LLH files.
 *     llh = None
 *     mlwin_lkv = (int(ann.query('Number of Azimuth Looks in 2x8 SLC')), int(ann.query('Number of Range Looks in 2x8 SLC')))             # <<<<<<<<<<<<<<
 * 
 *     for seg in range(num_segments):
 */
  __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_ann, __pyx_n_s_query); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 364, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_tuple__54, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 364, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __pyx_t_12 = __Pyx_PyNumber_Int(__pyx_t_4); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 364, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_ann, __pyx_n_s_query); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 364, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__55, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 364, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyNumber_Int(__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 364, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 364, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_GIVEREF(__pyx_t_12);
  PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_12);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_4);
  __pyx_t_12 = 0;
  __pyx_t_4 = 0;
  __pyx_v_mlwin_lkv = ((PyObject*)__pyx_t_7);
  __pyx_t_7 = 0;

  /* "kapok/uavsarc.pyx":366
 *     mlwin_lkv = (int(ann.query('Number of Azimuth Looks in 2x8 SLC')), int(ann.query('Number of Range Looks in 2x8 SLC')))
 * 
 *     for seg in range(num_segments):             # <<<<<<<<<<<<<<
 *         llhname = ann.query('llh_'+str(seg+1)+'_2x8')
 *         file = glob(datapath+llhname)
 */
  __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 366, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_INCREF(__pyx_v_num_segments);
  __Pyx_GIVEREF(__pyx_v_num_segments);
  PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_num_segments);
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 366, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) {
    __pyx_t_7 = __pyx_t_4; __Pyx_INCREF(__pyx_t_7); __pyx_t_15 = 0;
    __pyx_t_17 = NULL;
  } else {
    __pyx_t_15 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 366, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_17 = Py_TYPE(__pyx_t_7)->tp_iternext; if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 366, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  for (;;) {
    if (likely(!__pyx_t_17)) {
      if (likely(PyList_CheckExact(__pyx_t_7))) {
        if (__pyx_t_15 >= PyList_GET_SIZE(__pyx_t_7)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_15); __Pyx_INCREF(__pyx_t_4); __pyx_t_15++; if (unlikely(0 < 0)) __PYX_ERR(0, 366, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_7, __pyx_t_15); __pyx_t_15++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 366, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        if (__pyx_t_15 >= PyTuple_GET_SIZE(__pyx_t_7)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_15); __Pyx_INCREF(__pyx_t_4); __pyx_t_15++; if (unlikely(0 < 0)) __PYX_ERR(0, 366, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_7, __pyx_t_15); __pyx_t_15++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 366, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      }
    } else {
      __pyx_t_4 = __pyx_t_17(__pyx_t_7);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 366, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XDECREF_SET(__pyx_v_seg, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "kapok/uavsarc.pyx":367
 * 
 *     for seg in range(num_segments):
 *         llhname = ann.query('llh_'+str(seg+1)+'_2x8')             # <<<<<<<<<<<<<<
 *         file = glob(datapath+llhname)
 * 
 */
    __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_ann, __pyx_n_s_query); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 367, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __pyx_t_6 = __Pyx_PyInt_AddObjC(__pyx_v_seg, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 367, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_20 = PyTuple_New(1); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 367, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_20);
    __Pyx_GIVEREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_20, 0, __pyx_t_6);
    __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyObject_Call(((PyObject *)(&PyUnicode_Type)), __pyx_t_20, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 367, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
    __pyx_t_20 = __Pyx_PyUnicode_Concat(__pyx_n_u_llh, __pyx_t_6); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 367, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_20);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyUnicode_Concat(__pyx_t_20, __pyx_n_u_2x8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 367, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
    __pyx_t_20 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) {
      __pyx_t_20 = PyMethod_GET_SELF(__pyx_t_12);
      if (likely(__pyx_t_20)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
        __Pyx_INCREF(__pyx_t_20);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_12, function);
      }
    }
    if (!__pyx_t_20) {
      __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 367, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_GOTREF(__pyx_t_4);
    } else {
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_12)) {
        PyObject *__pyx_temp[2] = {__pyx_t_20, __pyx_t_6};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 367, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0;
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) {
        PyObject *__pyx_temp[2] = {__pyx_t_20, __pyx_t_6};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 367, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0;
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else
      #endif
      {
        __pyx_t_19 = PyTuple_New(1+1); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 367, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_19);
        __Pyx_GIVEREF(__pyx_t_20); PyTuple_SET_ITEM(__pyx_t_19, 0, __pyx_t_20); __pyx_t_20 = NULL;
        __Pyx_GIVEREF(__pyx_t_6);
        PyTuple_SET_ITEM(__pyx_t_19, 0+1, __pyx_t_6);
        __pyx_t_6 = 0;
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_19, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 367, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
      }
    }
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_XDECREF_SET(__pyx_v_llhname, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "kapok/uavsarc.pyx":368
 *     for seg in range(num_segments):
 *         llhname = ann.query('llh_'+str(seg+1)+'_2x8')
 *         file = glob(datapath+llhname)             # <<<<<<<<<<<<<<
 * 
 *         if len(file) == 1:
 */
    __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_glob); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 368, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __pyx_t_19 = PyNumber_Add(__pyx_v_datapath, __pyx_v_llhname); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 368, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_19);
    __pyx_t_6 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_12))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_12);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_12, function);
      }
    }
    if (!__pyx_t_6) {
      __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_19); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 368, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
      __Pyx_GOTREF(__pyx_t_4);
    } else {
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_12)) {
        PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_19};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 368, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) {
        PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_19};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 368, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
      } else
      #endif
      {
        __pyx_t_20 = PyTuple_New(1+1); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 368, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_20);
        __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_20, 0, __pyx_t_6); __pyx_t_6 = NULL;
        __Pyx_GIVEREF(__pyx_t_19);
        PyTuple_SET_ITEM(__pyx_t_20, 0+1, __pyx_t_19);
        __pyx_t_19 = 0;
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_20, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 368, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
      }
    }
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_XDECREF_SET(__pyx_v_file, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "kapok/uavsarc.pyx":370
 *         file = glob(datapath+llhname)
 * 
 *         if len(file) == 1:             # <<<<<<<<<<<<<<
 *             llh_rows = int(ann.query('llh_'+str(seg+1)+'_2x8 Rows'))
 *             llh_cols = int(ann.query('llh_'+str(seg+1)+'_2x8 Columns'))
 */
    __pyx_t_18 = PyObject_Length(__pyx_v_file); if (unlikely(__pyx_t_18 == -1)) __PYX_ERR(0, 370, __pyx_L1_error)
    __pyx_t_13 = ((__pyx_t_18 == 1) != 0);
    if (__pyx_t_13) {

      /* "kapok/uavsarc.pyx":371
 * 
 *         if len(file) == 1:
 *             llh_rows = int(ann.query('llh_'+str(seg+1)+'_2x8 Rows'))             # <<<<<<<<<<<<<<
 *             llh_cols = int(ann.query('llh_'+str(seg+1)+'_2x8 Columns'))
 *             if llh is None:
 */
      __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_ann, __pyx_n_s_query); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 371, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      __pyx_t_20 = __Pyx_PyInt_AddObjC(__pyx_v_seg, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 371, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_20);
      __pyx_t_19 = PyTuple_New(1); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 371, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_19);
      __Pyx_GIVEREF(__pyx_t_20);
      PyTuple_SET_ITEM(__pyx_t_19, 0, __pyx_t_20);
      __pyx_t_20 = 0;
      __pyx_t_20 = __Pyx_PyObject_Call(((PyObject *)(&PyUnicode_Type)), __pyx_t_19, NULL); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 371, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_20);
      __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
      __pyx_t_19 = __Pyx_PyUnicode_Concat(__pyx_n_u_llh, __pyx_t_20); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 371, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_19);
      __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
      __pyx_t_20 = __Pyx_PyUnicode_Concat(__pyx_t_19, __pyx_kp_u_2x8_Rows); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 371, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_20);
      __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
      __pyx_t_19 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) {
        __pyx_t_19 = PyMethod_GET_SELF(__pyx_t_12);
        if (likely(__pyx_t_19)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
          __Pyx_INCREF(__pyx_t_19);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_12, function);
        }
      }
      if (!__pyx_t_19) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_20); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 371, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_12)) {
          PyObject *__pyx_temp[2] = {__pyx_t_19, __pyx_t_20};
          __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 371, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0;
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) {
          PyObject *__pyx_temp[2] = {__pyx_t_19, __pyx_t_20};
          __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 371, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0;
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
        } else
        #endif
        {
          __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 371, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_GIVEREF(__pyx_t_19); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_19); __pyx_t_19 = NULL;
          __Pyx_GIVEREF(__pyx_t_20);
          PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_20);
          __pyx_t_20 = 0;
          __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 371, __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_t_12 = __Pyx_PyNumber_Int(__pyx_t_4); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 371, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_XDECREF_SET(__pyx_v_llh_rows, __pyx_t_12);
      __pyx_t_12 = 0;

      /* "kapok/uavsarc.pyx":372
 *         if len(file) == 1:
 *             llh_rows = int(ann.query('llh_'+str(seg+1)+'_2x8 Rows'))
 *             llh_cols = int(ann.query('llh_'+str(seg+1)+'_2x8 Columns'))             # <<<<<<<<<<<<<<
 *             if llh is None:
 *                 llh = np.memmap(file[0], dtype='float32', mode='r', shape=(llh_rows, llh_cols, 3))
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_ann, __pyx_n_s_query); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 372, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_6 = __Pyx_PyInt_AddObjC(__pyx_v_seg, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 372, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_20 = PyTuple_New(1); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 372, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_20);
      __Pyx_GIVEREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_20, 0, __pyx_t_6);
      __pyx_t_6 = 0;
      __pyx_t_6 = __Pyx_PyObject_Call(((PyObject *)(&PyUnicode_Type)), __pyx_t_20, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 372, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
      __pyx_t_20 = __Pyx_PyUnicode_Concat(__pyx_n_u_llh, __pyx_t_6); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 372, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_20);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = __Pyx_PyUnicode_Concat(__pyx_t_20, __pyx_kp_u_2x8_Columns); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 372, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
      __pyx_t_20 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_20 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_20)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_20);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
        }
      }
      if (!__pyx_t_20) {
        __pyx_t_12 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 372, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_GOTREF(__pyx_t_12);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_4)) {
          PyObject *__pyx_temp[2] = {__pyx_t_20, __pyx_t_6};
          __pyx_t_12 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 372, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0;
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
          PyObject *__pyx_temp[2] = {__pyx_t_20, __pyx_t_6};
          __pyx_t_12 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 372, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0;
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        } else
        #endif
        {
          __pyx_t_19 = PyTuple_New(1+1); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 372, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_19);
          __Pyx_GIVEREF(__pyx_t_20); PyTuple_SET_ITEM(__pyx_t_19, 0, __pyx_t_20); __pyx_t_20 = NULL;
          __Pyx_GIVEREF(__pyx_t_6);
          PyTuple_SET_ITEM(__pyx_t_19, 0+1, __pyx_t_6);
          __pyx_t_6 = 0;
          __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_19, NULL); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 372, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_PyNumber_Int(__pyx_t_12); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 372, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __Pyx_XDECREF_SET(__pyx_v_llh_cols, __pyx_t_4);
      __pyx_t_4 = 0;

      /* "kapok/uavsarc.pyx":373
 *             llh_rows = int(ann.query('llh_'+str(seg+1)+'_2x8 Rows'))
 *             llh_cols = int(ann.query('llh_'+str(seg+1)+'_2x8 Columns'))
 *             if llh is None:             # <<<<<<<<<<<<<<
 *                 llh = np.memmap(file[0], dtype='float32', mode='r', shape=(llh_rows, llh_cols, 3))
 *             else:
 */
      __pyx_t_13 = (__pyx_v_llh == Py_None);
      __pyx_t_8 = (__pyx_t_13 != 0);
      if (__pyx_t_8) {

        /* "kapok/uavsarc.pyx":374
 *             llh_cols = int(ann.query('llh_'+str(seg+1)+'_2x8 Columns'))
 *             if llh is None:
 *                 llh = np.memmap(file[0], dtype='float32', mode='r', shape=(llh_rows, llh_cols, 3))             # <<<<<<<<<<<<<<
 *             else:
 *                 llh = np.vstack((llh, np.memmap(file[0], dtype='float32', mode='r', shape=(llh_rows, llh_cols, 3))))
 */
        __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 374, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_memmap); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 374, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_file, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 374, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_19 = PyTuple_New(1); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 374, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_19);
        __Pyx_GIVEREF(__pyx_t_4);
        PyTuple_SET_ITEM(__pyx_t_19, 0, __pyx_t_4);
        __pyx_t_4 = 0;
        __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 374, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_n_u_float32) < 0) __PYX_ERR(0, 374, __pyx_L1_error)
        if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_mode, __pyx_n_u_r) < 0) __PYX_ERR(0, 374, __pyx_L1_error)
        __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 374, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_INCREF(__pyx_v_llh_rows);
        __Pyx_GIVEREF(__pyx_v_llh_rows);
        PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_llh_rows);
        __Pyx_INCREF(__pyx_v_llh_cols);
        __Pyx_GIVEREF(__pyx_v_llh_cols);
        PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_llh_cols);
        __Pyx_INCREF(__pyx_int_3);
        __Pyx_GIVEREF(__pyx_int_3);
        PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_int_3);
        if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_shape, __pyx_t_6) < 0) __PYX_ERR(0, 374, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_19, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 374, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF_SET(__pyx_v_llh, __pyx_t_6);
        __pyx_t_6 = 0;

        /* "kapok/uavsarc.pyx":373
 *             llh_rows = int(ann.query('llh_'+str(seg+1)+'_2x8 Rows'))
 *             llh_cols = int(ann.query('llh_'+str(seg+1)+'_2x8 Columns'))
 *             if llh is None:             # <<<<<<<<<<<<<<
 *                 llh = np.memmap(file[0], dtype='float32', mode='r', shape=(llh_rows, llh_cols, 3))
 *             else:
 */
        goto __pyx_L84;
      }

      /* "kapok/uavsarc.pyx":376
 *                 llh = np.memmap(file[0], dtype='float32', mode='r', shape=(llh_rows, llh_cols, 3))
 *             else:
 *                 llh = np.vstack((llh, np.memmap(file[0], dtype='float32', mode='r', shape=(llh_rows, llh_cols, 3))))             # <<<<<<<<<<<<<<
 *         elif len(file) > 1:
 *             print('kapok.uavsar.load | Too many LLH files matching pattern: "'+datapath+llhname+'".  Aborting.')
 */
      /*else*/ {
        __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 376, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_19 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_vstack); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 376, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_19);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 376, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_memmap); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 376, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_file, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 376, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_20 = PyTuple_New(1); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 376, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_20);
        __Pyx_GIVEREF(__pyx_t_4);
        PyTuple_SET_ITEM(__pyx_t_20, 0, __pyx_t_4);
        __pyx_t_4 = 0;
        __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 376, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_n_u_float32) < 0) __PYX_ERR(0, 376, __pyx_L1_error)
        if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_mode, __pyx_n_u_r) < 0) __PYX_ERR(0, 376, __pyx_L1_error)
        __pyx_t_29 = PyTuple_New(3); if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 376, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_29);
        __Pyx_INCREF(__pyx_v_llh_rows);
        __Pyx_GIVEREF(__pyx_v_llh_rows);
        PyTuple_SET_ITEM(__pyx_t_29, 0, __pyx_v_llh_rows);
        __Pyx_INCREF(__pyx_v_llh_cols);
        __Pyx_GIVEREF(__pyx_v_llh_cols);
        PyTuple_SET_ITEM(__pyx_t_29, 1, __pyx_v_llh_cols);
        __Pyx_INCREF(__pyx_int_3);
        __Pyx_GIVEREF(__pyx_int_3);
        PyTuple_SET_ITEM(__pyx_t_29, 2, __pyx_int_3);
        if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_shape, __pyx_t_29) < 0) __PYX_ERR(0, 376, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0;
        __pyx_t_29 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_20, __pyx_t_4); if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 376, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_29);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 376, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_INCREF(__pyx_v_llh);
        __Pyx_GIVEREF(__pyx_v_llh);
        PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_llh);
        __Pyx_GIVEREF(__pyx_t_29);
        PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_29);
        __pyx_t_29 = 0;
        __pyx_t_29 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_19))) {
          __pyx_t_29 = PyMethod_GET_SELF(__pyx_t_19);
          if (likely(__pyx_t_29)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_19);
            __Pyx_INCREF(__pyx_t_29);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_19, function);
          }
        }
        if (!__pyx_t_29) {
          __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_19, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 376, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_6);
        } else {
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_19)) {
            PyObject *__pyx_temp[2] = {__pyx_t_29, __pyx_t_4};
            __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_19, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 376, __pyx_L1_error)
            __Pyx_XDECREF(__pyx_t_29); __pyx_t_29 = 0;
            __Pyx_GOTREF(__pyx_t_6);
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_19)) {
            PyObject *__pyx_temp[2] = {__pyx_t_29, __pyx_t_4};
            __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_19, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 376, __pyx_L1_error)
            __Pyx_XDECREF(__pyx_t_29); __pyx_t_29 = 0;
            __Pyx_GOTREF(__pyx_t_6);
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          } else
          #endif
          {
            __pyx_t_20 = PyTuple_New(1+1); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 376, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_20);
            __Pyx_GIVEREF(__pyx_t_29); PyTuple_SET_ITEM(__pyx_t_20, 0, __pyx_t_29); __pyx_t_29 = NULL;
            __Pyx_GIVEREF(__pyx_t_4);
            PyTuple_SET_ITEM(__pyx_t_20, 0+1, __pyx_t_4);
            __pyx_t_4 = 0;
            __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_19, __pyx_t_20, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 376, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_6);
            __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
          }
        }
        __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
        __Pyx_DECREF_SET(__pyx_v_llh, __pyx_t_6);
        __pyx_t_6 = 0;
      }
      __pyx_L84:;

      /* "kapok/uavsarc.pyx":370
 *         file = glob(datapath+llhname)
 * 
 *         if len(file) == 1:             # <<<<<<<<<<<<<<
 *             llh_rows = int(ann.query('llh_'+str(seg+1)+'_2x8 Rows'))
 *             llh_cols = int(ann.query('llh_'+str(seg+1)+'_2x8 Columns'))
 */
      goto __pyx_L83;
    }

    /* "kapok/uavsarc.pyx":377
 *             else:
 *                 llh = np.vstack((llh, np.memmap(file[0], dtype='float32', mode='r', shape=(llh_rows, llh_cols, 3))))
 *         elif len(file) > 1:             # <<<<<<<<<<<<<<
 *             print('kapok.uavsar.load | Too many LLH files matching pattern: "'+datapath+llhname+'".  Aborting.')
 *             return
 */
    __pyx_t_18 = PyObject_Length(__pyx_v_file); if (unlikely(__pyx_t_18 == -1)) __PYX_ERR(0, 377, __pyx_L1_error)
    __pyx_t_8 = ((__pyx_t_18 > 1) != 0);
    if (__pyx_t_8) {

      /* "kapok/uavsarc.pyx":378
 *                 llh = np.vstack((llh, np.memmap(file[0], dtype='float32', mode='r', shape=(llh_rows, llh_cols, 3))))
 *         elif len(file) > 1:
 *             print('kapok.uavsar.load | Too many LLH files matching pattern: "'+datapath+llhname+'".  Aborting.')             # <<<<<<<<<<<<<<
 *             return
 *         else:
 */
      __pyx_t_6 = PyNumber_Add(__pyx_kp_u_kapok_uavsar_load_Too_many_LLH_f, __pyx_v_datapath); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 378, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_19 = PyNumber_Add(__pyx_t_6, __pyx_v_llhname); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 378, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_19);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = PyNumber_Add(__pyx_t_19, __pyx_kp_u_Aborting); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 378, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
      __pyx_t_19 = PyTuple_New(1); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 378, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_19);
      __Pyx_GIVEREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_19, 0, __pyx_t_6);
      __pyx_t_6 = 0;
      __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_t_19, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 378, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

      /* "kapok/uavsarc.pyx":379
 *         elif len(file) > 1:
 *             print('kapok.uavsar.load | Too many LLH files matching pattern: "'+datapath+llhname+'".  Aborting.')
 *             return             # <<<<<<<<<<<<<<
 *         else:
 *             print('kapok.uavsar.load | Cannot find LLH file matching pattern: "'+datapath+llhname+'".  Aborting.')
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_r = Py_None; __Pyx_INCREF(Py_None);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L0;

      /* "kapok/uavsarc.pyx":377
 *             else:
 *                 llh = np.vstack((llh, np.memmap(file[0], dtype='float32', mode='r', shape=(llh_rows, llh_cols, 3))))
 *         elif len(file) > 1:             # <<<<<<<<<<<<<<
 *             print('kapok.uavsar.load | Too many LLH files matching pattern: "'+datapath+llhname+'".  Aborting.')
 *             return
 */
    }

    /* "kapok/uavsarc.pyx":381
 *             return
 *         else:
 *             print('kapok.uavsar.load | Cannot find LLH file matching pattern: "'+datapath+llhname+'".  Aborting.')             # <<<<<<<<<<<<<<
 *             return
 * 
 */
    /*else*/ {
      __pyx_t_6 = PyNumber_Add(__pyx_kp_u_kapok_uavsar_load_Cannot_find_LL, __pyx_v_datapath); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 381, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_19 = PyNumber_Add(__pyx_t_6, __pyx_v_llhname); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 381, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_19);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = PyNumber_Add(__pyx_t_19, __pyx_kp_u_Aborting); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 381, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
      __pyx_t_19 = PyTuple_New(1); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 381, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_19);
      __Pyx_GIVEREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_19, 0, __pyx_t_6);
      __pyx_t_6 = 0;
      __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_t_19, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 381, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

      /* "kapok/uavsarc.pyx":382
 *         else:
 *             print('kapok.uavsar.load | Cannot find LLH file matching pattern: "'+datapath+llhname+'".  Aborting.')
 *             return             # <<<<<<<<<<<<<<
 * 
 * 
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_r = Py_None; __Pyx_INCREF(Py_None);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L0;
    }
    __pyx_L83:;

    /* "kapok/uavsarc.pyx":366
 *     mlwin_lkv = (int(ann.query('Number of Azimuth Looks in 2x8 SLC')), int(ann.query('Number of Range Looks in 2x8 SLC')))
 * 
 *     for seg in range(num_segments):             # <<<<<<<<<<<<<<
 *         llhname = ann.query('llh_'+str(seg+1)+'_2x8')
 *         file = glob(datapath+llhname)
 */
  }
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "kapok/uavsarc.pyx":386
 * 
 *     # LLH Subset Bounds and Offsets for Trimming Multilooked Arrays
 *     azllhstart = azbounds[0] // mlwin_lkv[0]             # <<<<<<<<<<<<<<
 *     azllhend = azbounds[1] // mlwin_lkv[0]
 *     azllhoffset = azbounds[0] % mlwin_lkv[0]
 */
  __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_azbounds, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 386, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_6 = __Pyx_GetItemInt_Tuple(__pyx_v_mlwin_lkv, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 386, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_19 = PyNumber_FloorDivide(__pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 386, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_v_azllhstart = __pyx_t_19;
  __pyx_t_19 = 0;

  /* "kapok/uavsarc.pyx":387
 *     # LLH Subset Bounds and Offsets for Trimming Multilooked Arrays
 *     azllhstart = azbounds[0] // mlwin_lkv[0]
 *     azllhend = azbounds[1] // mlwin_lkv[0]             # <<<<<<<<<<<<<<
 *     azllhoffset = azbounds[0] % mlwin_lkv[0]
 *     if (azllhend < llh.shape[0]):
 */
  __pyx_t_19 = __Pyx_GetItemInt(__pyx_v_azbounds, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 387, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __pyx_t_6 = __Pyx_GetItemInt_Tuple(__pyx_v_mlwin_lkv, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 387, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = PyNumber_FloorDivide(__pyx_t_19, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 387, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_v_azllhend = __pyx_t_7;
  __pyx_t_7 = 0;

  /* "kapok/uavsarc.pyx":388
 *     azllhstart = azbounds[0] // mlwin_lkv[0]
 *     azllhend = azbounds[1] // mlwin_lkv[0]
 *     azllhoffset = azbounds[0] % mlwin_lkv[0]             # <<<<<<<<<<<<<<
 *     if (azllhend < llh.shape[0]):
 *         azllhend += 1
 */
  __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_azbounds, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 388, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_6 = __Pyx_GetItemInt_Tuple(__pyx_v_mlwin_lkv, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 388, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_19 = PyNumber_Remainder(__pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 388, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_v_azllhoffset = __pyx_t_19;
  __pyx_t_19 = 0;

  /* "kapok/uavsarc.pyx":389
 *     azllhend = azbounds[1] // mlwin_lkv[0]
 *     azllhoffset = azbounds[0] % mlwin_lkv[0]
 *     if (azllhend < llh.shape[0]):             # <<<<<<<<<<<<<<
 *         azllhend += 1
 * 
 */
  __pyx_t_19 = __Pyx_PyObject_GetAttrStr(__pyx_v_llh, __pyx_n_s_shape); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 389, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_19, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 389, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  __pyx_t_19 = PyObject_RichCompare(__pyx_v_azllhend, __pyx_t_6, Py_LT); __Pyx_XGOTREF(__pyx_t_19); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 389, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_19); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 389, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  if (__pyx_t_8) {

    /* "kapok/uavsarc.pyx":390
 *     azllhoffset = azbounds[0] % mlwin_lkv[0]
 *     if (azllhend < llh.shape[0]):
 *         azllhend += 1             # <<<<<<<<<<<<<<
 * 
 *     rngllhstart = rngbounds[0] // mlwin_lkv[1]
 */
    __pyx_t_19 = __Pyx_PyInt_AddObjC(__pyx_v_azllhend, __pyx_int_1, 1, 1); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 390, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_19);
    __Pyx_DECREF_SET(__pyx_v_azllhend, __pyx_t_19);
    __pyx_t_19 = 0;

    /* "kapok/uavsarc.pyx":389
 *     azllhend = azbounds[1] // mlwin_lkv[0]
 *     azllhoffset = azbounds[0] % mlwin_lkv[0]
 *     if (azllhend < llh.shape[0]):             # <<<<<<<<<<<<<<
 *         azllhend += 1
 * 
 */
  }

  /* "kapok/uavsarc.pyx":392
 *         azllhend += 1
 * 
 *     rngllhstart = rngbounds[0] // mlwin_lkv[1]             # <<<<<<<<<<<<<<
 *     rngllhend = rngbounds[1] // mlwin_lkv[1]
 *     rngllhoffset = rngbounds[0] % mlwin_lkv[1]
 */
  __pyx_t_19 = __Pyx_GetItemInt(__pyx_v_rngbounds, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 392, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __pyx_t_6 = __Pyx_GetItemInt_Tuple(__pyx_v_mlwin_lkv, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 392, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = PyNumber_FloorDivide(__pyx_t_19, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 392, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_v_rngllhstart = __pyx_t_7;
  __pyx_t_7 = 0;

  /* "kapok/uavsarc.pyx":393
 * 
 *     rngllhstart = rngbounds[0] // mlwin_lkv[1]
 *     rngllhend = rngbounds[1] // mlwin_lkv[1]             # <<<<<<<<<<<<<<
 *     rngllhoffset = rngbounds[0] % mlwin_lkv[1]
 *     if (rngllhend < llh.shape[1]):
 */
  __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_rngbounds, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 393, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_6 = __Pyx_GetItemInt_Tuple(__pyx_v_mlwin_lkv, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 393, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_19 = PyNumber_FloorDivide(__pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 393, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_v_rngllhend = __pyx_t_19;
  __pyx_t_19 = 0;

  /* "kapok/uavsarc.pyx":394
 *     rngllhstart = rngbounds[0] // mlwin_lkv[1]
 *     rngllhend = rngbounds[1] // mlwin_lkv[1]
 *     rngllhoffset = rngbounds[0] % mlwin_lkv[1]             # <<<<<<<<<<<<<<
 *     if (rngllhend < llh.shape[1]):
 *         rngllhend += 1
 */
  __pyx_t_19 = __Pyx_GetItemInt(__pyx_v_rngbounds, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 394, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __pyx_t_6 = __Pyx_GetItemInt_Tuple(__pyx_v_mlwin_lkv, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 394, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = PyNumber_Remainder(__pyx_t_19, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 394, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_v_rngllhoffset = __pyx_t_7;
  __pyx_t_7 = 0;

  /* "kapok/uavsarc.pyx":395
 *     rngllhend = rngbounds[1] // mlwin_lkv[1]
 *     rngllhoffset = rngbounds[0] % mlwin_lkv[1]
 *     if (rngllhend < llh.shape[1]):             # <<<<<<<<<<<<<<
 *         rngllhend += 1
 * 
 */
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_llh, __pyx_n_s_shape); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 395, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_7, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 395, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = PyObject_RichCompare(__pyx_v_rngllhend, __pyx_t_6, Py_LT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 395, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 395, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (__pyx_t_8) {

    /* "kapok/uavsarc.pyx":396
 *     rngllhoffset = rngbounds[0] % mlwin_lkv[1]
 *     if (rngllhend < llh.shape[1]):
 *         rngllhend += 1             # <<<<<<<<<<<<<<
 * 
 *     # Initialize latitude dataset and import values:
 */
    __pyx_t_7 = __Pyx_PyInt_AddObjC(__pyx_v_rngllhend, __pyx_int_1, 1, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 396, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF_SET(__pyx_v_rngllhend, __pyx_t_7);
    __pyx_t_7 = 0;

    /* "kapok/uavsarc.pyx":395
 *     rngllhend = rngbounds[1] // mlwin_lkv[1]
 *     rngllhoffset = rngbounds[0] % mlwin_lkv[1]
 *     if (rngllhend < llh.shape[1]):             # <<<<<<<<<<<<<<
 *         rngllhend += 1
 * 
 */
  }

  /* "kapok/uavsarc.pyx":399
 * 
 *     # Initialize latitude dataset and import values:
 *     print('kapok.uavsar.load | Importing latitude values. ('+time.ctime()+')')             # <<<<<<<<<<<<<<
 *     lat = f.create_dataset('lat', (azsize, rngsize), dtype='float32', compression=compression, compression_opts=compression_opts)
 *     lat[:] = mlook(zoom(llh[azllhstart:azllhend,rngllhstart:rngllhend,0],mlwin_lkv),mlwin)[azllhoffset:(azllhoffset+azsize),rngllhoffset:(rngllhoffset+rngsize)]
 */
  __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_time); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 399, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_19 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_ctime); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 399, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_19))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_19);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_19);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_19, function);
    }
  }
  if (__pyx_t_6) {
    __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_19, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 399, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  } else {
    __pyx_t_7 = __Pyx_PyObject_CallNoArg(__pyx_t_19); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 399, __pyx_L1_error)
  }
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  __pyx_t_19 = PyNumber_Add(__pyx_kp_u_kapok_uavsar_load_Importing_lati, __pyx_t_7); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 399, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = PyNumber_Add(__pyx_t_19, __pyx_kp_u__16); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 399, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  __pyx_t_19 = PyTuple_New(1); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 399, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __Pyx_GIVEREF(__pyx_t_7);
  PyTuple_SET_ITEM(__pyx_t_19, 0, __pyx_t_7);
  __pyx_t_7 = 0;
  __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_t_19, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 399, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "kapok/uavsarc.pyx":400
 *     # Initialize latitude dataset and import values:
 *     print('kapok.uavsar.load | Importing latitude values. ('+time.ctime()+')')
 *     lat = f.create_dataset('lat', (azsize, rngsize), dtype='float32', compression=compression, compression_opts=compression_opts)             # <<<<<<<<<<<<<<
 *     lat[:] = mlook(zoom(llh[azllhstart:azllhend,rngllhstart:rngllhend,0],mlwin_lkv),mlwin)[azllhoffset:(azllhoffset+azsize),rngllhoffset:(rngllhoffset+rngsize)]
 *     lat.attrs['units'] = 'degrees'
 */
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_create_dataset); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 400, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_19 = PyTuple_New(2); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 400, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __Pyx_INCREF(__pyx_v_azsize);
  __Pyx_GIVEREF(__pyx_v_azsize);
  PyTuple_SET_ITEM(__pyx_t_19, 0, __pyx_v_azsize);
  __Pyx_INCREF(__pyx_v_rngsize);
  __Pyx_GIVEREF(__pyx_v_rngsize);
  PyTuple_SET_ITEM(__pyx_t_19, 1, __pyx_v_rngsize);
  __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 400, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_INCREF(__pyx_n_u_lat);
  __Pyx_GIVEREF(__pyx_n_u_lat);
  PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_n_u_lat);
  __Pyx_GIVEREF(__pyx_t_19);
  PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_19);
  __pyx_t_19 = 0;
  __pyx_t_19 = PyDict_New(); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 400, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_19, __pyx_n_s_dtype, __pyx_n_u_float32) < 0) __PYX_ERR(0, 400, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_19, __pyx_n_s_compression, __pyx_v_compression) < 0) __PYX_ERR(0, 400, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_19, __pyx_n_s_compression_opts, __pyx_v_compression_opts) < 0) __PYX_ERR(0, 400, __pyx_L1_error)
  __pyx_t_20 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, __pyx_t_19); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 400, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  __pyx_v_lat = __pyx_t_20;
  __pyx_t_20 = 0;

  /* "kapok/uavsarc.pyx":401
 *     print('kapok.uavsar.load | Importing latitude values. ('+time.ctime()+')')
 *     lat = f.create_dataset('lat', (azsize, rngsize), dtype='float32', compression=compression, compression_opts=compression_opts)
 *     lat[:] = mlook(zoom(llh[azllhstart:azllhend,rngllhstart:rngllhend,0],mlwin_lkv),mlwin)[azllhoffset:(azllhoffset+azsize),rngllhoffset:(rngllhoffset+rngsize)]             # <<<<<<<<<<<<<<
 *     lat.attrs['units'] = 'degrees'
 *     lat.attrs['description'] = 'Latitude'
 */
  __pyx_t_19 = __Pyx_GetModuleGlobalName(__pyx_n_s_mlook); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 401, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_zoom); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 401, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_4 = PySlice_New(__pyx_v_azllhstart, __pyx_v_azllhend, Py_None); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 401, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_29 = PySlice_New(__pyx_v_rngllhstart, __pyx_v_rngllhend, Py_None); if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 401, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_29);
  __pyx_t_12 = PyTuple_New(3); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 401, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_29);
  PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_29);
  __Pyx_INCREF(__pyx_int_0);
  __Pyx_GIVEREF(__pyx_int_0);
  PyTuple_SET_ITEM(__pyx_t_12, 2, __pyx_int_0);
  __pyx_t_4 = 0;
  __pyx_t_29 = 0;
  __pyx_t_29 = PyObject_GetItem(__pyx_v_llh, __pyx_t_12); if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 401, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_29);
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __pyx_t_12 = NULL;
  __pyx_t_9 = 0;
  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_9 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_7)) {
    PyObject *__pyx_temp[3] = {__pyx_t_12, __pyx_t_29, __pyx_v_mlwin_lkv};
    __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 401, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
    PyObject *__pyx_temp[3] = {__pyx_t_12, __pyx_t_29, __pyx_v_mlwin_lkv};
    __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 401, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0;
  } else
  #endif
  {
    __pyx_t_4 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 401, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (__pyx_t_12) {
      __Pyx_GIVEREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_12); __pyx_t_12 = NULL;
    }
    __Pyx_GIVEREF(__pyx_t_29);
    PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_9, __pyx_t_29);
    __Pyx_INCREF(__pyx_v_mlwin_lkv);
    __Pyx_GIVEREF(__pyx_v_mlwin_lkv);
    PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_9, __pyx_v_mlwin_lkv);
    __pyx_t_29 = 0;
    __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_4, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 401, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = NULL;
  __pyx_t_9 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_19))) {
    __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_19);
    if (likely(__pyx_t_7)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_19);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_19, function);
      __pyx_t_9 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_19)) {
    PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_mlwin};
    __pyx_t_20 = __Pyx_PyFunction_FastCall(__pyx_t_19, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 401, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_GOTREF(__pyx_t_20);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_19)) {
    PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_mlwin};
    __pyx_t_20 = __Pyx_PyCFunction_FastCall(__pyx_t_19, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 401, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_GOTREF(__pyx_t_20);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  } else
  #endif
  {
    __pyx_t_4 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 401, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (__pyx_t_7) {
      __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_7); __pyx_t_7 = NULL;
    }
    __Pyx_GIVEREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_9, __pyx_t_6);
    __Pyx_INCREF(__pyx_v_mlwin);
    __Pyx_GIVEREF(__pyx_v_mlwin);
    PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_9, __pyx_v_mlwin);
    __pyx_t_6 = 0;
    __pyx_t_20 = __Pyx_PyObject_Call(__pyx_t_19, __pyx_t_4, NULL); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 401, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_20);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  __pyx_t_19 = PyNumber_Add(__pyx_v_azllhoffset, __pyx_v_azsize); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 401, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __pyx_t_4 = PySlice_New(__pyx_v_azllhoffset, __pyx_t_19, Py_None); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 401, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  __pyx_t_19 = PyNumber_Add(__pyx_v_rngllhoffset, __pyx_v_rngsize); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 401, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __pyx_t_6 = PySlice_New(__pyx_v_rngllhoffset, __pyx_t_19, Py_None); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 401, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  __pyx_t_19 = PyTuple_New(2); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 401, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_19, 0, __pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_6);
  PyTuple_SET_ITEM(__pyx_t_19, 1, __pyx_t_6);
  __pyx_t_4 = 0;
  __pyx_t_6 = 0;
  __pyx_t_6 = PyObject_GetItem(__pyx_t_20, __pyx_t_19); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 401, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  if (__Pyx_PyObject_SetSlice(__pyx_v_lat, __pyx_t_6, 0, 0, NULL, NULL, &__pyx_slice__56, 0, 0, 1) < 0) __PYX_ERR(0, 401, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "kapok/uavsarc.pyx":402
 *     lat = f.create_dataset('lat', (azsize, rngsize), dtype='float32', compression=compression, compression_opts=compression_opts)
 *     lat[:] = mlook(zoom(llh[azllhstart:azllhend,rngllhstart:rngllhend,0],mlwin_lkv),mlwin)[azllhoffset:(azllhoffset+azsize),rngllhoffset:(rngllhoffset+rngsize)]
 *     lat.attrs['units'] = 'degrees'             # <<<<<<<<<<<<<<
 *     lat.attrs['description'] = 'Latitude'
 * 
 */
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_lat, __pyx_n_s_attrs); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 402, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (unlikely(PyObject_SetItem(__pyx_t_6, __pyx_n_u_units, __pyx_n_u_degrees) < 0)) __PYX_ERR(0, 402, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "kapok/uavsarc.pyx":403
 *     lat[:] = mlook(zoom(llh[azllhstart:azllhend,rngllhstart:rngllhend,0],mlwin_lkv),mlwin)[azllhoffset:(azllhoffset+azsize),rngllhoffset:(rngllhoffset+rngsize)]
 *     lat.attrs['units'] = 'degrees'
 *     lat.attrs['description'] = 'Latitude'             # <<<<<<<<<<<<<<
 * 
 *     # Initialize longitude dataset and import values:
 */
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_lat, __pyx_n_s_attrs); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 403, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (unlikely(PyObject_SetItem(__pyx_t_6, __pyx_n_u_description, __pyx_n_u_Latitude) < 0)) __PYX_ERR(0, 403, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "kapok/uavsarc.pyx":406
 * 
 *     # Initialize longitude dataset and import values:
 *     print('kapok.uavsar.load | Importing longitude values. ('+time.ctime()+')')             # <<<<<<<<<<<<<<
 *     lon = f.create_dataset('lon', (azsize, rngsize), dtype='float32', compression=compression, compression_opts=compression_opts)
 *     lon[:] = mlook(zoom(llh[azllhstart:azllhend,rngllhstart:rngllhend,1],mlwin_lkv),mlwin)[azllhoffset:(azllhoffset+azsize),rngllhoffset:(rngllhoffset+rngsize)]
 */
  __pyx_t_19 = __Pyx_GetModuleGlobalName(__pyx_n_s_time); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 406, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __pyx_t_20 = __Pyx_PyObject_GetAttrStr(__pyx_t_19, __pyx_n_s_ctime); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 406, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  __pyx_t_19 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_20))) {
    __pyx_t_19 = PyMethod_GET_SELF(__pyx_t_20);
    if (likely(__pyx_t_19)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_20);
      __Pyx_INCREF(__pyx_t_19);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_20, function);
    }
  }
  if (__pyx_t_19) {
    __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_20, __pyx_t_19); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 406, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  } else {
    __pyx_t_6 = __Pyx_PyObject_CallNoArg(__pyx_t_20); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 406, __pyx_L1_error)
  }
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
  __pyx_t_20 = PyNumber_Add(__pyx_kp_u_kapok_uavsar_load_Importing_long, __pyx_t_6); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 406, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = PyNumber_Add(__pyx_t_20, __pyx_kp_u__16); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 406, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
  __pyx_t_20 = PyTuple_New(1); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 406, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  __Pyx_GIVEREF(__pyx_t_6);
  PyTuple_SET_ITEM(__pyx_t_20, 0, __pyx_t_6);
  __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_t_20, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 406, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "kapok/uavsarc.pyx":407
 *     # Initialize longitude dataset and import values:
 *     print('kapok.uavsar.load | Importing longitude values. ('+time.ctime()+')')
 *     lon = f.create_dataset('lon', (azsize, rngsize), dtype='float32', compression=compression, compression_opts=compression_opts)             # <<<<<<<<<<<<<<
 *     lon[:] = mlook(zoom(llh[azllhstart:azllhend,rngllhstart:rngllhend,1],mlwin_lkv),mlwin)[azllhoffset:(azllhoffset+azsize),rngllhoffset:(rngllhoffset+rngsize)]
 *     lon.attrs['units'] = 'degrees'
 */
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_create_dataset); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 407, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_20 = PyTuple_New(2); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 407, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  __Pyx_INCREF(__pyx_v_azsize);
  __Pyx_GIVEREF(__pyx_v_azsize);
  PyTuple_SET_ITEM(__pyx_t_20, 0, __pyx_v_azsize);
  __Pyx_INCREF(__pyx_v_rngsize);
  __Pyx_GIVEREF(__pyx_v_rngsize);
  PyTuple_SET_ITEM(__pyx_t_20, 1, __pyx_v_rngsize);
  __pyx_t_19 = PyTuple_New(2); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 407, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __Pyx_INCREF(__pyx_n_u_lon);
  __Pyx_GIVEREF(__pyx_n_u_lon);
  PyTuple_SET_ITEM(__pyx_t_19, 0, __pyx_n_u_lon);
  __Pyx_GIVEREF(__pyx_t_20);
  PyTuple_SET_ITEM(__pyx_t_19, 1, __pyx_t_20);
  __pyx_t_20 = 0;
  __pyx_t_20 = PyDict_New(); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 407, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_t_20, __pyx_n_s_dtype, __pyx_n_u_float32) < 0) __PYX_ERR(0, 407, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_20, __pyx_n_s_compression, __pyx_v_compression) < 0) __PYX_ERR(0, 407, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_20, __pyx_n_s_compression_opts, __pyx_v_compression_opts) < 0) __PYX_ERR(0, 407, __pyx_L1_error)
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_19, __pyx_t_20); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 407, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
  __pyx_v_lon = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "kapok/uavsarc.pyx":408
 *     print('kapok.uavsar.load | Importing longitude values. ('+time.ctime()+')')
 *     lon = f.create_dataset('lon', (azsize, rngsize), dtype='float32', compression=compression, compression_opts=compression_opts)
 *     lon[:] = mlook(zoom(llh[azllhstart:azllhend,rngllhstart:rngllhend,1],mlwin_lkv),mlwin)[azllhoffset:(azllhoffset+azsize),rngllhoffset:(rngllhoffset+rngsize)]             # <<<<<<<<<<<<<<
 *     lon.attrs['units'] = 'degrees'
 *     lon.attrs['description'] = 'Longitude'
 */
  __pyx_t_20 = __Pyx_GetModuleGlobalName(__pyx_n_s_mlook); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 408, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_zoom); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 408, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = PySlice_New(__pyx_v_azllhstart, __pyx_v_azllhend, Py_None); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 408, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_29 = PySlice_New(__pyx_v_rngllhstart, __pyx_v_rngllhend, Py_None); if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 408, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_29);
  __pyx_t_12 = PyTuple_New(3); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 408, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __Pyx_GIVEREF(__pyx_t_7);
  PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_7);
  __Pyx_GIVEREF(__pyx_t_29);
  PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_29);
  __Pyx_INCREF(__pyx_int_1);
  __Pyx_GIVEREF(__pyx_int_1);
  PyTuple_SET_ITEM(__pyx_t_12, 2, __pyx_int_1);
  __pyx_t_7 = 0;
  __pyx_t_29 = 0;
  __pyx_t_29 = PyObject_GetItem(__pyx_v_llh, __pyx_t_12); if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 408, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_29);
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __pyx_t_12 = NULL;
  __pyx_t_9 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_6);
    if (likely(__pyx_t_12)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_12);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_6, function);
      __pyx_t_9 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_6)) {
    PyObject *__pyx_temp[3] = {__pyx_t_12, __pyx_t_29, __pyx_v_mlwin_lkv};
    __pyx_t_19 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 408, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_GOTREF(__pyx_t_19);
    __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
    PyObject *__pyx_temp[3] = {__pyx_t_12, __pyx_t_29, __pyx_v_mlwin_lkv};
    __pyx_t_19 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 408, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_GOTREF(__pyx_t_19);
    __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0;
  } else
  #endif
  {
    __pyx_t_7 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 408, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    if (__pyx_t_12) {
      __Pyx_GIVEREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_12); __pyx_t_12 = NULL;
    }
    __Pyx_GIVEREF(__pyx_t_29);
    PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_9, __pyx_t_29);
    __Pyx_INCREF(__pyx_v_mlwin_lkv);
    __Pyx_GIVEREF(__pyx_v_mlwin_lkv);
    PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_9, __pyx_v_mlwin_lkv);
    __pyx_t_29 = 0;
    __pyx_t_19 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 408, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_19);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  }
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = NULL;
  __pyx_t_9 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_20))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_20);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_20);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_20, function);
      __pyx_t_9 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_20)) {
    PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_19, __pyx_v_mlwin};
    __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_20, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 408, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_20)) {
    PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_19, __pyx_v_mlwin};
    __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_20, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 408, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  } else
  #endif
  {
    __pyx_t_7 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 408, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    if (__pyx_t_6) {
      __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL;
    }
    __Pyx_GIVEREF(__pyx_t_19);
    PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_9, __pyx_t_19);
    __Pyx_INCREF(__pyx_v_mlwin);
    __Pyx_GIVEREF(__pyx_v_mlwin);
    PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_9, __pyx_v_mlwin);
    __pyx_t_19 = 0;
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_20, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 408, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  }
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
  __pyx_t_20 = PyNumber_Add(__pyx_v_azllhoffset, __pyx_v_azsize); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 408, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  __pyx_t_7 = PySlice_New(__pyx_v_azllhoffset, __pyx_t_20, Py_None); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 408, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
  __pyx_t_20 = PyNumber_Add(__pyx_v_rngllhoffset, __pyx_v_rngsize); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 408, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  __pyx_t_19 = PySlice_New(__pyx_v_rngllhoffset, __pyx_t_20, Py_None); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 408, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
  __pyx_t_20 = PyTuple_New(2); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 408, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  __Pyx_GIVEREF(__pyx_t_7);
  PyTuple_SET_ITEM(__pyx_t_20, 0, __pyx_t_7);
  __Pyx_GIVEREF(__pyx_t_19);
  PyTuple_SET_ITEM(__pyx_t_20, 1, __pyx_t_19);
  __pyx_t_7 = 0;
  __pyx_t_19 = 0;
  __pyx_t_19 = PyObject_GetItem(__pyx_t_4, __pyx_t_20); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 408, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
  if (__Pyx_PyObject_SetSlice(__pyx_v_lon, __pyx_t_19, 0, 0, NULL, NULL, &__pyx_slice__57, 0, 0, 1) < 0) __PYX_ERR(0, 408, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "kapok/uavsarc.pyx":409
 *     lon = f.create_dataset('lon', (azsize, rngsize), dtype='float32', compression=compression, compression_opts=compression_opts)
 *     lon[:] = mlook(zoom(llh[azllhstart:azllhend,rngllhstart:rngllhend,1],mlwin_lkv),mlwin)[azllhoffset:(azllhoffset+azsize),rngllhoffset:(rngllhoffset+rngsize)]
 *     lon.attrs['units'] = 'degrees'             # <<<<<<<<<<<<<<
 *     lon.attrs['description'] = 'Longitude'
 * 
 */
  __pyx_t_19 = __Pyx_PyObject_GetAttrStr(__pyx_v_lon, __pyx_n_s_attrs); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 409, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (unlikely(PyObject_SetItem(__pyx_t_19, __pyx_n_u_units, __pyx_n_u_degrees) < 0)) __PYX_ERR(0, 409, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "kapok/uavsarc.pyx":410
 *     lon[:] = mlook(zoom(llh[azllhstart:azllhend,rngllhstart:rngllhend,1],mlwin_lkv),mlwin)[azllhoffset:(azllhoffset+azsize),rngllhoffset:(rngllhoffset+rngsize)]
 *     lon.attrs['units'] = 'degrees'
 *     lon.attrs['description'] = 'Longitude'             # <<<<<<<<<<<<<<
 * 
 *     # Initialize DEM height dataset and import values:
 */
  __pyx_t_19 = __Pyx_PyObject_GetAttrStr(__pyx_v_lon, __pyx_n_s_attrs); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 410, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (unlikely(PyObject_SetItem(__pyx_t_19, __pyx_n_u_description, __pyx_n_u_Longitude) < 0)) __PYX_ERR(0, 410, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "kapok/uavsarc.pyx":413
 * 
 *     # Initialize DEM height dataset and import values:
 *     print('kapok.uavsar.load | Importing DEM heights. ('+time.ctime()+')')             # <<<<<<<<<<<<<<
 *     dem = f.create_dataset('dem', (azsize, rngsize), dtype='float32', compression=compression, compression_opts=compression_opts)
 *     dem[:] = mlook(zoom(llh[azllhstart:azllhend,rngllhstart:rngllhend,2],mlwin_lkv),mlwin)[azllhoffset:(azllhoffset+azsize),rngllhoffset:(rngllhoffset+rngsize)]
 */
  __pyx_t_20 = __Pyx_GetModuleGlobalName(__pyx_n_s_time); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 413, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_20, __pyx_n_s_ctime); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 413, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
  __pyx_t_20 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_20 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_20)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_20);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  if (__pyx_t_20) {
    __pyx_t_19 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_20); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 413, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
  } else {
    __pyx_t_19 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 413, __pyx_L1_error)
  }
  __Pyx_GOTREF(__pyx_t_19);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyNumber_Add(__pyx_kp_u_kapok_uavsar_load_Importing_DEM, __pyx_t_19); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 413, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  __pyx_t_19 = PyNumber_Add(__pyx_t_4, __pyx_kp_u__16); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 413, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 413, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_19);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_19);
  __pyx_t_19 = 0;
  __pyx_t_19 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_t_4, NULL); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 413, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "kapok/uavsarc.pyx":414
 *     # Initialize DEM height dataset and import values:
 *     print('kapok.uavsar.load | Importing DEM heights. ('+time.ctime()+')')
 *     dem = f.create_dataset('dem', (azsize, rngsize), dtype='float32', compression=compression, compression_opts=compression_opts)             # <<<<<<<<<<<<<<
 *     dem[:] = mlook(zoom(llh[azllhstart:azllhend,rngllhstart:rngllhend,2],mlwin_lkv),mlwin)[azllhoffset:(azllhoffset+azsize),rngllhoffset:(rngllhoffset+rngsize)]
 *     dem.attrs['units'] = 'meters'
 */
  __pyx_t_19 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_create_dataset); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 414, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 414, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF(__pyx_v_azsize);
  __Pyx_GIVEREF(__pyx_v_azsize);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_azsize);
  __Pyx_INCREF(__pyx_v_rngsize);
  __Pyx_GIVEREF(__pyx_v_rngsize);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_rngsize);
  __pyx_t_20 = PyTuple_New(2); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 414, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  __Pyx_INCREF(__pyx_n_u_dem);
  __Pyx_GIVEREF(__pyx_n_u_dem);
  PyTuple_SET_ITEM(__pyx_t_20, 0, __pyx_n_u_dem);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_20, 1, __pyx_t_4);
  __pyx_t_4 = 0;
  __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 414, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_n_u_float32) < 0) __PYX_ERR(0, 414, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_compression, __pyx_v_compression) < 0) __PYX_ERR(0, 414, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_compression_opts, __pyx_v_compression_opts) < 0) __PYX_ERR(0, 414, __pyx_L1_error)
  __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_19, __pyx_t_20, __pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 414, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_dem = __pyx_t_7;
  __pyx_t_7 = 0;

  /* "kapok/uavsarc.pyx":415
 *     print('kapok.uavsar.load | Importing DEM heights. ('+time.ctime()+')')
 *     dem = f.create_dataset('dem', (azsize, rngsize), dtype='float32', compression=compression, compression_opts=compression_opts)
 *     dem[:] = mlook(zoom(llh[azllhstart:azllhend,rngllhstart:rngllhend,2],mlwin_lkv),mlwin)[azllhoffset:(azllhoffset+azsize),rngllhoffset:(rngllhoffset+rngsize)]             # <<<<<<<<<<<<<<
 *     dem.attrs['units'] = 'meters'
 *     dem.attrs['description'] = 'Processor DEM'
 */
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_mlook); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 415, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_19 = __Pyx_GetModuleGlobalName(__pyx_n_s_zoom); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 415, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __pyx_t_6 = PySlice_New(__pyx_v_azllhstart, __pyx_v_azllhend, Py_None); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 415, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_29 = PySlice_New(__pyx_v_rngllhstart, __pyx_v_rngllhend, Py_None); if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 415, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_29);
  __pyx_t_12 = PyTuple_New(3); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 415, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __Pyx_GIVEREF(__pyx_t_6);
  PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_29);
  PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_29);
  __Pyx_INCREF(__pyx_int_2);
  __Pyx_GIVEREF(__pyx_int_2);
  PyTuple_SET_ITEM(__pyx_t_12, 2, __pyx_int_2);
  __pyx_t_6 = 0;
  __pyx_t_29 = 0;
  __pyx_t_29 = PyObject_GetItem(__pyx_v_llh, __pyx_t_12); if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 415, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_29);
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __pyx_t_12 = NULL;
  __pyx_t_9 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_19))) {
    __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_19);
    if (likely(__pyx_t_12)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_19);
      __Pyx_INCREF(__pyx_t_12);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_19, function);
      __pyx_t_9 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_19)) {
    PyObject *__pyx_temp[3] = {__pyx_t_12, __pyx_t_29, __pyx_v_mlwin_lkv};
    __pyx_t_20 = __Pyx_PyFunction_FastCall(__pyx_t_19, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 415, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_GOTREF(__pyx_t_20);
    __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_19)) {
    PyObject *__pyx_temp[3] = {__pyx_t_12, __pyx_t_29, __pyx_v_mlwin_lkv};
    __pyx_t_20 = __Pyx_PyCFunction_FastCall(__pyx_t_19, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 415, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_GOTREF(__pyx_t_20);
    __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0;
  } else
  #endif
  {
    __pyx_t_6 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 415, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (__pyx_t_12) {
      __Pyx_GIVEREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_12); __pyx_t_12 = NULL;
    }
    __Pyx_GIVEREF(__pyx_t_29);
    PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_9, __pyx_t_29);
    __Pyx_INCREF(__pyx_v_mlwin_lkv);
    __Pyx_GIVEREF(__pyx_v_mlwin_lkv);
    PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_9, __pyx_v_mlwin_lkv);
    __pyx_t_29 = 0;
    __pyx_t_20 = __Pyx_PyObject_Call(__pyx_t_19, __pyx_t_6, NULL); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 415, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_20);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  __pyx_t_19 = NULL;
  __pyx_t_9 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_19 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_19)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_19);
      __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[3] = {__pyx_t_19, __pyx_t_20, __pyx_v_mlwin};
    __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 415, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0;
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
    PyObject *__pyx_temp[3] = {__pyx_t_19, __pyx_t_20, __pyx_v_mlwin};
    __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 415, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0;
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
  } else
  #endif
  {
    __pyx_t_6 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 415, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (__pyx_t_19) {
      __Pyx_GIVEREF(__pyx_t_19); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_19); __pyx_t_19 = NULL;
    }
    __Pyx_GIVEREF(__pyx_t_20);
    PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_9, __pyx_t_20);
    __Pyx_INCREF(__pyx_v_mlwin);
    __Pyx_GIVEREF(__pyx_v_mlwin);
    PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_9, __pyx_v_mlwin);
    __pyx_t_20 = 0;
    __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 415, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyNumber_Add(__pyx_v_azllhoffset, __pyx_v_azsize); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 415, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_6 = PySlice_New(__pyx_v_azllhoffset, __pyx_t_4, Py_None); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 415, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyNumber_Add(__pyx_v_rngllhoffset, __pyx_v_rngsize); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 415, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_20 = PySlice_New(__pyx_v_rngllhoffset, __pyx_t_4, Py_None); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 415, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 415, __pyx_L1_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_20);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_20);
  __pyx_t_6 = 0;
  __pyx_t_20 = 0;
  __pyx_t_20 = PyObject_GetItem(__pyx_t_7, __pyx_t_4); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 415, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_PyObject_SetSlice(__pyx_v_dem, __pyx_t_20, 0, 0, NULL, NULL, &__pyx_slice__58, 0, 0, 1) < 0) __PYX_ERR(0, 415, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "kapok/uavsarc.pyx":416
 *     dem = f.create_dataset('dem', (azsize, rngsize), dtype='float32', compression=compression, compression_opts=compression_opts)
 *     dem[:] = mlook(zoom(llh[azllhstart:azllhend,rngllhstart:rngllhend,2],mlwin_lkv),mlwin)[azllhoffset:(azllhoffset+azsize),rngllhoffset:(rngllhoffset+rngsize)]
 *     dem.attrs['units'] = 'meters'             # <<<<<<<<<<<<<<
 *     dem.attrs['description'] = 'Processor DEM'
 * 
 */
  __pyx_t_20 = __Pyx_PyObject_GetAttrStr(__pyx_v_dem, __pyx_n_s_attrs); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 416, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (unlikely(PyObject_SetItem(__pyx_t_20, __pyx_n_u_units, __pyx_n_u_meters) < 0)) __PYX_ERR(0, 416, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "kapok/uavsarc.pyx":417
 *     dem[:] = mlook(zoom(llh[azllhstart:azllhend,rngllhstart:rngllhend,2],mlwin_lkv),mlwin)[azllhoffset:(azllhoffset+azsize),rngllhoffset:(rngllhoffset+rngsize)]
 *     dem.attrs['units'] = 'meters'
 *     dem.attrs['description'] = 'Processor DEM'             # <<<<<<<<<<<<<<
 * 
 *     # Convert LLH to ENU coordinates.  Used to calculate platform position later.
 */
  __pyx_t_20 = __Pyx_PyObject_GetAttrStr(__pyx_v_dem, __pyx_n_s_attrs); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 417, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (unlikely(PyObject_SetItem(__pyx_t_20, __pyx_n_u_description, __pyx_kp_u_Processor_DEM) < 0)) __PYX_ERR(0, 417, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "kapok/uavsarc.pyx":420
 * 
 *     # Convert LLH to ENU coordinates.  Used to calculate platform position later.
 *     posmm = llh2enu(np.radians(llh[:,:,1]), np.radians(llh[:,:,0]), llh[:,:,2], peglat, peglon, peghdg)             # <<<<<<<<<<<<<<
 * 
 *     f.flush()
 */
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_llh2enu); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 420, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 420, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_19 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_radians); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 420, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = PyObject_GetItem(__pyx_v_llh, __pyx_tuple__61); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 420, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_29 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_19))) {
    __pyx_t_29 = PyMethod_GET_SELF(__pyx_t_19);
    if (likely(__pyx_t_29)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_19);
      __Pyx_INCREF(__pyx_t_29);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_19, function);
    }
  }
  if (!__pyx_t_29) {
    __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_19, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 420, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_GOTREF(__pyx_t_7);
  } else {
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_19)) {
      PyObject *__pyx_temp[2] = {__pyx_t_29, __pyx_t_6};
      __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_19, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 420, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_29); __pyx_t_29 = 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_19)) {
      PyObject *__pyx_temp[2] = {__pyx_t_29, __pyx_t_6};
      __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_19, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 420, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_29); __pyx_t_29 = 0;
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    } else
    #endif
    {
      __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 420, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_GIVEREF(__pyx_t_29); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_29); __pyx_t_29 = NULL;
      __Pyx_GIVEREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_6);
      __pyx_t_6 = 0;
      __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_19, __pyx_t_12, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 420, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 420, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_radians); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 420, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __pyx_t_12 = PyObject_GetItem(__pyx_v_llh, __pyx_tuple__64); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 420, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_29 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_29 = PyMethod_GET_SELF(__pyx_t_6);
    if (likely(__pyx_t_29)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_29);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_6, function);
    }
  }
  if (!__pyx_t_29) {
    __pyx_t_19 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_12); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 420, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_GOTREF(__pyx_t_19);
  } else {
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_6)) {
      PyObject *__pyx_temp[2] = {__pyx_t_29, __pyx_t_12};
      __pyx_t_19 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 420, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_29); __pyx_t_29 = 0;
      __Pyx_GOTREF(__pyx_t_19);
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
      PyObject *__pyx_temp[2] = {__pyx_t_29, __pyx_t_12};
      __pyx_t_19 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 420, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_29); __pyx_t_29 = 0;
      __Pyx_GOTREF(__pyx_t_19);
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    } else
    #endif
    {
      __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 420, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_29); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_29); __pyx_t_29 = NULL;
      __Pyx_GIVEREF(__pyx_t_12);
      PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_12);
      __pyx_t_12 = 0;
      __pyx_t_19 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, NULL); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 420, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_19);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = PyObject_GetItem(__pyx_v_llh, __pyx_tuple__67); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 420, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_5 = NULL;
  __pyx_t_9 = 0;
  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_9 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_4)) {
    PyObject *__pyx_temp[7] = {__pyx_t_5, __pyx_t_7, __pyx_t_19, __pyx_t_6, __pyx_v_peglat, __pyx_v_peglon, __pyx_v_peghdg};
    __pyx_t_20 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_9, 6+__pyx_t_9); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 420, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_GOTREF(__pyx_t_20);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
    PyObject *__pyx_temp[7] = {__pyx_t_5, __pyx_t_7, __pyx_t_19, __pyx_t_6, __pyx_v_peglat, __pyx_v_peglon, __pyx_v_peghdg};
    __pyx_t_20 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_9, 6+__pyx_t_9); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 420, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_GOTREF(__pyx_t_20);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  } else
  #endif
  {
    __pyx_t_12 = PyTuple_New(6+__pyx_t_9); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 420, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    if (__pyx_t_5) {
      __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_5); __pyx_t_5 = NULL;
    }
    __Pyx_GIVEREF(__pyx_t_7);
    PyTuple_SET_ITEM(__pyx_t_12, 0+__pyx_t_9, __pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_19);
    PyTuple_SET_ITEM(__pyx_t_12, 1+__pyx_t_9, __pyx_t_19);
    __Pyx_GIVEREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_12, 2+__pyx_t_9, __pyx_t_6);
    __Pyx_INCREF(__pyx_v_peglat);
    __Pyx_GIVEREF(__pyx_v_peglat);
    PyTuple_SET_ITEM(__pyx_t_12, 3+__pyx_t_9, __pyx_v_peglat);
    __Pyx_INCREF(__pyx_v_peglon);
    __Pyx_GIVEREF(__pyx_v_peglon);
    PyTuple_SET_ITEM(__pyx_t_12, 4+__pyx_t_9, __pyx_v_peglon);
    __Pyx_INCREF(__pyx_v_peghdg);
    __Pyx_GIVEREF(__pyx_v_peghdg);
    PyTuple_SET_ITEM(__pyx_t_12, 5+__pyx_t_9, __pyx_v_peghdg);
    __pyx_t_7 = 0;
    __pyx_t_19 = 0;
    __pyx_t_6 = 0;
    __pyx_t_20 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_12, NULL); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 420, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_20);
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_posmm = __pyx_t_20;
  __pyx_t_20 = 0;

  /* "kapok/uavsarc.pyx":422
 *     posmm = llh2enu(np.radians(llh[:,:,1]), np.radians(llh[:,:,0]), llh[:,:,2], peglat, peglon, peghdg)
 * 
 *     f.flush()             # <<<<<<<<<<<<<<
 *     del llh
 * 
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_flush); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 422, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_12 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_12)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_12);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  if (__pyx_t_12) {
    __pyx_t_20 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_12); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 422, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  } else {
    __pyx_t_20 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 422, __pyx_L1_error)
  }
  __Pyx_GOTREF(__pyx_t_20);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "kapok/uavsarc.pyx":423
 * 
 *     f.flush()
 *     del llh             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_DECREF(__pyx_v_llh);
  __pyx_v_llh = NULL;

  /* "kapok/uavsarc.pyx":427
 * 
 *     # Load LKV files.
 *     lkvmm = None             # <<<<<<<<<<<<<<
 *     for seg in range(num_segments):
 *         lkvname = ann.query('lkv_'+str(seg+1)+'_2x8')
 */
  __Pyx_INCREF(Py_None);
  __pyx_v_lkvmm = Py_None;

  /* "kapok/uavsarc.pyx":428
 *     # Load LKV files.
 *     lkvmm = None
 *     for seg in range(num_segments):             # <<<<<<<<<<<<<<
 *         lkvname = ann.query('lkv_'+str(seg+1)+'_2x8')
 *         file = glob(datapath+lkvname)
 */
  __pyx_t_20 = PyTuple_New(1); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 428, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  __Pyx_INCREF(__pyx_v_num_segments);
  __Pyx_GIVEREF(__pyx_v_num_segments);
  PyTuple_SET_ITEM(__pyx_t_20, 0, __pyx_v_num_segments);
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_20, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 428, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
  if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) {
    __pyx_t_20 = __pyx_t_4; __Pyx_INCREF(__pyx_t_20); __pyx_t_15 = 0;
    __pyx_t_17 = NULL;
  } else {
    __pyx_t_15 = -1; __pyx_t_20 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 428, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_20);
    __pyx_t_17 = Py_TYPE(__pyx_t_20)->tp_iternext; if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 428, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  for (;;) {
    if (likely(!__pyx_t_17)) {
      if (likely(PyList_CheckExact(__pyx_t_20))) {
        if (__pyx_t_15 >= PyList_GET_SIZE(__pyx_t_20)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_20, __pyx_t_15); __Pyx_INCREF(__pyx_t_4); __pyx_t_15++; if (unlikely(0 < 0)) __PYX_ERR(0, 428, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_20, __pyx_t_15); __pyx_t_15++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 428, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        if (__pyx_t_15 >= PyTuple_GET_SIZE(__pyx_t_20)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_20, __pyx_t_15); __Pyx_INCREF(__pyx_t_4); __pyx_t_15++; if (unlikely(0 < 0)) __PYX_ERR(0, 428, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_20, __pyx_t_15); __pyx_t_15++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 428, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      }
    } else {
      __pyx_t_4 = __pyx_t_17(__pyx_t_20);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 428, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XDECREF_SET(__pyx_v_seg, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "kapok/uavsarc.pyx":429
 *     lkvmm = None
 *     for seg in range(num_segments):
 *         lkvname = ann.query('lkv_'+str(seg+1)+'_2x8')             # <<<<<<<<<<<<<<
 *         file = glob(datapath+lkvname)
 * 
 */
    __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_ann, __pyx_n_s_query); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 429, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __pyx_t_6 = __Pyx_PyInt_AddObjC(__pyx_v_seg, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 429, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_19 = PyTuple_New(1); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 429, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_19);
    __Pyx_GIVEREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_19, 0, __pyx_t_6);
    __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyObject_Call(((PyObject *)(&PyUnicode_Type)), __pyx_t_19, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 429, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
    __pyx_t_19 = __Pyx_PyUnicode_Concat(__pyx_n_u_lkv, __pyx_t_6); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 429, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_19);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyUnicode_Concat(__pyx_t_19, __pyx_n_u_2x8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 429, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
    __pyx_t_19 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) {
      __pyx_t_19 = PyMethod_GET_SELF(__pyx_t_12);
      if (likely(__pyx_t_19)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
        __Pyx_INCREF(__pyx_t_19);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_12, function);
      }
    }
    if (!__pyx_t_19) {
      __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 429, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_GOTREF(__pyx_t_4);
    } else {
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_12)) {
        PyObject *__pyx_temp[2] = {__pyx_t_19, __pyx_t_6};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 429, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0;
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) {
        PyObject *__pyx_temp[2] = {__pyx_t_19, __pyx_t_6};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 429, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0;
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else
      #endif
      {
        __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 429, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_GIVEREF(__pyx_t_19); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_19); __pyx_t_19 = NULL;
        __Pyx_GIVEREF(__pyx_t_6);
        PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_6);
        __pyx_t_6 = 0;
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 429, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      }
    }
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_XDECREF_SET(__pyx_v_lkvname, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "kapok/uavsarc.pyx":430
 *     for seg in range(num_segments):
 *         lkvname = ann.query('lkv_'+str(seg+1)+'_2x8')
 *         file = glob(datapath+lkvname)             # <<<<<<<<<<<<<<
 * 
 *         if len(file) == 1:
 */
    __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_glob); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 430, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __pyx_t_7 = PyNumber_Add(__pyx_v_datapath, __pyx_v_lkvname); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 430, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_6 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_12))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_12);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_12, function);
      }
    }
    if (!__pyx_t_6) {
      __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 430, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_GOTREF(__pyx_t_4);
    } else {
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_12)) {
        PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_7};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 430, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) {
        PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_7};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 430, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      } else
      #endif
      {
        __pyx_t_19 = PyTuple_New(1+1); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 430, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_19);
        __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_19, 0, __pyx_t_6); __pyx_t_6 = NULL;
        __Pyx_GIVEREF(__pyx_t_7);
        PyTuple_SET_ITEM(__pyx_t_19, 0+1, __pyx_t_7);
        __pyx_t_7 = 0;
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_19, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 430, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
      }
    }
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_XDECREF_SET(__pyx_v_file, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "kapok/uavsarc.pyx":432
 *         file = glob(datapath+lkvname)
 * 
 *         if len(file) == 1:             # <<<<<<<<<<<<<<
 *             lkv_rows = int(ann.query('lkv_'+str(seg+1)+'_2x8 Rows'))
 *             lkv_cols = int(ann.query('lkv_'+str(seg+1)+'_2x8 Columns'))
 */
    __pyx_t_18 = PyObject_Length(__pyx_v_file); if (unlikely(__pyx_t_18 == -1)) __PYX_ERR(0, 432, __pyx_L1_error)
    __pyx_t_8 = ((__pyx_t_18 == 1) != 0);
    if (__pyx_t_8) {

      /* "kapok/uavsarc.pyx":433
 * 
 *         if len(file) == 1:
 *             lkv_rows = int(ann.query('lkv_'+str(seg+1)+'_2x8 Rows'))             # <<<<<<<<<<<<<<
 *             lkv_cols = int(ann.query('lkv_'+str(seg+1)+'_2x8 Columns'))
 *             if lkvmm is None:
 */
      __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_ann, __pyx_n_s_query); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 433, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      __pyx_t_19 = __Pyx_PyInt_AddObjC(__pyx_v_seg, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 433, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_19);
      __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 433, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_19);
      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_19);
      __pyx_t_19 = 0;
      __pyx_t_19 = __Pyx_PyObject_Call(((PyObject *)(&PyUnicode_Type)), __pyx_t_7, NULL); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 433, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_19);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = __Pyx_PyUnicode_Concat(__pyx_n_u_lkv, __pyx_t_19); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 433, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
      __pyx_t_19 = __Pyx_PyUnicode_Concat(__pyx_t_7, __pyx_kp_u_2x8_Rows); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 433, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_19);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) {
        __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_12);
        if (likely(__pyx_t_7)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
          __Pyx_INCREF(__pyx_t_7);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_12, function);
        }
      }
      if (!__pyx_t_7) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_19); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 433, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_12)) {
          PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_19};
          __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 433, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) {
          PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_19};
          __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 433, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
        } else
        #endif
        {
          __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 433, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_7); __pyx_t_7 = NULL;
          __Pyx_GIVEREF(__pyx_t_19);
          PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_19);
          __pyx_t_19 = 0;
          __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 433, __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_t_12 = __Pyx_PyNumber_Int(__pyx_t_4); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 433, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_XDECREF_SET(__pyx_v_lkv_rows, __pyx_t_12);
      __pyx_t_12 = 0;

      /* "kapok/uavsarc.pyx":434
 *         if len(file) == 1:
 *             lkv_rows = int(ann.query('lkv_'+str(seg+1)+'_2x8 Rows'))
 *             lkv_cols = int(ann.query('lkv_'+str(seg+1)+'_2x8 Columns'))             # <<<<<<<<<<<<<<
 *             if lkvmm is None:
 *                 lkvmm = np.memmap(file[0], dtype='float32', mode='r', shape=(lkv_rows, lkv_cols, 3))
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_ann, __pyx_n_s_query); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 434, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_6 = __Pyx_PyInt_AddObjC(__pyx_v_seg, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 434, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_19 = PyTuple_New(1); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 434, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_19);
      __Pyx_GIVEREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_19, 0, __pyx_t_6);
      __pyx_t_6 = 0;
      __pyx_t_6 = __Pyx_PyObject_Call(((PyObject *)(&PyUnicode_Type)), __pyx_t_19, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 434, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
      __pyx_t_19 = __Pyx_PyUnicode_Concat(__pyx_n_u_lkv, __pyx_t_6); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 434, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_19);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = __Pyx_PyUnicode_Concat(__pyx_t_19, __pyx_kp_u_2x8_Columns); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 434, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
      __pyx_t_19 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_19 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_19)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_19);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
        }
      }
      if (!__pyx_t_19) {
        __pyx_t_12 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 434, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_GOTREF(__pyx_t_12);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_4)) {
          PyObject *__pyx_temp[2] = {__pyx_t_19, __pyx_t_6};
          __pyx_t_12 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 434, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0;
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
          PyObject *__pyx_temp[2] = {__pyx_t_19, __pyx_t_6};
          __pyx_t_12 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 434, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0;
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        } else
        #endif
        {
          __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 434, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_GIVEREF(__pyx_t_19); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_19); __pyx_t_19 = NULL;
          __Pyx_GIVEREF(__pyx_t_6);
          PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_6);
          __pyx_t_6 = 0;
          __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 434, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_PyNumber_Int(__pyx_t_12); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 434, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __Pyx_XDECREF_SET(__pyx_v_lkv_cols, __pyx_t_4);
      __pyx_t_4 = 0;

      /* "kapok/uavsarc.pyx":435
 *             lkv_rows = int(ann.query('lkv_'+str(seg+1)+'_2x8 Rows'))
 *             lkv_cols = int(ann.query('lkv_'+str(seg+1)+'_2x8 Columns'))
 *             if lkvmm is None:             # <<<<<<<<<<<<<<
 *                 lkvmm = np.memmap(file[0], dtype='float32', mode='r', shape=(lkv_rows, lkv_cols, 3))
 *             else:
 */
      __pyx_t_8 = (__pyx_v_lkvmm == Py_None);
      __pyx_t_13 = (__pyx_t_8 != 0);
      if (__pyx_t_13) {

        /* "kapok/uavsarc.pyx":436
 *             lkv_cols = int(ann.query('lkv_'+str(seg+1)+'_2x8 Columns'))
 *             if lkvmm is None:
 *                 lkvmm = np.memmap(file[0], dtype='float32', mode='r', shape=(lkv_rows, lkv_cols, 3))             # <<<<<<<<<<<<<<
 *             else:
 *                 lkvmm = np.vstack((lkvmm, np.memmap(file[0], dtype='float32', mode='r', shape=(lkv_rows, lkv_cols, 3))))
 */
        __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 436, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_memmap); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 436, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_file, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 436, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 436, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_GIVEREF(__pyx_t_4);
        PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4);
        __pyx_t_4 = 0;
        __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 436, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_n_u_float32) < 0) __PYX_ERR(0, 436, __pyx_L1_error)
        if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_mode, __pyx_n_u_r) < 0) __PYX_ERR(0, 436, __pyx_L1_error)
        __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 436, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_INCREF(__pyx_v_lkv_rows);
        __Pyx_GIVEREF(__pyx_v_lkv_rows);
        PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_lkv_rows);
        __Pyx_INCREF(__pyx_v_lkv_cols);
        __Pyx_GIVEREF(__pyx_v_lkv_cols);
        PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_lkv_cols);
        __Pyx_INCREF(__pyx_int_3);
        __Pyx_GIVEREF(__pyx_int_3);
        PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_int_3);
        if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_shape, __pyx_t_6) < 0) __PYX_ERR(0, 436, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_7, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 436, __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_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF_SET(__pyx_v_lkvmm, __pyx_t_6);
        __pyx_t_6 = 0;

        /* "kapok/uavsarc.pyx":435
 *             lkv_rows = int(ann.query('lkv_'+str(seg+1)+'_2x8 Rows'))
 *             lkv_cols = int(ann.query('lkv_'+str(seg+1)+'_2x8 Columns'))
 *             if lkvmm is None:             # <<<<<<<<<<<<<<
 *                 lkvmm = np.memmap(file[0], dtype='float32', mode='r', shape=(lkv_rows, lkv_cols, 3))
 *             else:
 */
        goto __pyx_L90;
      }

      /* "kapok/uavsarc.pyx":438
 *                 lkvmm = np.memmap(file[0], dtype='float32', mode='r', shape=(lkv_rows, lkv_cols, 3))
 *             else:
 *                 lkvmm = np.vstack((lkvmm, np.memmap(file[0], dtype='float32', mode='r', shape=(lkv_rows, lkv_cols, 3))))             # <<<<<<<<<<<<<<
 *         elif len(file) > 1:
 *             print('kapok.uavsar.load | Too many LKV files matching pattern: "'+datapath+lkvname+'".  Aborting.')
 */
      /*else*/ {
        __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 438, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_vstack); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 438, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 438, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_memmap); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 438, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_file, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 438, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_19 = PyTuple_New(1); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 438, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_19);
        __Pyx_GIVEREF(__pyx_t_4);
        PyTuple_SET_ITEM(__pyx_t_19, 0, __pyx_t_4);
        __pyx_t_4 = 0;
        __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 438, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_n_u_float32) < 0) __PYX_ERR(0, 438, __pyx_L1_error)
        if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_mode, __pyx_n_u_r) < 0) __PYX_ERR(0, 438, __pyx_L1_error)
        __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 438, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_INCREF(__pyx_v_lkv_rows);
        __Pyx_GIVEREF(__pyx_v_lkv_rows);
        PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_lkv_rows);
        __Pyx_INCREF(__pyx_v_lkv_cols);
        __Pyx_GIVEREF(__pyx_v_lkv_cols);
        PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_lkv_cols);
        __Pyx_INCREF(__pyx_int_3);
        __Pyx_GIVEREF(__pyx_int_3);
        PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_int_3);
        if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_shape, __pyx_t_5) < 0) __PYX_ERR(0, 438, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_19, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 438, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 438, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_INCREF(__pyx_v_lkvmm);
        __Pyx_GIVEREF(__pyx_v_lkvmm);
        PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_lkvmm);
        __Pyx_GIVEREF(__pyx_t_5);
        PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_5);
        __pyx_t_5 = 0;
        __pyx_t_5 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
          __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7);
          if (likely(__pyx_t_5)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
            __Pyx_INCREF(__pyx_t_5);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_7, function);
          }
        }
        if (!__pyx_t_5) {
          __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 438, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_6);
        } else {
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_7)) {
            PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_4};
            __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 438, __pyx_L1_error)
            __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
            __Pyx_GOTREF(__pyx_t_6);
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
            PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_4};
            __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 438, __pyx_L1_error)
            __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
            __Pyx_GOTREF(__pyx_t_6);
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          } else
          #endif
          {
            __pyx_t_19 = PyTuple_New(1+1); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 438, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_19);
            __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_19, 0, __pyx_t_5); __pyx_t_5 = NULL;
            __Pyx_GIVEREF(__pyx_t_4);
            PyTuple_SET_ITEM(__pyx_t_19, 0+1, __pyx_t_4);
            __pyx_t_4 = 0;
            __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_19, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 438, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_6);
            __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
          }
        }
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF_SET(__pyx_v_lkvmm, __pyx_t_6);
        __pyx_t_6 = 0;
      }
      __pyx_L90:;

      /* "kapok/uavsarc.pyx":432
 *         file = glob(datapath+lkvname)
 * 
 *         if len(file) == 1:             # <<<<<<<<<<<<<<
 *             lkv_rows = int(ann.query('lkv_'+str(seg+1)+'_2x8 Rows'))
 *             lkv_cols = int(ann.query('lkv_'+str(seg+1)+'_2x8 Columns'))
 */
      goto __pyx_L89;
    }

    /* "kapok/uavsarc.pyx":439
 *             else:
 *                 lkvmm = np.vstack((lkvmm, np.memmap(file[0], dtype='float32', mode='r', shape=(lkv_rows, lkv_cols, 3))))
 *         elif len(file) > 1:             # <<<<<<<<<<<<<<
 *             print('kapok.uavsar.load | Too many LKV files matching pattern: "'+datapath+lkvname+'".  Aborting.')
 *             return
 */
    __pyx_t_18 = PyObject_Length(__pyx_v_file); if (unlikely(__pyx_t_18 == -1)) __PYX_ERR(0, 439, __pyx_L1_error)
    __pyx_t_13 = ((__pyx_t_18 > 1) != 0);
    if (__pyx_t_13) {

      /* "kapok/uavsarc.pyx":440
 *                 lkvmm = np.vstack((lkvmm, np.memmap(file[0], dtype='float32', mode='r', shape=(lkv_rows, lkv_cols, 3))))
 *         elif len(file) > 1:
 *             print('kapok.uavsar.load | Too many LKV files matching pattern: "'+datapath+lkvname+'".  Aborting.')             # <<<<<<<<<<<<<<
 *             return
 *         else:
 */
      __pyx_t_6 = PyNumber_Add(__pyx_kp_u_kapok_uavsar_load_Too_many_LKV_f, __pyx_v_datapath); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 440, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = PyNumber_Add(__pyx_t_6, __pyx_v_lkvname); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 440, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = PyNumber_Add(__pyx_t_7, __pyx_kp_u_Aborting); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 440, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 440, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6);
      __pyx_t_6 = 0;
      __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_t_7, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 440, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

      /* "kapok/uavsarc.pyx":441
 *         elif len(file) > 1:
 *             print('kapok.uavsar.load | Too many LKV files matching pattern: "'+datapath+lkvname+'".  Aborting.')
 *             return             # <<<<<<<<<<<<<<
 *         else:
 *             print('kapok.uavsar.load | Cannot find LKV file matching pattern: "'+datapath+lkvname+'".  Aborting.')
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_r = Py_None; __Pyx_INCREF(Py_None);
      __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
      goto __pyx_L0;

      /* "kapok/uavsarc.pyx":439
 *             else:
 *                 lkvmm = np.vstack((lkvmm, np.memmap(file[0], dtype='float32', mode='r', shape=(lkv_rows, lkv_cols, 3))))
 *         elif len(file) > 1:             # <<<<<<<<<<<<<<
 *             print('kapok.uavsar.load | Too many LKV files matching pattern: "'+datapath+lkvname+'".  Aborting.')
 *             return
 */
    }

    /* "kapok/uavsarc.pyx":443
 *             return
 *         else:
 *             print('kapok.uavsar.load | Cannot find LKV file matching pattern: "'+datapath+lkvname+'".  Aborting.')             # <<<<<<<<<<<<<<
 *             return
 * 
 */
    /*else*/ {
      __pyx_t_6 = PyNumber_Add(__pyx_kp_u_kapok_uavsar_load_Cannot_find_LK, __pyx_v_datapath); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 443, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = PyNumber_Add(__pyx_t_6, __pyx_v_lkvname); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 443, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = PyNumber_Add(__pyx_t_7, __pyx_kp_u_Aborting); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 443, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 443, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6);
      __pyx_t_6 = 0;
      __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_t_7, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 443, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

      /* "kapok/uavsarc.pyx":444
 *         else:
 *             print('kapok.uavsar.load | Cannot find LKV file matching pattern: "'+datapath+lkvname+'".  Aborting.')
 *             return             # <<<<<<<<<<<<<<
 * 
 * 
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_r = Py_None; __Pyx_INCREF(Py_None);
      __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
      goto __pyx_L0;
    }
    __pyx_L89:;

    /* "kapok/uavsarc.pyx":428
 *     # Load LKV files.
 *     lkvmm = None
 *     for seg in range(num_segments):             # <<<<<<<<<<<<<<
 *         lkvname = ann.query('lkv_'+str(seg+1)+'_2x8')
 *         file = glob(datapath+lkvname)
 */
  }
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "kapok/uavsarc.pyx":448
 * 
 *     # Get sensor wavelength from annotation file.
 *     wavelength = ann.query('Center Wavelength')             # <<<<<<<<<<<<<<
 *     wavelength /= 100 # convert from cm to m
 *     f.attrs['wavelength'] = wavelength
 */
  __pyx_t_20 = __Pyx_PyObject_GetAttrStr(__pyx_v_ann, __pyx_n_s_query); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 448, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_20, __pyx_tuple__68, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 448, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
  __pyx_v_wavelength = __pyx_t_6;
  __pyx_t_6 = 0;

  /* "kapok/uavsarc.pyx":449
 *     # Get sensor wavelength from annotation file.
 *     wavelength = ann.query('Center Wavelength')
 *     wavelength /= 100 # convert from cm to m             # <<<<<<<<<<<<<<
 *     f.attrs['wavelength'] = wavelength
 * 
 */
  __pyx_t_6 = __Pyx_PyInt_TrueDivideObjC(__pyx_v_wavelength, __pyx_int_100, 0x64, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 449, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF_SET(__pyx_v_wavelength, __pyx_t_6);
  __pyx_t_6 = 0;

  /* "kapok/uavsarc.pyx":450
 *     wavelength = ann.query('Center Wavelength')
 *     wavelength /= 100 # convert from cm to m
 *     f.attrs['wavelength'] = wavelength             # <<<<<<<<<<<<<<
 * 
 *     # Starting S coordinate of SLCs, and S coordinate spacing (in meters).
 */
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_attrs); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 450, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (unlikely(PyObject_SetItem(__pyx_t_6, __pyx_n_u_wavelength, __pyx_v_wavelength) < 0)) __PYX_ERR(0, 450, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "kapok/uavsarc.pyx":453
 * 
 *     # Starting S coordinate of SLCs, and S coordinate spacing (in meters).
 *     sstart = ann.query('slc_1_1x1_mag.row_addr')             # <<<<<<<<<<<<<<
 *     sspacing = ann.query('slc_1_1x1_mag.row_mult')
 * 
 */
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_ann, __pyx_n_s_query); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 453, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_20 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__69, NULL); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 453, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_v_sstart = __pyx_t_20;
  __pyx_t_20 = 0;

  /* "kapok/uavsarc.pyx":454
 *     # Starting S coordinate of SLCs, and S coordinate spacing (in meters).
 *     sstart = ann.query('slc_1_1x1_mag.row_addr')
 *     sspacing = ann.query('slc_1_1x1_mag.row_mult')             # <<<<<<<<<<<<<<
 * 
 *     # S Coordinate Bounds for Desired Subset:
 */
  __pyx_t_20 = __Pyx_PyObject_GetAttrStr(__pyx_v_ann, __pyx_n_s_query); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 454, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_20, __pyx_tuple__70, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 454, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
  __pyx_v_sspacing = __pyx_t_6;
  __pyx_t_6 = 0;

  /* "kapok/uavsarc.pyx":457
 * 
 *     # S Coordinate Bounds for Desired Subset:
 *     sbounds = azbounds*sspacing + sstart             # <<<<<<<<<<<<<<
 * 
 *     # Calculate platform position from LLH and LKV:
 */
  __pyx_t_6 = PyNumber_Multiply(__pyx_v_azbounds, __pyx_v_sspacing); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 457, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_20 = PyNumber_Add(__pyx_t_6, __pyx_v_sstart); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 457, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_v_sbounds = __pyx_t_20;
  __pyx_t_20 = 0;

  /* "kapok/uavsarc.pyx":460
 * 
 *     # Calculate platform position from LLH and LKV:
 *     posmm = posmm - lkvmm             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_20 = PyNumber_Subtract(__pyx_v_posmm, __pyx_v_lkvmm); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 460, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  __Pyx_DECREF_SET(__pyx_v_posmm, __pyx_t_20);
  __pyx_t_20 = 0;

  /* "kapok/uavsarc.pyx":464
 * 
 *     # Incidence Angle Calculation for Reference Track
 *     print('kapok.uavsar.load | Calculating incidence angle values from reference track look vector. ('+time.ctime()+')')             # <<<<<<<<<<<<<<
 *     refvelocity = np.gradient(posmm, axis=0)
 *     refvelocity = refvelocity / (np.linalg.norm(refvelocity,axis=2)[:,:,np.newaxis])
 */
  __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_time); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 464, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_ctime); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 464, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_7, function);
    }
  }
  if (__pyx_t_6) {
    __pyx_t_20 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 464, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  } else {
    __pyx_t_20 = __Pyx_PyObject_CallNoArg(__pyx_t_7); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 464, __pyx_L1_error)
  }
  __Pyx_GOTREF(__pyx_t_20);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = PyNumber_Add(__pyx_kp_u_kapok_uavsar_load_Calculating_in, __pyx_t_20); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 464, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
  __pyx_t_20 = PyNumber_Add(__pyx_t_7, __pyx_kp_u__16); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 464, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 464, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_GIVEREF(__pyx_t_20);
  PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_20);
  __pyx_t_20 = 0;
  __pyx_t_20 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_t_7, NULL); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 464, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "kapok/uavsarc.pyx":465
 *     # Incidence Angle Calculation for Reference Track
 *     print('kapok.uavsar.load | Calculating incidence angle values from reference track look vector. ('+time.ctime()+')')
 *     refvelocity = np.gradient(posmm, axis=0)             # <<<<<<<<<<<<<<
 *     refvelocity = refvelocity / (np.linalg.norm(refvelocity,axis=2)[:,:,np.newaxis])
 * 
 */
  __pyx_t_20 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 465, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_20, __pyx_n_s_gradient); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 465, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
  __pyx_t_20 = PyTuple_New(1); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 465, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  __Pyx_INCREF(__pyx_v_posmm);
  __Pyx_GIVEREF(__pyx_v_posmm);
  PyTuple_SET_ITEM(__pyx_t_20, 0, __pyx_v_posmm);
  __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 465, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_axis, __pyx_int_0) < 0) __PYX_ERR(0, 465, __pyx_L1_error)
  __pyx_t_19 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_20, __pyx_t_6); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 465, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_v_refvelocity = __pyx_t_19;
  __pyx_t_19 = 0;

  /* "kapok/uavsarc.pyx":466
 *     print('kapok.uavsar.load | Calculating incidence angle values from reference track look vector. ('+time.ctime()+')')
 *     refvelocity = np.gradient(posmm, axis=0)
 *     refvelocity = refvelocity / (np.linalg.norm(refvelocity,axis=2)[:,:,np.newaxis])             # <<<<<<<<<<<<<<
 * 
 *     proj_reflkv_v = np.sum(lkvmm*refvelocity,axis=2)[:,:,np.newaxis]*refvelocity
 */
  __pyx_t_19 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 466, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_19, __pyx_n_s_linalg); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 466, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  __pyx_t_19 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_norm); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 466, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 466, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_INCREF(__pyx_v_refvelocity);
  __Pyx_GIVEREF(__pyx_v_refvelocity);
  PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_refvelocity);
  __pyx_t_20 = PyDict_New(); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 466, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_t_20, __pyx_n_s_axis, __pyx_int_2) < 0) __PYX_ERR(0, 466, __pyx_L1_error)
  __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_19, __pyx_t_6, __pyx_t_20); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 466, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
  __pyx_t_20 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 466, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_20, __pyx_n_s_newaxis); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 466, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
  __pyx_t_20 = PyTuple_New(3); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 466, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  __Pyx_INCREF(__pyx_slice__71);
  __Pyx_GIVEREF(__pyx_slice__71);
  PyTuple_SET_ITEM(__pyx_t_20, 0, __pyx_slice__71);
  __Pyx_INCREF(__pyx_slice__72);
  __Pyx_GIVEREF(__pyx_slice__72);
  PyTuple_SET_ITEM(__pyx_t_20, 1, __pyx_slice__72);
  __Pyx_GIVEREF(__pyx_t_6);
  PyTuple_SET_ITEM(__pyx_t_20, 2, __pyx_t_6);
  __pyx_t_6 = 0;
  __pyx_t_6 = PyObject_GetItem(__pyx_t_7, __pyx_t_20); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 466, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
  __pyx_t_20 = __Pyx_PyNumber_Divide(__pyx_v_refvelocity, __pyx_t_6); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 466, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF_SET(__pyx_v_refvelocity, __pyx_t_20);
  __pyx_t_20 = 0;

  /* "kapok/uavsarc.pyx":468
 *     refvelocity = refvelocity / (np.linalg.norm(refvelocity,axis=2)[:,:,np.newaxis])
 * 
 *     proj_reflkv_v = np.sum(lkvmm*refvelocity,axis=2)[:,:,np.newaxis]*refvelocity             # <<<<<<<<<<<<<<
 * 
 *     incident_lkv = lkvmm - proj_reflkv_v
 */
  __pyx_t_20 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 468, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_20, __pyx_n_s_sum); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 468, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
  __pyx_t_20 = PyNumber_Multiply(__pyx_v_lkvmm, __pyx_v_refvelocity); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 468, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 468, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_GIVEREF(__pyx_t_20);
  PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_20);
  __pyx_t_20 = 0;
  __pyx_t_20 = PyDict_New(); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 468, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_t_20, __pyx_n_s_axis, __pyx_int_2) < 0) __PYX_ERR(0, 468, __pyx_L1_error)
  __pyx_t_19 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, __pyx_t_20); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 468, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
  __pyx_t_20 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 468, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_20, __pyx_n_s_newaxis); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 468, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
  __pyx_t_20 = PyTuple_New(3); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 468, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  __Pyx_INCREF(__pyx_slice__73);
  __Pyx_GIVEREF(__pyx_slice__73);
  PyTuple_SET_ITEM(__pyx_t_20, 0, __pyx_slice__73);
  __Pyx_INCREF(__pyx_slice__74);
  __Pyx_GIVEREF(__pyx_slice__74);
  PyTuple_SET_ITEM(__pyx_t_20, 1, __pyx_slice__74);
  __Pyx_GIVEREF(__pyx_t_7);
  PyTuple_SET_ITEM(__pyx_t_20, 2, __pyx_t_7);
  __pyx_t_7 = 0;
  __pyx_t_7 = PyObject_GetItem(__pyx_t_19, __pyx_t_20); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 468, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
  __pyx_t_20 = PyNumber_Multiply(__pyx_t_7, __pyx_v_refvelocity); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 468, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_v_proj_reflkv_v = __pyx_t_20;
  __pyx_t_20 = 0;

  /* "kapok/uavsarc.pyx":470
 *     proj_reflkv_v = np.sum(lkvmm*refvelocity,axis=2)[:,:,np.newaxis]*refvelocity
 * 
 *     incident_lkv = lkvmm - proj_reflkv_v             # <<<<<<<<<<<<<<
 *     inc_ref = np.arccos(np.abs(incident_lkv[:,:,2])/np.linalg.norm(incident_lkv,axis=2))
 * 
 */
  __pyx_t_20 = PyNumber_Subtract(__pyx_v_lkvmm, __pyx_v_proj_reflkv_v); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 470, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  __pyx_v_incident_lkv = __pyx_t_20;
  __pyx_t_20 = 0;

  /* "kapok/uavsarc.pyx":471
 * 
 *     incident_lkv = lkvmm - proj_reflkv_v
 *     inc_ref = np.arccos(np.abs(incident_lkv[:,:,2])/np.linalg.norm(incident_lkv,axis=2))             # <<<<<<<<<<<<<<
 * 
 *     # Initialize incidence angle dataset (stores reference track incidence angle):
 */
  __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 471, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_19 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_arccos); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 471, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 471, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_abs); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 471, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = PyObject_GetItem(__pyx_v_incident_lkv, __pyx_tuple__77); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 471, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __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);
    }
  }
  if (!__pyx_t_5) {
    __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 471, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_GOTREF(__pyx_t_7);
  } else {
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_4)) {
      PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_6};
      __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 471, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 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_4)) {
      PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_6};
      __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 471, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    } else
    #endif
    {
      __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 471, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_5); __pyx_t_5 = NULL;
      __Pyx_GIVEREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_6);
      __pyx_t_6 = 0;
      __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_12, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 471, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 471, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_linalg); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 471, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_norm); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 471, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __pyx_t_12 = PyTuple_New(1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 471, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __Pyx_INCREF(__pyx_v_incident_lkv);
  __Pyx_GIVEREF(__pyx_v_incident_lkv);
  PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_v_incident_lkv);
  __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 471, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_axis, __pyx_int_2) < 0) __PYX_ERR(0, 471, __pyx_L1_error)
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_12, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 471, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_PyNumber_Divide(__pyx_t_7, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 471, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_19))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_19);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_19);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_19, function);
    }
  }
  if (!__pyx_t_5) {
    __pyx_t_20 = __Pyx_PyObject_CallOneArg(__pyx_t_19, __pyx_t_6); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 471, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_GOTREF(__pyx_t_20);
  } else {
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_19)) {
      PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_6};
      __pyx_t_20 = __Pyx_PyFunction_FastCall(__pyx_t_19, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 471, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_GOTREF(__pyx_t_20);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_19)) {
      PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_6};
      __pyx_t_20 = __Pyx_PyCFunction_FastCall(__pyx_t_19, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 471, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_GOTREF(__pyx_t_20);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    } else
    #endif
    {
      __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 471, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
      __Pyx_GIVEREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_6);
      __pyx_t_6 = 0;
      __pyx_t_20 = __Pyx_PyObject_Call(__pyx_t_19, __pyx_t_7, NULL); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 471, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_20);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  __pyx_v_inc_ref = __pyx_t_20;
  __pyx_t_20 = 0;

  /* "kapok/uavsarc.pyx":474
 * 
 *     # Initialize incidence angle dataset (stores reference track incidence angle):
 *     inc = f.create_dataset('inc', (azsize, rngsize), dtype='float32', compression=compression, compression_opts=compression_opts)             # <<<<<<<<<<<<<<
 *     inc.attrs['units'] = 'radians'
 *     inc.attrs['description'] = 'Reference Track Incidence Angle'
 */
  __pyx_t_20 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_create_dataset); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 474, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  __pyx_t_19 = PyTuple_New(2); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 474, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __Pyx_INCREF(__pyx_v_azsize);
  __Pyx_GIVEREF(__pyx_v_azsize);
  PyTuple_SET_ITEM(__pyx_t_19, 0, __pyx_v_azsize);
  __Pyx_INCREF(__pyx_v_rngsize);
  __Pyx_GIVEREF(__pyx_v_rngsize);
  PyTuple_SET_ITEM(__pyx_t_19, 1, __pyx_v_rngsize);
  __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 474, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_INCREF(__pyx_n_u_inc);
  __Pyx_GIVEREF(__pyx_n_u_inc);
  PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_n_u_inc);
  __Pyx_GIVEREF(__pyx_t_19);
  PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_19);
  __pyx_t_19 = 0;
  __pyx_t_19 = PyDict_New(); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 474, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_19, __pyx_n_s_dtype, __pyx_n_u_float32) < 0) __PYX_ERR(0, 474, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_19, __pyx_n_s_compression, __pyx_v_compression) < 0) __PYX_ERR(0, 474, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_19, __pyx_n_s_compression_opts, __pyx_v_compression_opts) < 0) __PYX_ERR(0, 474, __pyx_L1_error)
  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_20, __pyx_t_7, __pyx_t_19); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 474, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  __pyx_v_inc = __pyx_t_6;
  __pyx_t_6 = 0;

  /* "kapok/uavsarc.pyx":475
 *     # Initialize incidence angle dataset (stores reference track incidence angle):
 *     inc = f.create_dataset('inc', (azsize, rngsize), dtype='float32', compression=compression, compression_opts=compression_opts)
 *     inc.attrs['units'] = 'radians'             # <<<<<<<<<<<<<<
 *     inc.attrs['description'] = 'Reference Track Incidence Angle'
 *     inc[:] = mlook(zoom(inc_ref[azllhstart:azllhend,rngllhstart:rngllhend],mlwin_lkv),mlwin)[azllhoffset:(azllhoffset+azsize),rngllhoffset:(rngllhoffset+rngsize)]
 */
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_inc, __pyx_n_s_attrs); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 475, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (unlikely(PyObject_SetItem(__pyx_t_6, __pyx_n_u_units, __pyx_n_u_radians) < 0)) __PYX_ERR(0, 475, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "kapok/uavsarc.pyx":476
 *     inc = f.create_dataset('inc', (azsize, rngsize), dtype='float32', compression=compression, compression_opts=compression_opts)
 *     inc.attrs['units'] = 'radians'
 *     inc.attrs['description'] = 'Reference Track Incidence Angle'             # <<<<<<<<<<<<<<
 *     inc[:] = mlook(zoom(inc_ref[azllhstart:azllhend,rngllhstart:rngllhend],mlwin_lkv),mlwin)[azllhoffset:(azllhoffset+azsize),rngllhoffset:(rngllhoffset+rngsize)]
 *     del refvelocity, proj_reflkv_v, incident_lkv, inc_ref
 */
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_inc, __pyx_n_s_attrs); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 476, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (unlikely(PyObject_SetItem(__pyx_t_6, __pyx_n_u_description, __pyx_kp_u_Reference_Track_Incidence_Angle) < 0)) __PYX_ERR(0, 476, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "kapok/uavsarc.pyx":477
 *     inc.attrs['units'] = 'radians'
 *     inc.attrs['description'] = 'Reference Track Incidence Angle'
 *     inc[:] = mlook(zoom(inc_ref[azllhstart:azllhend,rngllhstart:rngllhend],mlwin_lkv),mlwin)[azllhoffset:(azllhoffset+azsize),rngllhoffset:(rngllhoffset+rngsize)]             # <<<<<<<<<<<<<<
 *     del refvelocity, proj_reflkv_v, incident_lkv, inc_ref
 * 
 */
  __pyx_t_19 = __Pyx_GetModuleGlobalName(__pyx_n_s_mlook); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 477, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __pyx_t_20 = __Pyx_GetModuleGlobalName(__pyx_n_s_zoom); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 477, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  __pyx_t_5 = PySlice_New(__pyx_v_azllhstart, __pyx_v_azllhend, Py_None); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 477, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_12 = PySlice_New(__pyx_v_rngllhstart, __pyx_v_rngllhend, Py_None); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 477, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 477, __pyx_L1_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_12);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_12);
  __pyx_t_5 = 0;
  __pyx_t_12 = 0;
  __pyx_t_12 = PyObject_GetItem(__pyx_v_inc_ref, __pyx_t_4); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 477, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = NULL;
  __pyx_t_9 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_20))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_20);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_20);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_20, function);
      __pyx_t_9 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_20)) {
    PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_12, __pyx_v_mlwin_lkv};
    __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_20, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 477, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_20)) {
    PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_12, __pyx_v_mlwin_lkv};
    __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_20, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 477, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  } else
  #endif
  {
    __pyx_t_5 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 477, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (__pyx_t_4) {
      __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
    }
    __Pyx_GIVEREF(__pyx_t_12);
    PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_9, __pyx_t_12);
    __Pyx_INCREF(__pyx_v_mlwin_lkv);
    __Pyx_GIVEREF(__pyx_v_mlwin_lkv);
    PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_9, __pyx_v_mlwin_lkv);
    __pyx_t_12 = 0;
    __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_20, __pyx_t_5, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 477, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
  __pyx_t_20 = NULL;
  __pyx_t_9 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_19))) {
    __pyx_t_20 = PyMethod_GET_SELF(__pyx_t_19);
    if (likely(__pyx_t_20)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_19);
      __Pyx_INCREF(__pyx_t_20);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_19, function);
      __pyx_t_9 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_19)) {
    PyObject *__pyx_temp[3] = {__pyx_t_20, __pyx_t_7, __pyx_v_mlwin};
    __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_19, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 477, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0;
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_19)) {
    PyObject *__pyx_temp[3] = {__pyx_t_20, __pyx_t_7, __pyx_v_mlwin};
    __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_19, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 477, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0;
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  } else
  #endif
  {
    __pyx_t_5 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 477, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (__pyx_t_20) {
      __Pyx_GIVEREF(__pyx_t_20); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_20); __pyx_t_20 = NULL;
    }
    __Pyx_GIVEREF(__pyx_t_7);
    PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_9, __pyx_t_7);
    __Pyx_INCREF(__pyx_v_mlwin);
    __Pyx_GIVEREF(__pyx_v_mlwin);
    PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_9, __pyx_v_mlwin);
    __pyx_t_7 = 0;
    __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_19, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 477, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  __pyx_t_19 = PyNumber_Add(__pyx_v_azllhoffset, __pyx_v_azsize); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 477, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __pyx_t_5 = PySlice_New(__pyx_v_azllhoffset, __pyx_t_19, Py_None); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 477, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  __pyx_t_19 = PyNumber_Add(__pyx_v_rngllhoffset, __pyx_v_rngsize); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 477, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __pyx_t_7 = PySlice_New(__pyx_v_rngllhoffset, __pyx_t_19, Py_None); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 477, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  __pyx_t_19 = PyTuple_New(2); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 477, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_19, 0, __pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_7);
  PyTuple_SET_ITEM(__pyx_t_19, 1, __pyx_t_7);
  __pyx_t_5 = 0;
  __pyx_t_7 = 0;
  __pyx_t_7 = PyObject_GetItem(__pyx_t_6, __pyx_t_19); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 477, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  if (__Pyx_PyObject_SetSlice(__pyx_v_inc, __pyx_t_7, 0, 0, NULL, NULL, &__pyx_slice__78, 0, 0, 1) < 0) __PYX_ERR(0, 477, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "kapok/uavsarc.pyx":478
 *     inc.attrs['description'] = 'Reference Track Incidence Angle'
 *     inc[:] = mlook(zoom(inc_ref[azllhstart:azllhend,rngllhstart:rngllhend],mlwin_lkv),mlwin)[azllhoffset:(azllhoffset+azsize),rngllhoffset:(rngllhoffset+rngsize)]
 *     del refvelocity, proj_reflkv_v, incident_lkv, inc_ref             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_DECREF(__pyx_v_refvelocity);
  __pyx_v_refvelocity = NULL;
  __Pyx_DECREF(__pyx_v_proj_reflkv_v);
  __pyx_v_proj_reflkv_v = NULL;
  __Pyx_DECREF(__pyx_v_incident_lkv);
  __pyx_v_incident_lkv = NULL;
  __Pyx_DECREF(__pyx_v_inc_ref);
  __pyx_v_inc_ref = NULL;

  /* "kapok/uavsarc.pyx":483
 * 
 *     # Initialize kz dataset:
 *     kz = f.create_dataset('kz', (num_tracks, azsize, rngsize), dtype='float32', compression=compression, compression_opts=compression_opts)             # <<<<<<<<<<<<<<
 *     kz.attrs['units'] = 'radians/meter'
 *     kz.attrs['description'] = 'Interferometric Vertical Wavenumber'
 */
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_create_dataset); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 483, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_19 = PyTuple_New(3); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 483, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __Pyx_INCREF(__pyx_v_num_tracks);
  __Pyx_GIVEREF(__pyx_v_num_tracks);
  PyTuple_SET_ITEM(__pyx_t_19, 0, __pyx_v_num_tracks);
  __Pyx_INCREF(__pyx_v_azsize);
  __Pyx_GIVEREF(__pyx_v_azsize);
  PyTuple_SET_ITEM(__pyx_t_19, 1, __pyx_v_azsize);
  __Pyx_INCREF(__pyx_v_rngsize);
  __Pyx_GIVEREF(__pyx_v_rngsize);
  PyTuple_SET_ITEM(__pyx_t_19, 2, __pyx_v_rngsize);
  __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 483, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_INCREF(__pyx_n_u_kz);
  __Pyx_GIVEREF(__pyx_n_u_kz);
  PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_n_u_kz);
  __Pyx_GIVEREF(__pyx_t_19);
  PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_19);
  __pyx_t_19 = 0;
  __pyx_t_19 = PyDict_New(); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 483, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_19, __pyx_n_s_dtype, __pyx_n_u_float32) < 0) __PYX_ERR(0, 483, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_19, __pyx_n_s_compression, __pyx_v_compression) < 0) __PYX_ERR(0, 483, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_19, __pyx_n_s_compression_opts, __pyx_v_compression_opts) < 0) __PYX_ERR(0, 483, __pyx_L1_error)
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, __pyx_t_19); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 483, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  __pyx_v_kz = __pyx_t_5;
  __pyx_t_5 = 0;

  /* "kapok/uavsarc.pyx":484
 *     # Initialize kz dataset:
 *     kz = f.create_dataset('kz', (num_tracks, azsize, rngsize), dtype='float32', compression=compression, compression_opts=compression_opts)
 *     kz.attrs['units'] = 'radians/meter'             # <<<<<<<<<<<<<<
 *     kz.attrs['description'] = 'Interferometric Vertical Wavenumber'
 *     kz.attrs['indexing'] = 'track'
 */
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_kz, __pyx_n_s_attrs); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 484, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (unlikely(PyObject_SetItem(__pyx_t_5, __pyx_n_u_units, __pyx_kp_u_radians_meter) < 0)) __PYX_ERR(0, 484, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "kapok/uavsarc.pyx":485
 *     kz = f.create_dataset('kz', (num_tracks, azsize, rngsize), dtype='float32', compression=compression, compression_opts=compression_opts)
 *     kz.attrs['units'] = 'radians/meter'
 *     kz.attrs['description'] = 'Interferometric Vertical Wavenumber'             # <<<<<<<<<<<<<<
 *     kz.attrs['indexing'] = 'track'
 * 
 */
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_kz, __pyx_n_s_attrs); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 485, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (unlikely(PyObject_SetItem(__pyx_t_5, __pyx_n_u_description, __pyx_kp_u_Interferometric_Vertical_Wavenum) < 0)) __PYX_ERR(0, 485, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "kapok/uavsarc.pyx":486
 *     kz.attrs['units'] = 'radians/meter'
 *     kz.attrs['description'] = 'Interferometric Vertical Wavenumber'
 *     kz.attrs['indexing'] = 'track'             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_kz, __pyx_n_s_attrs); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 486, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (unlikely(PyObject_SetItem(__pyx_t_5, __pyx_n_u_indexing, __pyx_n_u_track) < 0)) __PYX_ERR(0, 486, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "kapok/uavsarc.pyx":490
 * 
 *     # Static Typed Variables (for kz calculation)
 *     cdef np.ndarray[np.float64_t, ndim=3] lkv = np.array(lkvmm,dtype='float64')             # <<<<<<<<<<<<<<
 *     del lkvmm
 * 
 */
  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 490, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_19 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_array); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 490, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 490, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_INCREF(__pyx_v_lkvmm);
  __Pyx_GIVEREF(__pyx_v_lkvmm);
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_lkvmm);
  __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 490, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_n_u_float64) < 0) __PYX_ERR(0, 490, __pyx_L1_error)
  __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_19, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 490, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 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, 490, __pyx_L1_error)
  __pyx_t_30 = ((PyArrayObject *)__pyx_t_7);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_lkv.rcbuffer->pybuffer, (PyObject*)__pyx_t_30, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) {
      __pyx_v_lkv = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_lkv.rcbuffer->pybuffer.buf = NULL;
      __PYX_ERR(0, 490, __pyx_L1_error)
    } else {__pyx_pybuffernd_lkv.diminfo[0].strides = __pyx_pybuffernd_lkv.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_lkv.diminfo[0].shape = __pyx_pybuffernd_lkv.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_lkv.diminfo[1].strides = __pyx_pybuffernd_lkv.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_lkv.diminfo[1].shape = __pyx_pybuffernd_lkv.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_lkv.diminfo[2].strides = __pyx_pybuffernd_lkv.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_lkv.diminfo[2].shape = __pyx_pybuffernd_lkv.rcbuffer->pybuffer.shape[2];
    }
  }
  __pyx_t_30 = 0;
  __pyx_v_lkv = ((PyArrayObject *)__pyx_t_7);
  __pyx_t_7 = 0;

  /* "kapok/uavsarc.pyx":491
 *     # Static Typed Variables (for kz calculation)
 *     cdef np.ndarray[np.float64_t, ndim=3] lkv = np.array(lkvmm,dtype='float64')
 *     del lkvmm             # <<<<<<<<<<<<<<
 * 
 *     cdef np.ndarray[np.float64_t, ndim=3] pos = np.array(posmm,dtype='float64')
 */
  __Pyx_DECREF(__pyx_v_lkvmm);
  __pyx_v_lkvmm = NULL;

  /* "kapok/uavsarc.pyx":493
 *     del lkvmm
 * 
 *     cdef np.ndarray[np.float64_t, ndim=3] pos = np.array(posmm,dtype='float64')             # <<<<<<<<<<<<<<
 *     del posmm
 * 
 */
  __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 493, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_array); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 493, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 493, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_INCREF(__pyx_v_posmm);
  __Pyx_GIVEREF(__pyx_v_posmm);
  PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_posmm);
  __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 493, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_n_u_float64) < 0) __PYX_ERR(0, 493, __pyx_L1_error)
  __pyx_t_19 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, __pyx_t_5); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 493, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (!(likely(((__pyx_t_19) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_19, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 493, __pyx_L1_error)
  __pyx_t_31 = ((PyArrayObject *)__pyx_t_19);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_pos.rcbuffer->pybuffer, (PyObject*)__pyx_t_31, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) {
      __pyx_v_pos = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_pos.rcbuffer->pybuffer.buf = NULL;
      __PYX_ERR(0, 493, __pyx_L1_error)
    } else {__pyx_pybuffernd_pos.diminfo[0].strides = __pyx_pybuffernd_pos.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_pos.diminfo[0].shape = __pyx_pybuffernd_pos.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_pos.diminfo[1].strides = __pyx_pybuffernd_pos.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_pos.diminfo[1].shape = __pyx_pybuffernd_pos.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_pos.diminfo[2].strides = __pyx_pybuffernd_pos.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_pos.diminfo[2].shape = __pyx_pybuffernd_pos.rcbuffer->pybuffer.shape[2];
    }
  }
  __pyx_t_31 = 0;
  __pyx_v_pos = ((PyArrayObject *)__pyx_t_19);
  __pyx_t_19 = 0;

  /* "kapok/uavsarc.pyx":494
 * 
 *     cdef np.ndarray[np.float64_t, ndim=3] pos = np.array(posmm,dtype='float64')
 *     del posmm             # <<<<<<<<<<<<<<
 * 
 *     cdef np.ndarray[np.float64_t, ndim=2] inc_buffer = np.zeros((mlwin[0],rngsize_slc),dtype='float64')
 */
  __Pyx_DECREF(__pyx_v_posmm);
  __pyx_v_posmm = NULL;

  /* "kapok/uavsarc.pyx":496
 *     del posmm
 * 
 *     cdef np.ndarray[np.float64_t, ndim=2] inc_buffer = np.zeros((mlwin[0],rngsize_slc),dtype='float64')             # <<<<<<<<<<<<<<
 *     cdef np.ndarray[np.float64_t, ndim=2] kz_buffer = np.zeros((mlwin[0],rngsize_slc),dtype='float64')
 * 
 */
  __pyx_t_19 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 496, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_19, __pyx_n_s_zeros); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 496, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  __pyx_t_19 = __Pyx_GetItemInt(__pyx_v_mlwin, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 496, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 496, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_GIVEREF(__pyx_t_19);
  PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_19);
  __Pyx_INCREF(__pyx_v_rngsize_slc);
  __Pyx_GIVEREF(__pyx_v_rngsize_slc);
  PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_v_rngsize_slc);
  __pyx_t_19 = 0;
  __pyx_t_19 = PyTuple_New(1); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 496, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __Pyx_GIVEREF(__pyx_t_7);
  PyTuple_SET_ITEM(__pyx_t_19, 0, __pyx_t_7);
  __pyx_t_7 = 0;
  __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 496, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_dtype, __pyx_n_u_float64) < 0) __PYX_ERR(0, 496, __pyx_L1_error)
  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_19, __pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 496, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 496, __pyx_L1_error)
  __pyx_t_32 = ((PyArrayObject *)__pyx_t_6);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_inc_buffer.rcbuffer->pybuffer, (PyObject*)__pyx_t_32, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
      __pyx_v_inc_buffer = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_inc_buffer.rcbuffer->pybuffer.buf = NULL;
      __PYX_ERR(0, 496, __pyx_L1_error)
    } else {__pyx_pybuffernd_inc_buffer.diminfo[0].strides = __pyx_pybuffernd_inc_buffer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_inc_buffer.diminfo[0].shape = __pyx_pybuffernd_inc_buffer.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_inc_buffer.diminfo[1].strides = __pyx_pybuffernd_inc_buffer.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_inc_buffer.diminfo[1].shape = __pyx_pybuffernd_inc_buffer.rcbuffer->pybuffer.shape[1];
    }
  }
  __pyx_t_32 = 0;
  __pyx_v_inc_buffer = ((PyArrayObject *)__pyx_t_6);
  __pyx_t_6 = 0;

  /* "kapok/uavsarc.pyx":497
 * 
 *     cdef np.ndarray[np.float64_t, ndim=2] inc_buffer = np.zeros((mlwin[0],rngsize_slc),dtype='float64')
 *     cdef np.ndarray[np.float64_t, ndim=2] kz_buffer = np.zeros((mlwin[0],rngsize_slc),dtype='float64')             # <<<<<<<<<<<<<<
 * 
 *     cdef np.ndarray[np.float64_t, ndim=3] tracklkv = np.zeros((mlwin[0],rngsize_slc,3),dtype='float64')
 */
  __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 497, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_zeros); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 497, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_mlwin, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 497, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_19 = PyTuple_New(2); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 497, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __Pyx_GIVEREF(__pyx_t_6);
  PyTuple_SET_ITEM(__pyx_t_19, 0, __pyx_t_6);
  __Pyx_INCREF(__pyx_v_rngsize_slc);
  __Pyx_GIVEREF(__pyx_v_rngsize_slc);
  PyTuple_SET_ITEM(__pyx_t_19, 1, __pyx_v_rngsize_slc);
  __pyx_t_6 = 0;
  __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 497, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_19);
  PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_19);
  __pyx_t_19 = 0;
  __pyx_t_19 = PyDict_New(); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 497, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_19, __pyx_n_s_dtype, __pyx_n_u_float64) < 0) __PYX_ERR(0, 497, __pyx_L1_error)
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, __pyx_t_19); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 497, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 497, __pyx_L1_error)
  __pyx_t_33 = ((PyArrayObject *)__pyx_t_5);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_kz_buffer.rcbuffer->pybuffer, (PyObject*)__pyx_t_33, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
      __pyx_v_kz_buffer = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_kz_buffer.rcbuffer->pybuffer.buf = NULL;
      __PYX_ERR(0, 497, __pyx_L1_error)
    } else {__pyx_pybuffernd_kz_buffer.diminfo[0].strides = __pyx_pybuffernd_kz_buffer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_kz_buffer.diminfo[0].shape = __pyx_pybuffernd_kz_buffer.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_kz_buffer.diminfo[1].strides = __pyx_pybuffernd_kz_buffer.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_kz_buffer.diminfo[1].shape = __pyx_pybuffernd_kz_buffer.rcbuffer->pybuffer.shape[1];
    }
  }
  __pyx_t_33 = 0;
  __pyx_v_kz_buffer = ((PyArrayObject *)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "kapok/uavsarc.pyx":499
 *     cdef np.ndarray[np.float64_t, ndim=2] kz_buffer = np.zeros((mlwin[0],rngsize_slc),dtype='float64')
 * 
 *     cdef np.ndarray[np.float64_t, ndim=3] tracklkv = np.zeros((mlwin[0],rngsize_slc,3),dtype='float64')             # <<<<<<<<<<<<<<
 *     cdef np.ndarray[np.float64_t, ndim=3] velocity = np.zeros((mlwin[0],rngsize_slc,3),dtype='float64')
 *     cdef np.ndarray[np.float64_t, ndim=3] lookcrossv = np.zeros((mlwin[0],rngsize_slc,3),dtype='float64')
 */
  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 499, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_19 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_zeros); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 499, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_mlwin, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 499, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 499, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5);
  __Pyx_INCREF(__pyx_v_rngsize_slc);
  __Pyx_GIVEREF(__pyx_v_rngsize_slc);
  PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_rngsize_slc);
  __Pyx_INCREF(__pyx_int_3);
  __Pyx_GIVEREF(__pyx_int_3);
  PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_int_3);
  __pyx_t_5 = 0;
  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 499, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_6);
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6);
  __pyx_t_6 = 0;
  __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 499, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_n_u_float64) < 0) __PYX_ERR(0, 499, __pyx_L1_error)
  __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_19, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 499, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 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, 499, __pyx_L1_error)
  __pyx_t_34 = ((PyArrayObject *)__pyx_t_7);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_tracklkv.rcbuffer->pybuffer, (PyObject*)__pyx_t_34, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) {
      __pyx_v_tracklkv = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_tracklkv.rcbuffer->pybuffer.buf = NULL;
      __PYX_ERR(0, 499, __pyx_L1_error)
    } else {__pyx_pybuffernd_tracklkv.diminfo[0].strides = __pyx_pybuffernd_tracklkv.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_tracklkv.diminfo[0].shape = __pyx_pybuffernd_tracklkv.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_tracklkv.diminfo[1].strides = __pyx_pybuffernd_tracklkv.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_tracklkv.diminfo[1].shape = __pyx_pybuffernd_tracklkv.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_tracklkv.diminfo[2].strides = __pyx_pybuffernd_tracklkv.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_tracklkv.diminfo[2].shape = __pyx_pybuffernd_tracklkv.rcbuffer->pybuffer.shape[2];
    }
  }
  __pyx_t_34 = 0;
  __pyx_v_tracklkv = ((PyArrayObject *)__pyx_t_7);
  __pyx_t_7 = 0;

  /* "kapok/uavsarc.pyx":500
 * 
 *     cdef np.ndarray[np.float64_t, ndim=3] tracklkv = np.zeros((mlwin[0],rngsize_slc,3),dtype='float64')
 *     cdef np.ndarray[np.float64_t, ndim=3] velocity = np.zeros((mlwin[0],rngsize_slc,3),dtype='float64')             # <<<<<<<<<<<<<<
 *     cdef np.ndarray[np.float64_t, ndim=3] lookcrossv = np.zeros((mlwin[0],rngsize_slc,3),dtype='float64')
 *     cdef np.ndarray[np.float64_t, ndim=3] tempdiff = np.zeros((mlwin[0],rngsize_slc,3),dtype='float64')
 */
  __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 500, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_zeros); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 500, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_mlwin, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 500, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 500, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_7);
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_7);
  __Pyx_INCREF(__pyx_v_rngsize_slc);
  __Pyx_GIVEREF(__pyx_v_rngsize_slc);
  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_rngsize_slc);
  __Pyx_INCREF(__pyx_int_3);
  __Pyx_GIVEREF(__pyx_int_3);
  PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_int_3);
  __pyx_t_7 = 0;
  __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 500, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5);
  __pyx_t_5 = 0;
  __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 500, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_n_u_float64) < 0) __PYX_ERR(0, 500, __pyx_L1_error)
  __pyx_t_19 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, __pyx_t_5); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 500, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (!(likely(((__pyx_t_19) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_19, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 500, __pyx_L1_error)
  __pyx_t_35 = ((PyArrayObject *)__pyx_t_19);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_velocity.rcbuffer->pybuffer, (PyObject*)__pyx_t_35, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) {
      __pyx_v_velocity = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_velocity.rcbuffer->pybuffer.buf = NULL;
      __PYX_ERR(0, 500, __pyx_L1_error)
    } else {__pyx_pybuffernd_velocity.diminfo[0].strides = __pyx_pybuffernd_velocity.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_velocity.diminfo[0].shape = __pyx_pybuffernd_velocity.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_velocity.diminfo[1].strides = __pyx_pybuffernd_velocity.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_velocity.diminfo[1].shape = __pyx_pybuffernd_velocity.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_velocity.diminfo[2].strides = __pyx_pybuffernd_velocity.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_velocity.diminfo[2].shape = __pyx_pybuffernd_velocity.rcbuffer->pybuffer.shape[2];
    }
  }
  __pyx_t_35 = 0;
  __pyx_v_velocity = ((PyArrayObject *)__pyx_t_19);
  __pyx_t_19 = 0;

  /* "kapok/uavsarc.pyx":501
 *     cdef np.ndarray[np.float64_t, ndim=3] tracklkv = np.zeros((mlwin[0],rngsize_slc,3),dtype='float64')
 *     cdef np.ndarray[np.float64_t, ndim=3] velocity = np.zeros((mlwin[0],rngsize_slc,3),dtype='float64')
 *     cdef np.ndarray[np.float64_t, ndim=3] lookcrossv = np.zeros((mlwin[0],rngsize_slc,3),dtype='float64')             # <<<<<<<<<<<<<<
 *     cdef np.ndarray[np.float64_t, ndim=3] tempdiff = np.zeros((mlwin[0],rngsize_slc,3),dtype='float64')
 *     cdef np.ndarray[np.float64_t, ndim=3] proj_lkv_velocity = np.zeros((mlwin[0],rngsize_slc,3),dtype='float64')
 */
  __pyx_t_19 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 501, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_19, __pyx_n_s_zeros); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 501, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  __pyx_t_19 = __Pyx_GetItemInt(__pyx_v_mlwin, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 501, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 501, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_GIVEREF(__pyx_t_19);
  PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_19);
  __Pyx_INCREF(__pyx_v_rngsize_slc);
  __Pyx_GIVEREF(__pyx_v_rngsize_slc);
  PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_v_rngsize_slc);
  __Pyx_INCREF(__pyx_int_3);
  __Pyx_GIVEREF(__pyx_int_3);
  PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_int_3);
  __pyx_t_19 = 0;
  __pyx_t_19 = PyTuple_New(1); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 501, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __Pyx_GIVEREF(__pyx_t_7);
  PyTuple_SET_ITEM(__pyx_t_19, 0, __pyx_t_7);
  __pyx_t_7 = 0;
  __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 501, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_dtype, __pyx_n_u_float64) < 0) __PYX_ERR(0, 501, __pyx_L1_error)
  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_19, __pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 501, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 501, __pyx_L1_error)
  __pyx_t_36 = ((PyArrayObject *)__pyx_t_6);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_lookcrossv.rcbuffer->pybuffer, (PyObject*)__pyx_t_36, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) {
      __pyx_v_lookcrossv = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_lookcrossv.rcbuffer->pybuffer.buf = NULL;
      __PYX_ERR(0, 501, __pyx_L1_error)
    } else {__pyx_pybuffernd_lookcrossv.diminfo[0].strides = __pyx_pybuffernd_lookcrossv.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_lookcrossv.diminfo[0].shape = __pyx_pybuffernd_lookcrossv.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_lookcrossv.diminfo[1].strides = __pyx_pybuffernd_lookcrossv.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_lookcrossv.diminfo[1].shape = __pyx_pybuffernd_lookcrossv.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_lookcrossv.diminfo[2].strides = __pyx_pybuffernd_lookcrossv.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_lookcrossv.diminfo[2].shape = __pyx_pybuffernd_lookcrossv.rcbuffer->pybuffer.shape[2];
    }
  }
  __pyx_t_36 = 0;
  __pyx_v_lookcrossv = ((PyArrayObject *)__pyx_t_6);
  __pyx_t_6 = 0;

  /* "kapok/uavsarc.pyx":502
 *     cdef np.ndarray[np.float64_t, ndim=3] velocity = np.zeros((mlwin[0],rngsize_slc,3),dtype='float64')
 *     cdef np.ndarray[np.float64_t, ndim=3] lookcrossv = np.zeros((mlwin[0],rngsize_slc,3),dtype='float64')
 *     cdef np.ndarray[np.float64_t, ndim=3] tempdiff = np.zeros((mlwin[0],rngsize_slc,3),dtype='float64')             # <<<<<<<<<<<<<<
 *     cdef np.ndarray[np.float64_t, ndim=3] proj_lkv_velocity = np.zeros((mlwin[0],rngsize_slc,3),dtype='float64')
 * 
 */
  __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 502, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_zeros); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 502, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_mlwin, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 502, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_19 = PyTuple_New(3); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 502, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __Pyx_GIVEREF(__pyx_t_6);
  PyTuple_SET_ITEM(__pyx_t_19, 0, __pyx_t_6);
  __Pyx_INCREF(__pyx_v_rngsize_slc);
  __Pyx_GIVEREF(__pyx_v_rngsize_slc);
  PyTuple_SET_ITEM(__pyx_t_19, 1, __pyx_v_rngsize_slc);
  __Pyx_INCREF(__pyx_int_3);
  __Pyx_GIVEREF(__pyx_int_3);
  PyTuple_SET_ITEM(__pyx_t_19, 2, __pyx_int_3);
  __pyx_t_6 = 0;
  __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 502, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_19);
  PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_19);
  __pyx_t_19 = 0;
  __pyx_t_19 = PyDict_New(); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 502, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_19, __pyx_n_s_dtype, __pyx_n_u_float64) < 0) __PYX_ERR(0, 502, __pyx_L1_error)
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, __pyx_t_19); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 502, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 502, __pyx_L1_error)
  __pyx_t_37 = ((PyArrayObject *)__pyx_t_5);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_tempdiff.rcbuffer->pybuffer, (PyObject*)__pyx_t_37, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) {
      __pyx_v_tempdiff = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_tempdiff.rcbuffer->pybuffer.buf = NULL;
      __PYX_ERR(0, 502, __pyx_L1_error)
    } else {__pyx_pybuffernd_tempdiff.diminfo[0].strides = __pyx_pybuffernd_tempdiff.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_tempdiff.diminfo[0].shape = __pyx_pybuffernd_tempdiff.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_tempdiff.diminfo[1].strides = __pyx_pybuffernd_tempdiff.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_tempdiff.diminfo[1].shape = __pyx_pybuffernd_tempdiff.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_tempdiff.diminfo[2].strides = __pyx_pybuffernd_tempdiff.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_tempdiff.diminfo[2].shape = __pyx_pybuffernd_tempdiff.rcbuffer->pybuffer.shape[2];
    }
  }
  __pyx_t_37 = 0;
  __pyx_v_tempdiff = ((PyArrayObject *)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "kapok/uavsarc.pyx":503
 *     cdef np.ndarray[np.float64_t, ndim=3] lookcrossv = np.zeros((mlwin[0],rngsize_slc,3),dtype='float64')
 *     cdef np.ndarray[np.float64_t, ndim=3] tempdiff = np.zeros((mlwin[0],rngsize_slc,3),dtype='float64')
 *     cdef np.ndarray[np.float64_t, ndim=3] proj_lkv_velocity = np.zeros((mlwin[0],rngsize_slc,3),dtype='float64')             # <<<<<<<<<<<<<<
 * 
 *     cdef np.ndarray[np.float64_t, ndim=2] base_enu = np.zeros((azbounds[1]-azbounds[0],3),dtype='float64')
 */
  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 503, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_19 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_zeros); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 503, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_mlwin, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 503, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 503, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5);
  __Pyx_INCREF(__pyx_v_rngsize_slc);
  __Pyx_GIVEREF(__pyx_v_rngsize_slc);
  PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_rngsize_slc);
  __Pyx_INCREF(__pyx_int_3);
  __Pyx_GIVEREF(__pyx_int_3);
  PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_int_3);
  __pyx_t_5 = 0;
  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 503, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_6);
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6);
  __pyx_t_6 = 0;
  __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 503, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_n_u_float64) < 0) __PYX_ERR(0, 503, __pyx_L1_error)
  __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_19, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 503, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 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, 503, __pyx_L1_error)
  __pyx_t_38 = ((PyArrayObject *)__pyx_t_7);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_proj_lkv_velocity.rcbuffer->pybuffer, (PyObject*)__pyx_t_38, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) {
      __pyx_v_proj_lkv_velocity = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_proj_lkv_velocity.rcbuffer->pybuffer.buf = NULL;
      __PYX_ERR(0, 503, __pyx_L1_error)
    } else {__pyx_pybuffernd_proj_lkv_velocity.diminfo[0].strides = __pyx_pybuffernd_proj_lkv_velocity.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_proj_lkv_velocity.diminfo[0].shape = __pyx_pybuffernd_proj_lkv_velocity.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_proj_lkv_velocity.diminfo[1].strides = __pyx_pybuffernd_proj_lkv_velocity.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_proj_lkv_velocity.diminfo[1].shape = __pyx_pybuffernd_proj_lkv_velocity.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_proj_lkv_velocity.diminfo[2].strides = __pyx_pybuffernd_proj_lkv_velocity.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_proj_lkv_velocity.diminfo[2].shape = __pyx_pybuffernd_proj_lkv_velocity.rcbuffer->pybuffer.shape[2];
    }
  }
  __pyx_t_38 = 0;
  __pyx_v_proj_lkv_velocity = ((PyArrayObject *)__pyx_t_7);
  __pyx_t_7 = 0;

  /* "kapok/uavsarc.pyx":505
 *     cdef np.ndarray[np.float64_t, ndim=3] proj_lkv_velocity = np.zeros((mlwin[0],rngsize_slc,3),dtype='float64')
 * 
 *     cdef np.ndarray[np.float64_t, ndim=2] base_enu = np.zeros((azbounds[1]-azbounds[0],3),dtype='float64')             # <<<<<<<<<<<<<<
 * 
 *     cdef np.ndarray[np.float64_t, ndim=2] baseline = np.zeros((mlwin[0],3),dtype='float64')
 */
  __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 505, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_zeros); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 505, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_azbounds, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 505, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_azbounds, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 505, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_19 = PyNumber_Subtract(__pyx_t_7, __pyx_t_5); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 505, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 505, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_19);
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_19);
  __Pyx_INCREF(__pyx_int_3);
  __Pyx_GIVEREF(__pyx_int_3);
  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_int_3);
  __pyx_t_19 = 0;
  __pyx_t_19 = PyTuple_New(1); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 505, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_19, 0, __pyx_t_5);
  __pyx_t_5 = 0;
  __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 505, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_n_u_float64) < 0) __PYX_ERR(0, 505, __pyx_L1_error)
  __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_19, __pyx_t_5); 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_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 505, __pyx_L1_error)
  __pyx_t_39 = ((PyArrayObject *)__pyx_t_7);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_base_enu.rcbuffer->pybuffer, (PyObject*)__pyx_t_39, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
      __pyx_v_base_enu = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_base_enu.rcbuffer->pybuffer.buf = NULL;
      __PYX_ERR(0, 505, __pyx_L1_error)
    } else {__pyx_pybuffernd_base_enu.diminfo[0].strides = __pyx_pybuffernd_base_enu.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_base_enu.diminfo[0].shape = __pyx_pybuffernd_base_enu.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_base_enu.diminfo[1].strides = __pyx_pybuffernd_base_enu.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_base_enu.diminfo[1].shape = __pyx_pybuffernd_base_enu.rcbuffer->pybuffer.shape[1];
    }
  }
  __pyx_t_39 = 0;
  __pyx_v_base_enu = ((PyArrayObject *)__pyx_t_7);
  __pyx_t_7 = 0;

  /* "kapok/uavsarc.pyx":507
 *     cdef np.ndarray[np.float64_t, ndim=2] base_enu = np.zeros((azbounds[1]-azbounds[0],3),dtype='float64')
 * 
 *     cdef np.ndarray[np.float64_t, ndim=2] baseline = np.zeros((mlwin[0],3),dtype='float64')             # <<<<<<<<<<<<<<
 *     cdef np.ndarray[np.float64_t, ndim=2] baselinep = np.zeros((mlwin[0],rngsize_slc),dtype='float64')
 *     cdef np.ndarray[np.float64_t, ndim=2] baselinepsign = np.zeros((mlwin[0],rngsize_slc),dtype='float64')
 */
  __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 507, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_zeros); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 507, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_mlwin, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 507, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_19 = PyTuple_New(2); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 507, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __Pyx_GIVEREF(__pyx_t_7);
  PyTuple_SET_ITEM(__pyx_t_19, 0, __pyx_t_7);
  __Pyx_INCREF(__pyx_int_3);
  __Pyx_GIVEREF(__pyx_int_3);
  PyTuple_SET_ITEM(__pyx_t_19, 1, __pyx_int_3);
  __pyx_t_7 = 0;
  __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 507, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_GIVEREF(__pyx_t_19);
  PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_19);
  __pyx_t_19 = 0;
  __pyx_t_19 = PyDict_New(); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 507, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_19, __pyx_n_s_dtype, __pyx_n_u_float64) < 0) __PYX_ERR(0, 507, __pyx_L1_error)
  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, __pyx_t_19); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 507, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 507, __pyx_L1_error)
  __pyx_t_40 = ((PyArrayObject *)__pyx_t_6);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_baseline.rcbuffer->pybuffer, (PyObject*)__pyx_t_40, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
      __pyx_v_baseline = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_baseline.rcbuffer->pybuffer.buf = NULL;
      __PYX_ERR(0, 507, __pyx_L1_error)
    } else {__pyx_pybuffernd_baseline.diminfo[0].strides = __pyx_pybuffernd_baseline.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_baseline.diminfo[0].shape = __pyx_pybuffernd_baseline.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_baseline.diminfo[1].strides = __pyx_pybuffernd_baseline.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_baseline.diminfo[1].shape = __pyx_pybuffernd_baseline.rcbuffer->pybuffer.shape[1];
    }
  }
  __pyx_t_40 = 0;
  __pyx_v_baseline = ((PyArrayObject *)__pyx_t_6);
  __pyx_t_6 = 0;

  /* "kapok/uavsarc.pyx":508
 * 
 *     cdef np.ndarray[np.float64_t, ndim=2] baseline = np.zeros((mlwin[0],3),dtype='float64')
 *     cdef np.ndarray[np.float64_t, ndim=2] baselinep = np.zeros((mlwin[0],rngsize_slc),dtype='float64')             # <<<<<<<<<<<<<<
 *     cdef np.ndarray[np.float64_t, ndim=2] baselinepsign = np.zeros((mlwin[0],rngsize_slc),dtype='float64')
 * 
 */
  __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 508, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_19 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_zeros); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 508, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_mlwin, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 508, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 508, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_GIVEREF(__pyx_t_6);
  PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6);
  __Pyx_INCREF(__pyx_v_rngsize_slc);
  __Pyx_GIVEREF(__pyx_v_rngsize_slc);
  PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_v_rngsize_slc);
  __pyx_t_6 = 0;
  __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 508, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_7);
  PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_7);
  __pyx_t_7 = 0;
  __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 508, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_dtype, __pyx_n_u_float64) < 0) __PYX_ERR(0, 508, __pyx_L1_error)
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_19, __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 508, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 508, __pyx_L1_error)
  __pyx_t_41 = ((PyArrayObject *)__pyx_t_5);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_baselinep.rcbuffer->pybuffer, (PyObject*)__pyx_t_41, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
      __pyx_v_baselinep = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_baselinep.rcbuffer->pybuffer.buf = NULL;
      __PYX_ERR(0, 508, __pyx_L1_error)
    } else {__pyx_pybuffernd_baselinep.diminfo[0].strides = __pyx_pybuffernd_baselinep.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_baselinep.diminfo[0].shape = __pyx_pybuffernd_baselinep.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_baselinep.diminfo[1].strides = __pyx_pybuffernd_baselinep.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_baselinep.diminfo[1].shape = __pyx_pybuffernd_baselinep.rcbuffer->pybuffer.shape[1];
    }
  }
  __pyx_t_41 = 0;
  __pyx_v_baselinep = ((PyArrayObject *)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "kapok/uavsarc.pyx":509
 *     cdef np.ndarray[np.float64_t, ndim=2] baseline = np.zeros((mlwin[0],3),dtype='float64')
 *     cdef np.ndarray[np.float64_t, ndim=2] baselinep = np.zeros((mlwin[0],rngsize_slc),dtype='float64')
 *     cdef np.ndarray[np.float64_t, ndim=2] baselinepsign = np.zeros((mlwin[0],rngsize_slc),dtype='float64')             # <<<<<<<<<<<<<<
 * 
 *     cdef unsigned long az_ml, lkvrowstart, lkvrowend, lkvtrimstart, lkvtrimend, azposstart, azposend
 */
  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 509, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_zeros); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 509, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_mlwin, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 509, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 509, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5);
  __Pyx_INCREF(__pyx_v_rngsize_slc);
  __Pyx_GIVEREF(__pyx_v_rngsize_slc);
  PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_rngsize_slc);
  __pyx_t_5 = 0;
  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 509, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_6);
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6);
  __pyx_t_6 = 0;
  __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 509, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_n_u_float64) < 0) __PYX_ERR(0, 509, __pyx_L1_error)
  __pyx_t_19 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 509, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (!(likely(((__pyx_t_19) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_19, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 509, __pyx_L1_error)
  __pyx_t_42 = ((PyArrayObject *)__pyx_t_19);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_baselinepsign.rcbuffer->pybuffer, (PyObject*)__pyx_t_42, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
      __pyx_v_baselinepsign = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_baselinepsign.rcbuffer->pybuffer.buf = NULL;
      __PYX_ERR(0, 509, __pyx_L1_error)
    } else {__pyx_pybuffernd_baselinepsign.diminfo[0].strides = __pyx_pybuffernd_baselinepsign.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_baselinepsign.diminfo[0].shape = __pyx_pybuffernd_baselinepsign.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_baselinepsign.diminfo[1].strides = __pyx_pybuffernd_baselinepsign.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_baselinepsign.diminfo[1].shape = __pyx_pybuffernd_baselinepsign.rcbuffer->pybuffer.shape[1];
    }
  }
  __pyx_t_42 = 0;
  __pyx_v_baselinepsign = ((PyArrayObject *)__pyx_t_19);
  __pyx_t_19 = 0;

  /* "kapok/uavsarc.pyx":515
 * 
 *     # Try to import .kz files if option kzcalc == False.
 *     if not kzcalc:             # <<<<<<<<<<<<<<
 *         kz.attrs['slope_corrected'] = True
 *         for tr in range(0,num_tracks):
 */
  __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_v_kzcalc); if (unlikely(__pyx_t_13 < 0)) __PYX_ERR(0, 515, __pyx_L1_error)
  __pyx_t_8 = ((!__pyx_t_13) != 0);
  if (__pyx_t_8) {

    /* "kapok/uavsarc.pyx":516
 *     # Try to import .kz files if option kzcalc == False.
 *     if not kzcalc:
 *         kz.attrs['slope_corrected'] = True             # <<<<<<<<<<<<<<
 *         for tr in range(0,num_tracks):
 *             kz_temp = None
 */
    __pyx_t_19 = __Pyx_PyObject_GetAttrStr(__pyx_v_kz, __pyx_n_s_attrs); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 516, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_19);
    if (unlikely(PyObject_SetItem(__pyx_t_19, __pyx_n_u_slope_corrected, Py_True) < 0)) __PYX_ERR(0, 516, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

    /* "kapok/uavsarc.pyx":517
 *     if not kzcalc:
 *         kz.attrs['slope_corrected'] = True
 *         for tr in range(0,num_tracks):             # <<<<<<<<<<<<<<
 *             kz_temp = None
 *             print('kapok.uavsar.load | Importing kz between track '+str(tr)+' and reference track. ('+time.ctime()+')')
 */
    __pyx_t_10 = __Pyx_PyInt_As_long(__pyx_v_num_tracks); if (unlikely((__pyx_t_10 == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 517, __pyx_L1_error)
    for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) {
      __pyx_v_tr = __pyx_t_11;

      /* "kapok/uavsarc.pyx":518
 *         kz.attrs['slope_corrected'] = True
 *         for tr in range(0,num_tracks):
 *             kz_temp = None             # <<<<<<<<<<<<<<
 *             print('kapok.uavsar.load | Importing kz between track '+str(tr)+' and reference track. ('+time.ctime()+')')
 *             for seg in range(num_segments):
 */
      __Pyx_INCREF(Py_None);
      __Pyx_XDECREF_SET(__pyx_v_kz_temp, Py_None);

      /* "kapok/uavsarc.pyx":519
 *         for tr in range(0,num_tracks):
 *             kz_temp = None
 *             print('kapok.uavsar.load | Importing kz between track '+str(tr)+' and reference track. ('+time.ctime()+')')             # <<<<<<<<<<<<<<
 *             for seg in range(num_segments):
 *                 if not kzcalc:
 */
      __pyx_t_19 = __Pyx_PyInt_From_unsigned_int(__pyx_v_tr); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 519, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_19);
      __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 519, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_19);
      PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_19);
      __pyx_t_19 = 0;
      __pyx_t_19 = __Pyx_PyObject_Call(((PyObject *)(&PyUnicode_Type)), __pyx_t_6, NULL); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 519, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_19);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = __Pyx_PyUnicode_Concat(__pyx_kp_u_kapok_uavsar_load_Importing_kz_b, __pyx_t_19); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 519, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
      __pyx_t_19 = __Pyx_PyUnicode_Concat(__pyx_t_6, __pyx_kp_u_and_reference_track); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 519, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_19);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_time); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 519, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_ctime); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 519, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
        }
      }
      if (__pyx_t_5) {
        __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 519, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      } else {
        __pyx_t_6 = __Pyx_PyObject_CallNoArg(__pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 519, __pyx_L1_error)
      }
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = PyNumber_Add(__pyx_t_19, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 519, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = PyNumber_Add(__pyx_t_7, __pyx_kp_u__16); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 519, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 519, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6);
      __pyx_t_6 = 0;
      __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_t_7, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 519, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

      /* "kapok/uavsarc.pyx":520
 *             kz_temp = None
 *             print('kapok.uavsar.load | Importing kz between track '+str(tr)+' and reference track. ('+time.ctime()+')')
 *             for seg in range(num_segments):             # <<<<<<<<<<<<<<
 *                 if not kzcalc:
 *                     file = glob(datapath+tracknames[tr]+'*s'+str(seg+1)+'*.kz')
 */
      __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 520, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_INCREF(__pyx_v_num_segments);
      __Pyx_GIVEREF(__pyx_v_num_segments);
      PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_num_segments);
      __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_6, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 520, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (likely(PyList_CheckExact(__pyx_t_7)) || PyTuple_CheckExact(__pyx_t_7)) {
        __pyx_t_6 = __pyx_t_7; __Pyx_INCREF(__pyx_t_6); __pyx_t_15 = 0;
        __pyx_t_17 = NULL;
      } else {
        __pyx_t_15 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 520, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_17 = Py_TYPE(__pyx_t_6)->tp_iternext; if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 520, __pyx_L1_error)
      }
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      for (;;) {
        if (likely(!__pyx_t_17)) {
          if (likely(PyList_CheckExact(__pyx_t_6))) {
            if (__pyx_t_15 >= PyList_GET_SIZE(__pyx_t_6)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_7 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_15); __Pyx_INCREF(__pyx_t_7); __pyx_t_15++; if (unlikely(0 < 0)) __PYX_ERR(0, 520, __pyx_L1_error)
            #else
            __pyx_t_7 = PySequence_ITEM(__pyx_t_6, __pyx_t_15); __pyx_t_15++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 520, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_7);
            #endif
          } else {
            if (__pyx_t_15 >= PyTuple_GET_SIZE(__pyx_t_6)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_15); __Pyx_INCREF(__pyx_t_7); __pyx_t_15++; if (unlikely(0 < 0)) __PYX_ERR(0, 520, __pyx_L1_error)
            #else
            __pyx_t_7 = PySequence_ITEM(__pyx_t_6, __pyx_t_15); __pyx_t_15++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 520, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_7);
            #endif
          }
        } else {
          __pyx_t_7 = __pyx_t_17(__pyx_t_6);
          if (unlikely(!__pyx_t_7)) {
            PyObject* exc_type = PyErr_Occurred();
            if (exc_type) {
              if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
              else __PYX_ERR(0, 520, __pyx_L1_error)
            }
            break;
          }
          __Pyx_GOTREF(__pyx_t_7);
        }
        __Pyx_XDECREF_SET(__pyx_v_seg, __pyx_t_7);
        __pyx_t_7 = 0;

        /* "kapok/uavsarc.pyx":521
 *             print('kapok.uavsar.load | Importing kz between track '+str(tr)+' and reference track. ('+time.ctime()+')')
 *             for seg in range(num_segments):
 *                 if not kzcalc:             # <<<<<<<<<<<<<<
 *                     file = glob(datapath+tracknames[tr]+'*s'+str(seg+1)+'*.kz')
 *                     file_alt = glob(datapath+tracknames[tr]+'*.kz')
 */
        __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_kzcalc); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 521, __pyx_L1_error)
        __pyx_t_13 = ((!__pyx_t_8) != 0);
        if (__pyx_t_13) {

          /* "kapok/uavsarc.pyx":522
 *             for seg in range(num_segments):
 *                 if not kzcalc:
 *                     file = glob(datapath+tracknames[tr]+'*s'+str(seg+1)+'*.kz')             # <<<<<<<<<<<<<<
 *                     file_alt = glob(datapath+tracknames[tr]+'*.kz')
 * 
 */
          __pyx_t_19 = __Pyx_GetModuleGlobalName(__pyx_n_s_glob); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 522, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_19);
          __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_tracknames, __pyx_v_tr, unsigned int, 0, __Pyx_PyInt_From_unsigned_int, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 522, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __pyx_t_20 = PyNumber_Add(__pyx_v_datapath, __pyx_t_5); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 522, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_20);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __pyx_t_5 = PyNumber_Add(__pyx_t_20, __pyx_kp_u_s_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 522, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
          __pyx_t_20 = __Pyx_PyInt_AddObjC(__pyx_v_seg, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 522, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_20);
          __pyx_t_12 = PyTuple_New(1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 522, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_GIVEREF(__pyx_t_20);
          PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_20);
          __pyx_t_20 = 0;
          __pyx_t_20 = __Pyx_PyObject_Call(((PyObject *)(&PyUnicode_Type)), __pyx_t_12, NULL); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 522, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_20);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_12 = PyNumber_Add(__pyx_t_5, __pyx_t_20); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 522, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
          __pyx_t_20 = PyNumber_Add(__pyx_t_12, __pyx_kp_u_kz_2); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 522, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_20);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_12 = NULL;
          if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_19))) {
            __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_19);
            if (likely(__pyx_t_12)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_19);
              __Pyx_INCREF(__pyx_t_12);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_19, function);
            }
          }
          if (!__pyx_t_12) {
            __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_19, __pyx_t_20); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 522, __pyx_L1_error)
            __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
            __Pyx_GOTREF(__pyx_t_7);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_19)) {
              PyObject *__pyx_temp[2] = {__pyx_t_12, __pyx_t_20};
              __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_19, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 522, __pyx_L1_error)
              __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
              __Pyx_GOTREF(__pyx_t_7);
              __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_19)) {
              PyObject *__pyx_temp[2] = {__pyx_t_12, __pyx_t_20};
              __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_19, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 522, __pyx_L1_error)
              __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
              __Pyx_GOTREF(__pyx_t_7);
              __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
            } else
            #endif
            {
              __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 522, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_5);
              __Pyx_GIVEREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_12); __pyx_t_12 = NULL;
              __Pyx_GIVEREF(__pyx_t_20);
              PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_20);
              __pyx_t_20 = 0;
              __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_19, __pyx_t_5, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 522, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_7);
              __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
          __Pyx_XDECREF_SET(__pyx_v_file, __pyx_t_7);
          __pyx_t_7 = 0;

          /* "kapok/uavsarc.pyx":523
 *                 if not kzcalc:
 *                     file = glob(datapath+tracknames[tr]+'*s'+str(seg+1)+'*.kz')
 *                     file_alt = glob(datapath+tracknames[tr]+'*.kz')             # <<<<<<<<<<<<<<
 * 
 *                     if len(file) >= 1:
 */
          __pyx_t_19 = __Pyx_GetModuleGlobalName(__pyx_n_s_glob); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 523, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_19);
          __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_tracknames, __pyx_v_tr, unsigned int, 0, __Pyx_PyInt_From_unsigned_int, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 523, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __pyx_t_20 = PyNumber_Add(__pyx_v_datapath, __pyx_t_5); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 523, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_20);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __pyx_t_5 = PyNumber_Add(__pyx_t_20, __pyx_kp_u_kz_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 523, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
          __pyx_t_20 = NULL;
          if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_19))) {
            __pyx_t_20 = PyMethod_GET_SELF(__pyx_t_19);
            if (likely(__pyx_t_20)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_19);
              __Pyx_INCREF(__pyx_t_20);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_19, function);
            }
          }
          if (!__pyx_t_20) {
            __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_19, __pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 523, __pyx_L1_error)
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
            __Pyx_GOTREF(__pyx_t_7);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_19)) {
              PyObject *__pyx_temp[2] = {__pyx_t_20, __pyx_t_5};
              __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_19, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 523, __pyx_L1_error)
              __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0;
              __Pyx_GOTREF(__pyx_t_7);
              __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_19)) {
              PyObject *__pyx_temp[2] = {__pyx_t_20, __pyx_t_5};
              __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_19, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 523, __pyx_L1_error)
              __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0;
              __Pyx_GOTREF(__pyx_t_7);
              __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
            } else
            #endif
            {
              __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 523, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_12);
              __Pyx_GIVEREF(__pyx_t_20); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_20); __pyx_t_20 = NULL;
              __Pyx_GIVEREF(__pyx_t_5);
              PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_5);
              __pyx_t_5 = 0;
              __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_19, __pyx_t_12, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 523, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_7);
              __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
          __Pyx_XDECREF_SET(__pyx_v_file_alt, __pyx_t_7);
          __pyx_t_7 = 0;

          /* "kapok/uavsarc.pyx":525
 *                     file_alt = glob(datapath+tracknames[tr]+'*.kz')
 * 
 *                     if len(file) >= 1:             # <<<<<<<<<<<<<<
 *                         kz_rows = int(ann.query('lkv_'+str(seg+1)+'_2x8 Rows'))
 *                         kz_cols = int(ann.query('lkv_'+str(seg+1)+'_2x8 Columns'))
 */
          __pyx_t_18 = PyObject_Length(__pyx_v_file); if (unlikely(__pyx_t_18 == -1)) __PYX_ERR(0, 525, __pyx_L1_error)
          __pyx_t_13 = ((__pyx_t_18 >= 1) != 0);
          if (__pyx_t_13) {

            /* "kapok/uavsarc.pyx":526
 * 
 *                     if len(file) >= 1:
 *                         kz_rows = int(ann.query('lkv_'+str(seg+1)+'_2x8 Rows'))             # <<<<<<<<<<<<<<
 *                         kz_cols = int(ann.query('lkv_'+str(seg+1)+'_2x8 Columns'))
 *                         if kz_temp is None:
 */
            __pyx_t_19 = __Pyx_PyObject_GetAttrStr(__pyx_v_ann, __pyx_n_s_query); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 526, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_19);
            __pyx_t_12 = __Pyx_PyInt_AddObjC(__pyx_v_seg, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 526, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_12);
            __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 526, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_GIVEREF(__pyx_t_12);
            PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_12);
            __pyx_t_12 = 0;
            __pyx_t_12 = __Pyx_PyObject_Call(((PyObject *)(&PyUnicode_Type)), __pyx_t_5, NULL); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 526, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_12);
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
            __pyx_t_5 = __Pyx_PyUnicode_Concat(__pyx_n_u_lkv, __pyx_t_12); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 526, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            __pyx_t_12 = __Pyx_PyUnicode_Concat(__pyx_t_5, __pyx_kp_u_2x8_Rows); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 526, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_12);
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
            __pyx_t_5 = NULL;
            if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_19))) {
              __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_19);
              if (likely(__pyx_t_5)) {
                PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_19);
                __Pyx_INCREF(__pyx_t_5);
                __Pyx_INCREF(function);
                __Pyx_DECREF_SET(__pyx_t_19, function);
              }
            }
            if (!__pyx_t_5) {
              __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_19, __pyx_t_12); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 526, __pyx_L1_error)
              __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
              __Pyx_GOTREF(__pyx_t_7);
            } else {
              #if CYTHON_FAST_PYCALL
              if (PyFunction_Check(__pyx_t_19)) {
                PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_12};
                __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_19, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 526, __pyx_L1_error)
                __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
                __Pyx_GOTREF(__pyx_t_7);
                __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
              } else
              #endif
              #if CYTHON_FAST_PYCCALL
              if (__Pyx_PyFastCFunction_Check(__pyx_t_19)) {
                PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_12};
                __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_19, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 526, __pyx_L1_error)
                __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
                __Pyx_GOTREF(__pyx_t_7);
                __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
              } else
              #endif
              {
                __pyx_t_20 = PyTuple_New(1+1); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 526, __pyx_L1_error)
                __Pyx_GOTREF(__pyx_t_20);
                __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_20, 0, __pyx_t_5); __pyx_t_5 = NULL;
                __Pyx_GIVEREF(__pyx_t_12);
                PyTuple_SET_ITEM(__pyx_t_20, 0+1, __pyx_t_12);
                __pyx_t_12 = 0;
                __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_19, __pyx_t_20, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 526, __pyx_L1_error)
                __Pyx_GOTREF(__pyx_t_7);
                __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
              }
            }
            __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
            __pyx_t_19 = __Pyx_PyNumber_Int(__pyx_t_7); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 526, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_19);
            __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_XDECREF_SET(__pyx_v_kz_rows, __pyx_t_19);
            __pyx_t_19 = 0;

            /* "kapok/uavsarc.pyx":527
 *                     if len(file) >= 1:
 *                         kz_rows = int(ann.query('lkv_'+str(seg+1)+'_2x8 Rows'))
 *                         kz_cols = int(ann.query('lkv_'+str(seg+1)+'_2x8 Columns'))             # <<<<<<<<<<<<<<
 *                         if kz_temp is None:
 *                             kz_temp = np.memmap(file[0], dtype='float32', mode='r', shape=(kz_rows, kz_cols))
 */
            __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_ann, __pyx_n_s_query); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 527, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_7);
            __pyx_t_20 = __Pyx_PyInt_AddObjC(__pyx_v_seg, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 527, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_20);
            __pyx_t_12 = PyTuple_New(1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 527, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_12);
            __Pyx_GIVEREF(__pyx_t_20);
            PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_20);
            __pyx_t_20 = 0;
            __pyx_t_20 = __Pyx_PyObject_Call(((PyObject *)(&PyUnicode_Type)), __pyx_t_12, NULL); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 527, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_20);
            __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            __pyx_t_12 = __Pyx_PyUnicode_Concat(__pyx_n_u_lkv, __pyx_t_20); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 527, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_12);
            __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
            __pyx_t_20 = __Pyx_PyUnicode_Concat(__pyx_t_12, __pyx_kp_u_2x8_Columns); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 527, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_20);
            __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            __pyx_t_12 = NULL;
            if (CYTHON_UNPACK_METHODS && likely(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);
              }
            }
            if (!__pyx_t_12) {
              __pyx_t_19 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_20); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 527, __pyx_L1_error)
              __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
              __Pyx_GOTREF(__pyx_t_19);
            } else {
              #if CYTHON_FAST_PYCALL
              if (PyFunction_Check(__pyx_t_7)) {
                PyObject *__pyx_temp[2] = {__pyx_t_12, __pyx_t_20};
                __pyx_t_19 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 527, __pyx_L1_error)
                __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
                __Pyx_GOTREF(__pyx_t_19);
                __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
              } else
              #endif
              #if CYTHON_FAST_PYCCALL
              if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
                PyObject *__pyx_temp[2] = {__pyx_t_12, __pyx_t_20};
                __pyx_t_19 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 527, __pyx_L1_error)
                __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
                __Pyx_GOTREF(__pyx_t_19);
                __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
              } else
              #endif
              {
                __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 527, __pyx_L1_error)
                __Pyx_GOTREF(__pyx_t_5);
                __Pyx_GIVEREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_12); __pyx_t_12 = NULL;
                __Pyx_GIVEREF(__pyx_t_20);
                PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_20);
                __pyx_t_20 = 0;
                __pyx_t_19 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_5, NULL); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 527, __pyx_L1_error)
                __Pyx_GOTREF(__pyx_t_19);
                __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
              }
            }
            __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
            __pyx_t_7 = __Pyx_PyNumber_Int(__pyx_t_19); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 527, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_7);
            __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
            __Pyx_XDECREF_SET(__pyx_v_kz_cols, __pyx_t_7);
            __pyx_t_7 = 0;

            /* "kapok/uavsarc.pyx":528
 *                         kz_rows = int(ann.query('lkv_'+str(seg+1)+'_2x8 Rows'))
 *                         kz_cols = int(ann.query('lkv_'+str(seg+1)+'_2x8 Columns'))
 *                         if kz_temp is None:             # <<<<<<<<<<<<<<
 *                             kz_temp = np.memmap(file[0], dtype='float32', mode='r', shape=(kz_rows, kz_cols))
 *                         else:
 */
            __pyx_t_13 = (__pyx_v_kz_temp == Py_None);
            __pyx_t_8 = (__pyx_t_13 != 0);
            if (__pyx_t_8) {

              /* "kapok/uavsarc.pyx":529
 *                         kz_cols = int(ann.query('lkv_'+str(seg+1)+'_2x8 Columns'))
 *                         if kz_temp is None:
 *                             kz_temp = np.memmap(file[0], dtype='float32', mode='r', shape=(kz_rows, kz_cols))             # <<<<<<<<<<<<<<
 *                         else:
 *                             kz_temp = np.vstack((kz_temp, np.memmap(file[0], dtype='float32', mode='r', shape=(kz_rows, kz_cols))))
 */
              __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 529, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_7);
              __pyx_t_19 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_memmap); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 529, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_19);
              __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
              __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_file, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 529, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_7);
              __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 529, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_5);
              __Pyx_GIVEREF(__pyx_t_7);
              PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_7);
              __pyx_t_7 = 0;
              __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 529, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_7);
              if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_dtype, __pyx_n_u_float32) < 0) __PYX_ERR(0, 529, __pyx_L1_error)
              if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_mode, __pyx_n_u_r) < 0) __PYX_ERR(0, 529, __pyx_L1_error)
              __pyx_t_20 = PyTuple_New(2); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 529, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_20);
              __Pyx_INCREF(__pyx_v_kz_rows);
              __Pyx_GIVEREF(__pyx_v_kz_rows);
              PyTuple_SET_ITEM(__pyx_t_20, 0, __pyx_v_kz_rows);
              __Pyx_INCREF(__pyx_v_kz_cols);
              __Pyx_GIVEREF(__pyx_v_kz_cols);
              PyTuple_SET_ITEM(__pyx_t_20, 1, __pyx_v_kz_cols);
              if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_shape, __pyx_t_20) < 0) __PYX_ERR(0, 529, __pyx_L1_error)
              __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
              __pyx_t_20 = __Pyx_PyObject_Call(__pyx_t_19, __pyx_t_5, __pyx_t_7); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 529, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_20);
              __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
              __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
              __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
              __Pyx_DECREF_SET(__pyx_v_kz_temp, __pyx_t_20);
              __pyx_t_20 = 0;

              /* "kapok/uavsarc.pyx":528
 *                         kz_rows = int(ann.query('lkv_'+str(seg+1)+'_2x8 Rows'))
 *                         kz_cols = int(ann.query('lkv_'+str(seg+1)+'_2x8 Columns'))
 *                         if kz_temp is None:             # <<<<<<<<<<<<<<
 *                             kz_temp = np.memmap(file[0], dtype='float32', mode='r', shape=(kz_rows, kz_cols))
 *                         else:
 */
              goto __pyx_L98;
            }

            /* "kapok/uavsarc.pyx":531
 *                             kz_temp = np.memmap(file[0], dtype='float32', mode='r', shape=(kz_rows, kz_cols))
 *                         else:
 *                             kz_temp = np.vstack((kz_temp, np.memmap(file[0], dtype='float32', mode='r', shape=(kz_rows, kz_cols))))             # <<<<<<<<<<<<<<
 *                     elif (num_segments == 1) and (len(file_alt) >= 1):
 *                         kz_rows = int(ann.query('lkv_'+str(seg+1)+'_2x8 Rows'))
 */
            /*else*/ {
              __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 531, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_7);
              __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_vstack); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 531, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_5);
              __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
              __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 531, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_7);
              __pyx_t_19 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_memmap); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 531, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_19);
              __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
              __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_file, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 531, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_7);
              __pyx_t_12 = PyTuple_New(1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 531, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_12);
              __Pyx_GIVEREF(__pyx_t_7);
              PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_7);
              __pyx_t_7 = 0;
              __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 531, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_7);
              if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_dtype, __pyx_n_u_float32) < 0) __PYX_ERR(0, 531, __pyx_L1_error)
              if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_mode, __pyx_n_u_r) < 0) __PYX_ERR(0, 531, __pyx_L1_error)
              __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 531, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_4);
              __Pyx_INCREF(__pyx_v_kz_rows);
              __Pyx_GIVEREF(__pyx_v_kz_rows);
              PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_kz_rows);
              __Pyx_INCREF(__pyx_v_kz_cols);
              __Pyx_GIVEREF(__pyx_v_kz_cols);
              PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_kz_cols);
              if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_shape, __pyx_t_4) < 0) __PYX_ERR(0, 531, __pyx_L1_error)
              __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
              __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_19, __pyx_t_12, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 531, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_4);
              __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
              __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
              __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
              __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 531, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_7);
              __Pyx_INCREF(__pyx_v_kz_temp);
              __Pyx_GIVEREF(__pyx_v_kz_temp);
              PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_kz_temp);
              __Pyx_GIVEREF(__pyx_t_4);
              PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_4);
              __pyx_t_4 = 0;
              __pyx_t_4 = NULL;
              if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
                __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
                if (likely(__pyx_t_4)) {
                  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
                  __Pyx_INCREF(__pyx_t_4);
                  __Pyx_INCREF(function);
                  __Pyx_DECREF_SET(__pyx_t_5, function);
                }
              }
              if (!__pyx_t_4) {
                __pyx_t_20 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_7); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 531, __pyx_L1_error)
                __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
                __Pyx_GOTREF(__pyx_t_20);
              } else {
                #if CYTHON_FAST_PYCALL
                if (PyFunction_Check(__pyx_t_5)) {
                  PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_7};
                  __pyx_t_20 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 531, __pyx_L1_error)
                  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
                  __Pyx_GOTREF(__pyx_t_20);
                  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
                } else
                #endif
                #if CYTHON_FAST_PYCCALL
                if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
                  PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_7};
                  __pyx_t_20 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 531, __pyx_L1_error)
                  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
                  __Pyx_GOTREF(__pyx_t_20);
                  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
                } else
                #endif
                {
                  __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 531, __pyx_L1_error)
                  __Pyx_GOTREF(__pyx_t_12);
                  __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_4); __pyx_t_4 = NULL;
                  __Pyx_GIVEREF(__pyx_t_7);
                  PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_7);
                  __pyx_t_7 = 0;
                  __pyx_t_20 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_12, NULL); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 531, __pyx_L1_error)
                  __Pyx_GOTREF(__pyx_t_20);
                  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
                }
              }
              __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
              __Pyx_DECREF_SET(__pyx_v_kz_temp, __pyx_t_20);
              __pyx_t_20 = 0;
            }
            __pyx_L98:;

            /* "kapok/uavsarc.pyx":525
 *                     file_alt = glob(datapath+tracknames[tr]+'*.kz')
 * 
 *                     if len(file) >= 1:             # <<<<<<<<<<<<<<
 *                         kz_rows = int(ann.query('lkv_'+str(seg+1)+'_2x8 Rows'))
 *                         kz_cols = int(ann.query('lkv_'+str(seg+1)+'_2x8 Columns'))
 */
            goto __pyx_L97;
          }

          /* "kapok/uavsarc.pyx":532
 *                         else:
 *                             kz_temp = np.vstack((kz_temp, np.memmap(file[0], dtype='float32', mode='r', shape=(kz_rows, kz_cols))))
 *                     elif (num_segments == 1) and (len(file_alt) >= 1):             # <<<<<<<<<<<<<<
 *                         kz_rows = int(ann.query('lkv_'+str(seg+1)+'_2x8 Rows'))
 *                         kz_cols = int(ann.query('lkv_'+str(seg+1)+'_2x8 Columns'))
 */
          __pyx_t_20 = __Pyx_PyInt_EqObjC(__pyx_v_num_segments, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 532, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_20);
          __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_20); if (unlikely(__pyx_t_13 < 0)) __PYX_ERR(0, 532, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
          if (__pyx_t_13) {
          } else {
            __pyx_t_8 = __pyx_t_13;
            goto __pyx_L99_bool_binop_done;
          }
          __pyx_t_18 = PyObject_Length(__pyx_v_file_alt); if (unlikely(__pyx_t_18 == -1)) __PYX_ERR(0, 532, __pyx_L1_error)
          __pyx_t_13 = ((__pyx_t_18 >= 1) != 0);
          __pyx_t_8 = __pyx_t_13;
          __pyx_L99_bool_binop_done:;
          if (__pyx_t_8) {

            /* "kapok/uavsarc.pyx":533
 *                             kz_temp = np.vstack((kz_temp, np.memmap(file[0], dtype='float32', mode='r', shape=(kz_rows, kz_cols))))
 *                     elif (num_segments == 1) and (len(file_alt) >= 1):
 *                         kz_rows = int(ann.query('lkv_'+str(seg+1)+'_2x8 Rows'))             # <<<<<<<<<<<<<<
 *                         kz_cols = int(ann.query('lkv_'+str(seg+1)+'_2x8 Columns'))
 *                         if kz_temp is None:
 */
            __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_ann, __pyx_n_s_query); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 533, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_5);
            __pyx_t_12 = __Pyx_PyInt_AddObjC(__pyx_v_seg, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 533, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_12);
            __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 533, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_7);
            __Pyx_GIVEREF(__pyx_t_12);
            PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_12);
            __pyx_t_12 = 0;
            __pyx_t_12 = __Pyx_PyObject_Call(((PyObject *)(&PyUnicode_Type)), __pyx_t_7, NULL); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 533, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_12);
            __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
            __pyx_t_7 = __Pyx_PyUnicode_Concat(__pyx_n_u_lkv, __pyx_t_12); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 533, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_7);
            __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            __pyx_t_12 = __Pyx_PyUnicode_Concat(__pyx_t_7, __pyx_kp_u_2x8_Rows); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 533, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_12);
            __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
            __pyx_t_7 = NULL;
            if (CYTHON_UNPACK_METHODS && likely(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);
              }
            }
            if (!__pyx_t_7) {
              __pyx_t_20 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_12); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 533, __pyx_L1_error)
              __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
              __Pyx_GOTREF(__pyx_t_20);
            } else {
              #if CYTHON_FAST_PYCALL
              if (PyFunction_Check(__pyx_t_5)) {
                PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_12};
                __pyx_t_20 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 533, __pyx_L1_error)
                __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
                __Pyx_GOTREF(__pyx_t_20);
                __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
              } else
              #endif
              #if CYTHON_FAST_PYCCALL
              if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
                PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_12};
                __pyx_t_20 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 533, __pyx_L1_error)
                __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
                __Pyx_GOTREF(__pyx_t_20);
                __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
              } else
              #endif
              {
                __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 533, __pyx_L1_error)
                __Pyx_GOTREF(__pyx_t_4);
                __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_7); __pyx_t_7 = NULL;
                __Pyx_GIVEREF(__pyx_t_12);
                PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_t_12);
                __pyx_t_12 = 0;
                __pyx_t_20 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, NULL); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 533, __pyx_L1_error)
                __Pyx_GOTREF(__pyx_t_20);
                __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
              }
            }
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
            __pyx_t_5 = __Pyx_PyNumber_Int(__pyx_t_20); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 533, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
            __Pyx_XDECREF_SET(__pyx_v_kz_rows, __pyx_t_5);
            __pyx_t_5 = 0;

            /* "kapok/uavsarc.pyx":534
 *                     elif (num_segments == 1) and (len(file_alt) >= 1):
 *                         kz_rows = int(ann.query('lkv_'+str(seg+1)+'_2x8 Rows'))
 *                         kz_cols = int(ann.query('lkv_'+str(seg+1)+'_2x8 Columns'))             # <<<<<<<<<<<<<<
 *                         if kz_temp is None:
 *                             kz_temp = np.memmap(file_alt[0], dtype='float32', mode='r', shape=(kz_rows, kz_cols))
 */
            __pyx_t_20 = __Pyx_PyObject_GetAttrStr(__pyx_v_ann, __pyx_n_s_query); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 534, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_20);
            __pyx_t_4 = __Pyx_PyInt_AddObjC(__pyx_v_seg, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 534, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_4);
            __pyx_t_12 = PyTuple_New(1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 534, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_12);
            __Pyx_GIVEREF(__pyx_t_4);
            PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_4);
            __pyx_t_4 = 0;
            __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)(&PyUnicode_Type)), __pyx_t_12, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 534, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            __pyx_t_12 = __Pyx_PyUnicode_Concat(__pyx_n_u_lkv, __pyx_t_4); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 534, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_12);
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
            __pyx_t_4 = __Pyx_PyUnicode_Concat(__pyx_t_12, __pyx_kp_u_2x8_Columns); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 534, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            __pyx_t_12 = NULL;
            if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_20))) {
              __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_20);
              if (likely(__pyx_t_12)) {
                PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_20);
                __Pyx_INCREF(__pyx_t_12);
                __Pyx_INCREF(function);
                __Pyx_DECREF_SET(__pyx_t_20, function);
              }
            }
            if (!__pyx_t_12) {
              __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_20, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 534, __pyx_L1_error)
              __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
              __Pyx_GOTREF(__pyx_t_5);
            } else {
              #if CYTHON_FAST_PYCALL
              if (PyFunction_Check(__pyx_t_20)) {
                PyObject *__pyx_temp[2] = {__pyx_t_12, __pyx_t_4};
                __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_20, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 534, __pyx_L1_error)
                __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
                __Pyx_GOTREF(__pyx_t_5);
                __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
              } else
              #endif
              #if CYTHON_FAST_PYCCALL
              if (__Pyx_PyFastCFunction_Check(__pyx_t_20)) {
                PyObject *__pyx_temp[2] = {__pyx_t_12, __pyx_t_4};
                __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_20, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 534, __pyx_L1_error)
                __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
                __Pyx_GOTREF(__pyx_t_5);
                __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
              } else
              #endif
              {
                __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 534, __pyx_L1_error)
                __Pyx_GOTREF(__pyx_t_7);
                __Pyx_GIVEREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_12); __pyx_t_12 = NULL;
                __Pyx_GIVEREF(__pyx_t_4);
                PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_4);
                __pyx_t_4 = 0;
                __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_20, __pyx_t_7, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 534, __pyx_L1_error)
                __Pyx_GOTREF(__pyx_t_5);
                __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
              }
            }
            __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
            __pyx_t_20 = __Pyx_PyNumber_Int(__pyx_t_5); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 534, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_20);
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
            __Pyx_XDECREF_SET(__pyx_v_kz_cols, __pyx_t_20);
            __pyx_t_20 = 0;

            /* "kapok/uavsarc.pyx":535
 *                         kz_rows = int(ann.query('lkv_'+str(seg+1)+'_2x8 Rows'))
 *                         kz_cols = int(ann.query('lkv_'+str(seg+1)+'_2x8 Columns'))
 *                         if kz_temp is None:             # <<<<<<<<<<<<<<
 *                             kz_temp = np.memmap(file_alt[0], dtype='float32', mode='r', shape=(kz_rows, kz_cols))
 *                         else:
 */
            __pyx_t_8 = (__pyx_v_kz_temp == Py_None);
            __pyx_t_13 = (__pyx_t_8 != 0);
            if (__pyx_t_13) {

              /* "kapok/uavsarc.pyx":536
 *                         kz_cols = int(ann.query('lkv_'+str(seg+1)+'_2x8 Columns'))
 *                         if kz_temp is None:
 *                             kz_temp = np.memmap(file_alt[0], dtype='float32', mode='r', shape=(kz_rows, kz_cols))             # <<<<<<<<<<<<<<
 *                         else:
 *                             kz_temp = np.vstack((kz_temp, np.memmap(file_alt[0], dtype='float32', mode='r', shape=(kz_rows, kz_cols))))
 */
              __pyx_t_20 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 536, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_20);
              __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_20, __pyx_n_s_memmap); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 536, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_5);
              __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
              __pyx_t_20 = __Pyx_GetItemInt(__pyx_v_file_alt, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 536, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_20);
              __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 536, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_7);
              __Pyx_GIVEREF(__pyx_t_20);
              PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_20);
              __pyx_t_20 = 0;
              __pyx_t_20 = PyDict_New(); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 536, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_20);
              if (PyDict_SetItem(__pyx_t_20, __pyx_n_s_dtype, __pyx_n_u_float32) < 0) __PYX_ERR(0, 536, __pyx_L1_error)
              if (PyDict_SetItem(__pyx_t_20, __pyx_n_s_mode, __pyx_n_u_r) < 0) __PYX_ERR(0, 536, __pyx_L1_error)
              __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 536, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_4);
              __Pyx_INCREF(__pyx_v_kz_rows);
              __Pyx_GIVEREF(__pyx_v_kz_rows);
              PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_kz_rows);
              __Pyx_INCREF(__pyx_v_kz_cols);
              __Pyx_GIVEREF(__pyx_v_kz_cols);
              PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_kz_cols);
              if (PyDict_SetItem(__pyx_t_20, __pyx_n_s_shape, __pyx_t_4) < 0) __PYX_ERR(0, 536, __pyx_L1_error)
              __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
              __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, __pyx_t_20); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 536, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_4);
              __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
              __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
              __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
              __Pyx_DECREF_SET(__pyx_v_kz_temp, __pyx_t_4);
              __pyx_t_4 = 0;

              /* "kapok/uavsarc.pyx":535
 *                         kz_rows = int(ann.query('lkv_'+str(seg+1)+'_2x8 Rows'))
 *                         kz_cols = int(ann.query('lkv_'+str(seg+1)+'_2x8 Columns'))
 *                         if kz_temp is None:             # <<<<<<<<<<<<<<
 *                             kz_temp = np.memmap(file_alt[0], dtype='float32', mode='r', shape=(kz_rows, kz_cols))
 *                         else:
 */
              goto __pyx_L101;
            }

            /* "kapok/uavsarc.pyx":538
 *                             kz_temp = np.memmap(file_alt[0], dtype='float32', mode='r', shape=(kz_rows, kz_cols))
 *                         else:
 *                             kz_temp = np.vstack((kz_temp, np.memmap(file_alt[0], dtype='float32', mode='r', shape=(kz_rows, kz_cols))))             # <<<<<<<<<<<<<<
 *                     else:
 *                         print('kapok.uavsar.load | Cannot find .kz file matching pattern: "'+datapath+tracknames[tr]+'*s'+str(seg+1)+'*.kz".  Attempting to calculate kz from .baseline files.')
 */
            /*else*/ {
              __pyx_t_20 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 538, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_20);
              __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_20, __pyx_n_s_vstack); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 538, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_7);
              __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
              __pyx_t_20 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 538, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_20);
              __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_20, __pyx_n_s_memmap); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 538, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_5);
              __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
              __pyx_t_20 = __Pyx_GetItemInt(__pyx_v_file_alt, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 538, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_20);
              __pyx_t_12 = PyTuple_New(1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 538, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_12);
              __Pyx_GIVEREF(__pyx_t_20);
              PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_20);
              __pyx_t_20 = 0;
              __pyx_t_20 = PyDict_New(); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 538, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_20);
              if (PyDict_SetItem(__pyx_t_20, __pyx_n_s_dtype, __pyx_n_u_float32) < 0) __PYX_ERR(0, 538, __pyx_L1_error)
              if (PyDict_SetItem(__pyx_t_20, __pyx_n_s_mode, __pyx_n_u_r) < 0) __PYX_ERR(0, 538, __pyx_L1_error)
              __pyx_t_19 = PyTuple_New(2); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 538, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_19);
              __Pyx_INCREF(__pyx_v_kz_rows);
              __Pyx_GIVEREF(__pyx_v_kz_rows);
              PyTuple_SET_ITEM(__pyx_t_19, 0, __pyx_v_kz_rows);
              __Pyx_INCREF(__pyx_v_kz_cols);
              __Pyx_GIVEREF(__pyx_v_kz_cols);
              PyTuple_SET_ITEM(__pyx_t_19, 1, __pyx_v_kz_cols);
              if (PyDict_SetItem(__pyx_t_20, __pyx_n_s_shape, __pyx_t_19) < 0) __PYX_ERR(0, 538, __pyx_L1_error)
              __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
              __pyx_t_19 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_12, __pyx_t_20); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 538, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_19);
              __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
              __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
              __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
              __pyx_t_20 = PyTuple_New(2); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 538, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_20);
              __Pyx_INCREF(__pyx_v_kz_temp);
              __Pyx_GIVEREF(__pyx_v_kz_temp);
              PyTuple_SET_ITEM(__pyx_t_20, 0, __pyx_v_kz_temp);
              __Pyx_GIVEREF(__pyx_t_19);
              PyTuple_SET_ITEM(__pyx_t_20, 1, __pyx_t_19);
              __pyx_t_19 = 0;
              __pyx_t_19 = NULL;
              if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
                __pyx_t_19 = PyMethod_GET_SELF(__pyx_t_7);
                if (likely(__pyx_t_19)) {
                  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
                  __Pyx_INCREF(__pyx_t_19);
                  __Pyx_INCREF(function);
                  __Pyx_DECREF_SET(__pyx_t_7, function);
                }
              }
              if (!__pyx_t_19) {
                __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_20); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 538, __pyx_L1_error)
                __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
                __Pyx_GOTREF(__pyx_t_4);
              } else {
                #if CYTHON_FAST_PYCALL
                if (PyFunction_Check(__pyx_t_7)) {
                  PyObject *__pyx_temp[2] = {__pyx_t_19, __pyx_t_20};
                  __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 538, __pyx_L1_error)
                  __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0;
                  __Pyx_GOTREF(__pyx_t_4);
                  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
                } else
                #endif
                #if CYTHON_FAST_PYCCALL
                if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
                  PyObject *__pyx_temp[2] = {__pyx_t_19, __pyx_t_20};
                  __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 538, __pyx_L1_error)
                  __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0;
                  __Pyx_GOTREF(__pyx_t_4);
                  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
                } else
                #endif
                {
                  __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 538, __pyx_L1_error)
                  __Pyx_GOTREF(__pyx_t_12);
                  __Pyx_GIVEREF(__pyx_t_19); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_19); __pyx_t_19 = NULL;
                  __Pyx_GIVEREF(__pyx_t_20);
                  PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_20);
                  __pyx_t_20 = 0;
                  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_12, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 538, __pyx_L1_error)
                  __Pyx_GOTREF(__pyx_t_4);
                  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
                }
              }
              __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
              __Pyx_DECREF_SET(__pyx_v_kz_temp, __pyx_t_4);
              __pyx_t_4 = 0;
            }
            __pyx_L101:;

            /* "kapok/uavsarc.pyx":532
 *                         else:
 *                             kz_temp = np.vstack((kz_temp, np.memmap(file[0], dtype='float32', mode='r', shape=(kz_rows, kz_cols))))
 *                     elif (num_segments == 1) and (len(file_alt) >= 1):             # <<<<<<<<<<<<<<
 *                         kz_rows = int(ann.query('lkv_'+str(seg+1)+'_2x8 Rows'))
 *                         kz_cols = int(ann.query('lkv_'+str(seg+1)+'_2x8 Columns'))
 */
            goto __pyx_L97;
          }

          /* "kapok/uavsarc.pyx":540
 *                             kz_temp = np.vstack((kz_temp, np.memmap(file_alt[0], dtype='float32', mode='r', shape=(kz_rows, kz_cols))))
 *                     else:
 *                         print('kapok.uavsar.load | Cannot find .kz file matching pattern: "'+datapath+tracknames[tr]+'*s'+str(seg+1)+'*.kz".  Attempting to calculate kz from .baseline files.')             # <<<<<<<<<<<<<<
 *                         kzcalc = True
 *                         break
 */
          /*else*/ {
            __pyx_t_4 = PyNumber_Add(__pyx_kp_u_kapok_uavsar_load_Cannot_find_kz, __pyx_v_datapath); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 540, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_4);
            __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_tracknames, __pyx_v_tr, unsigned int, 0, __Pyx_PyInt_From_unsigned_int, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 540, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_7);
            __pyx_t_12 = PyNumber_Add(__pyx_t_4, __pyx_t_7); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 540, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_12);
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
            __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
            __pyx_t_7 = PyNumber_Add(__pyx_t_12, __pyx_kp_u_s_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 540, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_7);
            __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            __pyx_t_12 = __Pyx_PyInt_AddObjC(__pyx_v_seg, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 540, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_12);
            __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 540, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_GIVEREF(__pyx_t_12);
            PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_12);
            __pyx_t_12 = 0;
            __pyx_t_12 = __Pyx_PyObject_Call(((PyObject *)(&PyUnicode_Type)), __pyx_t_4, NULL); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 540, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_12);
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
            __pyx_t_4 = PyNumber_Add(__pyx_t_7, __pyx_t_12); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 540, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            __pyx_t_12 = PyNumber_Add(__pyx_t_4, __pyx_kp_u_kz_Attempting_to_calculate_kz_f); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 540, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_12);
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
            __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 540, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_GIVEREF(__pyx_t_12);
            PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_12);
            __pyx_t_12 = 0;
            __pyx_t_12 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_t_4, NULL); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 540, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_12);
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
            __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;

            /* "kapok/uavsarc.pyx":541
 *                     else:
 *                         print('kapok.uavsar.load | Cannot find .kz file matching pattern: "'+datapath+tracknames[tr]+'*s'+str(seg+1)+'*.kz".  Attempting to calculate kz from .baseline files.')
 *                         kzcalc = True             # <<<<<<<<<<<<<<
 *                         break
 * 
 */
            __Pyx_INCREF(Py_True);
            __Pyx_DECREF_SET(__pyx_v_kzcalc, Py_True);

            /* "kapok/uavsarc.pyx":542
 *                         print('kapok.uavsar.load | Cannot find .kz file matching pattern: "'+datapath+tracknames[tr]+'*s'+str(seg+1)+'*.kz".  Attempting to calculate kz from .baseline files.')
 *                         kzcalc = True
 *                         break             # <<<<<<<<<<<<<<
 * 
 *             if not kzcalc:
 */
            goto __pyx_L95_break;
          }
          __pyx_L97:;

          /* "kapok/uavsarc.pyx":521
 *             print('kapok.uavsar.load | Importing kz between track '+str(tr)+' and reference track. ('+time.ctime()+')')
 *             for seg in range(num_segments):
 *                 if not kzcalc:             # <<<<<<<<<<<<<<
 *                     file = glob(datapath+tracknames[tr]+'*s'+str(seg+1)+'*.kz')
 *                     file_alt = glob(datapath+tracknames[tr]+'*.kz')
 */
        }

        /* "kapok/uavsarc.pyx":520
 *             kz_temp = None
 *             print('kapok.uavsar.load | Importing kz between track '+str(tr)+' and reference track. ('+time.ctime()+')')
 *             for seg in range(num_segments):             # <<<<<<<<<<<<<<
 *                 if not kzcalc:
 *                     file = glob(datapath+tracknames[tr]+'*s'+str(seg+1)+'*.kz')
 */
      }
      __pyx_L95_break:;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

      /* "kapok/uavsarc.pyx":544
 *                         break
 * 
 *             if not kzcalc:             # <<<<<<<<<<<<<<
 *                 # kz files appear to be kz_i0 rather than kz_0i.  Multiplying by -1 so that in the Scene object, kz_ij = kz[j] - kz[i].
 *                 kz[tr,:,:] = -1*mlook(zoom(kz_temp[azllhstart:azllhend,rngllhstart:rngllhend],mlwin_lkv),mlwin)[azllhoffset:(azllhoffset+azsize),rngllhoffset:(rngllhoffset+rngsize)]
 */
      __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_v_kzcalc); if (unlikely(__pyx_t_13 < 0)) __PYX_ERR(0, 544, __pyx_L1_error)
      __pyx_t_8 = ((!__pyx_t_13) != 0);
      if (__pyx_t_8) {

        /* "kapok/uavsarc.pyx":546
 *             if not kzcalc:
 *                 # kz files appear to be kz_i0 rather than kz_0i.  Multiplying by -1 so that in the Scene object, kz_ij = kz[j] - kz[i].
 *                 kz[tr,:,:] = -1*mlook(zoom(kz_temp[azllhstart:azllhend,rngllhstart:rngllhend],mlwin_lkv),mlwin)[azllhoffset:(azllhoffset+azsize),rngllhoffset:(rngllhoffset+rngsize)]             # <<<<<<<<<<<<<<
 * 
 * 
 */
        __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_mlook); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 546, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_zoom); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 546, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_20 = PySlice_New(__pyx_v_azllhstart, __pyx_v_azllhend, Py_None); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 546, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_20);
        __pyx_t_19 = PySlice_New(__pyx_v_rngllhstart, __pyx_v_rngllhend, Py_None); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 546, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_19);
        __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 546, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_GIVEREF(__pyx_t_20);
        PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_20);
        __Pyx_GIVEREF(__pyx_t_19);
        PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_19);
        __pyx_t_20 = 0;
        __pyx_t_19 = 0;
        __pyx_t_19 = PyObject_GetItem(__pyx_v_kz_temp, __pyx_t_5); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 546, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_19);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = NULL;
        __pyx_t_9 = 0;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
          __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7);
          if (likely(__pyx_t_5)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
            __Pyx_INCREF(__pyx_t_5);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_7, function);
            __pyx_t_9 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_7)) {
          PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_19, __pyx_v_mlwin_lkv};
          __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 546, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
          PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_19, __pyx_v_mlwin_lkv};
          __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 546, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
        } else
        #endif
        {
          __pyx_t_20 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 546, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_20);
          if (__pyx_t_5) {
            __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_20, 0, __pyx_t_5); __pyx_t_5 = NULL;
          }
          __Pyx_GIVEREF(__pyx_t_19);
          PyTuple_SET_ITEM(__pyx_t_20, 0+__pyx_t_9, __pyx_t_19);
          __Pyx_INCREF(__pyx_v_mlwin_lkv);
          __Pyx_GIVEREF(__pyx_v_mlwin_lkv);
          PyTuple_SET_ITEM(__pyx_t_20, 1+__pyx_t_9, __pyx_v_mlwin_lkv);
          __pyx_t_19 = 0;
          __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_20, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 546, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
        }
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = NULL;
        __pyx_t_9 = 0;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_12))) {
          __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_12);
          if (likely(__pyx_t_7)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
            __Pyx_INCREF(__pyx_t_7);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_12, function);
            __pyx_t_9 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_12)) {
          PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_4, __pyx_v_mlwin};
          __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 546, __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;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) {
          PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_4, __pyx_v_mlwin};
          __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 546, __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;
        } else
        #endif
        {
          __pyx_t_20 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 546, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_20);
          if (__pyx_t_7) {
            __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_20, 0, __pyx_t_7); __pyx_t_7 = NULL;
          }
          __Pyx_GIVEREF(__pyx_t_4);
          PyTuple_SET_ITEM(__pyx_t_20, 0+__pyx_t_9, __pyx_t_4);
          __Pyx_INCREF(__pyx_v_mlwin);
          __Pyx_GIVEREF(__pyx_v_mlwin);
          PyTuple_SET_ITEM(__pyx_t_20, 1+__pyx_t_9, __pyx_v_mlwin);
          __pyx_t_4 = 0;
          __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_20, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 546, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
        }
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_t_12 = PyNumber_Add(__pyx_v_azllhoffset, __pyx_v_azsize); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 546, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_20 = PySlice_New(__pyx_v_azllhoffset, __pyx_t_12, Py_None); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 546, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_20);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_t_12 = PyNumber_Add(__pyx_v_rngllhoffset, __pyx_v_rngsize); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 546, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_4 = PySlice_New(__pyx_v_rngllhoffset, __pyx_t_12, Py_None); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 546, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_t_12 = PyTuple_New(2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 546, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_GIVEREF(__pyx_t_20);
        PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_20);
        __Pyx_GIVEREF(__pyx_t_4);
        PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_4);
        __pyx_t_20 = 0;
        __pyx_t_4 = 0;
        __pyx_t_4 = PyObject_GetItem(__pyx_t_6, __pyx_t_12); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 546, __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_t_12 = PyNumber_Multiply(__pyx_int_neg_1, __pyx_t_4); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 546, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_4 = __Pyx_PyInt_From_unsigned_int(__pyx_v_tr); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 546, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 546, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_GIVEREF(__pyx_t_4);
        PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4);
        __Pyx_INCREF(__pyx_slice__79);
        __Pyx_GIVEREF(__pyx_slice__79);
        PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_slice__79);
        __Pyx_INCREF(__pyx_slice__80);
        __Pyx_GIVEREF(__pyx_slice__80);
        PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_slice__80);
        __pyx_t_4 = 0;
        if (unlikely(PyObject_SetItem(__pyx_v_kz, __pyx_t_6, __pyx_t_12) < 0)) __PYX_ERR(0, 546, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;

        /* "kapok/uavsarc.pyx":544
 *                         break
 * 
 *             if not kzcalc:             # <<<<<<<<<<<<<<
 *                 # kz files appear to be kz_i0 rather than kz_0i.  Multiplying by -1 so that in the Scene object, kz_ij = kz[j] - kz[i].
 *                 kz[tr,:,:] = -1*mlook(zoom(kz_temp[azllhstart:azllhend,rngllhstart:rngllhend],mlwin_lkv),mlwin)[azllhoffset:(azllhoffset+azsize),rngllhoffset:(rngllhoffset+rngsize)]
 */
      }
    }

    /* "kapok/uavsarc.pyx":549
 * 
 * 
 *         if (not kzcalc) and kzvertical:             # <<<<<<<<<<<<<<
 *             print('kapok.uavsar.load | Adjusting kz to use vertical direction. ('+time.ctime()+')')
 *             # Change kz values to measure vertical heights, rather than distances perpendicular to the ground surface.
 */
    __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_v_kzcalc); if (unlikely(__pyx_t_13 < 0)) __PYX_ERR(0, 549, __pyx_L1_error)
    __pyx_t_16 = ((!__pyx_t_13) != 0);
    if (__pyx_t_16) {
    } else {
      __pyx_t_8 = __pyx_t_16;
      goto __pyx_L104_bool_binop_done;
    }
    __pyx_t_16 = __Pyx_PyObject_IsTrue(__pyx_v_kzvertical); if (unlikely(__pyx_t_16 < 0)) __PYX_ERR(0, 549, __pyx_L1_error)
    __pyx_t_8 = __pyx_t_16;
    __pyx_L104_bool_binop_done:;
    if (__pyx_t_8) {

      /* "kapok/uavsarc.pyx":550
 * 
 *         if (not kzcalc) and kzvertical:
 *             print('kapok.uavsar.load | Adjusting kz to use vertical direction. ('+time.ctime()+')')             # <<<<<<<<<<<<<<
 *             # Change kz values to measure vertical heights, rather than distances perpendicular to the ground surface.
 *             from kapok.lib import calcslope
 */
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_time); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 550, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_ctime); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 550, __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);
        }
      }
      if (__pyx_t_6) {
        __pyx_t_12 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 550, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else {
        __pyx_t_12 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 550, __pyx_L1_error)
      }
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = PyNumber_Add(__pyx_kp_u_kapok_uavsar_load_Adjusting_kz_t, __pyx_t_12); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 550, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __pyx_t_12 = PyNumber_Add(__pyx_t_4, __pyx_kp_u__16); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 550, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 550, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_12);
      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_12);
      __pyx_t_12 = 0;
      __pyx_t_12 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_t_4, NULL); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 550, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;

      /* "kapok/uavsarc.pyx":552
 *             print('kapok.uavsar.load | Adjusting kz to use vertical direction. ('+time.ctime()+')')
 *             # Change kz values to measure vertical heights, rather than distances perpendicular to the ground surface.
 *             from kapok.lib import calcslope             # <<<<<<<<<<<<<<
 * 
 *             # Calculate range and azimuth terrain slope angles.
 */
      __pyx_t_12 = PyList_New(1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 552, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_INCREF(__pyx_n_s_calcslope);
      __Pyx_GIVEREF(__pyx_n_s_calcslope);
      PyList_SET_ITEM(__pyx_t_12, 0, __pyx_n_s_calcslope);
      __pyx_t_4 = __Pyx_Import(__pyx_n_s_kapok_lib, __pyx_t_12, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 552, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __pyx_t_12 = __Pyx_ImportFrom(__pyx_t_4, __pyx_n_s_calcslope); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 552, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_INCREF(__pyx_t_12);
      __pyx_v_calcslope = __pyx_t_12;
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "kapok/uavsarc.pyx":555
 * 
 *             # Calculate range and azimuth terrain slope angles.
 *             spacing = (f.attrs['cov_azimuth_pixel_spacing'], f.attrs['cov_slant_range_pixel_spacing'])             # <<<<<<<<<<<<<<
 *             rngslope, azslope = calcslope(dem, spacing, inc)
 * 
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_attrs); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 555, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_12 = PyObject_GetItem(__pyx_t_4, __pyx_n_u_cov_azimuth_pixel_spacing); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 555, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_attrs); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 555, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_6 = PyObject_GetItem(__pyx_t_4, __pyx_n_u_cov_slant_range_pixel_spacing); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 555, __pyx_L1_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, 555, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_12);
      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_12);
      __Pyx_GIVEREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_6);
      __pyx_t_12 = 0;
      __pyx_t_6 = 0;
      __pyx_v_spacing = ((PyObject*)__pyx_t_4);
      __pyx_t_4 = 0;

      /* "kapok/uavsarc.pyx":556
 *             # Calculate range and azimuth terrain slope angles.
 *             spacing = (f.attrs['cov_azimuth_pixel_spacing'], f.attrs['cov_slant_range_pixel_spacing'])
 *             rngslope, azslope = calcslope(dem, spacing, inc)             # <<<<<<<<<<<<<<
 * 
 *             # Compute dot product of vertical and surface normal.
 */
      __Pyx_INCREF(__pyx_v_calcslope);
      __pyx_t_6 = __pyx_v_calcslope; __pyx_t_12 = NULL;
      __pyx_t_9 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_12)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_12);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
          __pyx_t_9 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[4] = {__pyx_t_12, __pyx_v_dem, __pyx_v_spacing, __pyx_v_inc};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_9, 3+__pyx_t_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 556, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[4] = {__pyx_t_12, __pyx_v_dem, __pyx_v_spacing, __pyx_v_inc};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_9, 3+__pyx_t_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 556, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      {
        __pyx_t_20 = PyTuple_New(3+__pyx_t_9); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 556, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_20);
        if (__pyx_t_12) {
          __Pyx_GIVEREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_20, 0, __pyx_t_12); __pyx_t_12 = NULL;
        }
        __Pyx_INCREF(__pyx_v_dem);
        __Pyx_GIVEREF(__pyx_v_dem);
        PyTuple_SET_ITEM(__pyx_t_20, 0+__pyx_t_9, __pyx_v_dem);
        __Pyx_INCREF(__pyx_v_spacing);
        __Pyx_GIVEREF(__pyx_v_spacing);
        PyTuple_SET_ITEM(__pyx_t_20, 1+__pyx_t_9, __pyx_v_spacing);
        __Pyx_INCREF(__pyx_v_inc);
        __Pyx_GIVEREF(__pyx_v_inc);
        PyTuple_SET_ITEM(__pyx_t_20, 2+__pyx_t_9, __pyx_v_inc);
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_20, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 556, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
      }
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) {
        PyObject* sequence = __pyx_t_4;
        #if !CYTHON_COMPILING_IN_PYPY
        Py_ssize_t size = Py_SIZE(sequence);
        #else
        Py_ssize_t size = PySequence_Size(sequence);
        #endif
        if (unlikely(size != 2)) {
          if (size > 2) __Pyx_RaiseTooManyValuesError(2);
          else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
          __PYX_ERR(0, 556, __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_20 = PyTuple_GET_ITEM(sequence, 1); 
        } else {
          __pyx_t_6 = PyList_GET_ITEM(sequence, 0); 
          __pyx_t_20 = PyList_GET_ITEM(sequence, 1); 
        }
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_20);
        #else
        __pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 556, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_20 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 556, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_20);
        #endif
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        Py_ssize_t index = -1;
        __pyx_t_12 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 556, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_23 = Py_TYPE(__pyx_t_12)->tp_iternext;
        index = 0; __pyx_t_6 = __pyx_t_23(__pyx_t_12); if (unlikely(!__pyx_t_6)) goto __pyx_L106_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_6);
        index = 1; __pyx_t_20 = __pyx_t_23(__pyx_t_12); if (unlikely(!__pyx_t_20)) goto __pyx_L106_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_20);
        if (__Pyx_IternextUnpackEndCheck(__pyx_t_23(__pyx_t_12), 2) < 0) __PYX_ERR(0, 556, __pyx_L1_error)
        __pyx_t_23 = NULL;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        goto __pyx_L107_unpacking_done;
        __pyx_L106_unpacking_failed:;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_t_23 = NULL;
        if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
        __PYX_ERR(0, 556, __pyx_L1_error)
        __pyx_L107_unpacking_done:;
      }
      __pyx_v_rngslope = __pyx_t_6;
      __pyx_t_6 = 0;
      __pyx_v_azslope = __pyx_t_20;
      __pyx_t_20 = 0;

      /* "kapok/uavsarc.pyx":559
 * 
 *             # Compute dot product of vertical and surface normal.
 *             height_dot_normal = 1 / np.sqrt(np.square(np.tan(rngslope)) + np.square(np.tan(azslope)) + 1)             # <<<<<<<<<<<<<<
 * 
 *             # Normalize kz values by dot product.
 */
      __pyx_t_20 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 559, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_20);
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_20, __pyx_n_s_sqrt); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 559, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
      __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 559, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_square); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 559, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __pyx_t_19 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 559, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_19);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_19, __pyx_n_s_tan); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 559, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
      __pyx_t_19 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_19 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_19)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_19);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      if (!__pyx_t_19) {
        __pyx_t_12 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_rngslope); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 559, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_5)) {
          PyObject *__pyx_temp[2] = {__pyx_t_19, __pyx_v_rngslope};
          __pyx_t_12 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 559, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0;
          __Pyx_GOTREF(__pyx_t_12);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
          PyObject *__pyx_temp[2] = {__pyx_t_19, __pyx_v_rngslope};
          __pyx_t_12 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 559, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0;
          __Pyx_GOTREF(__pyx_t_12);
        } else
        #endif
        {
          __pyx_t_29 = PyTuple_New(1+1); if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 559, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_29);
          __Pyx_GIVEREF(__pyx_t_19); PyTuple_SET_ITEM(__pyx_t_29, 0, __pyx_t_19); __pyx_t_19 = NULL;
          __Pyx_INCREF(__pyx_v_rngslope);
          __Pyx_GIVEREF(__pyx_v_rngslope);
          PyTuple_SET_ITEM(__pyx_t_29, 0+1, __pyx_v_rngslope);
          __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_29, NULL); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 559, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
        }
      }
      if (!__pyx_t_5) {
        __pyx_t_20 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_12); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 559, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_GOTREF(__pyx_t_20);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_7)) {
          PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_12};
          __pyx_t_20 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 559, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_GOTREF(__pyx_t_20);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
          PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_12};
          __pyx_t_20 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 559, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_GOTREF(__pyx_t_20);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        } else
        #endif
        {
          __pyx_t_29 = PyTuple_New(1+1); if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 559, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_29);
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_29, 0, __pyx_t_5); __pyx_t_5 = NULL;
          __Pyx_GIVEREF(__pyx_t_12);
          PyTuple_SET_ITEM(__pyx_t_29, 0+1, __pyx_t_12);
          __pyx_t_12 = 0;
          __pyx_t_20 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_29, NULL); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 559, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_20);
          __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_29 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 559, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_29);
      __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_29, __pyx_n_s_square); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 559, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0;
      __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 559, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_19 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_tan); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 559, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_19);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_19))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_19);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_19);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_19, function);
        }
      }
      if (!__pyx_t_5) {
        __pyx_t_29 = __Pyx_PyObject_CallOneArg(__pyx_t_19, __pyx_v_azslope); if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 559, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_29);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_19)) {
          PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_v_azslope};
          __pyx_t_29 = __Pyx_PyFunction_FastCall(__pyx_t_19, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 559, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_GOTREF(__pyx_t_29);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_19)) {
          PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_v_azslope};
          __pyx_t_29 = __Pyx_PyCFunction_FastCall(__pyx_t_19, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 559, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_GOTREF(__pyx_t_29);
        } else
        #endif
        {
          __pyx_t_28 = PyTuple_New(1+1); if (unlikely(!__pyx_t_28)) __PYX_ERR(0, 559, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_28);
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_28, 0, __pyx_t_5); __pyx_t_5 = NULL;
          __Pyx_INCREF(__pyx_v_azslope);
          __Pyx_GIVEREF(__pyx_v_azslope);
          PyTuple_SET_ITEM(__pyx_t_28, 0+1, __pyx_v_azslope);
          __pyx_t_29 = __Pyx_PyObject_Call(__pyx_t_19, __pyx_t_28, NULL); if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 559, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_29);
          __Pyx_DECREF(__pyx_t_28); __pyx_t_28 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
      __pyx_t_19 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_12))) {
        __pyx_t_19 = PyMethod_GET_SELF(__pyx_t_12);
        if (likely(__pyx_t_19)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
          __Pyx_INCREF(__pyx_t_19);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_12, function);
        }
      }
      if (!__pyx_t_19) {
        __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_29); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 559, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0;
        __Pyx_GOTREF(__pyx_t_7);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_12)) {
          PyObject *__pyx_temp[2] = {__pyx_t_19, __pyx_t_29};
          __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 559, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0;
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) {
          PyObject *__pyx_temp[2] = {__pyx_t_19, __pyx_t_29};
          __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 559, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0;
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0;
        } else
        #endif
        {
          __pyx_t_28 = PyTuple_New(1+1); if (unlikely(!__pyx_t_28)) __PYX_ERR(0, 559, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_28);
          __Pyx_GIVEREF(__pyx_t_19); PyTuple_SET_ITEM(__pyx_t_28, 0, __pyx_t_19); __pyx_t_19 = NULL;
          __Pyx_GIVEREF(__pyx_t_29);
          PyTuple_SET_ITEM(__pyx_t_28, 0+1, __pyx_t_29);
          __pyx_t_29 = 0;
          __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_28, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 559, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_DECREF(__pyx_t_28); __pyx_t_28 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __pyx_t_12 = PyNumber_Add(__pyx_t_20, __pyx_t_7); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 559, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = __Pyx_PyInt_AddObjC(__pyx_t_12, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 559, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __pyx_t_12 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_12)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_12);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
        }
      }
      if (!__pyx_t_12) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 559, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[2] = {__pyx_t_12, __pyx_t_7};
          __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 559, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[2] = {__pyx_t_12, __pyx_t_7};
          __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 559, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        } else
        #endif
        {
          __pyx_t_20 = PyTuple_New(1+1); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 559, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_20);
          __Pyx_GIVEREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_20, 0, __pyx_t_12); __pyx_t_12 = NULL;
          __Pyx_GIVEREF(__pyx_t_7);
          PyTuple_SET_ITEM(__pyx_t_20, 0+1, __pyx_t_7);
          __pyx_t_7 = 0;
          __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_20, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 559, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = __Pyx_PyNumber_Divide(__pyx_int_1, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 559, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_v_height_dot_normal = __pyx_t_6;
      __pyx_t_6 = 0;

      /* "kapok/uavsarc.pyx":562
 * 
 *             # Normalize kz values by dot product.
 *             kz[:] *= height_dot_normal[np.newaxis,:,:]             # <<<<<<<<<<<<<<
 *             del height_dot_normal, rngslope, azslope
 * 
 */
      __Pyx_INCREF(__pyx_slice__81);
      __pyx_t_43 = __pyx_slice__81;
      __pyx_t_6 = PyObject_GetItem(__pyx_v_kz, __pyx_t_43); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 562, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 562, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_20 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_newaxis); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 562, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_20);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 562, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_20);
      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_20);
      __Pyx_INCREF(__pyx_slice__82);
      __Pyx_GIVEREF(__pyx_slice__82);
      PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_slice__82);
      __Pyx_INCREF(__pyx_slice__83);
      __Pyx_GIVEREF(__pyx_slice__83);
      PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_slice__83);
      __pyx_t_20 = 0;
      __pyx_t_20 = PyObject_GetItem(__pyx_v_height_dot_normal, __pyx_t_4); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 562, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_20);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = PyNumber_InPlaceMultiply(__pyx_t_6, __pyx_t_20); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 562, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
      if (unlikely(PyObject_SetItem(__pyx_v_kz, __pyx_t_43, __pyx_t_4) < 0)) __PYX_ERR(0, 562, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_43); __pyx_t_43 = 0;

      /* "kapok/uavsarc.pyx":563
 *             # Normalize kz values by dot product.
 *             kz[:] *= height_dot_normal[np.newaxis,:,:]
 *             del height_dot_normal, rngslope, azslope             # <<<<<<<<<<<<<<
 * 
 * 
 */
      __Pyx_DECREF(__pyx_v_height_dot_normal);
      __pyx_v_height_dot_normal = NULL;
      __Pyx_DECREF(__pyx_v_rngslope);
      __pyx_v_rngslope = NULL;
      __Pyx_DECREF(__pyx_v_azslope);
      __pyx_v_azslope = NULL;

      /* "kapok/uavsarc.pyx":549
 * 
 * 
 *         if (not kzcalc) and kzvertical:             # <<<<<<<<<<<<<<
 *             print('kapok.uavsar.load | Adjusting kz to use vertical direction. ('+time.ctime()+')')
 *             # Change kz values to measure vertical heights, rather than distances perpendicular to the ground surface.
 */
    }

    /* "kapok/uavsarc.pyx":515
 * 
 *     # Try to import .kz files if option kzcalc == False.
 *     if not kzcalc:             # <<<<<<<<<<<<<<
 *         kz.attrs['slope_corrected'] = True
 *         for tr in range(0,num_tracks):
 */
  }

  /* "kapok/uavsarc.pyx":567
 * 
 *     # Calculating kz from .baseline and .lkv, if kzcalc == True.
 *     if kzcalc:             # <<<<<<<<<<<<<<
 *         kz.attrs['slope_corrected'] = False
 * 
 */
  __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_kzcalc); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 567, __pyx_L1_error)
  if (__pyx_t_8) {

    /* "kapok/uavsarc.pyx":568
 *     # Calculating kz from .baseline and .lkv, if kzcalc == True.
 *     if kzcalc:
 *         kz.attrs['slope_corrected'] = False             # <<<<<<<<<<<<<<
 * 
 *         for tr in range(0,num_tracks):
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_kz, __pyx_n_s_attrs); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 568, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (unlikely(PyObject_SetItem(__pyx_t_4, __pyx_n_u_slope_corrected, Py_False) < 0)) __PYX_ERR(0, 568, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "kapok/uavsarc.pyx":570
 *         kz.attrs['slope_corrected'] = False
 * 
 *         for tr in range(0,num_tracks):             # <<<<<<<<<<<<<<
 *             print('kapok.uavsar.load | Calculating kz between track '+str(tr)+' and reference track. ('+time.ctime()+')')
 *             basefile = glob(datapath+tracknames[tr]+'*.baseline')
 */
    __pyx_t_10 = __Pyx_PyInt_As_long(__pyx_v_num_tracks); if (unlikely((__pyx_t_10 == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 570, __pyx_L1_error)
    for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) {
      __pyx_v_tr = __pyx_t_11;

      /* "kapok/uavsarc.pyx":571
 * 
 *         for tr in range(0,num_tracks):
 *             print('kapok.uavsar.load | Calculating kz between track '+str(tr)+' and reference track. ('+time.ctime()+')')             # <<<<<<<<<<<<<<
 *             basefile = glob(datapath+tracknames[tr]+'*.baseline')
 * 
 */
      __pyx_t_4 = __Pyx_PyInt_From_unsigned_int(__pyx_v_tr); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 571, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_20 = PyTuple_New(1); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 571, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_20);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_20, 0, __pyx_t_4);
      __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)(&PyUnicode_Type)), __pyx_t_20, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 571, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
      __pyx_t_20 = __Pyx_PyUnicode_Concat(__pyx_kp_u_kapok_uavsar_load_Calculating_kz, __pyx_t_4); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 571, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_20);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_PyUnicode_Concat(__pyx_t_20, __pyx_kp_u_and_reference_track); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 571, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_time); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 571, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_ctime); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 571, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
        }
      }
      if (__pyx_t_6) {
        __pyx_t_20 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 571, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else {
        __pyx_t_20 = __Pyx_PyObject_CallNoArg(__pyx_t_7); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 571, __pyx_L1_error)
      }
      __Pyx_GOTREF(__pyx_t_20);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = PyNumber_Add(__pyx_t_4, __pyx_t_20); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 571, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
      __pyx_t_20 = PyNumber_Add(__pyx_t_7, __pyx_kp_u__16); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 571, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_20);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 571, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_20);
      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_20);
      __pyx_t_20 = 0;
      __pyx_t_20 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_t_7, NULL); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 571, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_20);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

      /* "kapok/uavsarc.pyx":572
 *         for tr in range(0,num_tracks):
 *             print('kapok.uavsar.load | Calculating kz between track '+str(tr)+' and reference track. ('+time.ctime()+')')
 *             basefile = glob(datapath+tracknames[tr]+'*.baseline')             # <<<<<<<<<<<<<<
 * 
 *             if len(basefile) >= 1:
 */
      __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_glob); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 572, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_tracknames, __pyx_v_tr, unsigned int, 0, __Pyx_PyInt_From_unsigned_int, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 572, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_6 = PyNumber_Add(__pyx_v_datapath, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 572, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = PyNumber_Add(__pyx_t_6, __pyx_kp_u_baseline); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 572, __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_7))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
        }
      }
      if (!__pyx_t_6) {
        __pyx_t_20 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_4); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 572, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_20);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_7)) {
          PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_4};
          __pyx_t_20 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 572, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_GOTREF(__pyx_t_20);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
          PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_4};
          __pyx_t_20 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 572, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_GOTREF(__pyx_t_20);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        } else
        #endif
        {
          __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 572, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_6); __pyx_t_6 = NULL;
          __Pyx_GIVEREF(__pyx_t_4);
          PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_4);
          __pyx_t_4 = 0;
          __pyx_t_20 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_12, NULL); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 572, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_20);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_XDECREF_SET(__pyx_v_basefile, __pyx_t_20);
      __pyx_t_20 = 0;

      /* "kapok/uavsarc.pyx":574
 *             basefile = glob(datapath+tracknames[tr]+'*.baseline')
 * 
 *             if len(basefile) >= 1:             # <<<<<<<<<<<<<<
 *                 basesch = np.loadtxt(basefile[0])
 *             else:
 */
      __pyx_t_15 = PyObject_Length(__pyx_v_basefile); if (unlikely(__pyx_t_15 == -1)) __PYX_ERR(0, 574, __pyx_L1_error)
      __pyx_t_8 = ((__pyx_t_15 >= 1) != 0);
      if (__pyx_t_8) {

        /* "kapok/uavsarc.pyx":575
 * 
 *             if len(basefile) >= 1:
 *                 basesch = np.loadtxt(basefile[0])             # <<<<<<<<<<<<<<
 *             else:
 *                 print('kapok.uavsar.load | Cannot find .baseline file matching pattern: "'+datapath+tracknames[tr]+'*.baseline'+'".  Aborting.')
 */
        __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 575, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_loadtxt); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 575, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_basefile, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 575, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_4 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_12))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_12);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_12, function);
          }
        }
        if (!__pyx_t_4) {
          __pyx_t_20 = __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_7); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 575, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_GOTREF(__pyx_t_20);
        } else {
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_12)) {
            PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_7};
            __pyx_t_20 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 575, __pyx_L1_error)
            __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
            __Pyx_GOTREF(__pyx_t_20);
            __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) {
            PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_7};
            __pyx_t_20 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 575, __pyx_L1_error)
            __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
            __Pyx_GOTREF(__pyx_t_20);
            __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          } else
          #endif
          {
            __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 575, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_6);
            __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
            __Pyx_GIVEREF(__pyx_t_7);
            PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_7);
            __pyx_t_7 = 0;
            __pyx_t_20 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_6, NULL); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 575, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_20);
            __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          }
        }
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_XDECREF_SET(__pyx_v_basesch, __pyx_t_20);
        __pyx_t_20 = 0;

        /* "kapok/uavsarc.pyx":574
 *             basefile = glob(datapath+tracknames[tr]+'*.baseline')
 * 
 *             if len(basefile) >= 1:             # <<<<<<<<<<<<<<
 *                 basesch = np.loadtxt(basefile[0])
 *             else:
 */
        goto __pyx_L111;
      }

      /* "kapok/uavsarc.pyx":577
 *                 basesch = np.loadtxt(basefile[0])
 *             else:
 *                 print('kapok.uavsar.load | Cannot find .baseline file matching pattern: "'+datapath+tracknames[tr]+'*.baseline'+'".  Aborting.')             # <<<<<<<<<<<<<<
 *                 return
 * 
 */
      /*else*/ {
        __pyx_t_20 = PyNumber_Add(__pyx_kp_u_kapok_uavsar_load_Cannot_find_ba, __pyx_v_datapath); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 577, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_20);
        __pyx_t_12 = __Pyx_GetItemInt(__pyx_v_tracknames, __pyx_v_tr, unsigned int, 0, __Pyx_PyInt_From_unsigned_int, 0, 0, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 577, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_6 = PyNumber_Add(__pyx_t_20, __pyx_t_12); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 577, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_t_12 = PyNumber_Add(__pyx_t_6, __pyx_kp_u_baseline); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 577, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_6 = PyNumber_Add(__pyx_t_12, __pyx_kp_u_Aborting); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 577, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_t_12 = PyTuple_New(1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 577, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_GIVEREF(__pyx_t_6);
        PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_6);
        __pyx_t_6 = 0;
        __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_t_12, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 577, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

        /* "kapok/uavsarc.pyx":578
 *             else:
 *                 print('kapok.uavsar.load | Cannot find .baseline file matching pattern: "'+datapath+tracknames[tr]+'*.baseline'+'".  Aborting.')
 *                 return             # <<<<<<<<<<<<<<
 * 
 *             istart = np.where(np.isclose(basesch[:,0],sbounds[0]))[0][0] # index of first azimuth line in subset
 */
        __Pyx_XDECREF(__pyx_r);
        __pyx_r = Py_None; __Pyx_INCREF(Py_None);
        goto __pyx_L0;
      }
      __pyx_L111:;

      /* "kapok/uavsarc.pyx":580
 *                 return
 * 
 *             istart = np.where(np.isclose(basesch[:,0],sbounds[0]))[0][0] # index of first azimuth line in subset             # <<<<<<<<<<<<<<
 *             iend = np.where(np.isclose(basesch[:,0],sbounds[1]))[0][0] # index of last azimuth line in subset
 *             base_enu[:] = sch2enu(basesch[istart:iend,1],basesch[istart:iend,2],basesch[istart:iend,3], peglat, peglon, peghdg)[0:base_enu.shape[0],:]
 */
      __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 580, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      __pyx_t_20 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_where); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 580, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_20);
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 580, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_isclose); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 580, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = PyObject_GetItem(__pyx_v_basesch, __pyx_tuple__85); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 580, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_28 = __Pyx_GetItemInt(__pyx_v_sbounds, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_28)) __PYX_ERR(0, 580, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_28);
      __pyx_t_29 = NULL;
      __pyx_t_9 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_29 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_29)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_29);
          __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[3] = {__pyx_t_29, __pyx_t_7, __pyx_t_28};
        __pyx_t_12 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 580, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_29); __pyx_t_29 = 0;
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_28); __pyx_t_28 = 0;
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
        PyObject *__pyx_temp[3] = {__pyx_t_29, __pyx_t_7, __pyx_t_28};
        __pyx_t_12 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 580, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_29); __pyx_t_29 = 0;
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_28); __pyx_t_28 = 0;
      } else
      #endif
      {
        __pyx_t_19 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 580, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_19);
        if (__pyx_t_29) {
          __Pyx_GIVEREF(__pyx_t_29); PyTuple_SET_ITEM(__pyx_t_19, 0, __pyx_t_29); __pyx_t_29 = NULL;
        }
        __Pyx_GIVEREF(__pyx_t_7);
        PyTuple_SET_ITEM(__pyx_t_19, 0+__pyx_t_9, __pyx_t_7);
        __Pyx_GIVEREF(__pyx_t_28);
        PyTuple_SET_ITEM(__pyx_t_19, 1+__pyx_t_9, __pyx_t_28);
        __pyx_t_7 = 0;
        __pyx_t_28 = 0;
        __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_19, NULL); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 580, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_20))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_20);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_20);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_20, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_20, __pyx_t_12); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 580, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_GOTREF(__pyx_t_6);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_20)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_12};
          __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_20, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 580, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_20)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_12};
          __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_20, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 580, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        } else
        #endif
        {
          __pyx_t_19 = PyTuple_New(1+1); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 580, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_19);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_19, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_GIVEREF(__pyx_t_12);
          PyTuple_SET_ITEM(__pyx_t_19, 0+1, __pyx_t_12);
          __pyx_t_12 = 0;
          __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_20, __pyx_t_19, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 580, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
      __pyx_t_20 = __Pyx_GetItemInt(__pyx_t_6, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 580, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_20);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_20, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 580, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
      __Pyx_XDECREF_SET(__pyx_v_istart, __pyx_t_6);
      __pyx_t_6 = 0;

      /* "kapok/uavsarc.pyx":581
 * 
 *             istart = np.where(np.isclose(basesch[:,0],sbounds[0]))[0][0] # index of first azimuth line in subset
 *             iend = np.where(np.isclose(basesch[:,0],sbounds[1]))[0][0] # index of last azimuth line in subset             # <<<<<<<<<<<<<<
 *             base_enu[:] = sch2enu(basesch[istart:iend,1],basesch[istart:iend,2],basesch[istart:iend,3], peglat, peglon, peghdg)[0:base_enu.shape[0],:]
 * 
 */
      __pyx_t_20 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 581, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_20);
      __pyx_t_19 = __Pyx_PyObject_GetAttrStr(__pyx_t_20, __pyx_n_s_where); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 581, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_19);
      __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
      __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 581, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_isclose); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 581, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __pyx_t_12 = PyObject_GetItem(__pyx_v_basesch, __pyx_tuple__87); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 581, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      __pyx_t_28 = __Pyx_GetItemInt(__pyx_v_sbounds, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_28)) __PYX_ERR(0, 581, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_28);
      __pyx_t_7 = NULL;
      __pyx_t_9 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_7)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_7);
          __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[3] = {__pyx_t_7, __pyx_t_12, __pyx_t_28};
        __pyx_t_20 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 581, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_GOTREF(__pyx_t_20);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_DECREF(__pyx_t_28); __pyx_t_28 = 0;
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
        PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_12, __pyx_t_28};
        __pyx_t_20 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 581, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_GOTREF(__pyx_t_20);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_DECREF(__pyx_t_28); __pyx_t_28 = 0;
      } else
      #endif
      {
        __pyx_t_29 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 581, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_29);
        if (__pyx_t_7) {
          __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_29, 0, __pyx_t_7); __pyx_t_7 = NULL;
        }
        __Pyx_GIVEREF(__pyx_t_12);
        PyTuple_SET_ITEM(__pyx_t_29, 0+__pyx_t_9, __pyx_t_12);
        __Pyx_GIVEREF(__pyx_t_28);
        PyTuple_SET_ITEM(__pyx_t_29, 1+__pyx_t_9, __pyx_t_28);
        __pyx_t_12 = 0;
        __pyx_t_28 = 0;
        __pyx_t_20 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_29, NULL); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 581, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_20);
        __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_19))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_19);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_19);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_19, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_19, __pyx_t_20); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 581, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
        __Pyx_GOTREF(__pyx_t_6);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_19)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_20};
          __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_19, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 581, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_19)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_20};
          __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_19, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 581, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
        } else
        #endif
        {
          __pyx_t_29 = PyTuple_New(1+1); if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 581, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_29);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_29, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_GIVEREF(__pyx_t_20);
          PyTuple_SET_ITEM(__pyx_t_29, 0+1, __pyx_t_20);
          __pyx_t_20 = 0;
          __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_19, __pyx_t_29, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 581, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
      __pyx_t_19 = __Pyx_GetItemInt(__pyx_t_6, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 581, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_19);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_19, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 581, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
      __Pyx_XDECREF_SET(__pyx_v_iend, __pyx_t_6);
      __pyx_t_6 = 0;

      /* "kapok/uavsarc.pyx":582
 *             istart = np.where(np.isclose(basesch[:,0],sbounds[0]))[0][0] # index of first azimuth line in subset
 *             iend = np.where(np.isclose(basesch[:,0],sbounds[1]))[0][0] # index of last azimuth line in subset
 *             base_enu[:] = sch2enu(basesch[istart:iend,1],basesch[istart:iend,2],basesch[istart:iend,3], peglat, peglon, peghdg)[0:base_enu.shape[0],:]             # <<<<<<<<<<<<<<
 * 
 * 
 */
      __pyx_t_19 = __Pyx_GetModuleGlobalName(__pyx_n_s_sch2enu); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 582, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_19);
      __pyx_t_29 = PySlice_New(__pyx_v_istart, __pyx_v_iend, Py_None); if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 582, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_29);
      __pyx_t_20 = PyTuple_New(2); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 582, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_20);
      __Pyx_GIVEREF(__pyx_t_29);
      PyTuple_SET_ITEM(__pyx_t_20, 0, __pyx_t_29);
      __Pyx_INCREF(__pyx_int_1);
      __Pyx_GIVEREF(__pyx_int_1);
      PyTuple_SET_ITEM(__pyx_t_20, 1, __pyx_int_1);
      __pyx_t_29 = 0;
      __pyx_t_29 = PyObject_GetItem(__pyx_v_basesch, __pyx_t_20); if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 582, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_29);
      __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
      __pyx_t_20 = PySlice_New(__pyx_v_istart, __pyx_v_iend, Py_None); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 582, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_20);
      __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 582, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_20);
      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_20);
      __Pyx_INCREF(__pyx_int_2);
      __Pyx_GIVEREF(__pyx_int_2);
      PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_int_2);
      __pyx_t_20 = 0;
      __pyx_t_20 = PyObject_GetItem(__pyx_v_basesch, __pyx_t_4); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 582, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_20);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = PySlice_New(__pyx_v_istart, __pyx_v_iend, Py_None); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 582, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_28 = PyTuple_New(2); if (unlikely(!__pyx_t_28)) __PYX_ERR(0, 582, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_28);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_28, 0, __pyx_t_4);
      __Pyx_INCREF(__pyx_int_3);
      __Pyx_GIVEREF(__pyx_int_3);
      PyTuple_SET_ITEM(__pyx_t_28, 1, __pyx_int_3);
      __pyx_t_4 = 0;
      __pyx_t_4 = PyObject_GetItem(__pyx_v_basesch, __pyx_t_28); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 582, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_28); __pyx_t_28 = 0;
      __pyx_t_28 = NULL;
      __pyx_t_9 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_19))) {
        __pyx_t_28 = PyMethod_GET_SELF(__pyx_t_19);
        if (likely(__pyx_t_28)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_19);
          __Pyx_INCREF(__pyx_t_28);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_19, function);
          __pyx_t_9 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_19)) {
        PyObject *__pyx_temp[7] = {__pyx_t_28, __pyx_t_29, __pyx_t_20, __pyx_t_4, __pyx_v_peglat, __pyx_v_peglon, __pyx_v_peghdg};
        __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_19, __pyx_temp+1-__pyx_t_9, 6+__pyx_t_9); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 582, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_28); __pyx_t_28 = 0;
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0;
        __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_19)) {
        PyObject *__pyx_temp[7] = {__pyx_t_28, __pyx_t_29, __pyx_t_20, __pyx_t_4, __pyx_v_peglat, __pyx_v_peglon, __pyx_v_peghdg};
        __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_19, __pyx_temp+1-__pyx_t_9, 6+__pyx_t_9); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 582, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_28); __pyx_t_28 = 0;
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0;
        __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else
      #endif
      {
        __pyx_t_12 = PyTuple_New(6+__pyx_t_9); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 582, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        if (__pyx_t_28) {
          __Pyx_GIVEREF(__pyx_t_28); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_28); __pyx_t_28 = NULL;
        }
        __Pyx_GIVEREF(__pyx_t_29);
        PyTuple_SET_ITEM(__pyx_t_12, 0+__pyx_t_9, __pyx_t_29);
        __Pyx_GIVEREF(__pyx_t_20);
        PyTuple_SET_ITEM(__pyx_t_12, 1+__pyx_t_9, __pyx_t_20);
        __Pyx_GIVEREF(__pyx_t_4);
        PyTuple_SET_ITEM(__pyx_t_12, 2+__pyx_t_9, __pyx_t_4);
        __Pyx_INCREF(__pyx_v_peglat);
        __Pyx_GIVEREF(__pyx_v_peglat);
        PyTuple_SET_ITEM(__pyx_t_12, 3+__pyx_t_9, __pyx_v_peglat);
        __Pyx_INCREF(__pyx_v_peglon);
        __Pyx_GIVEREF(__pyx_v_peglon);
        PyTuple_SET_ITEM(__pyx_t_12, 4+__pyx_t_9, __pyx_v_peglon);
        __Pyx_INCREF(__pyx_v_peghdg);
        __Pyx_GIVEREF(__pyx_v_peghdg);
        PyTuple_SET_ITEM(__pyx_t_12, 5+__pyx_t_9, __pyx_v_peghdg);
        __pyx_t_29 = 0;
        __pyx_t_20 = 0;
        __pyx_t_4 = 0;
        __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_19, __pyx_t_12, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 582, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      }
      __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
      __pyx_t_19 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_base_enu->dimensions[0])); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 582, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_19);
      __pyx_t_12 = PySlice_New(__pyx_int_0, __pyx_t_19, Py_None); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 582, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
      __pyx_t_19 = PyTuple_New(2); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 582, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_19);
      __Pyx_GIVEREF(__pyx_t_12);
      PyTuple_SET_ITEM(__pyx_t_19, 0, __pyx_t_12);
      __Pyx_INCREF(__pyx_slice__88);
      __Pyx_GIVEREF(__pyx_slice__88);
      PyTuple_SET_ITEM(__pyx_t_19, 1, __pyx_slice__88);
      __pyx_t_12 = 0;
      __pyx_t_12 = PyObject_GetItem(__pyx_t_6, __pyx_t_19); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 582, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
      if (__Pyx_PyObject_SetSlice(((PyObject *)__pyx_v_base_enu), __pyx_t_12, 0, 0, NULL, NULL, &__pyx_slice__89, 0, 0, 1) < 0) __PYX_ERR(0, 582, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;

      /* "kapok/uavsarc.pyx":586
 * 
 *             # Main kz calculation loop.
 *             for az_ml in range(0,azsize):             # <<<<<<<<<<<<<<
 *                 # Calculate indices.
 *                 azstart = az_ml*mlwin[0]
 */
      __pyx_t_26 = __Pyx_PyInt_As_long(__pyx_v_azsize); if (unlikely((__pyx_t_26 == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 586, __pyx_L1_error)
      for (__pyx_t_22 = 0; __pyx_t_22 < __pyx_t_26; __pyx_t_22+=1) {
        __pyx_v_az_ml = __pyx_t_22;

        /* "kapok/uavsarc.pyx":588
 *             for az_ml in range(0,azsize):
 *                 # Calculate indices.
 *                 azstart = az_ml*mlwin[0]             # <<<<<<<<<<<<<<
 *                 azend = azstart + mlwin[0]
 *                 lkvrowstart = (azstart + azbounds[0]) // mlwin_lkv[0]
 */
        __pyx_t_12 = __Pyx_PyInt_From_unsigned_long(__pyx_v_az_ml); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 588, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_19 = __Pyx_GetItemInt(__pyx_v_mlwin, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 588, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_19);
        __pyx_t_6 = PyNumber_Multiply(__pyx_t_12, __pyx_t_19); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 588, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
        __pyx_t_44 = __Pyx_PyInt_As_unsigned_long(__pyx_t_6); if (unlikely((__pyx_t_44 == (unsigned long)-1) && PyErr_Occurred())) __PYX_ERR(0, 588, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_v_azstart = __pyx_t_44;

        /* "kapok/uavsarc.pyx":589
 *                 # Calculate indices.
 *                 azstart = az_ml*mlwin[0]
 *                 azend = azstart + mlwin[0]             # <<<<<<<<<<<<<<
 *                 lkvrowstart = (azstart + azbounds[0]) // mlwin_lkv[0]
 *                 lkvrowend = (azend + azbounds[0]) // mlwin_lkv[0]
 */
        __pyx_t_6 = __Pyx_PyInt_From_unsigned_long(__pyx_v_azstart); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 589, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_19 = __Pyx_GetItemInt(__pyx_v_mlwin, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 589, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_19);
        __pyx_t_12 = PyNumber_Add(__pyx_t_6, __pyx_t_19); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 589, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
        __pyx_t_44 = __Pyx_PyInt_As_unsigned_long(__pyx_t_12); if (unlikely((__pyx_t_44 == (unsigned long)-1) && PyErr_Occurred())) __PYX_ERR(0, 589, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_v_azend = __pyx_t_44;

        /* "kapok/uavsarc.pyx":590
 *                 azstart = az_ml*mlwin[0]
 *                 azend = azstart + mlwin[0]
 *                 lkvrowstart = (azstart + azbounds[0]) // mlwin_lkv[0]             # <<<<<<<<<<<<<<
 *                 lkvrowend = (azend + azbounds[0]) // mlwin_lkv[0]
 *                 if lkvrowend < np.shape(lkv)[0]:
 */
        __pyx_t_12 = __Pyx_PyInt_From_unsigned_long(__pyx_v_azstart); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 590, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_19 = __Pyx_GetItemInt(__pyx_v_azbounds, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 590, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_19);
        __pyx_t_6 = PyNumber_Add(__pyx_t_12, __pyx_t_19); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 590, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
        __pyx_t_19 = __Pyx_GetItemInt_Tuple(__pyx_v_mlwin_lkv, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 590, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_19);
        __pyx_t_12 = PyNumber_FloorDivide(__pyx_t_6, __pyx_t_19); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 590, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
        __pyx_t_44 = __Pyx_PyInt_As_unsigned_long(__pyx_t_12); if (unlikely((__pyx_t_44 == (unsigned long)-1) && PyErr_Occurred())) __PYX_ERR(0, 590, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_v_lkvrowstart = __pyx_t_44;

        /* "kapok/uavsarc.pyx":591
 *                 azend = azstart + mlwin[0]
 *                 lkvrowstart = (azstart + azbounds[0]) // mlwin_lkv[0]
 *                 lkvrowend = (azend + azbounds[0]) // mlwin_lkv[0]             # <<<<<<<<<<<<<<
 *                 if lkvrowend < np.shape(lkv)[0]:
 *                     lkvrowend += 1
 */
        __pyx_t_12 = __Pyx_PyInt_From_unsigned_long(__pyx_v_azend); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 591, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_19 = __Pyx_GetItemInt(__pyx_v_azbounds, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 591, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_19);
        __pyx_t_6 = PyNumber_Add(__pyx_t_12, __pyx_t_19); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 591, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
        __pyx_t_19 = __Pyx_GetItemInt_Tuple(__pyx_v_mlwin_lkv, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 591, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_19);
        __pyx_t_12 = PyNumber_FloorDivide(__pyx_t_6, __pyx_t_19); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 591, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
        __pyx_t_44 = __Pyx_PyInt_As_unsigned_long(__pyx_t_12); if (unlikely((__pyx_t_44 == (unsigned long)-1) && PyErr_Occurred())) __PYX_ERR(0, 591, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_v_lkvrowend = __pyx_t_44;

        /* "kapok/uavsarc.pyx":592
 *                 lkvrowstart = (azstart + azbounds[0]) // mlwin_lkv[0]
 *                 lkvrowend = (azend + azbounds[0]) // mlwin_lkv[0]
 *                 if lkvrowend < np.shape(lkv)[0]:             # <<<<<<<<<<<<<<
 *                     lkvrowend += 1
 *                 lkvtrimstart = (azstart + azbounds[0]) % mlwin_lkv[0]
 */
        __pyx_t_12 = __Pyx_PyInt_From_unsigned_long(__pyx_v_lkvrowend); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 592, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 592, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_shape); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 592, __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);
          }
        }
        if (!__pyx_t_6) {
          __pyx_t_19 = __Pyx_PyObject_CallOneArg(__pyx_t_4, ((PyObject *)__pyx_v_lkv)); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 592, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_19);
        } else {
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_4)) {
            PyObject *__pyx_temp[2] = {__pyx_t_6, ((PyObject *)__pyx_v_lkv)};
            __pyx_t_19 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 592, __pyx_L1_error)
            __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
            __Pyx_GOTREF(__pyx_t_19);
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
            PyObject *__pyx_temp[2] = {__pyx_t_6, ((PyObject *)__pyx_v_lkv)};
            __pyx_t_19 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 592, __pyx_L1_error)
            __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
            __Pyx_GOTREF(__pyx_t_19);
          } else
          #endif
          {
            __pyx_t_20 = PyTuple_New(1+1); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 592, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_20);
            __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_20, 0, __pyx_t_6); __pyx_t_6 = NULL;
            __Pyx_INCREF(((PyObject *)__pyx_v_lkv));
            __Pyx_GIVEREF(((PyObject *)__pyx_v_lkv));
            PyTuple_SET_ITEM(__pyx_t_20, 0+1, ((PyObject *)__pyx_v_lkv));
            __pyx_t_19 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_20, NULL); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 592, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_19);
            __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
          }
        }
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_19, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 592, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
        __pyx_t_19 = PyObject_RichCompare(__pyx_t_12, __pyx_t_4, Py_LT); __Pyx_XGOTREF(__pyx_t_19); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 592, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_19); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 592, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
        if (__pyx_t_8) {

          /* "kapok/uavsarc.pyx":593
 *                 lkvrowend = (azend + azbounds[0]) // mlwin_lkv[0]
 *                 if lkvrowend < np.shape(lkv)[0]:
 *                     lkvrowend += 1             # <<<<<<<<<<<<<<
 *                 lkvtrimstart = (azstart + azbounds[0]) % mlwin_lkv[0]
 *                 lkvtrimend = lkvtrimstart + mlwin[0]
 */
          __pyx_v_lkvrowend = (__pyx_v_lkvrowend + 1);

          /* "kapok/uavsarc.pyx":592
 *                 lkvrowstart = (azstart + azbounds[0]) // mlwin_lkv[0]
 *                 lkvrowend = (azend + azbounds[0]) // mlwin_lkv[0]
 *                 if lkvrowend < np.shape(lkv)[0]:             # <<<<<<<<<<<<<<
 *                     lkvrowend += 1
 *                 lkvtrimstart = (azstart + azbounds[0]) % mlwin_lkv[0]
 */
        }

        /* "kapok/uavsarc.pyx":594
 *                 if lkvrowend < np.shape(lkv)[0]:
 *                     lkvrowend += 1
 *                 lkvtrimstart = (azstart + azbounds[0]) % mlwin_lkv[0]             # <<<<<<<<<<<<<<
 *                 lkvtrimend = lkvtrimstart + mlwin[0]
 * 
 */
        __pyx_t_19 = __Pyx_PyInt_From_unsigned_long(__pyx_v_azstart); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 594, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_19);
        __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_azbounds, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 594, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_12 = PyNumber_Add(__pyx_t_19, __pyx_t_4); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 594, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_4 = __Pyx_GetItemInt_Tuple(__pyx_v_mlwin_lkv, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 594, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_19 = PyNumber_Remainder(__pyx_t_12, __pyx_t_4); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 594, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_19);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_44 = __Pyx_PyInt_As_unsigned_long(__pyx_t_19); if (unlikely((__pyx_t_44 == (unsigned long)-1) && PyErr_Occurred())) __PYX_ERR(0, 594, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
        __pyx_v_lkvtrimstart = __pyx_t_44;

        /* "kapok/uavsarc.pyx":595
 *                     lkvrowend += 1
 *                 lkvtrimstart = (azstart + azbounds[0]) % mlwin_lkv[0]
 *                 lkvtrimend = lkvtrimstart + mlwin[0]             # <<<<<<<<<<<<<<
 * 
 *                 # Current track look vector.
 */
        __pyx_t_19 = __Pyx_PyInt_From_unsigned_long(__pyx_v_lkvtrimstart); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 595, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_19);
        __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_mlwin, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 595, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_12 = PyNumber_Add(__pyx_t_19, __pyx_t_4); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 595, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_44 = __Pyx_PyInt_As_unsigned_long(__pyx_t_12); if (unlikely((__pyx_t_44 == (unsigned long)-1) && PyErr_Occurred())) __PYX_ERR(0, 595, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_v_lkvtrimend = __pyx_t_44;

        /* "kapok/uavsarc.pyx":598
 * 
 *                 # Current track look vector.
 *                 tracklkv[:,:,0] = (zoom(lkv[lkvrowstart:lkvrowend,:,0],mlwin_lkv)[lkvtrimstart:lkvtrimend] + base_enu[azstart:azend,np.newaxis,0])[0:mlwin[0],0:rngsize_slc]             # <<<<<<<<<<<<<<
 *                 tracklkv[:,:,1] = (zoom(lkv[lkvrowstart:lkvrowend,:,1],mlwin_lkv)[lkvtrimstart:lkvtrimend] + base_enu[azstart:azend,np.newaxis,1])[0:mlwin[0],0:rngsize_slc]
 *                 tracklkv[:,:,2] = (zoom(lkv[lkvrowstart:lkvrowend,:,2],mlwin_lkv)[lkvtrimstart:lkvtrimend] + base_enu[azstart:azend,np.newaxis,2])[0:mlwin[0],0:rngsize_slc]
 */
        __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_zoom); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 598, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_19 = __Pyx_PyInt_From_unsigned_long(__pyx_v_lkvrowstart); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 598, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_19);
        __pyx_t_20 = __Pyx_PyInt_From_unsigned_long(__pyx_v_lkvrowend); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 598, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_20);
        __pyx_t_6 = PySlice_New(__pyx_t_19, __pyx_t_20, Py_None); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 598, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
        __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
        __pyx_t_20 = PyTuple_New(3); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 598, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_20);
        __Pyx_GIVEREF(__pyx_t_6);
        PyTuple_SET_ITEM(__pyx_t_20, 0, __pyx_t_6);
        __Pyx_INCREF(__pyx_slice__90);
        __Pyx_GIVEREF(__pyx_slice__90);
        PyTuple_SET_ITEM(__pyx_t_20, 1, __pyx_slice__90);
        __Pyx_INCREF(__pyx_int_0);
        __Pyx_GIVEREF(__pyx_int_0);
        PyTuple_SET_ITEM(__pyx_t_20, 2, __pyx_int_0);
        __pyx_t_6 = 0;
        __pyx_t_6 = PyObject_GetItem(((PyObject *)__pyx_v_lkv), __pyx_t_20); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 598, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
        __pyx_t_20 = NULL;
        __pyx_t_9 = 0;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_20 = PyMethod_GET_SELF(__pyx_t_4);
          if (likely(__pyx_t_20)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
            __Pyx_INCREF(__pyx_t_20);
            __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[3] = {__pyx_t_20, __pyx_t_6, __pyx_v_mlwin_lkv};
          __pyx_t_12 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 598, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0;
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
          PyObject *__pyx_temp[3] = {__pyx_t_20, __pyx_t_6, __pyx_v_mlwin_lkv};
          __pyx_t_12 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 598, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0;
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        } else
        #endif
        {
          __pyx_t_19 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 598, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_19);
          if (__pyx_t_20) {
            __Pyx_GIVEREF(__pyx_t_20); PyTuple_SET_ITEM(__pyx_t_19, 0, __pyx_t_20); __pyx_t_20 = NULL;
          }
          __Pyx_GIVEREF(__pyx_t_6);
          PyTuple_SET_ITEM(__pyx_t_19, 0+__pyx_t_9, __pyx_t_6);
          __Pyx_INCREF(__pyx_v_mlwin_lkv);
          __Pyx_GIVEREF(__pyx_v_mlwin_lkv);
          PyTuple_SET_ITEM(__pyx_t_19, 1+__pyx_t_9, __pyx_v_mlwin_lkv);
          __pyx_t_6 = 0;
          __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_19, NULL); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 598, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
        }
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_4 = __Pyx_PyObject_GetSlice(__pyx_t_12, __pyx_v_lkvtrimstart, __pyx_v_lkvtrimend, NULL, NULL, NULL, 1, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 598, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_t_12 = __Pyx_PyInt_From_unsigned_long(__pyx_v_azstart); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 598, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_19 = __Pyx_PyInt_From_unsigned_long(__pyx_v_azend); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 598, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_19);
        __pyx_t_6 = PySlice_New(__pyx_t_12, __pyx_t_19, Py_None); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 598, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
        __pyx_t_19 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 598, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_19);
        __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_19, __pyx_n_s_newaxis); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 598, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
        __pyx_t_19 = PyTuple_New(3); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 598, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_19);
        __Pyx_GIVEREF(__pyx_t_6);
        PyTuple_SET_ITEM(__pyx_t_19, 0, __pyx_t_6);
        __Pyx_GIVEREF(__pyx_t_12);
        PyTuple_SET_ITEM(__pyx_t_19, 1, __pyx_t_12);
        __Pyx_INCREF(__pyx_int_0);
        __Pyx_GIVEREF(__pyx_int_0);
        PyTuple_SET_ITEM(__pyx_t_19, 2, __pyx_int_0);
        __pyx_t_6 = 0;
        __pyx_t_12 = 0;
        __pyx_t_12 = PyObject_GetItem(((PyObject *)__pyx_v_base_enu), __pyx_t_19); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 598, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
        __pyx_t_19 = PyNumber_Add(__pyx_t_4, __pyx_t_12); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 598, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_19);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_t_12 = __Pyx_GetItemInt(__pyx_v_mlwin, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 598, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_4 = PySlice_New(__pyx_int_0, __pyx_t_12, Py_None); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 598, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_t_12 = PySlice_New(__pyx_int_0, __pyx_v_rngsize_slc, Py_None); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 598, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 598, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_GIVEREF(__pyx_t_4);
        PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4);
        __Pyx_GIVEREF(__pyx_t_12);
        PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_12);
        __pyx_t_4 = 0;
        __pyx_t_12 = 0;
        __pyx_t_12 = PyObject_GetItem(__pyx_t_19, __pyx_t_6); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 598, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_tracklkv), __pyx_tuple__93, __pyx_t_12) < 0)) __PYX_ERR(0, 598, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;

        /* "kapok/uavsarc.pyx":599
 *                 # Current track look vector.
 *                 tracklkv[:,:,0] = (zoom(lkv[lkvrowstart:lkvrowend,:,0],mlwin_lkv)[lkvtrimstart:lkvtrimend] + base_enu[azstart:azend,np.newaxis,0])[0:mlwin[0],0:rngsize_slc]
 *                 tracklkv[:,:,1] = (zoom(lkv[lkvrowstart:lkvrowend,:,1],mlwin_lkv)[lkvtrimstart:lkvtrimend] + base_enu[azstart:azend,np.newaxis,1])[0:mlwin[0],0:rngsize_slc]             # <<<<<<<<<<<<<<
 *                 tracklkv[:,:,2] = (zoom(lkv[lkvrowstart:lkvrowend,:,2],mlwin_lkv)[lkvtrimstart:lkvtrimend] + base_enu[azstart:azend,np.newaxis,2])[0:mlwin[0],0:rngsize_slc]
 * 
 */
        __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_zoom); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 599, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_19 = __Pyx_PyInt_From_unsigned_long(__pyx_v_lkvrowstart); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 599, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_19);
        __pyx_t_4 = __Pyx_PyInt_From_unsigned_long(__pyx_v_lkvrowend); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 599, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_20 = PySlice_New(__pyx_t_19, __pyx_t_4, Py_None); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 599, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_20);
        __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 599, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_GIVEREF(__pyx_t_20);
        PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_20);
        __Pyx_INCREF(__pyx_slice__94);
        __Pyx_GIVEREF(__pyx_slice__94);
        PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_slice__94);
        __Pyx_INCREF(__pyx_int_1);
        __Pyx_GIVEREF(__pyx_int_1);
        PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_int_1);
        __pyx_t_20 = 0;
        __pyx_t_20 = PyObject_GetItem(((PyObject *)__pyx_v_lkv), __pyx_t_4); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 599, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_20);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_4 = NULL;
        __pyx_t_9 = 0;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
            __pyx_t_9 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_20, __pyx_v_mlwin_lkv};
          __pyx_t_12 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 599, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_20, __pyx_v_mlwin_lkv};
          __pyx_t_12 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 599, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
        } else
        #endif
        {
          __pyx_t_19 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 599, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_19);
          if (__pyx_t_4) {
            __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_19, 0, __pyx_t_4); __pyx_t_4 = NULL;
          }
          __Pyx_GIVEREF(__pyx_t_20);
          PyTuple_SET_ITEM(__pyx_t_19, 0+__pyx_t_9, __pyx_t_20);
          __Pyx_INCREF(__pyx_v_mlwin_lkv);
          __Pyx_GIVEREF(__pyx_v_mlwin_lkv);
          PyTuple_SET_ITEM(__pyx_t_19, 1+__pyx_t_9, __pyx_v_mlwin_lkv);
          __pyx_t_20 = 0;
          __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_19, NULL); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 599, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_6 = __Pyx_PyObject_GetSlice(__pyx_t_12, __pyx_v_lkvtrimstart, __pyx_v_lkvtrimend, NULL, NULL, NULL, 1, 1, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 599, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_t_12 = __Pyx_PyInt_From_unsigned_long(__pyx_v_azstart); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 599, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_19 = __Pyx_PyInt_From_unsigned_long(__pyx_v_azend); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 599, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_19);
        __pyx_t_20 = PySlice_New(__pyx_t_12, __pyx_t_19, Py_None); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 599, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_20);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
        __pyx_t_19 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 599, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_19);
        __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_19, __pyx_n_s_newaxis); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 599, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
        __pyx_t_19 = PyTuple_New(3); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 599, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_19);
        __Pyx_GIVEREF(__pyx_t_20);
        PyTuple_SET_ITEM(__pyx_t_19, 0, __pyx_t_20);
        __Pyx_GIVEREF(__pyx_t_12);
        PyTuple_SET_ITEM(__pyx_t_19, 1, __pyx_t_12);
        __Pyx_INCREF(__pyx_int_1);
        __Pyx_GIVEREF(__pyx_int_1);
        PyTuple_SET_ITEM(__pyx_t_19, 2, __pyx_int_1);
        __pyx_t_20 = 0;
        __pyx_t_12 = 0;
        __pyx_t_12 = PyObject_GetItem(((PyObject *)__pyx_v_base_enu), __pyx_t_19); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 599, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
        __pyx_t_19 = PyNumber_Add(__pyx_t_6, __pyx_t_12); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 599, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_19);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_t_12 = __Pyx_GetItemInt(__pyx_v_mlwin, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 599, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_6 = PySlice_New(__pyx_int_0, __pyx_t_12, Py_None); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 599, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_t_12 = PySlice_New(__pyx_int_0, __pyx_v_rngsize_slc, Py_None); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 599, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_20 = PyTuple_New(2); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 599, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_20);
        __Pyx_GIVEREF(__pyx_t_6);
        PyTuple_SET_ITEM(__pyx_t_20, 0, __pyx_t_6);
        __Pyx_GIVEREF(__pyx_t_12);
        PyTuple_SET_ITEM(__pyx_t_20, 1, __pyx_t_12);
        __pyx_t_6 = 0;
        __pyx_t_12 = 0;
        __pyx_t_12 = PyObject_GetItem(__pyx_t_19, __pyx_t_20); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 599, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
        __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
        if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_tracklkv), __pyx_tuple__97, __pyx_t_12) < 0)) __PYX_ERR(0, 599, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;

        /* "kapok/uavsarc.pyx":600
 *                 tracklkv[:,:,0] = (zoom(lkv[lkvrowstart:lkvrowend,:,0],mlwin_lkv)[lkvtrimstart:lkvtrimend] + base_enu[azstart:azend,np.newaxis,0])[0:mlwin[0],0:rngsize_slc]
 *                 tracklkv[:,:,1] = (zoom(lkv[lkvrowstart:lkvrowend,:,1],mlwin_lkv)[lkvtrimstart:lkvtrimend] + base_enu[azstart:azend,np.newaxis,1])[0:mlwin[0],0:rngsize_slc]
 *                 tracklkv[:,:,2] = (zoom(lkv[lkvrowstart:lkvrowend,:,2],mlwin_lkv)[lkvtrimstart:lkvtrimend] + base_enu[azstart:azend,np.newaxis,2])[0:mlwin[0],0:rngsize_slc]             # <<<<<<<<<<<<<<
 * 
 *                 # Platform velocity vector.
 */
        __pyx_t_20 = __Pyx_GetModuleGlobalName(__pyx_n_s_zoom); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 600, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_20);
        __pyx_t_19 = __Pyx_PyInt_From_unsigned_long(__pyx_v_lkvrowstart); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 600, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_19);
        __pyx_t_6 = __Pyx_PyInt_From_unsigned_long(__pyx_v_lkvrowend); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 600, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_4 = PySlice_New(__pyx_t_19, __pyx_t_6, Py_None); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 600, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 600, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_GIVEREF(__pyx_t_4);
        PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4);
        __Pyx_INCREF(__pyx_slice__98);
        __Pyx_GIVEREF(__pyx_slice__98);
        PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_slice__98);
        __Pyx_INCREF(__pyx_int_2);
        __Pyx_GIVEREF(__pyx_int_2);
        PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_int_2);
        __pyx_t_4 = 0;
        __pyx_t_4 = PyObject_GetItem(((PyObject *)__pyx_v_lkv), __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 600, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_6 = NULL;
        __pyx_t_9 = 0;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_20))) {
          __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_20);
          if (likely(__pyx_t_6)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_20);
            __Pyx_INCREF(__pyx_t_6);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_20, function);
            __pyx_t_9 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_20)) {
          PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_4, __pyx_v_mlwin_lkv};
          __pyx_t_12 = __Pyx_PyFunction_FastCall(__pyx_t_20, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 600, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_20)) {
          PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_4, __pyx_v_mlwin_lkv};
          __pyx_t_12 = __Pyx_PyCFunction_FastCall(__pyx_t_20, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 600, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        } else
        #endif
        {
          __pyx_t_19 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 600, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_19);
          if (__pyx_t_6) {
            __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_19, 0, __pyx_t_6); __pyx_t_6 = NULL;
          }
          __Pyx_GIVEREF(__pyx_t_4);
          PyTuple_SET_ITEM(__pyx_t_19, 0+__pyx_t_9, __pyx_t_4);
          __Pyx_INCREF(__pyx_v_mlwin_lkv);
          __Pyx_GIVEREF(__pyx_v_mlwin_lkv);
          PyTuple_SET_ITEM(__pyx_t_19, 1+__pyx_t_9, __pyx_v_mlwin_lkv);
          __pyx_t_4 = 0;
          __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_20, __pyx_t_19, NULL); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 600, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
        }
        __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
        __pyx_t_20 = __Pyx_PyObject_GetSlice(__pyx_t_12, __pyx_v_lkvtrimstart, __pyx_v_lkvtrimend, NULL, NULL, NULL, 1, 1, 1); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 600, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_20);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_t_12 = __Pyx_PyInt_From_unsigned_long(__pyx_v_azstart); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 600, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_19 = __Pyx_PyInt_From_unsigned_long(__pyx_v_azend); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 600, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_19);
        __pyx_t_4 = PySlice_New(__pyx_t_12, __pyx_t_19, Py_None); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 600, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
        __pyx_t_19 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 600, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_19);
        __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_19, __pyx_n_s_newaxis); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 600, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
        __pyx_t_19 = PyTuple_New(3); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 600, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_19);
        __Pyx_GIVEREF(__pyx_t_4);
        PyTuple_SET_ITEM(__pyx_t_19, 0, __pyx_t_4);
        __Pyx_GIVEREF(__pyx_t_12);
        PyTuple_SET_ITEM(__pyx_t_19, 1, __pyx_t_12);
        __Pyx_INCREF(__pyx_int_2);
        __Pyx_GIVEREF(__pyx_int_2);
        PyTuple_SET_ITEM(__pyx_t_19, 2, __pyx_int_2);
        __pyx_t_4 = 0;
        __pyx_t_12 = 0;
        __pyx_t_12 = PyObject_GetItem(((PyObject *)__pyx_v_base_enu), __pyx_t_19); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 600, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
        __pyx_t_19 = PyNumber_Add(__pyx_t_20, __pyx_t_12); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 600, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_19);
        __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_t_12 = __Pyx_GetItemInt(__pyx_v_mlwin, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 600, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_20 = PySlice_New(__pyx_int_0, __pyx_t_12, Py_None); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 600, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_20);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_t_12 = PySlice_New(__pyx_int_0, __pyx_v_rngsize_slc, Py_None); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 600, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 600, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_GIVEREF(__pyx_t_20);
        PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_20);
        __Pyx_GIVEREF(__pyx_t_12);
        PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_12);
        __pyx_t_20 = 0;
        __pyx_t_12 = 0;
        __pyx_t_12 = PyObject_GetItem(__pyx_t_19, __pyx_t_4); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 600, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_tracklkv), __pyx_tuple__101, __pyx_t_12) < 0)) __PYX_ERR(0, 600, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;

        /* "kapok/uavsarc.pyx":603
 * 
 *                 # Platform velocity vector.
 *                 velocity[:,:,0] = np.gradient(zoom(pos[lkvrowstart:lkvrowend,:,0],mlwin_lkv)[lkvtrimstart:lkvtrimend] + base_enu[azstart:azend,np.newaxis,0], axis=0)[0:mlwin[0],0:rngsize_slc]             # <<<<<<<<<<<<<<
 *                 velocity[:,:,1] = np.gradient(zoom(pos[lkvrowstart:lkvrowend,:,1],mlwin_lkv)[lkvtrimstart:lkvtrimend] + base_enu[azstart:azend,np.newaxis,1], axis=0)[0:mlwin[0],0:rngsize_slc]
 *                 velocity[:,:,2] = np.gradient(zoom(pos[lkvrowstart:lkvrowend,:,2],mlwin_lkv)[lkvtrimstart:lkvtrimend] + base_enu[azstart:azend,np.newaxis,2], axis=0)[0:mlwin[0],0:rngsize_slc]
 */
        __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 603, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_gradient); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 603, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_t_19 = __Pyx_GetModuleGlobalName(__pyx_n_s_zoom); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 603, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_19);
        __pyx_t_20 = __Pyx_PyInt_From_unsigned_long(__pyx_v_lkvrowstart); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 603, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_20);
        __pyx_t_6 = __Pyx_PyInt_From_unsigned_long(__pyx_v_lkvrowend); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 603, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_29 = PySlice_New(__pyx_t_20, __pyx_t_6, Py_None); if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 603, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_29);
        __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 603, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_GIVEREF(__pyx_t_29);
        PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_29);
        __Pyx_INCREF(__pyx_slice__102);
        __Pyx_GIVEREF(__pyx_slice__102);
        PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_slice__102);
        __Pyx_INCREF(__pyx_int_0);
        __Pyx_GIVEREF(__pyx_int_0);
        PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_int_0);
        __pyx_t_29 = 0;
        __pyx_t_29 = PyObject_GetItem(((PyObject *)__pyx_v_pos), __pyx_t_6); if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 603, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_29);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_6 = NULL;
        __pyx_t_9 = 0;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_19))) {
          __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_19);
          if (likely(__pyx_t_6)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_19);
            __Pyx_INCREF(__pyx_t_6);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_19, function);
            __pyx_t_9 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_19)) {
          PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_29, __pyx_v_mlwin_lkv};
          __pyx_t_12 = __Pyx_PyFunction_FastCall(__pyx_t_19, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 603, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_19)) {
          PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_29, __pyx_v_mlwin_lkv};
          __pyx_t_12 = __Pyx_PyCFunction_FastCall(__pyx_t_19, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 603, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0;
        } else
        #endif
        {
          __pyx_t_20 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 603, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_20);
          if (__pyx_t_6) {
            __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_20, 0, __pyx_t_6); __pyx_t_6 = NULL;
          }
          __Pyx_GIVEREF(__pyx_t_29);
          PyTuple_SET_ITEM(__pyx_t_20, 0+__pyx_t_9, __pyx_t_29);
          __Pyx_INCREF(__pyx_v_mlwin_lkv);
          __Pyx_GIVEREF(__pyx_v_mlwin_lkv);
          PyTuple_SET_ITEM(__pyx_t_20, 1+__pyx_t_9, __pyx_v_mlwin_lkv);
          __pyx_t_29 = 0;
          __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_19, __pyx_t_20, NULL); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 603, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
        }
        __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
        __pyx_t_19 = __Pyx_PyObject_GetSlice(__pyx_t_12, __pyx_v_lkvtrimstart, __pyx_v_lkvtrimend, NULL, NULL, NULL, 1, 1, 1); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 603, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_19);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_t_12 = __Pyx_PyInt_From_unsigned_long(__pyx_v_azstart); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 603, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_20 = __Pyx_PyInt_From_unsigned_long(__pyx_v_azend); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 603, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_20);
        __pyx_t_29 = PySlice_New(__pyx_t_12, __pyx_t_20, Py_None); if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 603, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_29);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
        __pyx_t_20 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 603, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_20);
        __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_20, __pyx_n_s_newaxis); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 603, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
        __pyx_t_20 = PyTuple_New(3); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 603, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_20);
        __Pyx_GIVEREF(__pyx_t_29);
        PyTuple_SET_ITEM(__pyx_t_20, 0, __pyx_t_29);
        __Pyx_GIVEREF(__pyx_t_12);
        PyTuple_SET_ITEM(__pyx_t_20, 1, __pyx_t_12);
        __Pyx_INCREF(__pyx_int_0);
        __Pyx_GIVEREF(__pyx_int_0);
        PyTuple_SET_ITEM(__pyx_t_20, 2, __pyx_int_0);
        __pyx_t_29 = 0;
        __pyx_t_12 = 0;
        __pyx_t_12 = PyObject_GetItem(((PyObject *)__pyx_v_base_enu), __pyx_t_20); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 603, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
        __pyx_t_20 = PyNumber_Add(__pyx_t_19, __pyx_t_12); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 603, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_20);
        __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_t_12 = PyTuple_New(1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 603, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_GIVEREF(__pyx_t_20);
        PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_20);
        __pyx_t_20 = 0;
        __pyx_t_20 = PyDict_New(); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 603, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_20);
        if (PyDict_SetItem(__pyx_t_20, __pyx_n_s_axis, __pyx_int_0) < 0) __PYX_ERR(0, 603, __pyx_L1_error)
        __pyx_t_19 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_12, __pyx_t_20); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 603, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_19);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
        __pyx_t_20 = __Pyx_GetItemInt(__pyx_v_mlwin, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 603, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_20);
        __pyx_t_12 = PySlice_New(__pyx_int_0, __pyx_t_20, Py_None); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 603, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
        __pyx_t_20 = PySlice_New(__pyx_int_0, __pyx_v_rngsize_slc, Py_None); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 603, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_20);
        __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 603, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_GIVEREF(__pyx_t_12);
        PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_12);
        __Pyx_GIVEREF(__pyx_t_20);
        PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_20);
        __pyx_t_12 = 0;
        __pyx_t_20 = 0;
        __pyx_t_20 = PyObject_GetItem(__pyx_t_19, __pyx_t_4); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 603, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_20);
        __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_velocity), __pyx_tuple__105, __pyx_t_20) < 0)) __PYX_ERR(0, 603, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

        /* "kapok/uavsarc.pyx":604
 *                 # Platform velocity vector.
 *                 velocity[:,:,0] = np.gradient(zoom(pos[lkvrowstart:lkvrowend,:,0],mlwin_lkv)[lkvtrimstart:lkvtrimend] + base_enu[azstart:azend,np.newaxis,0], axis=0)[0:mlwin[0],0:rngsize_slc]
 *                 velocity[:,:,1] = np.gradient(zoom(pos[lkvrowstart:lkvrowend,:,1],mlwin_lkv)[lkvtrimstart:lkvtrimend] + base_enu[azstart:azend,np.newaxis,1], axis=0)[0:mlwin[0],0:rngsize_slc]             # <<<<<<<<<<<<<<
 *                 velocity[:,:,2] = np.gradient(zoom(pos[lkvrowstart:lkvrowend,:,2],mlwin_lkv)[lkvtrimstart:lkvtrimend] + base_enu[azstart:azend,np.newaxis,2], axis=0)[0:mlwin[0],0:rngsize_slc]
 *                 velocity = velocity / (np.linalg.norm(velocity,axis=2)[:,:,np.newaxis])
 */
        __pyx_t_20 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 604, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_20);
        __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_20, __pyx_n_s_gradient); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 604, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
        __pyx_t_19 = __Pyx_GetModuleGlobalName(__pyx_n_s_zoom); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 604, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_19);
        __pyx_t_12 = __Pyx_PyInt_From_unsigned_long(__pyx_v_lkvrowstart); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 604, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_29 = __Pyx_PyInt_From_unsigned_long(__pyx_v_lkvrowend); if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 604, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_29);
        __pyx_t_6 = PySlice_New(__pyx_t_12, __pyx_t_29, Py_None); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 604, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0;
        __pyx_t_29 = PyTuple_New(3); if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 604, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_29);
        __Pyx_GIVEREF(__pyx_t_6);
        PyTuple_SET_ITEM(__pyx_t_29, 0, __pyx_t_6);
        __Pyx_INCREF(__pyx_slice__106);
        __Pyx_GIVEREF(__pyx_slice__106);
        PyTuple_SET_ITEM(__pyx_t_29, 1, __pyx_slice__106);
        __Pyx_INCREF(__pyx_int_1);
        __Pyx_GIVEREF(__pyx_int_1);
        PyTuple_SET_ITEM(__pyx_t_29, 2, __pyx_int_1);
        __pyx_t_6 = 0;
        __pyx_t_6 = PyObject_GetItem(((PyObject *)__pyx_v_pos), __pyx_t_29); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 604, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0;
        __pyx_t_29 = NULL;
        __pyx_t_9 = 0;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_19))) {
          __pyx_t_29 = PyMethod_GET_SELF(__pyx_t_19);
          if (likely(__pyx_t_29)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_19);
            __Pyx_INCREF(__pyx_t_29);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_19, function);
            __pyx_t_9 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_19)) {
          PyObject *__pyx_temp[3] = {__pyx_t_29, __pyx_t_6, __pyx_v_mlwin_lkv};
          __pyx_t_20 = __Pyx_PyFunction_FastCall(__pyx_t_19, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 604, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_29); __pyx_t_29 = 0;
          __Pyx_GOTREF(__pyx_t_20);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_19)) {
          PyObject *__pyx_temp[3] = {__pyx_t_29, __pyx_t_6, __pyx_v_mlwin_lkv};
          __pyx_t_20 = __Pyx_PyCFunction_FastCall(__pyx_t_19, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 604, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_29); __pyx_t_29 = 0;
          __Pyx_GOTREF(__pyx_t_20);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        } else
        #endif
        {
          __pyx_t_12 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 604, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_12);
          if (__pyx_t_29) {
            __Pyx_GIVEREF(__pyx_t_29); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_29); __pyx_t_29 = NULL;
          }
          __Pyx_GIVEREF(__pyx_t_6);
          PyTuple_SET_ITEM(__pyx_t_12, 0+__pyx_t_9, __pyx_t_6);
          __Pyx_INCREF(__pyx_v_mlwin_lkv);
          __Pyx_GIVEREF(__pyx_v_mlwin_lkv);
          PyTuple_SET_ITEM(__pyx_t_12, 1+__pyx_t_9, __pyx_v_mlwin_lkv);
          __pyx_t_6 = 0;
          __pyx_t_20 = __Pyx_PyObject_Call(__pyx_t_19, __pyx_t_12, NULL); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 604, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_20);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        }
        __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
        __pyx_t_19 = __Pyx_PyObject_GetSlice(__pyx_t_20, __pyx_v_lkvtrimstart, __pyx_v_lkvtrimend, NULL, NULL, NULL, 1, 1, 1); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 604, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_19);
        __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
        __pyx_t_20 = __Pyx_PyInt_From_unsigned_long(__pyx_v_azstart); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 604, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_20);
        __pyx_t_12 = __Pyx_PyInt_From_unsigned_long(__pyx_v_azend); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 604, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_6 = PySlice_New(__pyx_t_20, __pyx_t_12, Py_None); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 604, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 604, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_20 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_newaxis); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 604, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_20);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_t_12 = PyTuple_New(3); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 604, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_GIVEREF(__pyx_t_6);
        PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_6);
        __Pyx_GIVEREF(__pyx_t_20);
        PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_20);
        __Pyx_INCREF(__pyx_int_1);
        __Pyx_GIVEREF(__pyx_int_1);
        PyTuple_SET_ITEM(__pyx_t_12, 2, __pyx_int_1);
        __pyx_t_6 = 0;
        __pyx_t_20 = 0;
        __pyx_t_20 = PyObject_GetItem(((PyObject *)__pyx_v_base_enu), __pyx_t_12); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 604, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_20);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_t_12 = PyNumber_Add(__pyx_t_19, __pyx_t_20); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 604, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
        __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
        __pyx_t_20 = PyTuple_New(1); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 604, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_20);
        __Pyx_GIVEREF(__pyx_t_12);
        PyTuple_SET_ITEM(__pyx_t_20, 0, __pyx_t_12);
        __pyx_t_12 = 0;
        __pyx_t_12 = PyDict_New(); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 604, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_axis, __pyx_int_0) < 0) __PYX_ERR(0, 604, __pyx_L1_error)
        __pyx_t_19 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_20, __pyx_t_12); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 604, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_19);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_t_12 = __Pyx_GetItemInt(__pyx_v_mlwin, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 604, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_20 = PySlice_New(__pyx_int_0, __pyx_t_12, Py_None); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 604, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_20);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_t_12 = PySlice_New(__pyx_int_0, __pyx_v_rngsize_slc, Py_None); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 604, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 604, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_GIVEREF(__pyx_t_20);
        PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_20);
        __Pyx_GIVEREF(__pyx_t_12);
        PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_12);
        __pyx_t_20 = 0;
        __pyx_t_12 = 0;
        __pyx_t_12 = PyObject_GetItem(__pyx_t_19, __pyx_t_4); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 604, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_velocity), __pyx_tuple__109, __pyx_t_12) < 0)) __PYX_ERR(0, 604, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;

        /* "kapok/uavsarc.pyx":605
 *                 velocity[:,:,0] = np.gradient(zoom(pos[lkvrowstart:lkvrowend,:,0],mlwin_lkv)[lkvtrimstart:lkvtrimend] + base_enu[azstart:azend,np.newaxis,0], axis=0)[0:mlwin[0],0:rngsize_slc]
 *                 velocity[:,:,1] = np.gradient(zoom(pos[lkvrowstart:lkvrowend,:,1],mlwin_lkv)[lkvtrimstart:lkvtrimend] + base_enu[azstart:azend,np.newaxis,1], axis=0)[0:mlwin[0],0:rngsize_slc]
 *                 velocity[:,:,2] = np.gradient(zoom(pos[lkvrowstart:lkvrowend,:,2],mlwin_lkv)[lkvtrimstart:lkvtrimend] + base_enu[azstart:azend,np.newaxis,2], axis=0)[0:mlwin[0],0:rngsize_slc]             # <<<<<<<<<<<<<<
 *                 velocity = velocity / (np.linalg.norm(velocity,axis=2)[:,:,np.newaxis])
 * 
 */
        __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 605, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_gradient); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 605, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_t_19 = __Pyx_GetModuleGlobalName(__pyx_n_s_zoom); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 605, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_19);
        __pyx_t_20 = __Pyx_PyInt_From_unsigned_long(__pyx_v_lkvrowstart); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 605, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_20);
        __pyx_t_6 = __Pyx_PyInt_From_unsigned_long(__pyx_v_lkvrowend); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 605, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_29 = PySlice_New(__pyx_t_20, __pyx_t_6, Py_None); if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 605, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_29);
        __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 605, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_GIVEREF(__pyx_t_29);
        PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_29);
        __Pyx_INCREF(__pyx_slice__110);
        __Pyx_GIVEREF(__pyx_slice__110);
        PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_slice__110);
        __Pyx_INCREF(__pyx_int_2);
        __Pyx_GIVEREF(__pyx_int_2);
        PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_int_2);
        __pyx_t_29 = 0;
        __pyx_t_29 = PyObject_GetItem(((PyObject *)__pyx_v_pos), __pyx_t_6); if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 605, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_29);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_6 = NULL;
        __pyx_t_9 = 0;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_19))) {
          __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_19);
          if (likely(__pyx_t_6)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_19);
            __Pyx_INCREF(__pyx_t_6);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_19, function);
            __pyx_t_9 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_19)) {
          PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_29, __pyx_v_mlwin_lkv};
          __pyx_t_12 = __Pyx_PyFunction_FastCall(__pyx_t_19, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 605, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_19)) {
          PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_29, __pyx_v_mlwin_lkv};
          __pyx_t_12 = __Pyx_PyCFunction_FastCall(__pyx_t_19, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 605, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0;
        } else
        #endif
        {
          __pyx_t_20 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 605, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_20);
          if (__pyx_t_6) {
            __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_20, 0, __pyx_t_6); __pyx_t_6 = NULL;
          }
          __Pyx_GIVEREF(__pyx_t_29);
          PyTuple_SET_ITEM(__pyx_t_20, 0+__pyx_t_9, __pyx_t_29);
          __Pyx_INCREF(__pyx_v_mlwin_lkv);
          __Pyx_GIVEREF(__pyx_v_mlwin_lkv);
          PyTuple_SET_ITEM(__pyx_t_20, 1+__pyx_t_9, __pyx_v_mlwin_lkv);
          __pyx_t_29 = 0;
          __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_19, __pyx_t_20, NULL); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 605, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
        }
        __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
        __pyx_t_19 = __Pyx_PyObject_GetSlice(__pyx_t_12, __pyx_v_lkvtrimstart, __pyx_v_lkvtrimend, NULL, NULL, NULL, 1, 1, 1); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 605, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_19);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_t_12 = __Pyx_PyInt_From_unsigned_long(__pyx_v_azstart); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 605, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_20 = __Pyx_PyInt_From_unsigned_long(__pyx_v_azend); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 605, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_20);
        __pyx_t_29 = PySlice_New(__pyx_t_12, __pyx_t_20, Py_None); if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 605, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_29);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
        __pyx_t_20 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 605, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_20);
        __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_20, __pyx_n_s_newaxis); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 605, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
        __pyx_t_20 = PyTuple_New(3); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 605, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_20);
        __Pyx_GIVEREF(__pyx_t_29);
        PyTuple_SET_ITEM(__pyx_t_20, 0, __pyx_t_29);
        __Pyx_GIVEREF(__pyx_t_12);
        PyTuple_SET_ITEM(__pyx_t_20, 1, __pyx_t_12);
        __Pyx_INCREF(__pyx_int_2);
        __Pyx_GIVEREF(__pyx_int_2);
        PyTuple_SET_ITEM(__pyx_t_20, 2, __pyx_int_2);
        __pyx_t_29 = 0;
        __pyx_t_12 = 0;
        __pyx_t_12 = PyObject_GetItem(((PyObject *)__pyx_v_base_enu), __pyx_t_20); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 605, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
        __pyx_t_20 = PyNumber_Add(__pyx_t_19, __pyx_t_12); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 605, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_20);
        __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_t_12 = PyTuple_New(1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 605, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_GIVEREF(__pyx_t_20);
        PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_20);
        __pyx_t_20 = 0;
        __pyx_t_20 = PyDict_New(); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 605, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_20);
        if (PyDict_SetItem(__pyx_t_20, __pyx_n_s_axis, __pyx_int_0) < 0) __PYX_ERR(0, 605, __pyx_L1_error)
        __pyx_t_19 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_12, __pyx_t_20); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 605, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_19);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
        __pyx_t_20 = __Pyx_GetItemInt(__pyx_v_mlwin, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 605, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_20);
        __pyx_t_12 = PySlice_New(__pyx_int_0, __pyx_t_20, Py_None); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 605, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
        __pyx_t_20 = PySlice_New(__pyx_int_0, __pyx_v_rngsize_slc, Py_None); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 605, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_20);
        __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 605, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_GIVEREF(__pyx_t_12);
        PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_12);
        __Pyx_GIVEREF(__pyx_t_20);
        PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_20);
        __pyx_t_12 = 0;
        __pyx_t_20 = 0;
        __pyx_t_20 = PyObject_GetItem(__pyx_t_19, __pyx_t_4); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 605, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_20);
        __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_velocity), __pyx_tuple__113, __pyx_t_20) < 0)) __PYX_ERR(0, 605, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

        /* "kapok/uavsarc.pyx":606
 *                 velocity[:,:,1] = np.gradient(zoom(pos[lkvrowstart:lkvrowend,:,1],mlwin_lkv)[lkvtrimstart:lkvtrimend] + base_enu[azstart:azend,np.newaxis,1], axis=0)[0:mlwin[0],0:rngsize_slc]
 *                 velocity[:,:,2] = np.gradient(zoom(pos[lkvrowstart:lkvrowend,:,2],mlwin_lkv)[lkvtrimstart:lkvtrimend] + base_enu[azstart:azend,np.newaxis,2], axis=0)[0:mlwin[0],0:rngsize_slc]
 *                 velocity = velocity / (np.linalg.norm(velocity,axis=2)[:,:,np.newaxis])             # <<<<<<<<<<<<<<
 * 
 *                 # Project look vector onto velocity vector.
 */
        __pyx_t_20 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 606, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_20);
        __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_20, __pyx_n_s_linalg); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 606, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
        __pyx_t_20 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_norm); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 606, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_20);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 606, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_INCREF(((PyObject *)__pyx_v_velocity));
        __Pyx_GIVEREF(((PyObject *)__pyx_v_velocity));
        PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_velocity));
        __pyx_t_19 = PyDict_New(); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 606, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_19);
        if (PyDict_SetItem(__pyx_t_19, __pyx_n_s_axis, __pyx_int_2) < 0) __PYX_ERR(0, 606, __pyx_L1_error)
        __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_20, __pyx_t_4, __pyx_t_19); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 606, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
        __pyx_t_19 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 606, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_19);
        __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_19, __pyx_n_s_newaxis); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 606, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
        __pyx_t_19 = PyTuple_New(3); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 606, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_19);
        __Pyx_INCREF(__pyx_slice__114);
        __Pyx_GIVEREF(__pyx_slice__114);
        PyTuple_SET_ITEM(__pyx_t_19, 0, __pyx_slice__114);
        __Pyx_INCREF(__pyx_slice__115);
        __Pyx_GIVEREF(__pyx_slice__115);
        PyTuple_SET_ITEM(__pyx_t_19, 1, __pyx_slice__115);
        __Pyx_GIVEREF(__pyx_t_4);
        PyTuple_SET_ITEM(__pyx_t_19, 2, __pyx_t_4);
        __pyx_t_4 = 0;
        __pyx_t_4 = PyObject_GetItem(__pyx_t_12, __pyx_t_19); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 606, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
        __pyx_t_19 = __Pyx_PyNumber_Divide(((PyObject *)__pyx_v_velocity), __pyx_t_4); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 606, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_19);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (!(likely(((__pyx_t_19) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_19, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 606, __pyx_L1_error)
        __pyx_t_35 = ((PyArrayObject *)__pyx_t_19);
        {
          __Pyx_BufFmt_StackElem __pyx_stack[1];
          __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_velocity.rcbuffer->pybuffer);
          __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_velocity.rcbuffer->pybuffer, (PyObject*)__pyx_t_35, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack);
          if (unlikely(__pyx_t_9 < 0)) {
            PyErr_Fetch(&__pyx_t_3, &__pyx_t_2, &__pyx_t_1);
            if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_velocity.rcbuffer->pybuffer, (PyObject*)__pyx_v_velocity, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) {
              Py_XDECREF(__pyx_t_3); Py_XDECREF(__pyx_t_2); Py_XDECREF(__pyx_t_1);
              __Pyx_RaiseBufferFallbackError();
            } else {
              PyErr_Restore(__pyx_t_3, __pyx_t_2, __pyx_t_1);
            }
          }
          __pyx_pybuffernd_velocity.diminfo[0].strides = __pyx_pybuffernd_velocity.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_velocity.diminfo[0].shape = __pyx_pybuffernd_velocity.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_velocity.diminfo[1].strides = __pyx_pybuffernd_velocity.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_velocity.diminfo[1].shape = __pyx_pybuffernd_velocity.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_velocity.diminfo[2].strides = __pyx_pybuffernd_velocity.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_velocity.diminfo[2].shape = __pyx_pybuffernd_velocity.rcbuffer->pybuffer.shape[2];
          if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 606, __pyx_L1_error)
        }
        __pyx_t_35 = 0;
        __Pyx_DECREF_SET(__pyx_v_velocity, ((PyArrayObject *)__pyx_t_19));
        __pyx_t_19 = 0;

        /* "kapok/uavsarc.pyx":609
 * 
 *                 # Project look vector onto velocity vector.
 *                 proj_lkv_velocity = np.sum(tracklkv*velocity,axis=2)[:,:,np.newaxis]*velocity             # <<<<<<<<<<<<<<
 * 
 *                 # Get incidence angle with same dimensions as single-look kz buffer.
 */
        __pyx_t_19 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 609, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_19);
        __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_19, __pyx_n_s_sum); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 609, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
        __pyx_t_19 = PyNumber_Multiply(((PyObject *)__pyx_v_tracklkv), ((PyObject *)__pyx_v_velocity)); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 609, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_19);
        __pyx_t_12 = PyTuple_New(1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 609, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_GIVEREF(__pyx_t_19);
        PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_19);
        __pyx_t_19 = 0;
        __pyx_t_19 = PyDict_New(); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 609, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_19);
        if (PyDict_SetItem(__pyx_t_19, __pyx_n_s_axis, __pyx_int_2) < 0) __PYX_ERR(0, 609, __pyx_L1_error)
        __pyx_t_20 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_12, __pyx_t_19); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 609, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_20);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
        __pyx_t_19 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 609, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_19);
        __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_19, __pyx_n_s_newaxis); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 609, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
        __pyx_t_19 = PyTuple_New(3); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 609, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_19);
        __Pyx_INCREF(__pyx_slice__116);
        __Pyx_GIVEREF(__pyx_slice__116);
        PyTuple_SET_ITEM(__pyx_t_19, 0, __pyx_slice__116);
        __Pyx_INCREF(__pyx_slice__117);
        __Pyx_GIVEREF(__pyx_slice__117);
        PyTuple_SET_ITEM(__pyx_t_19, 1, __pyx_slice__117);
        __Pyx_GIVEREF(__pyx_t_12);
        PyTuple_SET_ITEM(__pyx_t_19, 2, __pyx_t_12);
        __pyx_t_12 = 0;
        __pyx_t_12 = PyObject_GetItem(__pyx_t_20, __pyx_t_19); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 609, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
        __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
        __pyx_t_19 = PyNumber_Multiply(__pyx_t_12, ((PyObject *)__pyx_v_velocity)); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 609, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_19);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        if (!(likely(((__pyx_t_19) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_19, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 609, __pyx_L1_error)
        __pyx_t_38 = ((PyArrayObject *)__pyx_t_19);
        {
          __Pyx_BufFmt_StackElem __pyx_stack[1];
          __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_proj_lkv_velocity.rcbuffer->pybuffer);
          __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_proj_lkv_velocity.rcbuffer->pybuffer, (PyObject*)__pyx_t_38, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack);
          if (unlikely(__pyx_t_9 < 0)) {
            PyErr_Fetch(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
            if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_proj_lkv_velocity.rcbuffer->pybuffer, (PyObject*)__pyx_v_proj_lkv_velocity, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) {
              Py_XDECREF(__pyx_t_1); Py_XDECREF(__pyx_t_2); Py_XDECREF(__pyx_t_3);
              __Pyx_RaiseBufferFallbackError();
            } else {
              PyErr_Restore(__pyx_t_1, __pyx_t_2, __pyx_t_3);
            }
          }
          __pyx_pybuffernd_proj_lkv_velocity.diminfo[0].strides = __pyx_pybuffernd_proj_lkv_velocity.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_proj_lkv_velocity.diminfo[0].shape = __pyx_pybuffernd_proj_lkv_velocity.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_proj_lkv_velocity.diminfo[1].strides = __pyx_pybuffernd_proj_lkv_velocity.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_proj_lkv_velocity.diminfo[1].shape = __pyx_pybuffernd_proj_lkv_velocity.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_proj_lkv_velocity.diminfo[2].strides = __pyx_pybuffernd_proj_lkv_velocity.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_proj_lkv_velocity.diminfo[2].shape = __pyx_pybuffernd_proj_lkv_velocity.rcbuffer->pybuffer.shape[2];
          if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 609, __pyx_L1_error)
        }
        __pyx_t_38 = 0;
        __Pyx_DECREF_SET(__pyx_v_proj_lkv_velocity, ((PyArrayObject *)__pyx_t_19));
        __pyx_t_19 = 0;

        /* "kapok/uavsarc.pyx":612
 * 
 *                 # Get incidence angle with same dimensions as single-look kz buffer.
 *                 inc_buffer[:,0:rngsize*mlwin[1]] = zoom(inc[az_ml,:][np.newaxis,:],mlwin)             # <<<<<<<<<<<<<<
 *                 inc_buffer[:,rngsize*mlwin[1]:] = inc_buffer[:,(rngsize*mlwin[1]-1)][:,np.newaxis]
 * 
 */
        __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_zoom); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 612, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_20 = __Pyx_PyInt_From_unsigned_long(__pyx_v_az_ml); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 612, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_20);
        __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 612, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_GIVEREF(__pyx_t_20);
        PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_20);
        __Pyx_INCREF(__pyx_slice__118);
        __Pyx_GIVEREF(__pyx_slice__118);
        PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_slice__118);
        __pyx_t_20 = 0;
        __pyx_t_20 = PyObject_GetItem(__pyx_v_inc, __pyx_t_4); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 612, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_20);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 612, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_29 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_newaxis); if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 612, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_29);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 612, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_GIVEREF(__pyx_t_29);
        PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_29);
        __Pyx_INCREF(__pyx_slice__119);
        __Pyx_GIVEREF(__pyx_slice__119);
        PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_slice__119);
        __pyx_t_29 = 0;
        __pyx_t_29 = PyObject_GetItem(__pyx_t_20, __pyx_t_4); if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 612, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_29);
        __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_4 = NULL;
        __pyx_t_9 = 0;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_12))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_12);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_12, function);
            __pyx_t_9 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_12)) {
          PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_29, __pyx_v_mlwin};
          __pyx_t_19 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 612, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_19);
          __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) {
          PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_29, __pyx_v_mlwin};
          __pyx_t_19 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 612, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_19);
          __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0;
        } else
        #endif
        {
          __pyx_t_20 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 612, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_20);
          if (__pyx_t_4) {
            __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_20, 0, __pyx_t_4); __pyx_t_4 = NULL;
          }
          __Pyx_GIVEREF(__pyx_t_29);
          PyTuple_SET_ITEM(__pyx_t_20, 0+__pyx_t_9, __pyx_t_29);
          __Pyx_INCREF(__pyx_v_mlwin);
          __Pyx_GIVEREF(__pyx_v_mlwin);
          PyTuple_SET_ITEM(__pyx_t_20, 1+__pyx_t_9, __pyx_v_mlwin);
          __pyx_t_29 = 0;
          __pyx_t_19 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_20, NULL); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 612, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_19);
          __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
        }
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_t_12 = __Pyx_GetItemInt(__pyx_v_mlwin, 1, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 0, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 612, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_20 = PyNumber_Multiply(__pyx_v_rngsize, __pyx_t_12); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 612, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_20);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_t_12 = PySlice_New(__pyx_int_0, __pyx_t_20, Py_None); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 612, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
        __pyx_t_20 = PyTuple_New(2); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 612, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_20);
        __Pyx_INCREF(__pyx_slice__120);
        __Pyx_GIVEREF(__pyx_slice__120);
        PyTuple_SET_ITEM(__pyx_t_20, 0, __pyx_slice__120);
        __Pyx_GIVEREF(__pyx_t_12);
        PyTuple_SET_ITEM(__pyx_t_20, 1, __pyx_t_12);
        __pyx_t_12 = 0;
        if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_inc_buffer), __pyx_t_20, __pyx_t_19) < 0)) __PYX_ERR(0, 612, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
        __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

        /* "kapok/uavsarc.pyx":613
 *                 # Get incidence angle with same dimensions as single-look kz buffer.
 *                 inc_buffer[:,0:rngsize*mlwin[1]] = zoom(inc[az_ml,:][np.newaxis,:],mlwin)
 *                 inc_buffer[:,rngsize*mlwin[1]:] = inc_buffer[:,(rngsize*mlwin[1]-1)][:,np.newaxis]             # <<<<<<<<<<<<<<
 * 
 *                 # Component of look vector orthogonal to velocity.
 */
        __pyx_t_19 = __Pyx_GetItemInt(__pyx_v_mlwin, 1, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 0, 1); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 613, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_19);
        __pyx_t_20 = PyNumber_Multiply(__pyx_v_rngsize, __pyx_t_19); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 613, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_20);
        __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
        __pyx_t_19 = __Pyx_PyInt_SubtractObjC(__pyx_t_20, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 613, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_19);
        __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
        __pyx_t_20 = PyTuple_New(2); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 613, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_20);
        __Pyx_INCREF(__pyx_slice__121);
        __Pyx_GIVEREF(__pyx_slice__121);
        PyTuple_SET_ITEM(__pyx_t_20, 0, __pyx_slice__121);
        __Pyx_GIVEREF(__pyx_t_19);
        PyTuple_SET_ITEM(__pyx_t_20, 1, __pyx_t_19);
        __pyx_t_19 = 0;
        __pyx_t_19 = PyObject_GetItem(((PyObject *)__pyx_v_inc_buffer), __pyx_t_20); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 613, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_19);
        __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
        __pyx_t_20 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 613, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_20);
        __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_20, __pyx_n_s_newaxis); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 613, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
        __pyx_t_20 = PyTuple_New(2); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 613, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_20);
        __Pyx_INCREF(__pyx_slice__122);
        __Pyx_GIVEREF(__pyx_slice__122);
        PyTuple_SET_ITEM(__pyx_t_20, 0, __pyx_slice__122);
        __Pyx_GIVEREF(__pyx_t_12);
        PyTuple_SET_ITEM(__pyx_t_20, 1, __pyx_t_12);
        __pyx_t_12 = 0;
        __pyx_t_12 = PyObject_GetItem(__pyx_t_19, __pyx_t_20); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 613, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
        __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
        __pyx_t_20 = __Pyx_GetItemInt(__pyx_v_mlwin, 1, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 0, 1); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 613, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_20);
        __pyx_t_19 = PyNumber_Multiply(__pyx_v_rngsize, __pyx_t_20); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 613, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_19);
        __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
        __pyx_t_20 = PySlice_New(__pyx_t_19, Py_None, Py_None); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 613, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_20);
        __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
        __pyx_t_19 = PyTuple_New(2); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 613, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_19);
        __Pyx_INCREF(__pyx_slice__123);
        __Pyx_GIVEREF(__pyx_slice__123);
        PyTuple_SET_ITEM(__pyx_t_19, 0, __pyx_slice__123);
        __Pyx_GIVEREF(__pyx_t_20);
        PyTuple_SET_ITEM(__pyx_t_19, 1, __pyx_t_20);
        __pyx_t_20 = 0;
        if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_inc_buffer), __pyx_t_19, __pyx_t_12) < 0)) __PYX_ERR(0, 613, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;

        /* "kapok/uavsarc.pyx":616
 * 
 *                 # Component of look vector orthogonal to velocity.
 *                 lookcrossv[:,:,0] = tracklkv[:,:,1]*velocity[:,:,2] - tracklkv[:,:,2]*velocity[:,:,1]             # <<<<<<<<<<<<<<
 *                 lookcrossv[:,:,1] = tracklkv[:,:,2]*velocity[:,:,0] - tracklkv[:,:,0]*velocity[:,:,2]
 *                 lookcrossv[:,:,2] = tracklkv[:,:,0]*velocity[:,:,1] - tracklkv[:,:,1]*velocity[:,:,0]
 */
        __pyx_t_12 = PyObject_GetItem(((PyObject *)__pyx_v_tracklkv), __pyx_tuple__126); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 616, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_19 = PyObject_GetItem(((PyObject *)__pyx_v_velocity), __pyx_tuple__129); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 616, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_19);
        __pyx_t_20 = PyNumber_Multiply(__pyx_t_12, __pyx_t_19); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 616, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_20);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
        __pyx_t_19 = PyObject_GetItem(((PyObject *)__pyx_v_tracklkv), __pyx_tuple__132); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 616, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_19);
        __pyx_t_12 = PyObject_GetItem(((PyObject *)__pyx_v_velocity), __pyx_tuple__135); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 616, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_29 = PyNumber_Multiply(__pyx_t_19, __pyx_t_12); if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 616, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_29);
        __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_t_12 = PyNumber_Subtract(__pyx_t_20, __pyx_t_29); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 616, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
        __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0;
        if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_lookcrossv), __pyx_tuple__138, __pyx_t_12) < 0)) __PYX_ERR(0, 616, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;

        /* "kapok/uavsarc.pyx":617
 *                 # Component of look vector orthogonal to velocity.
 *                 lookcrossv[:,:,0] = tracklkv[:,:,1]*velocity[:,:,2] - tracklkv[:,:,2]*velocity[:,:,1]
 *                 lookcrossv[:,:,1] = tracklkv[:,:,2]*velocity[:,:,0] - tracklkv[:,:,0]*velocity[:,:,2]             # <<<<<<<<<<<<<<
 *                 lookcrossv[:,:,2] = tracklkv[:,:,0]*velocity[:,:,1] - tracklkv[:,:,1]*velocity[:,:,0]
 * 
 */
        __pyx_t_12 = PyObject_GetItem(((PyObject *)__pyx_v_tracklkv), __pyx_tuple__141); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 617, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_29 = PyObject_GetItem(((PyObject *)__pyx_v_velocity), __pyx_tuple__144); if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 617, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_29);
        __pyx_t_20 = PyNumber_Multiply(__pyx_t_12, __pyx_t_29); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 617, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_20);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0;
        __pyx_t_29 = PyObject_GetItem(((PyObject *)__pyx_v_tracklkv), __pyx_tuple__147); if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 617, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_29);
        __pyx_t_12 = PyObject_GetItem(((PyObject *)__pyx_v_velocity), __pyx_tuple__150); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 617, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_19 = PyNumber_Multiply(__pyx_t_29, __pyx_t_12); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 617, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_19);
        __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_t_12 = PyNumber_Subtract(__pyx_t_20, __pyx_t_19); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 617, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
        __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
        if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_lookcrossv), __pyx_tuple__153, __pyx_t_12) < 0)) __PYX_ERR(0, 617, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;

        /* "kapok/uavsarc.pyx":618
 *                 lookcrossv[:,:,0] = tracklkv[:,:,1]*velocity[:,:,2] - tracklkv[:,:,2]*velocity[:,:,1]
 *                 lookcrossv[:,:,1] = tracklkv[:,:,2]*velocity[:,:,0] - tracklkv[:,:,0]*velocity[:,:,2]
 *                 lookcrossv[:,:,2] = tracklkv[:,:,0]*velocity[:,:,1] - tracklkv[:,:,1]*velocity[:,:,0]             # <<<<<<<<<<<<<<
 * 
 *                 # Baseline and perpendicular baseline.
 */
        __pyx_t_12 = PyObject_GetItem(((PyObject *)__pyx_v_tracklkv), __pyx_tuple__156); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 618, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_19 = PyObject_GetItem(((PyObject *)__pyx_v_velocity), __pyx_tuple__159); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 618, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_19);
        __pyx_t_20 = PyNumber_Multiply(__pyx_t_12, __pyx_t_19); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 618, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_20);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
        __pyx_t_19 = PyObject_GetItem(((PyObject *)__pyx_v_tracklkv), __pyx_tuple__162); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 618, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_19);
        __pyx_t_12 = PyObject_GetItem(((PyObject *)__pyx_v_velocity), __pyx_tuple__165); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 618, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_29 = PyNumber_Multiply(__pyx_t_19, __pyx_t_12); if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 618, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_29);
        __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_t_12 = PyNumber_Subtract(__pyx_t_20, __pyx_t_29); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 618, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
        __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0;
        if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_lookcrossv), __pyx_tuple__168, __pyx_t_12) < 0)) __PYX_ERR(0, 618, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;

        /* "kapok/uavsarc.pyx":621
 * 
 *                 # Baseline and perpendicular baseline.
 *                 baseline = base_enu[azstart:azend]             # <<<<<<<<<<<<<<
 *                 baselinepsign = np.sum(baseline[:,np.newaxis,:]*lookcrossv,axis=2)/np.sum(lookcrossv*lookcrossv,axis=2)
 *                 baselinep = np.linalg.norm((np.sum(baseline[:,np.newaxis,:]*lookcrossv,axis=2)/np.sum(lookcrossv*lookcrossv,axis=2))[:,:,np.newaxis]*lookcrossv,axis=2)
 */
        __pyx_t_12 = __Pyx_PyObject_GetSlice(((PyObject *)__pyx_v_base_enu), __pyx_v_azstart, __pyx_v_azend, NULL, NULL, NULL, 1, 1, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 621, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        if (!(likely(((__pyx_t_12) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_12, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 621, __pyx_L1_error)
        __pyx_t_40 = ((PyArrayObject *)__pyx_t_12);
        {
          __Pyx_BufFmt_StackElem __pyx_stack[1];
          __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_baseline.rcbuffer->pybuffer);
          __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_baseline.rcbuffer->pybuffer, (PyObject*)__pyx_t_40, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack);
          if (unlikely(__pyx_t_9 < 0)) {
            PyErr_Fetch(&__pyx_t_3, &__pyx_t_2, &__pyx_t_1);
            if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_baseline.rcbuffer->pybuffer, (PyObject*)__pyx_v_baseline, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
              Py_XDECREF(__pyx_t_3); Py_XDECREF(__pyx_t_2); Py_XDECREF(__pyx_t_1);
              __Pyx_RaiseBufferFallbackError();
            } else {
              PyErr_Restore(__pyx_t_3, __pyx_t_2, __pyx_t_1);
            }
          }
          __pyx_pybuffernd_baseline.diminfo[0].strides = __pyx_pybuffernd_baseline.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_baseline.diminfo[0].shape = __pyx_pybuffernd_baseline.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_baseline.diminfo[1].strides = __pyx_pybuffernd_baseline.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_baseline.diminfo[1].shape = __pyx_pybuffernd_baseline.rcbuffer->pybuffer.shape[1];
          if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 621, __pyx_L1_error)
        }
        __pyx_t_40 = 0;
        __Pyx_DECREF_SET(__pyx_v_baseline, ((PyArrayObject *)__pyx_t_12));
        __pyx_t_12 = 0;

        /* "kapok/uavsarc.pyx":622
 *                 # Baseline and perpendicular baseline.
 *                 baseline = base_enu[azstart:azend]
 *                 baselinepsign = np.sum(baseline[:,np.newaxis,:]*lookcrossv,axis=2)/np.sum(lookcrossv*lookcrossv,axis=2)             # <<<<<<<<<<<<<<
 *                 baselinep = np.linalg.norm((np.sum(baseline[:,np.newaxis,:]*lookcrossv,axis=2)/np.sum(lookcrossv*lookcrossv,axis=2))[:,:,np.newaxis]*lookcrossv,axis=2)
 * 
 */
        __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 622, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_29 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_sum); if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 622, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_29);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 622, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_20 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_newaxis); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 622, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_20);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_t_12 = PyTuple_New(3); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 622, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_INCREF(__pyx_slice__169);
        __Pyx_GIVEREF(__pyx_slice__169);
        PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_slice__169);
        __Pyx_GIVEREF(__pyx_t_20);
        PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_20);
        __Pyx_INCREF(__pyx_slice__170);
        __Pyx_GIVEREF(__pyx_slice__170);
        PyTuple_SET_ITEM(__pyx_t_12, 2, __pyx_slice__170);
        __pyx_t_20 = 0;
        __pyx_t_20 = PyObject_GetItem(((PyObject *)__pyx_v_baseline), __pyx_t_12); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 622, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_20);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_t_12 = PyNumber_Multiply(__pyx_t_20, ((PyObject *)__pyx_v_lookcrossv)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 622, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
        __pyx_t_20 = PyTuple_New(1); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 622, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_20);
        __Pyx_GIVEREF(__pyx_t_12);
        PyTuple_SET_ITEM(__pyx_t_20, 0, __pyx_t_12);
        __pyx_t_12 = 0;
        __pyx_t_12 = PyDict_New(); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 622, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_axis, __pyx_int_2) < 0) __PYX_ERR(0, 622, __pyx_L1_error)
        __pyx_t_19 = __Pyx_PyObject_Call(__pyx_t_29, __pyx_t_20, __pyx_t_12); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 622, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_19);
        __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0;
        __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 622, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_20 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_sum); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 622, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_20);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_t_12 = PyNumber_Multiply(((PyObject *)__pyx_v_lookcrossv), ((PyObject *)__pyx_v_lookcrossv)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 622, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_29 = PyTuple_New(1); if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 622, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_29);
        __Pyx_GIVEREF(__pyx_t_12);
        PyTuple_SET_ITEM(__pyx_t_29, 0, __pyx_t_12);
        __pyx_t_12 = 0;
        __pyx_t_12 = PyDict_New(); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 622, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_axis, __pyx_int_2) < 0) __PYX_ERR(0, 622, __pyx_L1_error)
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_20, __pyx_t_29, __pyx_t_12); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 622, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
        __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_t_12 = __Pyx_PyNumber_Divide(__pyx_t_19, __pyx_t_4); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 622, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (!(likely(((__pyx_t_12) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_12, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 622, __pyx_L1_error)
        __pyx_t_42 = ((PyArrayObject *)__pyx_t_12);
        {
          __Pyx_BufFmt_StackElem __pyx_stack[1];
          __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_baselinepsign.rcbuffer->pybuffer);
          __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_baselinepsign.rcbuffer->pybuffer, (PyObject*)__pyx_t_42, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack);
          if (unlikely(__pyx_t_9 < 0)) {
            PyErr_Fetch(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
            if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_baselinepsign.rcbuffer->pybuffer, (PyObject*)__pyx_v_baselinepsign, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
              Py_XDECREF(__pyx_t_1); Py_XDECREF(__pyx_t_2); Py_XDECREF(__pyx_t_3);
              __Pyx_RaiseBufferFallbackError();
            } else {
              PyErr_Restore(__pyx_t_1, __pyx_t_2, __pyx_t_3);
            }
          }
          __pyx_pybuffernd_baselinepsign.diminfo[0].strides = __pyx_pybuffernd_baselinepsign.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_baselinepsign.diminfo[0].shape = __pyx_pybuffernd_baselinepsign.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_baselinepsign.diminfo[1].strides = __pyx_pybuffernd_baselinepsign.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_baselinepsign.diminfo[1].shape = __pyx_pybuffernd_baselinepsign.rcbuffer->pybuffer.shape[1];
          if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 622, __pyx_L1_error)
        }
        __pyx_t_42 = 0;
        __Pyx_DECREF_SET(__pyx_v_baselinepsign, ((PyArrayObject *)__pyx_t_12));
        __pyx_t_12 = 0;

        /* "kapok/uavsarc.pyx":623
 *                 baseline = base_enu[azstart:azend]
 *                 baselinepsign = np.sum(baseline[:,np.newaxis,:]*lookcrossv,axis=2)/np.sum(lookcrossv*lookcrossv,axis=2)
 *                 baselinep = np.linalg.norm((np.sum(baseline[:,np.newaxis,:]*lookcrossv,axis=2)/np.sum(lookcrossv*lookcrossv,axis=2))[:,:,np.newaxis]*lookcrossv,axis=2)             # <<<<<<<<<<<<<<
 * 
 *                 # Calculate kz.
 */
        __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 623, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_linalg); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 623, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_norm); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 623, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 623, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_19 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_sum); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 623, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_19);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 623, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_29 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_newaxis); if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 623, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_29);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 623, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_INCREF(__pyx_slice__171);
        __Pyx_GIVEREF(__pyx_slice__171);
        PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_slice__171);
        __Pyx_GIVEREF(__pyx_t_29);
        PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_29);
        __Pyx_INCREF(__pyx_slice__172);
        __Pyx_GIVEREF(__pyx_slice__172);
        PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_slice__172);
        __pyx_t_29 = 0;
        __pyx_t_29 = PyObject_GetItem(((PyObject *)__pyx_v_baseline), __pyx_t_4); if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 623, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_29);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_4 = PyNumber_Multiply(__pyx_t_29, ((PyObject *)__pyx_v_lookcrossv)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 623, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0;
        __pyx_t_29 = PyTuple_New(1); if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 623, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_29);
        __Pyx_GIVEREF(__pyx_t_4);
        PyTuple_SET_ITEM(__pyx_t_29, 0, __pyx_t_4);
        __pyx_t_4 = 0;
        __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 623, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_axis, __pyx_int_2) < 0) __PYX_ERR(0, 623, __pyx_L1_error)
        __pyx_t_20 = __Pyx_PyObject_Call(__pyx_t_19, __pyx_t_29, __pyx_t_4); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 623, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_20);
        __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
        __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 623, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_29 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_sum); if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 623, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_29);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_4 = PyNumber_Multiply(((PyObject *)__pyx_v_lookcrossv), ((PyObject *)__pyx_v_lookcrossv)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 623, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_19 = PyTuple_New(1); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 623, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_19);
        __Pyx_GIVEREF(__pyx_t_4);
        PyTuple_SET_ITEM(__pyx_t_19, 0, __pyx_t_4);
        __pyx_t_4 = 0;
        __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 623, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_axis, __pyx_int_2) < 0) __PYX_ERR(0, 623, __pyx_L1_error)
        __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_29, __pyx_t_19, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 623, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0;
        __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_4 = __Pyx_PyNumber_Divide(__pyx_t_20, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 623, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 623, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_20 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_newaxis); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 623, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_20);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 623, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_INCREF(__pyx_slice__173);
        __Pyx_GIVEREF(__pyx_slice__173);
        PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_slice__173);
        __Pyx_INCREF(__pyx_slice__174);
        __Pyx_GIVEREF(__pyx_slice__174);
        PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_slice__174);
        __Pyx_GIVEREF(__pyx_t_20);
        PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_20);
        __pyx_t_20 = 0;
        __pyx_t_20 = PyObject_GetItem(__pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 623, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_20);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_6 = PyNumber_Multiply(__pyx_t_20, ((PyObject *)__pyx_v_lookcrossv)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 623, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
        __pyx_t_20 = PyTuple_New(1); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 623, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_20);
        __Pyx_GIVEREF(__pyx_t_6);
        PyTuple_SET_ITEM(__pyx_t_20, 0, __pyx_t_6);
        __pyx_t_6 = 0;
        __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 623, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_axis, __pyx_int_2) < 0) __PYX_ERR(0, 623, __pyx_L1_error)
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_20, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 623, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 623, __pyx_L1_error)
        __pyx_t_41 = ((PyArrayObject *)__pyx_t_4);
        {
          __Pyx_BufFmt_StackElem __pyx_stack[1];
          __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_baselinep.rcbuffer->pybuffer);
          __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_baselinep.rcbuffer->pybuffer, (PyObject*)__pyx_t_41, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack);
          if (unlikely(__pyx_t_9 < 0)) {
            PyErr_Fetch(&__pyx_t_3, &__pyx_t_2, &__pyx_t_1);
            if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_baselinep.rcbuffer->pybuffer, (PyObject*)__pyx_v_baselinep, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
              Py_XDECREF(__pyx_t_3); Py_XDECREF(__pyx_t_2); Py_XDECREF(__pyx_t_1);
              __Pyx_RaiseBufferFallbackError();
            } else {
              PyErr_Restore(__pyx_t_3, __pyx_t_2, __pyx_t_1);
            }
          }
          __pyx_pybuffernd_baselinep.diminfo[0].strides = __pyx_pybuffernd_baselinep.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_baselinep.diminfo[0].shape = __pyx_pybuffernd_baselinep.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_baselinep.diminfo[1].strides = __pyx_pybuffernd_baselinep.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_baselinep.diminfo[1].shape = __pyx_pybuffernd_baselinep.rcbuffer->pybuffer.shape[1];
          if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 623, __pyx_L1_error)
        }
        __pyx_t_41 = 0;
        __Pyx_DECREF_SET(__pyx_v_baselinep, ((PyArrayObject *)__pyx_t_4));
        __pyx_t_4 = 0;

        /* "kapok/uavsarc.pyx":626
 * 
 *                 # Calculate kz.
 *                 kz_buffer = (4*np.pi/wavelength) * baselinep / (np.linalg.norm(tracklkv,axis=2)*np.sin(inc_buffer)) * np.sign(baselinepsign)             # <<<<<<<<<<<<<<
 * 
 *                 kz[tr,az_ml,:] = mlook(kz_buffer[:,rngbounds[0]:rngbounds[1]], mlwin)
 */
        __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 626, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_pi); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 626, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_4 = PyNumber_Multiply(__pyx_int_4, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 626, __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_4, __pyx_v_wavelength); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 626, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_4 = PyNumber_Multiply(__pyx_t_6, ((PyObject *)__pyx_v_baselinep)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 626, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 626, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_20 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_linalg); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 626, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_20);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_20, __pyx_n_s_norm); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 626, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
        __pyx_t_20 = PyTuple_New(1); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 626, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_20);
        __Pyx_INCREF(((PyObject *)__pyx_v_tracklkv));
        __Pyx_GIVEREF(((PyObject *)__pyx_v_tracklkv));
        PyTuple_SET_ITEM(__pyx_t_20, 0, ((PyObject *)__pyx_v_tracklkv));
        __pyx_t_12 = PyDict_New(); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 626, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_axis, __pyx_int_2) < 0) __PYX_ERR(0, 626, __pyx_L1_error)
        __pyx_t_19 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_20, __pyx_t_12); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 626, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_19);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_t_20 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 626, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_20);
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_20, __pyx_n_s_sin); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 626, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
        __pyx_t_20 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_20 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_20)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_20);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
          }
        }
        if (!__pyx_t_20) {
          __pyx_t_12 = __Pyx_PyObject_CallOneArg(__pyx_t_6, ((PyObject *)__pyx_v_inc_buffer)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 626, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_12);
        } else {
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_20, ((PyObject *)__pyx_v_inc_buffer)};
            __pyx_t_12 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 626, __pyx_L1_error)
            __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0;
            __Pyx_GOTREF(__pyx_t_12);
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
            PyObject *__pyx_temp[2] = {__pyx_t_20, ((PyObject *)__pyx_v_inc_buffer)};
            __pyx_t_12 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 626, __pyx_L1_error)
            __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0;
            __Pyx_GOTREF(__pyx_t_12);
          } else
          #endif
          {
            __pyx_t_29 = PyTuple_New(1+1); if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 626, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_29);
            __Pyx_GIVEREF(__pyx_t_20); PyTuple_SET_ITEM(__pyx_t_29, 0, __pyx_t_20); __pyx_t_20 = NULL;
            __Pyx_INCREF(((PyObject *)__pyx_v_inc_buffer));
            __Pyx_GIVEREF(((PyObject *)__pyx_v_inc_buffer));
            PyTuple_SET_ITEM(__pyx_t_29, 0+1, ((PyObject *)__pyx_v_inc_buffer));
            __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_29, NULL); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 626, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_12);
            __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0;
          }
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_6 = PyNumber_Multiply(__pyx_t_19, __pyx_t_12); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 626, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_t_12 = __Pyx_PyNumber_Divide(__pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 626, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 626, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_19 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_sign); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 626, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_19);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_4 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_19))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_19);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_19);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_19, function);
          }
        }
        if (!__pyx_t_4) {
          __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_19, ((PyObject *)__pyx_v_baselinepsign)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 626, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
        } else {
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_19)) {
            PyObject *__pyx_temp[2] = {__pyx_t_4, ((PyObject *)__pyx_v_baselinepsign)};
            __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_19, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 626, __pyx_L1_error)
            __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
            __Pyx_GOTREF(__pyx_t_6);
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_19)) {
            PyObject *__pyx_temp[2] = {__pyx_t_4, ((PyObject *)__pyx_v_baselinepsign)};
            __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_19, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 626, __pyx_L1_error)
            __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
            __Pyx_GOTREF(__pyx_t_6);
          } else
          #endif
          {
            __pyx_t_29 = PyTuple_New(1+1); if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 626, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_29);
            __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_29, 0, __pyx_t_4); __pyx_t_4 = NULL;
            __Pyx_INCREF(((PyObject *)__pyx_v_baselinepsign));
            __Pyx_GIVEREF(((PyObject *)__pyx_v_baselinepsign));
            PyTuple_SET_ITEM(__pyx_t_29, 0+1, ((PyObject *)__pyx_v_baselinepsign));
            __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_19, __pyx_t_29, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 626, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_6);
            __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0;
          }
        }
        __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
        __pyx_t_19 = PyNumber_Multiply(__pyx_t_12, __pyx_t_6); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 626, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_19);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (!(likely(((__pyx_t_19) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_19, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 626, __pyx_L1_error)
        __pyx_t_33 = ((PyArrayObject *)__pyx_t_19);
        {
          __Pyx_BufFmt_StackElem __pyx_stack[1];
          __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_kz_buffer.rcbuffer->pybuffer);
          __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_kz_buffer.rcbuffer->pybuffer, (PyObject*)__pyx_t_33, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack);
          if (unlikely(__pyx_t_9 < 0)) {
            PyErr_Fetch(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
            if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_kz_buffer.rcbuffer->pybuffer, (PyObject*)__pyx_v_kz_buffer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
              Py_XDECREF(__pyx_t_1); Py_XDECREF(__pyx_t_2); Py_XDECREF(__pyx_t_3);
              __Pyx_RaiseBufferFallbackError();
            } else {
              PyErr_Restore(__pyx_t_1, __pyx_t_2, __pyx_t_3);
            }
          }
          __pyx_pybuffernd_kz_buffer.diminfo[0].strides = __pyx_pybuffernd_kz_buffer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_kz_buffer.diminfo[0].shape = __pyx_pybuffernd_kz_buffer.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_kz_buffer.diminfo[1].strides = __pyx_pybuffernd_kz_buffer.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_kz_buffer.diminfo[1].shape = __pyx_pybuffernd_kz_buffer.rcbuffer->pybuffer.shape[1];
          if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 626, __pyx_L1_error)
        }
        __pyx_t_33 = 0;
        __Pyx_DECREF_SET(__pyx_v_kz_buffer, ((PyArrayObject *)__pyx_t_19));
        __pyx_t_19 = 0;

        /* "kapok/uavsarc.pyx":628
 *                 kz_buffer = (4*np.pi/wavelength) * baselinep / (np.linalg.norm(tracklkv,axis=2)*np.sin(inc_buffer)) * np.sign(baselinepsign)
 * 
 *                 kz[tr,az_ml,:] = mlook(kz_buffer[:,rngbounds[0]:rngbounds[1]], mlwin)             # <<<<<<<<<<<<<<
 * 
 * 
 */
        __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_mlook); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 628, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_12 = __Pyx_GetItemInt(__pyx_v_rngbounds, 0, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 0, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 628, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_29 = __Pyx_GetItemInt(__pyx_v_rngbounds, 1, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 0, 1); if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 628, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_29);
        __pyx_t_4 = PySlice_New(__pyx_t_12, __pyx_t_29, Py_None); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 628, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0;
        __pyx_t_29 = PyTuple_New(2); if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 628, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_29);
        __Pyx_INCREF(__pyx_slice__175);
        __Pyx_GIVEREF(__pyx_slice__175);
        PyTuple_SET_ITEM(__pyx_t_29, 0, __pyx_slice__175);
        __Pyx_GIVEREF(__pyx_t_4);
        PyTuple_SET_ITEM(__pyx_t_29, 1, __pyx_t_4);
        __pyx_t_4 = 0;
        __pyx_t_4 = PyObject_GetItem(((PyObject *)__pyx_v_kz_buffer), __pyx_t_29); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 628, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0;
        __pyx_t_29 = NULL;
        __pyx_t_9 = 0;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_29 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_29)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_29);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
            __pyx_t_9 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[3] = {__pyx_t_29, __pyx_t_4, __pyx_v_mlwin};
          __pyx_t_19 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 628, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_29); __pyx_t_29 = 0;
          __Pyx_GOTREF(__pyx_t_19);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[3] = {__pyx_t_29, __pyx_t_4, __pyx_v_mlwin};
          __pyx_t_19 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 628, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_29); __pyx_t_29 = 0;
          __Pyx_GOTREF(__pyx_t_19);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        } else
        #endif
        {
          __pyx_t_12 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 628, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_12);
          if (__pyx_t_29) {
            __Pyx_GIVEREF(__pyx_t_29); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_29); __pyx_t_29 = NULL;
          }
          __Pyx_GIVEREF(__pyx_t_4);
          PyTuple_SET_ITEM(__pyx_t_12, 0+__pyx_t_9, __pyx_t_4);
          __Pyx_INCREF(__pyx_v_mlwin);
          __Pyx_GIVEREF(__pyx_v_mlwin);
          PyTuple_SET_ITEM(__pyx_t_12, 1+__pyx_t_9, __pyx_v_mlwin);
          __pyx_t_4 = 0;
          __pyx_t_19 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_12, NULL); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 628, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_19);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_6 = __Pyx_PyInt_From_unsigned_int(__pyx_v_tr); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 628, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_12 = __Pyx_PyInt_From_unsigned_long(__pyx_v_az_ml); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 628, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 628, __pyx_L1_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_12);
        PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_12);
        __Pyx_INCREF(__pyx_slice__176);
        __Pyx_GIVEREF(__pyx_slice__176);
        PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_slice__176);
        __pyx_t_6 = 0;
        __pyx_t_12 = 0;
        if (unlikely(PyObject_SetItem(__pyx_v_kz, __pyx_t_4, __pyx_t_19) < 0)) __PYX_ERR(0, 628, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
      }
    }

    /* "kapok/uavsarc.pyx":567
 * 
 *     # Calculating kz from .baseline and .lkv, if kzcalc == True.
 *     if kzcalc:             # <<<<<<<<<<<<<<
 *         kz.attrs['slope_corrected'] = False
 * 
 */
  }

  /* "kapok/uavsarc.pyx":633
 * 
 *     # Close the file, then return it as a Scene object.
 *     f.close()             # <<<<<<<<<<<<<<
 *     print('kapok.uavsar.load | Complete. ('+time.ctime()+')     ')
 *     return kapok.Scene(outfile)
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_close); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 633, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_12 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_12)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_12);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  if (__pyx_t_12) {
    __pyx_t_19 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_12); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 633, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  } else {
    __pyx_t_19 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 633, __pyx_L1_error)
  }
  __Pyx_GOTREF(__pyx_t_19);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "kapok/uavsarc.pyx":634
 *     # Close the file, then return it as a Scene object.
 *     f.close()
 *     print('kapok.uavsar.load | Complete. ('+time.ctime()+')     ')             # <<<<<<<<<<<<<<
 *     return kapok.Scene(outfile)
 * 
 */
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_time); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 634, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_ctime); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 634, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_12))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_12);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_12, function);
    }
  }
  if (__pyx_t_4) {
    __pyx_t_19 = __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_4); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 634, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  } else {
    __pyx_t_19 = __Pyx_PyObject_CallNoArg(__pyx_t_12); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 634, __pyx_L1_error)
  }
  __Pyx_GOTREF(__pyx_t_19);
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __pyx_t_12 = PyNumber_Add(__pyx_kp_u_kapok_uavsar_load_Complete, __pyx_t_19); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 634, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  __pyx_t_19 = PyNumber_Add(__pyx_t_12, __pyx_kp_u__42); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 634, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __pyx_t_12 = PyTuple_New(1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 634, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __Pyx_GIVEREF(__pyx_t_19);
  PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_19);
  __pyx_t_19 = 0;
  __pyx_t_19 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_t_12, NULL); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 634, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "kapok/uavsarc.pyx":635
 *     f.close()
 *     print('kapok.uavsar.load | Complete. ('+time.ctime()+')     ')
 *     return kapok.Scene(outfile)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_kapok); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 635, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_Scene); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 635, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __pyx_t_12 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_12)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_12);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  if (!__pyx_t_12) {
    __pyx_t_19 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_outfile); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 635, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_19);
  } else {
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_4)) {
      PyObject *__pyx_temp[2] = {__pyx_t_12, __pyx_v_outfile};
      __pyx_t_19 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 635, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
      __Pyx_GOTREF(__pyx_t_19);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
      PyObject *__pyx_temp[2] = {__pyx_t_12, __pyx_v_outfile};
      __pyx_t_19 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 635, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
      __Pyx_GOTREF(__pyx_t_19);
    } else
    #endif
    {
      __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 635, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_12); __pyx_t_12 = NULL;
      __Pyx_INCREF(__pyx_v_outfile);
      __Pyx_GIVEREF(__pyx_v_outfile);
      PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_outfile);
      __pyx_t_19 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 635, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_19);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_r = __pyx_t_19;
  __pyx_t_19 = 0;
  goto __pyx_L0;

  /* "kapok/uavsarc.pyx":45
 * 
 * 
 * def load(infile, outfile, mlwin=(20,5), smwin=(1,1), azbounds=None,             # <<<<<<<<<<<<<<
 *          rngbounds=None, tracks=None, compression='gzip',
 *          compression_opts=4, num_blocks=20, kzcalc=False, kzvertical=True,
 */

  /* 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_12);
  __Pyx_XDECREF(__pyx_t_19);
  __Pyx_XDECREF(__pyx_t_20);
  __Pyx_XDECREF(__pyx_t_28);
  __Pyx_XDECREF(__pyx_t_29);
  __Pyx_XDECREF(__pyx_t_43);
  { 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_base_enu.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_baseline.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_baselinep.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_baselinepsign.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_inc_buffer.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_kz_buffer.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lkv.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lookcrossv.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_pos.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_proj_lkv_velocity.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_tempdiff.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_tracklkv.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_velocity.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("kapok.uavsarc.load", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_base_enu.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_baseline.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_baselinep.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_baselinepsign.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_inc_buffer.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_kz_buffer.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lkv.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lookcrossv.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_pos.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_proj_lkv_velocity.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_tempdiff.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_tracklkv.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_velocity.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF(__pyx_v_ann);
  __Pyx_XDECREF(__pyx_v_f);
  __Pyx_XDECREF(__pyx_v_rngsize_slc);
  __Pyx_XDECREF(__pyx_v_num_segments);
  __Pyx_XDECREF(__pyx_v_azsize_slc);
  __Pyx_XDECREF(__pyx_v_temp);
  __Pyx_XDECREF(__pyx_v_num);
  __Pyx_XDECREF(__pyx_v_tracknames);
  __Pyx_XDECREF(__pyx_v_num_tracks);
  __Pyx_XDECREF(__pyx_v_num_bl);
  __Pyx_XDECREF(__pyx_v_num_pol);
  __Pyx_XDECREF(__pyx_v_num_cov_elements);
  __Pyx_XDECREF(__pyx_v_peglat);
  __Pyx_XDECREF(__pyx_v_peglon);
  __Pyx_XDECREF(__pyx_v_peghdg);
  __Pyx_XDECREF(__pyx_v_azsize);
  __Pyx_XDECREF(__pyx_v_rngsize);
  __Pyx_XDECREF(__pyx_v_datapath);
  __Pyx_XDECREF(__pyx_v_slcfiles);
  __Pyx_XDECREF(__pyx_v_seg);
  __Pyx_XDECREF(__pyx_v_pol);
  __Pyx_XDECREF(__pyx_v_file);
  __Pyx_XDECREF(__pyx_v_cov);
  __Pyx_XDECREF(__pyx_v_az_vector);
  __Pyx_XDECREF(__pyx_v_slcnum);
  __Pyx_XDECREF(__pyx_v_slc);
  __Pyx_XDECREF(__pyx_v_file2);
  __Pyx_XDECREF(__pyx_v_slcstack);
  __Pyx_XDECREF(__pyx_v_llh);
  __Pyx_XDECREF(__pyx_v_mlwin_lkv);
  __Pyx_XDECREF(__pyx_v_llhname);
  __Pyx_XDECREF(__pyx_v_llh_rows);
  __Pyx_XDECREF(__pyx_v_llh_cols);
  __Pyx_XDECREF(__pyx_v_azllhstart);
  __Pyx_XDECREF(__pyx_v_azllhend);
  __Pyx_XDECREF(__pyx_v_azllhoffset);
  __Pyx_XDECREF(__pyx_v_rngllhstart);
  __Pyx_XDECREF(__pyx_v_rngllhend);
  __Pyx_XDECREF(__pyx_v_rngllhoffset);
  __Pyx_XDECREF(__pyx_v_lat);
  __Pyx_XDECREF(__pyx_v_lon);
  __Pyx_XDECREF(__pyx_v_dem);
  __Pyx_XDECREF(__pyx_v_posmm);
  __Pyx_XDECREF(__pyx_v_lkvmm);
  __Pyx_XDECREF(__pyx_v_lkvname);
  __Pyx_XDECREF(__pyx_v_lkv_rows);
  __Pyx_XDECREF(__pyx_v_lkv_cols);
  __Pyx_XDECREF(__pyx_v_wavelength);
  __Pyx_XDECREF(__pyx_v_sstart);
  __Pyx_XDECREF(__pyx_v_sspacing);
  __Pyx_XDECREF(__pyx_v_sbounds);
  __Pyx_XDECREF(__pyx_v_refvelocity);
  __Pyx_XDECREF(__pyx_v_proj_reflkv_v);
  __Pyx_XDECREF(__pyx_v_incident_lkv);
  __Pyx_XDECREF(__pyx_v_inc_ref);
  __Pyx_XDECREF(__pyx_v_inc);
  __Pyx_XDECREF(__pyx_v_kz);
  __Pyx_XDECREF((PyObject *)__pyx_v_lkv);
  __Pyx_XDECREF((PyObject *)__pyx_v_pos);
  __Pyx_XDECREF((PyObject *)__pyx_v_inc_buffer);
  __Pyx_XDECREF((PyObject *)__pyx_v_kz_buffer);
  __Pyx_XDECREF((PyObject *)__pyx_v_tracklkv);
  __Pyx_XDECREF((PyObject *)__pyx_v_velocity);
  __Pyx_XDECREF((PyObject *)__pyx_v_lookcrossv);
  __Pyx_XDECREF((PyObject *)__pyx_v_tempdiff);
  __Pyx_XDECREF((PyObject *)__pyx_v_proj_lkv_velocity);
  __Pyx_XDECREF((PyObject *)__pyx_v_base_enu);
  __Pyx_XDECREF((PyObject *)__pyx_v_baseline);
  __Pyx_XDECREF((PyObject *)__pyx_v_baselinep);
  __Pyx_XDECREF((PyObject *)__pyx_v_baselinepsign);
  __Pyx_XDECREF(__pyx_v_kz_temp);
  __Pyx_XDECREF(__pyx_v_file_alt);
  __Pyx_XDECREF(__pyx_v_kz_rows);
  __Pyx_XDECREF(__pyx_v_kz_cols);
  __Pyx_XDECREF(__pyx_v_calcslope);
  __Pyx_XDECREF(__pyx_v_spacing);
  __Pyx_XDECREF(__pyx_v_rngslope);
  __Pyx_XDECREF(__pyx_v_azslope);
  __Pyx_XDECREF(__pyx_v_height_dot_normal);
  __Pyx_XDECREF(__pyx_v_basefile);
  __Pyx_XDECREF(__pyx_v_basesch);
  __Pyx_XDECREF(__pyx_v_istart);
  __Pyx_XDECREF(__pyx_v_iend);
  __Pyx_XDECREF(__pyx_v_azbounds);
  __Pyx_XDECREF(__pyx_v_rngbounds);
  __Pyx_XDECREF(__pyx_v_tracks);
  __Pyx_XDECREF(__pyx_v_kzcalc);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "kapok/uavsarc.pyx":641
 *     """Class for loading and interacting with a UAVSAR annotation file."""
 * 
 *     def __init__(self, file):             # <<<<<<<<<<<<<<
 *         """Load in the specified .ann file as a list of strings and
 *             initialize.
 */

/* Python wrapper */
static PyObject *__pyx_pw_5kapok_7uavsarc_3Ann_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5kapok_7uavsarc_3Ann___init__[] = "Load in the specified .ann file as a list of strings and\n            initialize.\n        \n        Arguments:\n            file (str): UAVSAR annotation filename to load.\n            \n        ";
static PyMethodDef __pyx_mdef_5kapok_7uavsarc_3Ann_1__init__ = {"__init__", (PyCFunction)__pyx_pw_5kapok_7uavsarc_3Ann_1__init__, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5kapok_7uavsarc_3Ann___init__};
static PyObject *__pyx_pw_5kapok_7uavsarc_3Ann_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_file = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_file,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_file)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); __PYX_ERR(0, 641, __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, 641, __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_file = 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, 641, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("kapok.uavsarc.Ann.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5kapok_7uavsarc_3Ann___init__(__pyx_self, __pyx_v_self, __pyx_v_file);

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

static PyObject *__pyx_pf_5kapok_7uavsarc_3Ann___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_file) {
  PyObject *__pyx_v_fd = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "kapok/uavsarc.pyx":649
 * 
 *         """
 *         self.file = file             # <<<<<<<<<<<<<<
 *         fd = open(self.file, 'r')
 *         self.ann = fd.read().split('\n')
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_file, __pyx_v_file) < 0) __PYX_ERR(0, 649, __pyx_L1_error)

  /* "kapok/uavsarc.pyx":650
 *         """
 *         self.file = file
 *         fd = open(self.file, 'r')             # <<<<<<<<<<<<<<
 *         self.ann = fd.read().split('\n')
 *         return
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_file); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 650, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 650, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_INCREF(__pyx_n_u_r);
  __Pyx_GIVEREF(__pyx_n_u_r);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_n_u_r);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_open, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 650, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_fd = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "kapok/uavsarc.pyx":651
 *         self.file = file
 *         fd = open(self.file, 'r')
 *         self.ann = fd.read().split('\n')             # <<<<<<<<<<<<<<
 *         return
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_fd, __pyx_n_s_read); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 651, __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);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 651, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 651, __pyx_L1_error)
  }
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_split); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 651, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__178, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 651, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_ann, __pyx_t_1) < 0) __PYX_ERR(0, 651, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "kapok/uavsarc.pyx":652
 *         fd = open(self.file, 'r')
 *         self.ann = fd.read().split('\n')
 *         return             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;

  /* "kapok/uavsarc.pyx":641
 *     """Class for loading and interacting with a UAVSAR annotation file."""
 * 
 *     def __init__(self, file):             # <<<<<<<<<<<<<<
 *         """Load in the specified .ann file as a list of strings and
 *             initialize.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("kapok.uavsarc.Ann.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_fd);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "kapok/uavsarc.pyx":655
 * 
 * 
 *     def query(self, keyword):             # <<<<<<<<<<<<<<
 *         """Query the annotation file for the specified annotation keyword.
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_5kapok_7uavsarc_3Ann_3query(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5kapok_7uavsarc_3Ann_2query[] = "Query the annotation file for the specified annotation keyword. \n        \n        Arguments:\n            keyword (str): The keyword to query.\n            \n        Returns:\n            value: The value of the specified keyword.\n            \n        ";
static PyMethodDef __pyx_mdef_5kapok_7uavsarc_3Ann_3query = {"query", (PyCFunction)__pyx_pw_5kapok_7uavsarc_3Ann_3query, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5kapok_7uavsarc_3Ann_2query};
static PyObject *__pyx_pw_5kapok_7uavsarc_3Ann_3query(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_keyword = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("query (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_keyword,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_keyword)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("query", 1, 2, 2, 1); __PYX_ERR(0, 655, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "query") < 0)) __PYX_ERR(0, 655, __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_keyword = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("query", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 655, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("kapok.uavsarc.Ann.query", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5kapok_7uavsarc_3Ann_2query(__pyx_self, __pyx_v_self, __pyx_v_keyword);

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

static PyObject *__pyx_pf_5kapok_7uavsarc_3Ann_2query(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_keyword) {
  Py_ssize_t __pyx_v_n;
  PyObject *__pyx_v_val = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  int __pyx_t_11;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  __Pyx_RefNannySetupContext("query", 0);

  /* "kapok/uavsarc.pyx":665
 * 
 *         """
 *         for n in range(len(self.ann)):             # <<<<<<<<<<<<<<
 *             if self.ann[n].startswith(keyword):
 *                 try:
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_ann); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 665, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 665, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
    __pyx_v_n = __pyx_t_3;

    /* "kapok/uavsarc.pyx":666
 *         """
 *         for n in range(len(self.ann)):
 *             if self.ann[n].startswith(keyword):             # <<<<<<<<<<<<<<
 *                 try:
 *                     val = self.ann[n].rsplit('=')[-1].split(';')[0].split()[0]
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_ann); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 666, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_4, __pyx_v_n, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 666, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_startswith); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 666, __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 && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    if (!__pyx_t_5) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_keyword); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 666, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    } else {
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_4)) {
        PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_v_keyword};
        __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 666, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_1);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
        PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_v_keyword};
        __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 666, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_1);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 666, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
        __Pyx_INCREF(__pyx_v_keyword);
        __Pyx_GIVEREF(__pyx_v_keyword);
        PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_keyword);
        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 666, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 666, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (__pyx_t_7) {

      /* "kapok/uavsarc.pyx":667
 *         for n in range(len(self.ann)):
 *             if self.ann[n].startswith(keyword):
 *                 try:             # <<<<<<<<<<<<<<
 *                     val = self.ann[n].rsplit('=')[-1].split(';')[0].split()[0]
 *                     val = np.array(val,dtype='float') # if we can convert the string to a number, do so
 */
      {
        __Pyx_PyThreadState_declare
        __Pyx_PyThreadState_assign
        __Pyx_ExceptionSave(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10);
        __Pyx_XGOTREF(__pyx_t_8);
        __Pyx_XGOTREF(__pyx_t_9);
        __Pyx_XGOTREF(__pyx_t_10);
        /*try:*/ {

          /* "kapok/uavsarc.pyx":668
 *             if self.ann[n].startswith(keyword):
 *                 try:
 *                     val = self.ann[n].rsplit('=')[-1].split(';')[0].split()[0]             # <<<<<<<<<<<<<<
 *                     val = np.array(val,dtype='float') # if we can convert the string to a number, do so
 *                     if (val - np.floor(val)) == 0:
 */
          __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_ann); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 668, __pyx_L6_error)
          __Pyx_GOTREF(__pyx_t_4);
          __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_4, __pyx_v_n, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 668, __pyx_L6_error)
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_rsplit); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 668, __pyx_L6_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__180, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 668, __pyx_L6_error)
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_6, -1L, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 668, __pyx_L6_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_split); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 668, __pyx_L6_error)
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__182, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 668, __pyx_L6_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_4, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 668, __pyx_L6_error)
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_split); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 668, __pyx_L6_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          __pyx_t_6 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(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);
            }
          }
          if (__pyx_t_6) {
            __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 668, __pyx_L6_error)
            __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          } else {
            __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 668, __pyx_L6_error)
          }
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 668, __pyx_L6_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __pyx_v_val = __pyx_t_4;
          __pyx_t_4 = 0;

          /* "kapok/uavsarc.pyx":669
 *                 try:
 *                     val = self.ann[n].rsplit('=')[-1].split(';')[0].split()[0]
 *                     val = np.array(val,dtype='float') # if we can convert the string to a number, do so             # <<<<<<<<<<<<<<
 *                     if (val - np.floor(val)) == 0:
 *                         val = np.array(val,dtype='int')  # if it's an integer, convert it to one (e.g., number of samples)
 */
          __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 669, __pyx_L6_error)
          __Pyx_GOTREF(__pyx_t_4);
          __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_array); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 669, __pyx_L6_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 669, __pyx_L6_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_INCREF(__pyx_v_val);
          __Pyx_GIVEREF(__pyx_v_val);
          PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_val);
          __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 669, __pyx_L6_error)
          __Pyx_GOTREF(__pyx_t_6);
          if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_n_u_float) < 0) __PYX_ERR(0, 669, __pyx_L6_error)
          __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 669, __pyx_L6_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_DECREF_SET(__pyx_v_val, __pyx_t_5);
          __pyx_t_5 = 0;

          /* "kapok/uavsarc.pyx":670
 *                     val = self.ann[n].rsplit('=')[-1].split(';')[0].split()[0]
 *                     val = np.array(val,dtype='float') # if we can convert the string to a number, do so
 *                     if (val - np.floor(val)) == 0:             # <<<<<<<<<<<<<<
 *                         val = np.array(val,dtype='int')  # if it's an integer, convert it to one (e.g., number of samples)
 *                     return val
 */
          __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 670, __pyx_L6_error)
          __Pyx_GOTREF(__pyx_t_6);
          __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_floor); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 670, __pyx_L6_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);
            }
          }
          if (!__pyx_t_6) {
            __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_val); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 670, __pyx_L6_error)
            __Pyx_GOTREF(__pyx_t_5);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_4)) {
              PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_v_val};
              __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 670, __pyx_L6_error)
              __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
              __Pyx_GOTREF(__pyx_t_5);
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
              PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_v_val};
              __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 670, __pyx_L6_error)
              __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
              __Pyx_GOTREF(__pyx_t_5);
            } else
            #endif
            {
              __pyx_t_1 = PyTuple_New(1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 670, __pyx_L6_error)
              __Pyx_GOTREF(__pyx_t_1);
              __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_6); __pyx_t_6 = NULL;
              __Pyx_INCREF(__pyx_v_val);
              __Pyx_GIVEREF(__pyx_v_val);
              PyTuple_SET_ITEM(__pyx_t_1, 0+1, __pyx_v_val);
              __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_1, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 670, __pyx_L6_error)
              __Pyx_GOTREF(__pyx_t_5);
              __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __pyx_t_4 = PyNumber_Subtract(__pyx_v_val, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 670, __pyx_L6_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __pyx_t_5 = __Pyx_PyInt_EqObjC(__pyx_t_4, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 670, __pyx_L6_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 670, __pyx_L6_error)
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          if (__pyx_t_7) {

            /* "kapok/uavsarc.pyx":671
 *                     val = np.array(val,dtype='float') # if we can convert the string to a number, do so
 *                     if (val - np.floor(val)) == 0:
 *                         val = np.array(val,dtype='int')  # if it's an integer, convert it to one (e.g., number of samples)             # <<<<<<<<<<<<<<
 *                     return val
 *                 except ValueError: # if we can't convert the string to a number, leave it as a string
 */
            __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 671, __pyx_L6_error)
            __Pyx_GOTREF(__pyx_t_5);
            __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_array); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 671, __pyx_L6_error)
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
            __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 671, __pyx_L6_error)
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_INCREF(__pyx_v_val);
            __Pyx_GIVEREF(__pyx_v_val);
            PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_val);
            __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 671, __pyx_L6_error)
            __Pyx_GOTREF(__pyx_t_1);
            if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_n_u_int) < 0) __PYX_ERR(0, 671, __pyx_L6_error)
            __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 671, __pyx_L6_error)
            __Pyx_GOTREF(__pyx_t_6);
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            __Pyx_DECREF_SET(__pyx_v_val, __pyx_t_6);
            __pyx_t_6 = 0;

            /* "kapok/uavsarc.pyx":670
 *                     val = self.ann[n].rsplit('=')[-1].split(';')[0].split()[0]
 *                     val = np.array(val,dtype='float') # if we can convert the string to a number, do so
 *                     if (val - np.floor(val)) == 0:             # <<<<<<<<<<<<<<
 *                         val = np.array(val,dtype='int')  # if it's an integer, convert it to one (e.g., number of samples)
 *                     return val
 */
          }

          /* "kapok/uavsarc.pyx":672
 *                     if (val - np.floor(val)) == 0:
 *                         val = np.array(val,dtype='int')  # if it's an integer, convert it to one (e.g., number of samples)
 *                     return val             # <<<<<<<<<<<<<<
 *                 except ValueError: # if we can't convert the string to a number, leave it as a string
 *                     val = self.ann[n].split('=',maxsplit=1)[-1].split(';')[0].strip()
 */
          __Pyx_XDECREF(__pyx_r);
          __Pyx_INCREF(__pyx_v_val);
          __pyx_r = __pyx_v_val;
          goto __pyx_L10_try_return;

          /* "kapok/uavsarc.pyx":667
 *         for n in range(len(self.ann)):
 *             if self.ann[n].startswith(keyword):
 *                 try:             # <<<<<<<<<<<<<<
 *                     val = self.ann[n].rsplit('=')[-1].split(';')[0].split()[0]
 *                     val = np.array(val,dtype='float') # if we can convert the string to a number, do so
 */
        }
        __pyx_L6_error:;
        __Pyx_PyThreadState_assign
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;

        /* "kapok/uavsarc.pyx":673
 *                         val = np.array(val,dtype='int')  # if it's an integer, convert it to one (e.g., number of samples)
 *                     return val
 *                 except ValueError: # if we can't convert the string to a number, leave it as a string             # <<<<<<<<<<<<<<
 *                     val = self.ann[n].split('=',maxsplit=1)[-1].split(';')[0].strip()
 *                     return val
 */
        __pyx_t_11 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ValueError);
        if (__pyx_t_11) {
          __Pyx_AddTraceback("kapok.uavsarc.Ann.query", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_1, &__pyx_t_5) < 0) __PYX_ERR(0, 673, __pyx_L8_except_error)
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_GOTREF(__pyx_t_5);

          /* "kapok/uavsarc.pyx":674
 *                     return val
 *                 except ValueError: # if we can't convert the string to a number, leave it as a string
 *                     val = self.ann[n].split('=',maxsplit=1)[-1].split(';')[0].strip()             # <<<<<<<<<<<<<<
 *                     return val
 * 
 */
          __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_ann); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 674, __pyx_L8_except_error)
          __Pyx_GOTREF(__pyx_t_12);
          __pyx_t_13 = __Pyx_GetItemInt(__pyx_t_12, __pyx_v_n, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 674, __pyx_L8_except_error)
          __Pyx_GOTREF(__pyx_t_13);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_split); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 674, __pyx_L8_except_error)
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
          __pyx_t_13 = PyDict_New(); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 674, __pyx_L8_except_error)
          __Pyx_GOTREF(__pyx_t_13);
          if (PyDict_SetItem(__pyx_t_13, __pyx_n_s_maxsplit, __pyx_int_1) < 0) __PYX_ERR(0, 674, __pyx_L8_except_error)
          __pyx_t_14 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_tuple__183, __pyx_t_13); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 674, __pyx_L8_except_error)
          __Pyx_GOTREF(__pyx_t_14);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
          __pyx_t_13 = __Pyx_GetItemInt(__pyx_t_14, -1L, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 674, __pyx_L8_except_error)
          __Pyx_GOTREF(__pyx_t_13);
          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
          __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_split); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 674, __pyx_L8_except_error)
          __Pyx_GOTREF(__pyx_t_14);
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
          __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_14, __pyx_tuple__184, NULL); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 674, __pyx_L8_except_error)
          __Pyx_GOTREF(__pyx_t_13);
          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
          __pyx_t_14 = __Pyx_GetItemInt(__pyx_t_13, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 674, __pyx_L8_except_error)
          __Pyx_GOTREF(__pyx_t_14);
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
          __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_n_s_strip); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 674, __pyx_L8_except_error)
          __Pyx_GOTREF(__pyx_t_13);
          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
          __pyx_t_14 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_13))) {
            __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_13);
            if (likely(__pyx_t_14)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13);
              __Pyx_INCREF(__pyx_t_14);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_13, function);
            }
          }
          if (__pyx_t_14) {
            __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_13, __pyx_t_14); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 674, __pyx_L8_except_error)
            __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
          } else {
            __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_13); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 674, __pyx_L8_except_error)
          }
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_4);
          __pyx_t_4 = 0;

          /* "kapok/uavsarc.pyx":675
 *                 except ValueError: # if we can't convert the string to a number, leave it as a string
 *                     val = self.ann[n].split('=',maxsplit=1)[-1].split(';')[0].strip()
 *                     return val             # <<<<<<<<<<<<<<
 * 
 *         return None
 */
          __Pyx_XDECREF(__pyx_r);
          __Pyx_INCREF(__pyx_v_val);
          __pyx_r = __pyx_v_val;
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          goto __pyx_L9_except_return;
        }
        goto __pyx_L8_except_error;
        __pyx_L8_except_error:;

        /* "kapok/uavsarc.pyx":667
 *         for n in range(len(self.ann)):
 *             if self.ann[n].startswith(keyword):
 *                 try:             # <<<<<<<<<<<<<<
 *                     val = self.ann[n].rsplit('=')[-1].split(';')[0].split()[0]
 *                     val = np.array(val,dtype='float') # if we can convert the string to a number, do so
 */
        __Pyx_PyThreadState_assign
        __Pyx_XGIVEREF(__pyx_t_8);
        __Pyx_XGIVEREF(__pyx_t_9);
        __Pyx_XGIVEREF(__pyx_t_10);
        __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10);
        goto __pyx_L1_error;
        __pyx_L10_try_return:;
        __Pyx_PyThreadState_assign
        __Pyx_XGIVEREF(__pyx_t_8);
        __Pyx_XGIVEREF(__pyx_t_9);
        __Pyx_XGIVEREF(__pyx_t_10);
        __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10);
        goto __pyx_L0;
        __pyx_L9_except_return:;
        __Pyx_PyThreadState_assign
        __Pyx_XGIVEREF(__pyx_t_8);
        __Pyx_XGIVEREF(__pyx_t_9);
        __Pyx_XGIVEREF(__pyx_t_10);
        __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10);
        goto __pyx_L0;
      }

      /* "kapok/uavsarc.pyx":666
 *         """
 *         for n in range(len(self.ann)):
 *             if self.ann[n].startswith(keyword):             # <<<<<<<<<<<<<<
 *                 try:
 *                     val = self.ann[n].rsplit('=')[-1].split(';')[0].split()[0]
 */
    }
  }

  /* "kapok/uavsarc.pyx":677
 *                     return val
 * 
 *         return None             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(Py_None);
  __pyx_r = Py_None;
  goto __pyx_L0;

  /* "kapok/uavsarc.pyx":655
 * 
 * 
 *     def query(self, keyword):             # <<<<<<<<<<<<<<
 *         """Query the annotation file for the specified annotation keyword.
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_AddTraceback("kapok.uavsarc.Ann.query", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_val);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "kapok/uavsarc.pyx":680
 * 
 * 
 * def findsegment(az,azsize):             # <<<<<<<<<<<<<<
 *     """For a given azimuth index, return the segment number and
 *     the azimuth index within the given segment.
 */

/* Python wrapper */
static PyObject *__pyx_pw_5kapok_7uavsarc_3findsegment(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5kapok_7uavsarc_2findsegment[] = "For a given azimuth index, return the segment number and\n    the azimuth index within the given segment.\n    \n    Arguments:\n        az: Azimuth index of interest.\n        azsize: List containing the azimuth size of each segment.\n        \n    Returns:\n        seg: Segment number.\n        azoff: Azimuth index within the segment.\n        \n    ";
static PyMethodDef __pyx_mdef_5kapok_7uavsarc_3findsegment = {"findsegment", (PyCFunction)__pyx_pw_5kapok_7uavsarc_3findsegment, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5kapok_7uavsarc_2findsegment};
static PyObject *__pyx_pw_5kapok_7uavsarc_3findsegment(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_az = 0;
  PyObject *__pyx_v_azsize = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("findsegment (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_az,&__pyx_n_s_azsize,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_az)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_azsize)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("findsegment", 1, 2, 2, 1); __PYX_ERR(0, 680, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "findsegment") < 0)) __PYX_ERR(0, 680, __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_az = values[0];
    __pyx_v_azsize = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("findsegment", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 680, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("kapok.uavsarc.findsegment", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5kapok_7uavsarc_2findsegment(__pyx_self, __pyx_v_az, __pyx_v_azsize);

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

static PyObject *__pyx_pf_5kapok_7uavsarc_2findsegment(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_az, PyObject *__pyx_v_azsize) {
  PyObject *__pyx_v_azstart = NULL;
  PyObject *__pyx_v_seg = NULL;
  PyObject *__pyx_v_azoff = 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;
  int __pyx_t_7;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  __Pyx_RefNannySetupContext("findsegment", 0);

  /* "kapok/uavsarc.pyx":693
 * 
 *     """
 *     azstart = np.insert(np.cumsum(azsize), 0, 0)[0:-1]             # <<<<<<<<<<<<<<
 * 
 *     if az <= np.sum(azsize):
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 693, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_insert); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 693, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 693, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_cumsum); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 693, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
    }
  }
  if (!__pyx_t_4) {
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_azsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 693, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  } else {
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_5)) {
      PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_azsize};
      __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 693, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_GOTREF(__pyx_t_2);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
      PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_azsize};
      __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 693, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_GOTREF(__pyx_t_2);
    } else
    #endif
    {
      __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 693, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
      __Pyx_INCREF(__pyx_v_azsize);
      __Pyx_GIVEREF(__pyx_v_azsize);
      PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_azsize);
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 693, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = NULL;
  __pyx_t_7 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_7 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_3)) {
    PyObject *__pyx_temp[4] = {__pyx_t_5, __pyx_t_2, __pyx_int_0, __pyx_int_0};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_7, 3+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 693, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 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_3)) {
    PyObject *__pyx_temp[4] = {__pyx_t_5, __pyx_t_2, __pyx_int_0, __pyx_int_0};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_7, 3+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 693, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  } else
  #endif
  {
    __pyx_t_6 = PyTuple_New(3+__pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 693, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (__pyx_t_5) {
      __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
    }
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_7, __pyx_t_2);
    __Pyx_INCREF(__pyx_int_0);
    __Pyx_GIVEREF(__pyx_int_0);
    PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_7, __pyx_int_0);
    __Pyx_INCREF(__pyx_int_0);
    __Pyx_GIVEREF(__pyx_int_0);
    PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_7, __pyx_int_0);
    __pyx_t_2 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 693, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_GetSlice(__pyx_t_1, 0, -1L, NULL, NULL, &__pyx_slice__185, 1, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 693, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_azstart = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "kapok/uavsarc.pyx":695
 *     azstart = np.insert(np.cumsum(azsize), 0, 0)[0:-1]
 * 
 *     if az <= np.sum(azsize):             # <<<<<<<<<<<<<<
 *         seg = np.max(np.where(azstart <= az))
 *         azoff = az - azstart[seg]
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 695, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_sum); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 695, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_6);
    if (likely(__pyx_t_1)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_6, function);
    }
  }
  if (!__pyx_t_1) {
    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_azsize); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 695, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  } else {
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_6)) {
      PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_v_azsize};
      __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 695, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_GOTREF(__pyx_t_3);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
      PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_v_azsize};
      __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 695, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_GOTREF(__pyx_t_3);
    } else
    #endif
    {
      __pyx_t_2 = PyTuple_New(1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 695, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); __pyx_t_1 = NULL;
      __Pyx_INCREF(__pyx_v_azsize);
      __Pyx_GIVEREF(__pyx_v_azsize);
      PyTuple_SET_ITEM(__pyx_t_2, 0+1, __pyx_v_azsize);
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 695, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = PyObject_RichCompare(__pyx_v_az, __pyx_t_3, Py_LE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 695, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 695, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (__pyx_t_8) {

    /* "kapok/uavsarc.pyx":696
 * 
 *     if az <= np.sum(azsize):
 *         seg = np.max(np.where(azstart <= az))             # <<<<<<<<<<<<<<
 *         azoff = az - azstart[seg]
 *     else:
 */
    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 696, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_max); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 696, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 696, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_where); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 696, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyObject_RichCompare(__pyx_v_azstart, __pyx_v_az, Py_LE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 696, __pyx_L1_error)
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    if (!__pyx_t_4) {
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 696, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_GOTREF(__pyx_t_3);
    } else {
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_5)) {
        PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_1};
        __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 696, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
        PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_1};
        __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 696, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      } else
      #endif
      {
        __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 696, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_4); __pyx_t_4 = NULL;
        __Pyx_GIVEREF(__pyx_t_1);
        PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_t_1);
        __pyx_t_1 = 0;
        __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 696, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      }
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __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);
      }
    }
    if (!__pyx_t_5) {
      __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 696, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_GOTREF(__pyx_t_6);
    } else {
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_2)) {
        PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_3};
        __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 696, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
        PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_3};
        __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 696, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      } else
      #endif
      {
        __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 696, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_5); __pyx_t_5 = NULL;
        __Pyx_GIVEREF(__pyx_t_3);
        PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_t_3);
        __pyx_t_3 = 0;
        __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_9, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 696, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      }
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_v_seg = __pyx_t_6;
    __pyx_t_6 = 0;

    /* "kapok/uavsarc.pyx":697
 *     if az <= np.sum(azsize):
 *         seg = np.max(np.where(azstart <= az))
 *         azoff = az - azstart[seg]             # <<<<<<<<<<<<<<
 *     else:
 *         seg = azstart.shape[0] - 1
 */
    __pyx_t_6 = PyObject_GetItem(__pyx_v_azstart, __pyx_v_seg); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 697, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_2 = PyNumber_Subtract(__pyx_v_az, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 697, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_v_azoff = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "kapok/uavsarc.pyx":695
 *     azstart = np.insert(np.cumsum(azsize), 0, 0)[0:-1]
 * 
 *     if az <= np.sum(azsize):             # <<<<<<<<<<<<<<
 *         seg = np.max(np.where(azstart <= az))
 *         azoff = az - azstart[seg]
 */
    goto __pyx_L3;
  }

  /* "kapok/uavsarc.pyx":699
 *         azoff = az - azstart[seg]
 *     else:
 *         seg = azstart.shape[0] - 1             # <<<<<<<<<<<<<<
 *         azoff = azsize[seg]
 *         print('kapok.uavsar.fingsegment | SLC row index of '+str(az)+' is larger than the size of the data.  Returning maximum index.')
 */
  /*else*/ {
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_azstart, __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 699, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_2, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 699, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyInt_SubtractObjC(__pyx_t_6, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 699, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_v_seg = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "kapok/uavsarc.pyx":700
 *     else:
 *         seg = azstart.shape[0] - 1
 *         azoff = azsize[seg]             # <<<<<<<<<<<<<<
 *         print('kapok.uavsar.fingsegment | SLC row index of '+str(az)+' is larger than the size of the data.  Returning maximum index.')
 * 
 */
    __pyx_t_2 = PyObject_GetItem(__pyx_v_azsize, __pyx_v_seg); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 700, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_v_azoff = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "kapok/uavsarc.pyx":701
 *         seg = azstart.shape[0] - 1
 *         azoff = azsize[seg]
 *         print('kapok.uavsar.fingsegment | SLC row index of '+str(az)+' is larger than the size of the data.  Returning maximum index.')             # <<<<<<<<<<<<<<
 * 
 *     return seg, azoff
 */
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 701, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_v_az);
    __Pyx_GIVEREF(__pyx_v_az);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_az);
    __pyx_t_6 = __Pyx_PyObject_Call(((PyObject *)(&PyUnicode_Type)), __pyx_t_2, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 701, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyUnicode_Concat(__pyx_kp_u_kapok_uavsar_fingsegment_SLC_row, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 701, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyUnicode_Concat(__pyx_t_2, __pyx_kp_u_is_larger_than_the_size_of_the); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 701, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 701, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_6);
    __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_t_2, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 701, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
  __pyx_L3:;

  /* "kapok/uavsarc.pyx":703
 *         print('kapok.uavsar.fingsegment | SLC row index of '+str(az)+' is larger than the size of the data.  Returning maximum index.')
 * 
 *     return seg, azoff             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 703, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_INCREF(__pyx_v_seg);
  __Pyx_GIVEREF(__pyx_v_seg);
  PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_seg);
  __Pyx_INCREF(__pyx_v_azoff);
  __Pyx_GIVEREF(__pyx_v_azoff);
  PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_azoff);
  __pyx_r = __pyx_t_6;
  __pyx_t_6 = 0;
  goto __pyx_L0;

  /* "kapok/uavsarc.pyx":680
 * 
 * 
 * def findsegment(az,azsize):             # <<<<<<<<<<<<<<
 *     """For a given azimuth index, return the segment number and
 *     the azimuth index within the given segment.
 */

  /* 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_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("kapok.uavsarc.findsegment", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_azstart);
  __Pyx_XDECREF(__pyx_v_seg);
  __Pyx_XDECREF(__pyx_v_azoff);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "kapok/uavsarc.pyx":706
 * 
 * 
 * def getslcblock(file, rngsize, azstart, azend, rngbounds=None, file2=None,             # <<<<<<<<<<<<<<
 *                 azsize=None):
 *     """Load SLC data into a NumPy array buffer.  If the file2 argument is
 */

/* Python wrapper */
static PyObject *__pyx_pw_5kapok_7uavsarc_5getslcblock(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5kapok_7uavsarc_4getslcblock[] = "Load SLC data into a NumPy array buffer.  If the file2 argument is\n    specified in the arguments, this function will treat the two files as\n    consecutive segments, and will join them.\n    \n    Arguments:\n        file (str): Filename of the first SLC.\n        rngsize (int): Number of columns (range bins).  Same for both SLCs.\n        azstart (int): Azimuth index at which to start the buffer, in the\n            first SLC.\n        azend (int): Azimuth index at which to end the buffer.  If file2\n            is specified, this is an azimuth index in the second SLC.  If\n            file2 is not specified, this is an azimuth index in the first SLC.\n            The row specified by azend is not actually included in the buffer,\n            as in the Python range() function.  (azend-1) is the last line\n            included in the buffer.  To load the entire SLC, azend should be\n            equal to the number of rows in SLC.\n        rngbounds (tuple, int): Starting and ending range bounds, if range\n            subsetting is desired.\n        file2 (str): Filename of the second SLC, if combining multiple\n            segments is desired.\n        azsize (int): Number of rows (azimuth bins) for the first SLC.  Only\n            required if file2 is specified.  Otherwise we only load in the\n            lines of the SLC before azend.\n        \n    Returns:\n        block: NumPy array of complex64 datatype, containing the loaded SLC\n        data between the specified azimuth bounds.\n    \n    ";
static PyMethodDef __pyx_mdef_5kapok_7uavsarc_5getslcblock = {"getslcblock", (PyCFunction)__pyx_pw_5kapok_7uavsarc_5getslcblock, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5kapok_7uavsarc_4getslcblock};
static PyObject *__pyx_pw_5kapok_7uavsarc_5getslcblock(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_file = 0;
  PyObject *__pyx_v_rngsize = 0;
  PyObject *__pyx_v_azstart = 0;
  PyObject *__pyx_v_azend = 0;
  PyObject *__pyx_v_rngbounds = 0;
  PyObject *__pyx_v_file2 = 0;
  PyObject *__pyx_v_azsize = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("getslcblock (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_file,&__pyx_n_s_rngsize,&__pyx_n_s_azstart,&__pyx_n_s_azend,&__pyx_n_s_rngbounds,&__pyx_n_s_file2,&__pyx_n_s_azsize,0};
    PyObject* values[7] = {0,0,0,0,0,0,0};
    values[4] = ((PyObject *)Py_None);
    values[5] = ((PyObject *)Py_None);

    /* "kapok/uavsarc.pyx":707
 * 
 * def getslcblock(file, rngsize, azstart, azend, rngbounds=None, file2=None,
 *                 azsize=None):             # <<<<<<<<<<<<<<
 *     """Load SLC data into a NumPy array buffer.  If the file2 argument is
 *     specified in the arguments, this function will treat the two files as
 */
    values[6] = ((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  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_file)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_rngsize)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("getslcblock", 0, 4, 7, 1); __PYX_ERR(0, 706, __pyx_L3_error)
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_azstart)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("getslcblock", 0, 4, 7, 2); __PYX_ERR(0, 706, __pyx_L3_error)
        }
        case  3:
        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_azend)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("getslcblock", 0, 4, 7, 3); __PYX_ERR(0, 706, __pyx_L3_error)
        }
        case  4:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_rngbounds);
          if (value) { values[4] = value; kw_args--; }
        }
        case  5:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_file2);
          if (value) { values[5] = value; kw_args--; }
        }
        case  6:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_azsize);
          if (value) { values[6] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getslcblock") < 0)) __PYX_ERR(0, 706, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        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_file = values[0];
    __pyx_v_rngsize = values[1];
    __pyx_v_azstart = values[2];
    __pyx_v_azend = values[3];
    __pyx_v_rngbounds = values[4];
    __pyx_v_file2 = values[5];
    __pyx_v_azsize = values[6];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("getslcblock", 0, 4, 7, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 706, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("kapok.uavsarc.getslcblock", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5kapok_7uavsarc_4getslcblock(__pyx_self, __pyx_v_file, __pyx_v_rngsize, __pyx_v_azstart, __pyx_v_azend, __pyx_v_rngbounds, __pyx_v_file2, __pyx_v_azsize);

  /* "kapok/uavsarc.pyx":706
 * 
 * 
 * def getslcblock(file, rngsize, azstart, azend, rngbounds=None, file2=None,             # <<<<<<<<<<<<<<
 *                 azsize=None):
 *     """Load SLC data into a NumPy array buffer.  If the file2 argument is
 */

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

static PyObject *__pyx_pf_5kapok_7uavsarc_4getslcblock(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_file, PyObject *__pyx_v_rngsize, PyObject *__pyx_v_azstart, PyObject *__pyx_v_azend, PyObject *__pyx_v_rngbounds, PyObject *__pyx_v_file2, PyObject *__pyx_v_azsize) {
  PyObject *__pyx_v_byteoffset = NULL;
  PyObject *__pyx_v_slc = NULL;
  PyObject *__pyx_v_slca = NULL;
  PyObject *__pyx_v_slcb = NULL;
  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;
  __Pyx_RefNannySetupContext("getslcblock", 0);

  /* "kapok/uavsarc.pyx":737
 * 
 *     """
 *     if file2 is None:             # <<<<<<<<<<<<<<
 *         byteoffset = rngsize * 8 * azstart
 *         slc = np.memmap(file, dtype='complex64', mode='c', offset=byteoffset, shape=(azend-azstart,rngsize))
 */
  __pyx_t_1 = (__pyx_v_file2 == Py_None);
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "kapok/uavsarc.pyx":738
 *     """
 *     if file2 is None:
 *         byteoffset = rngsize * 8 * azstart             # <<<<<<<<<<<<<<
 *         slc = np.memmap(file, dtype='complex64', mode='c', offset=byteoffset, shape=(azend-azstart,rngsize))
 *         if rngbounds is not None:
 */
    __pyx_t_3 = PyNumber_Multiply(__pyx_v_rngsize, __pyx_int_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 738, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = PyNumber_Multiply(__pyx_t_3, __pyx_v_azstart); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 738, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_v_byteoffset = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "kapok/uavsarc.pyx":739
 *     if file2 is None:
 *         byteoffset = rngsize * 8 * azstart
 *         slc = np.memmap(file, dtype='complex64', mode='c', offset=byteoffset, shape=(azend-azstart,rngsize))             # <<<<<<<<<<<<<<
 *         if rngbounds is not None:
 *             slc = slc[:,rngbounds[0]:rngbounds[1]]
 */
    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 739, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_memmap); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 739, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 739, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_v_file);
    __Pyx_GIVEREF(__pyx_v_file);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_file);
    __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 739, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_n_u_complex64) < 0) __PYX_ERR(0, 739, __pyx_L1_error)
    if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_mode, __pyx_n_u_c) < 0) __PYX_ERR(0, 739, __pyx_L1_error)
    if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_offset, __pyx_v_byteoffset) < 0) __PYX_ERR(0, 739, __pyx_L1_error)
    __pyx_t_6 = PyNumber_Subtract(__pyx_v_azend, __pyx_v_azstart); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 739, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 739, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6);
    __Pyx_INCREF(__pyx_v_rngsize);
    __Pyx_GIVEREF(__pyx_v_rngsize);
    PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_v_rngsize);
    __pyx_t_6 = 0;
    if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_shape, __pyx_t_7) < 0) __PYX_ERR(0, 739, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 739, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __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_v_slc = __pyx_t_7;
    __pyx_t_7 = 0;

    /* "kapok/uavsarc.pyx":740
 *         byteoffset = rngsize * 8 * azstart
 *         slc = np.memmap(file, dtype='complex64', mode='c', offset=byteoffset, shape=(azend-azstart,rngsize))
 *         if rngbounds is not None:             # <<<<<<<<<<<<<<
 *             slc = slc[:,rngbounds[0]:rngbounds[1]]
 *         return slc
 */
    __pyx_t_2 = (__pyx_v_rngbounds != Py_None);
    __pyx_t_1 = (__pyx_t_2 != 0);
    if (__pyx_t_1) {

      /* "kapok/uavsarc.pyx":741
 *         slc = np.memmap(file, dtype='complex64', mode='c', offset=byteoffset, shape=(azend-azstart,rngsize))
 *         if rngbounds is not None:
 *             slc = slc[:,rngbounds[0]:rngbounds[1]]             # <<<<<<<<<<<<<<
 *         return slc
 *     elif azsize is None:
 */
      __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_rngbounds, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 741, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_rngbounds, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 741, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_4 = PySlice_New(__pyx_t_7, __pyx_t_5, Py_None); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 741, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 741, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_INCREF(__pyx_slice__186);
      __Pyx_GIVEREF(__pyx_slice__186);
      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_slice__186);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4);
      __pyx_t_4 = 0;
      __pyx_t_4 = PyObject_GetItem(__pyx_v_slc, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 741, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF_SET(__pyx_v_slc, __pyx_t_4);
      __pyx_t_4 = 0;

      /* "kapok/uavsarc.pyx":740
 *         byteoffset = rngsize * 8 * azstart
 *         slc = np.memmap(file, dtype='complex64', mode='c', offset=byteoffset, shape=(azend-azstart,rngsize))
 *         if rngbounds is not None:             # <<<<<<<<<<<<<<
 *             slc = slc[:,rngbounds[0]:rngbounds[1]]
 *         return slc
 */
    }

    /* "kapok/uavsarc.pyx":742
 *         if rngbounds is not None:
 *             slc = slc[:,rngbounds[0]:rngbounds[1]]
 *         return slc             # <<<<<<<<<<<<<<
 *     elif azsize is None:
 *         print('kapok.uavsar.getslcblock: "file2" argument specified, but "azsize" argument missing. Aborting.')
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_v_slc);
    __pyx_r = __pyx_v_slc;
    goto __pyx_L0;

    /* "kapok/uavsarc.pyx":737
 * 
 *     """
 *     if file2 is None:             # <<<<<<<<<<<<<<
 *         byteoffset = rngsize * 8 * azstart
 *         slc = np.memmap(file, dtype='complex64', mode='c', offset=byteoffset, shape=(azend-azstart,rngsize))
 */
  }

  /* "kapok/uavsarc.pyx":743
 *             slc = slc[:,rngbounds[0]:rngbounds[1]]
 *         return slc
 *     elif azsize is None:             # <<<<<<<<<<<<<<
 *         print('kapok.uavsar.getslcblock: "file2" argument specified, but "azsize" argument missing. Aborting.')
 *         return
 */
  __pyx_t_1 = (__pyx_v_azsize == Py_None);
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "kapok/uavsarc.pyx":744
 *         return slc
 *     elif azsize is None:
 *         print('kapok.uavsar.getslcblock: "file2" argument specified, but "azsize" argument missing. Aborting.')             # <<<<<<<<<<<<<<
 *         return
 *     else:
 */
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_tuple__187, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 744, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "kapok/uavsarc.pyx":745
 *     elif azsize is None:
 *         print('kapok.uavsar.getslcblock: "file2" argument specified, but "azsize" argument missing. Aborting.')
 *         return             # <<<<<<<<<<<<<<
 *     else:
 *         byteoffset = rngsize * 8 * azstart
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "kapok/uavsarc.pyx":743
 *             slc = slc[:,rngbounds[0]:rngbounds[1]]
 *         return slc
 *     elif azsize is None:             # <<<<<<<<<<<<<<
 *         print('kapok.uavsar.getslcblock: "file2" argument specified, but "azsize" argument missing. Aborting.')
 *         return
 */
  }

  /* "kapok/uavsarc.pyx":747
 *         return
 *     else:
 *         byteoffset = rngsize * 8 * azstart             # <<<<<<<<<<<<<<
 *         slca = np.memmap(file, dtype='complex64', mode='c', offset=byteoffset, shape=(azsize-azstart,rngsize))
 *         slcb = np.memmap(file2, dtype='complex64', mode='c', shape=(azend,rngsize))
 */
  /*else*/ {
    __pyx_t_4 = PyNumber_Multiply(__pyx_v_rngsize, __pyx_int_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 747, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyNumber_Multiply(__pyx_t_4, __pyx_v_azstart); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 747, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_v_byteoffset = __pyx_t_5;
    __pyx_t_5 = 0;

    /* "kapok/uavsarc.pyx":748
 *     else:
 *         byteoffset = rngsize * 8 * azstart
 *         slca = np.memmap(file, dtype='complex64', mode='c', offset=byteoffset, shape=(azsize-azstart,rngsize))             # <<<<<<<<<<<<<<
 *         slcb = np.memmap(file2, dtype='complex64', mode='c', shape=(azend,rngsize))
 *         if rngbounds is not None:
 */
    __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 748, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_memmap); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 748, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 748, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_INCREF(__pyx_v_file);
    __Pyx_GIVEREF(__pyx_v_file);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_file);
    __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 748, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_dtype, __pyx_n_u_complex64) < 0) __PYX_ERR(0, 748, __pyx_L1_error)
    if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_mode, __pyx_n_u_c) < 0) __PYX_ERR(0, 748, __pyx_L1_error)
    if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_offset, __pyx_v_byteoffset) < 0) __PYX_ERR(0, 748, __pyx_L1_error)
    __pyx_t_3 = PyNumber_Subtract(__pyx_v_azsize, __pyx_v_azstart); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 748, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 748, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3);
    __Pyx_INCREF(__pyx_v_rngsize);
    __Pyx_GIVEREF(__pyx_v_rngsize);
    PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_rngsize);
    __pyx_t_3 = 0;
    if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_shape, __pyx_t_6) < 0) __PYX_ERR(0, 748, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, __pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 748, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_v_slca = __pyx_t_6;
    __pyx_t_6 = 0;

    /* "kapok/uavsarc.pyx":749
 *         byteoffset = rngsize * 8 * azstart
 *         slca = np.memmap(file, dtype='complex64', mode='c', offset=byteoffset, shape=(azsize-azstart,rngsize))
 *         slcb = np.memmap(file2, dtype='complex64', mode='c', shape=(azend,rngsize))             # <<<<<<<<<<<<<<
 *         if rngbounds is not None:
 *             slca = slca[:,rngbounds[0]:rngbounds[1]]
 */
    __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 749, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_memmap); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 749, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 749, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_INCREF(__pyx_v_file2);
    __Pyx_GIVEREF(__pyx_v_file2);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_file2);
    __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 749, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_n_u_complex64) < 0) __PYX_ERR(0, 749, __pyx_L1_error)
    if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_mode, __pyx_n_u_c) < 0) __PYX_ERR(0, 749, __pyx_L1_error)
    __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 749, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_v_azend);
    __Pyx_GIVEREF(__pyx_v_azend);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_azend);
    __Pyx_INCREF(__pyx_v_rngsize);
    __Pyx_GIVEREF(__pyx_v_rngsize);
    PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_rngsize);
    if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_shape, __pyx_t_4) < 0) __PYX_ERR(0, 749, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 749, __pyx_L1_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_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_v_slcb = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "kapok/uavsarc.pyx":750
 *         slca = np.memmap(file, dtype='complex64', mode='c', offset=byteoffset, shape=(azsize-azstart,rngsize))
 *         slcb = np.memmap(file2, dtype='complex64', mode='c', shape=(azend,rngsize))
 *         if rngbounds is not None:             # <<<<<<<<<<<<<<
 *             slca = slca[:,rngbounds[0]:rngbounds[1]]
 *             slcb = slcb[:,rngbounds[0]:rngbounds[1]]
 */
    __pyx_t_2 = (__pyx_v_rngbounds != Py_None);
    __pyx_t_1 = (__pyx_t_2 != 0);
    if (__pyx_t_1) {

      /* "kapok/uavsarc.pyx":751
 *         slcb = np.memmap(file2, dtype='complex64', mode='c', shape=(azend,rngsize))
 *         if rngbounds is not None:
 *             slca = slca[:,rngbounds[0]:rngbounds[1]]             # <<<<<<<<<<<<<<
 *             slcb = slcb[:,rngbounds[0]:rngbounds[1]]
 *         return np.vstack((slca,slcb))
 */
      __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_rngbounds, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 751, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_rngbounds, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 751, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = PySlice_New(__pyx_t_4, __pyx_t_5, Py_None); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 751, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 751, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_INCREF(__pyx_slice__188);
      __Pyx_GIVEREF(__pyx_slice__188);
      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_slice__188);
      __Pyx_GIVEREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_6);
      __pyx_t_6 = 0;
      __pyx_t_6 = PyObject_GetItem(__pyx_v_slca, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 751, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF_SET(__pyx_v_slca, __pyx_t_6);
      __pyx_t_6 = 0;

      /* "kapok/uavsarc.pyx":752
 *         if rngbounds is not None:
 *             slca = slca[:,rngbounds[0]:rngbounds[1]]
 *             slcb = slcb[:,rngbounds[0]:rngbounds[1]]             # <<<<<<<<<<<<<<
 *         return np.vstack((slca,slcb))
 * 
 */
      __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_rngbounds, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 752, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_rngbounds, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 752, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_4 = PySlice_New(__pyx_t_6, __pyx_t_5, Py_None); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 752, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 752, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_INCREF(__pyx_slice__189);
      __Pyx_GIVEREF(__pyx_slice__189);
      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_slice__189);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4);
      __pyx_t_4 = 0;
      __pyx_t_4 = PyObject_GetItem(__pyx_v_slcb, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 752, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF_SET(__pyx_v_slcb, __pyx_t_4);
      __pyx_t_4 = 0;

      /* "kapok/uavsarc.pyx":750
 *         slca = np.memmap(file, dtype='complex64', mode='c', offset=byteoffset, shape=(azsize-azstart,rngsize))
 *         slcb = np.memmap(file2, dtype='complex64', mode='c', shape=(azend,rngsize))
 *         if rngbounds is not None:             # <<<<<<<<<<<<<<
 *             slca = slca[:,rngbounds[0]:rngbounds[1]]
 *             slcb = slcb[:,rngbounds[0]:rngbounds[1]]
 */
    }

    /* "kapok/uavsarc.pyx":753
 *             slca = slca[:,rngbounds[0]:rngbounds[1]]
 *             slcb = slcb[:,rngbounds[0]:rngbounds[1]]
 *         return np.vstack((slca,slcb))             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 753, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_vstack); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 753, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 753, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_INCREF(__pyx_v_slca);
    __Pyx_GIVEREF(__pyx_v_slca);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_slca);
    __Pyx_INCREF(__pyx_v_slcb);
    __Pyx_GIVEREF(__pyx_v_slcb);
    PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_slcb);
    __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);
      }
    }
    if (!__pyx_t_7) {
      __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 753, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_GOTREF(__pyx_t_4);
    } else {
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_5};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 753, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_5};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 753, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      } else
      #endif
      {
        __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 753, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_7); __pyx_t_7 = NULL;
        __Pyx_GIVEREF(__pyx_t_5);
        PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_t_5);
        __pyx_t_5 = 0;
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 753, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      }
    }
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;
  }

  /* "kapok/uavsarc.pyx":706
 * 
 * 
 * def getslcblock(file, rngsize, azstart, azend, rngbounds=None, file2=None,             # <<<<<<<<<<<<<<
 *                 azsize=None):
 *     """Load SLC data into a NumPy array buffer.  If the file2 argument is
 */

  /* 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_AddTraceback("kapok.uavsarc.getslcblock", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_byteoffset);
  __Pyx_XDECREF(__pyx_v_slc);
  __Pyx_XDECREF(__pyx_v_slca);
  __Pyx_XDECREF(__pyx_v_slcb);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "kapok/uavsarc.pyx":756
 * 
 * 
 * def quicklook(infile, tr=0, pol='hh', mlwin=(40,10), savefile=None):             # <<<<<<<<<<<<<<
 *     """Display a quick look intensity image for a given UAVSAR SLC stack.
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_5kapok_7uavsarc_7quicklook(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5kapok_7uavsarc_6quicklook[] = "Display a quick look intensity image for a given UAVSAR SLC stack.\n    \n    Arguments:\n        infile (str): Input annotation file of the UAVSAR stack.\n        tr (int): Track index of the desired image.  Default: 0\n            (first track in .ann file).\n        pol (str): Polarization str of the desired image.  Options are 'hh',\n            'hv', or 'vv'.  Default: 'hh'\n        mlwin (tuple): Multi-looking window size to use for the quick look\n            image.  Note:  The original SLC azimuth indices will be displayed\n            on the axes of the image, so that the image can be used as a guide\n            for suitable values of the azbounds and rngbounds keywords in\n            kapok.uavsar.load.  These multi-looking windows are in terms\n            of the original 1x1 SLC image size, not the 8x2 or 4x1\n            image sizes.\n        savefile (str): Output path and filename to save the displayed image.\n    \n    ";
static PyMethodDef __pyx_mdef_5kapok_7uavsarc_7quicklook = {"quicklook", (PyCFunction)__pyx_pw_5kapok_7uavsarc_7quicklook, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5kapok_7uavsarc_6quicklook};
static PyObject *__pyx_pw_5kapok_7uavsarc_7quicklook(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_infile = 0;
  PyObject *__pyx_v_tr = 0;
  PyObject *__pyx_v_pol = 0;
  PyObject *__pyx_v_mlwin = 0;
  PyObject *__pyx_v_savefile = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("quicklook (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_infile,&__pyx_n_s_tr,&__pyx_n_s_pol,&__pyx_n_s_mlwin,&__pyx_n_s_savefile,0};
    PyObject* values[5] = {0,0,0,0,0};
    values[1] = ((PyObject *)__pyx_int_0);
    values[2] = ((PyObject *)__pyx_n_u_hh);
    values[3] = ((PyObject *)__pyx_tuple__190);
    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);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_infile)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_tr);
          if (value) { values[1] = value; kw_args--; }
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pol);
          if (value) { values[2] = value; kw_args--; }
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mlwin);
          if (value) { values[3] = value; kw_args--; }
        }
        case  4:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_savefile);
          if (value) { values[4] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "quicklook") < 0)) __PYX_ERR(0, 756, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_infile = values[0];
    __pyx_v_tr = values[1];
    __pyx_v_pol = values[2];
    __pyx_v_mlwin = values[3];
    __pyx_v_savefile = values[4];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("quicklook", 0, 1, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 756, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("kapok.uavsarc.quicklook", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5kapok_7uavsarc_6quicklook(__pyx_self, __pyx_v_infile, __pyx_v_tr, __pyx_v_pol, __pyx_v_mlwin, __pyx_v_savefile);

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

static PyObject *__pyx_pf_5kapok_7uavsarc_6quicklook(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_infile, PyObject *__pyx_v_tr, PyObject *__pyx_v_pol, PyObject *__pyx_v_mlwin, PyObject *__pyx_v_savefile) {
  PyObject *__pyx_v_plt = NULL;
  PyObject *__pyx_v_ann = NULL;
  PyObject *__pyx_v_temp = NULL;
  PyObject *__pyx_v_num = NULL;
  PyObject *__pyx_v_tracknames = NULL;
  PyObject *__pyx_v_datapath = NULL;
  PyObject *__pyx_v_num_segments = NULL;
  PyObject *__pyx_v_slcfiles = NULL;
  PyObject *__pyx_v_seg = NULL;
  PyObject *__pyx_v_file = NULL;
  PyObject *__pyx_v_slcwindow = NULL;
  PyObject *__pyx_v_rngsize_slc = NULL;
  PyObject *__pyx_v_azsize_slc = NULL;
  PyObject *__pyx_v_n = NULL;
  PyObject *__pyx_v_azsize = NULL;
  PyObject *__pyx_v_rngsize = NULL;
  PyObject *__pyx_v_rngsize_slc1x1 = NULL;
  PyObject *__pyx_v_azsize_slc1x1 = NULL;
  PyObject *__pyx_v_qlimage = NULL;
  PyObject *__pyx_v_num_blocks = NULL;
  PyObject *__pyx_v_az_vector = NULL;
  PyObject *__pyx_v_azstart = NULL;
  PyObject *__pyx_v_azend = NULL;
  PyObject *__pyx_v_azstart_slc = NULL;
  PyObject *__pyx_v_azend_slc = NULL;
  PyObject *__pyx_v_seg_start = NULL;
  PyObject *__pyx_v_azoffset_start = NULL;
  PyObject *__pyx_v_seg_end = NULL;
  PyObject *__pyx_v_azoffset_end = NULL;
  PyObject *__pyx_v_slc = NULL;
  PyObject *__pyx_v_file2 = 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;
  Py_ssize_t __pyx_t_12;
  PyObject *(*__pyx_t_13)(PyObject *);
  PyObject *__pyx_t_14 = NULL;
  Py_ssize_t __pyx_t_15;
  PyObject *(*__pyx_t_16)(PyObject *);
  PyObject *__pyx_t_17 = NULL;
  int __pyx_t_18;
  PyObject *(*__pyx_t_19)(PyObject *);
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  PyObject *__pyx_t_22 = NULL;
  __Pyx_RefNannySetupContext("quicklook", 0);
  __Pyx_INCREF(__pyx_v_pol);
  __Pyx_INCREF(__pyx_v_mlwin);

  /* "kapok/uavsarc.pyx":775
 * 
 *     """
 *     import matplotlib.pyplot as plt             # <<<<<<<<<<<<<<
 * 
 *     # Load the annotation file.
 */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 775, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_n_s__33);
  __Pyx_GIVEREF(__pyx_n_s__33);
  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s__33);
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_matplotlib_pyplot, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 775, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_plt = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "kapok/uavsarc.pyx":778
 * 
 *     # Load the annotation file.
 *     try:             # <<<<<<<<<<<<<<
 *         ann = Ann(infile)
 *     except:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_5);
    /*try:*/ {

      /* "kapok/uavsarc.pyx":779
 *     # Load the annotation file.
 *     try:
 *         ann = Ann(infile)             # <<<<<<<<<<<<<<
 *     except:
 *         print('kapok.uavsar.quicklook | Cannot load UAVSAR annotation file. Aborting.')
 */
      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_Ann); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 779, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_1, function);
        }
      }
      if (!__pyx_t_6) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_infile); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 779, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_1)) {
          PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_v_infile};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 779, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
          PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_v_infile};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 779, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 779, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL;
          __Pyx_INCREF(__pyx_v_infile);
          __Pyx_GIVEREF(__pyx_v_infile);
          PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_v_infile);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 779, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v_ann = __pyx_t_2;
      __pyx_t_2 = 0;

      /* "kapok/uavsarc.pyx":778
 * 
 *     # Load the annotation file.
 *     try:             # <<<<<<<<<<<<<<
 *         ann = Ann(infile)
 *     except:
 */
    }
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    goto __pyx_L10_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "kapok/uavsarc.pyx":780
 *     try:
 *         ann = Ann(infile)
 *     except:             # <<<<<<<<<<<<<<
 *         print('kapok.uavsar.quicklook | Cannot load UAVSAR annotation file. Aborting.')
 *         return
 */
    /*except:*/ {
      __Pyx_AddTraceback("kapok.uavsarc.quicklook", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_1, &__pyx_t_7) < 0) __PYX_ERR(0, 780, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_GOTREF(__pyx_t_7);

      /* "kapok/uavsarc.pyx":781
 *         ann = Ann(infile)
 *     except:
 *         print('kapok.uavsar.quicklook | Cannot load UAVSAR annotation file. Aborting.')             # <<<<<<<<<<<<<<
 *         return
 * 
 */
      __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_tuple__191, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 781, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

      /* "kapok/uavsarc.pyx":782
 *     except:
 *         print('kapok.uavsar.quicklook | Cannot load UAVSAR annotation file. Aborting.')
 *         return             # <<<<<<<<<<<<<<
 * 
 * 
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_r = Py_None; __Pyx_INCREF(Py_None);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L6_except_return;
    }
    __pyx_L5_except_error:;

    /* "kapok/uavsarc.pyx":778
 * 
 *     # Load the annotation file.
 *     try:             # <<<<<<<<<<<<<<
 *         ann = Ann(infile)
 *     except:
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
    goto __pyx_L1_error;
    __pyx_L6_except_return:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
    goto __pyx_L0;
    __pyx_L10_try_end:;
  }

  /* "kapok/uavsarc.pyx":786
 * 
 *     # Get track filenames and number of tracks.
 *     temp = ann.query('stackline1')             # <<<<<<<<<<<<<<
 *     num = 1
 *     if temp is not None:
 */
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_ann, __pyx_n_s_query); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 786, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_tuple__192, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 786, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_v_temp = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "kapok/uavsarc.pyx":787
 *     # Get track filenames and number of tracks.
 *     temp = ann.query('stackline1')
 *     num = 1             # <<<<<<<<<<<<<<
 *     if temp is not None:
 *         tracknames = [temp.split('_L090')[0]]
 */
  __Pyx_INCREF(__pyx_int_1);
  __pyx_v_num = __pyx_int_1;

  /* "kapok/uavsarc.pyx":788
 *     temp = ann.query('stackline1')
 *     num = 1
 *     if temp is not None:             # <<<<<<<<<<<<<<
 *         tracknames = [temp.split('_L090')[0]]
 *         num += 1
 */
  __pyx_t_8 = (__pyx_v_temp != Py_None);
  __pyx_t_9 = (__pyx_t_8 != 0);
  if (__pyx_t_9) {

    /* "kapok/uavsarc.pyx":789
 *     num = 1
 *     if temp is not None:
 *         tracknames = [temp.split('_L090')[0]]             # <<<<<<<<<<<<<<
 *         num += 1
 *         temp = ann.query('stackline'+str(num))
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_temp, __pyx_n_s_split); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 789, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__193, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 789, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_7, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 789, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = PyList_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 789, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_1);
    PyList_SET_ITEM(__pyx_t_7, 0, __pyx_t_1);
    __pyx_t_1 = 0;
    __pyx_v_tracknames = ((PyObject*)__pyx_t_7);
    __pyx_t_7 = 0;

    /* "kapok/uavsarc.pyx":790
 *     if temp is not None:
 *         tracknames = [temp.split('_L090')[0]]
 *         num += 1             # <<<<<<<<<<<<<<
 *         temp = ann.query('stackline'+str(num))
 *         while temp is not None:
 */
    __pyx_t_7 = __Pyx_PyInt_AddObjC(__pyx_v_num, __pyx_int_1, 1, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 790, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF_SET(__pyx_v_num, __pyx_t_7);
    __pyx_t_7 = 0;

    /* "kapok/uavsarc.pyx":791
 *         tracknames = [temp.split('_L090')[0]]
 *         num += 1
 *         temp = ann.query('stackline'+str(num))             # <<<<<<<<<<<<<<
 *         while temp is not None:
 *             tracknames.append(temp.split('_L090')[0])
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_ann, __pyx_n_s_query); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 791, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 791, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_v_num);
    __Pyx_GIVEREF(__pyx_v_num);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_num);
    __pyx_t_6 = __Pyx_PyObject_Call(((PyObject *)(&PyUnicode_Type)), __pyx_t_2, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 791, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyUnicode_Concat(__pyx_n_u_stackline, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 791, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
      }
    }
    if (!__pyx_t_6) {
      __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 791, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_GOTREF(__pyx_t_7);
    } else {
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_1)) {
        PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_2};
        __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 791, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
        PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_2};
        __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 791, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      } else
      #endif
      {
        __pyx_t_10 = PyTuple_New(1+1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 791, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_6); __pyx_t_6 = NULL;
        __Pyx_GIVEREF(__pyx_t_2);
        PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_t_2);
        __pyx_t_2 = 0;
        __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_10, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 791, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      }
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF_SET(__pyx_v_temp, __pyx_t_7);
    __pyx_t_7 = 0;

    /* "kapok/uavsarc.pyx":792
 *         num += 1
 *         temp = ann.query('stackline'+str(num))
 *         while temp is not None:             # <<<<<<<<<<<<<<
 *             tracknames.append(temp.split('_L090')[0])
 *             num += 1
 */
    while (1) {
      __pyx_t_9 = (__pyx_v_temp != Py_None);
      __pyx_t_8 = (__pyx_t_9 != 0);
      if (!__pyx_t_8) break;

      /* "kapok/uavsarc.pyx":793
 *         temp = ann.query('stackline'+str(num))
 *         while temp is not None:
 *             tracknames.append(temp.split('_L090')[0])             # <<<<<<<<<<<<<<
 *             num += 1
 *             temp = ann.query('stackline'+str(num))
 */
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_temp, __pyx_n_s_split); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 793, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_tuple__194, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 793, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 793, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_tracknames, __pyx_t_7); if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(0, 793, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

      /* "kapok/uavsarc.pyx":794
 *         while temp is not None:
 *             tracknames.append(temp.split('_L090')[0])
 *             num += 1             # <<<<<<<<<<<<<<
 *             temp = ann.query('stackline'+str(num))
 *     else:
 */
      __pyx_t_7 = __Pyx_PyInt_AddObjC(__pyx_v_num, __pyx_int_1, 1, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 794, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF_SET(__pyx_v_num, __pyx_t_7);
      __pyx_t_7 = 0;

      /* "kapok/uavsarc.pyx":795
 *             tracknames.append(temp.split('_L090')[0])
 *             num += 1
 *             temp = ann.query('stackline'+str(num))             # <<<<<<<<<<<<<<
 *     else:
 *         print('kapok.uavsar.quicklook | Cannot find track names in UAVSAR annotation file.  Aborting.')
 */
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_ann, __pyx_n_s_query); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 795, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 795, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_INCREF(__pyx_v_num);
      __Pyx_GIVEREF(__pyx_v_num);
      PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_v_num);
      __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)(&PyUnicode_Type)), __pyx_t_10, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 795, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_10 = __Pyx_PyUnicode_Concat(__pyx_n_u_stackline, __pyx_t_2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 795, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __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);
        }
      }
      if (!__pyx_t_2) {
        __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_10); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 795, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_GOTREF(__pyx_t_7);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_1)) {
          PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_t_10};
          __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 795, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
          PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_t_10};
          __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 795, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        } else
        #endif
        {
          __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 795, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2); __pyx_t_2 = NULL;
          __Pyx_GIVEREF(__pyx_t_10);
          PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_10);
          __pyx_t_10 = 0;
          __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 795, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF_SET(__pyx_v_temp, __pyx_t_7);
      __pyx_t_7 = 0;
    }

    /* "kapok/uavsarc.pyx":788
 *     temp = ann.query('stackline1')
 *     num = 1
 *     if temp is not None:             # <<<<<<<<<<<<<<
 *         tracknames = [temp.split('_L090')[0]]
 *         num += 1
 */
    goto __pyx_L13;
  }

  /* "kapok/uavsarc.pyx":797
 *             temp = ann.query('stackline'+str(num))
 *     else:
 *         print('kapok.uavsar.quicklook | Cannot find track names in UAVSAR annotation file.  Aborting.')             # <<<<<<<<<<<<<<
 *         return
 * 
 */
  /*else*/ {
    __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_tuple__195, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 797, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

    /* "kapok/uavsarc.pyx":798
 *     else:
 *         print('kapok.uavsar.quicklook | Cannot find track names in UAVSAR annotation file.  Aborting.')
 *         return             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;
  }
  __pyx_L13:;

  /* "kapok/uavsarc.pyx":802
 * 
 *     # Path containing SLCs and other files (assume in same folder as .ann):
 *     datapath = os.path.dirname(infile)             # <<<<<<<<<<<<<<
 *     if datapath != '':
 *         datapath = datapath + '/'
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 802, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_path); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 802, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_dirname); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 802, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
    }
  }
  if (!__pyx_t_6) {
    __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_infile); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 802, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
  } else {
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_1)) {
      PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_v_infile};
      __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 802, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_GOTREF(__pyx_t_7);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
      PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_v_infile};
      __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 802, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_GOTREF(__pyx_t_7);
    } else
    #endif
    {
      __pyx_t_10 = PyTuple_New(1+1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 802, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_6); __pyx_t_6 = NULL;
      __Pyx_INCREF(__pyx_v_infile);
      __Pyx_GIVEREF(__pyx_v_infile);
      PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_v_infile);
      __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_10, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 802, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_datapath = __pyx_t_7;
  __pyx_t_7 = 0;

  /* "kapok/uavsarc.pyx":803
 *     # Path containing SLCs and other files (assume in same folder as .ann):
 *     datapath = os.path.dirname(infile)
 *     if datapath != '':             # <<<<<<<<<<<<<<
 *         datapath = datapath + '/'
 * 
 */
  __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_v_datapath, __pyx_kp_u__30, Py_NE)); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 803, __pyx_L1_error)
  if (__pyx_t_8) {

    /* "kapok/uavsarc.pyx":804
 *     datapath = os.path.dirname(infile)
 *     if datapath != '':
 *         datapath = datapath + '/'             # <<<<<<<<<<<<<<
 * 
 *     pol = pol.upper()
 */
    __pyx_t_7 = PyNumber_Add(__pyx_v_datapath, __pyx_kp_u__31); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 804, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF_SET(__pyx_v_datapath, __pyx_t_7);
    __pyx_t_7 = 0;

    /* "kapok/uavsarc.pyx":803
 *     # Path containing SLCs and other files (assume in same folder as .ann):
 *     datapath = os.path.dirname(infile)
 *     if datapath != '':             # <<<<<<<<<<<<<<
 *         datapath = datapath + '/'
 * 
 */
  }

  /* "kapok/uavsarc.pyx":806
 *         datapath = datapath + '/'
 * 
 *     pol = pol.upper()             # <<<<<<<<<<<<<<
 * 
 *     # Get filenames and dimensions of SLCs for each segment.
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_pol, __pyx_n_s_upper); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 806, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_10 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_10)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_10);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
    }
  }
  if (__pyx_t_10) {
    __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_10); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 806, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  } else {
    __pyx_t_7 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 806, __pyx_L1_error)
  }
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF_SET(__pyx_v_pol, __pyx_t_7);
  __pyx_t_7 = 0;

  /* "kapok/uavsarc.pyx":809
 * 
 *     # Get filenames and dimensions of SLCs for each segment.
 *     num_segments = ann.query('Number of Segments')             # <<<<<<<<<<<<<<
 * 
 *     slcfiles = []
 */
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_ann, __pyx_n_s_query); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 809, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_tuple__196, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 809, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_v_num_segments = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "kapok/uavsarc.pyx":811
 *     num_segments = ann.query('Number of Segments')
 * 
 *     slcfiles = []             # <<<<<<<<<<<<<<
 *     for seg in range(num_segments):
 *         file = glob(datapath+tracknames[tr]+'*'+pol+'_*_s'+str(seg+1)+'_2x8.slc')
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 811, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_slcfiles = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "kapok/uavsarc.pyx":812
 * 
 *     slcfiles = []
 *     for seg in range(num_segments):             # <<<<<<<<<<<<<<
 *         file = glob(datapath+tracknames[tr]+'*'+pol+'_*_s'+str(seg+1)+'_2x8.slc')
 * 
 */
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 812, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_num_segments);
  __Pyx_GIVEREF(__pyx_v_num_segments);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_num_segments);
  __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_1, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 812, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (likely(PyList_CheckExact(__pyx_t_7)) || PyTuple_CheckExact(__pyx_t_7)) {
    __pyx_t_1 = __pyx_t_7; __Pyx_INCREF(__pyx_t_1); __pyx_t_12 = 0;
    __pyx_t_13 = NULL;
  } else {
    __pyx_t_12 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 812, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_13 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 812, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  for (;;) {
    if (likely(!__pyx_t_13)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_12 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_7 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_12); __Pyx_INCREF(__pyx_t_7); __pyx_t_12++; if (unlikely(0 < 0)) __PYX_ERR(0, 812, __pyx_L1_error)
        #else
        __pyx_t_7 = PySequence_ITEM(__pyx_t_1, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 812, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        #endif
      } else {
        if (__pyx_t_12 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_12); __Pyx_INCREF(__pyx_t_7); __pyx_t_12++; if (unlikely(0 < 0)) __PYX_ERR(0, 812, __pyx_L1_error)
        #else
        __pyx_t_7 = PySequence_ITEM(__pyx_t_1, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 812, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        #endif
      }
    } else {
      __pyx_t_7 = __pyx_t_13(__pyx_t_1);
      if (unlikely(!__pyx_t_7)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 812, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_7);
    }
    __Pyx_XDECREF_SET(__pyx_v_seg, __pyx_t_7);
    __pyx_t_7 = 0;

    /* "kapok/uavsarc.pyx":813
 *     slcfiles = []
 *     for seg in range(num_segments):
 *         file = glob(datapath+tracknames[tr]+'*'+pol+'_*_s'+str(seg+1)+'_2x8.slc')             # <<<<<<<<<<<<<<
 * 
 *         if len(file) == 1:
 */
    __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_glob); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 813, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_6 = PyObject_GetItem(__pyx_v_tracknames, __pyx_v_tr); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 813, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_2 = PyNumber_Add(__pyx_v_datapath, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 813, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = PyNumber_Add(__pyx_t_2, __pyx_kp_u__33); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 813, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = PyNumber_Add(__pyx_t_6, __pyx_v_pol); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 813, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = PyNumber_Add(__pyx_t_2, __pyx_kp_u_s); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 813, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyInt_AddObjC(__pyx_v_seg, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 813, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_14 = PyTuple_New(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 813, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_14);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_2);
    __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)(&PyUnicode_Type)), __pyx_t_14, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 813, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
    __pyx_t_14 = PyNumber_Add(__pyx_t_6, __pyx_t_2); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 813, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_14);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = PyNumber_Add(__pyx_t_14, __pyx_kp_u_2x8_slc); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 813, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
    __pyx_t_14 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_10))) {
      __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_10);
      if (likely(__pyx_t_14)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
        __Pyx_INCREF(__pyx_t_14);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_10, function);
      }
    }
    if (!__pyx_t_14) {
      __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 813, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_GOTREF(__pyx_t_7);
    } else {
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_10)) {
        PyObject *__pyx_temp[2] = {__pyx_t_14, __pyx_t_2};
        __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_10, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 813, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_10)) {
        PyObject *__pyx_temp[2] = {__pyx_t_14, __pyx_t_2};
        __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_10, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 813, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 813, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_GIVEREF(__pyx_t_14); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_14); __pyx_t_14 = NULL;
        __Pyx_GIVEREF(__pyx_t_2);
        PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_2);
        __pyx_t_2 = 0;
        __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_6, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 813, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
    }
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_XDECREF_SET(__pyx_v_file, __pyx_t_7);
    __pyx_t_7 = 0;

    /* "kapok/uavsarc.pyx":815
 *         file = glob(datapath+tracknames[tr]+'*'+pol+'_*_s'+str(seg+1)+'_2x8.slc')
 * 
 *         if len(file) == 1:             # <<<<<<<<<<<<<<
 *             slcfiles.append(file[0])
 *             slcwindow = (8,2)
 */
    __pyx_t_15 = PyObject_Length(__pyx_v_file); if (unlikely(__pyx_t_15 == -1)) __PYX_ERR(0, 815, __pyx_L1_error)
    __pyx_t_8 = ((__pyx_t_15 == 1) != 0);
    if (__pyx_t_8) {

      /* "kapok/uavsarc.pyx":816
 * 
 *         if len(file) == 1:
 *             slcfiles.append(file[0])             # <<<<<<<<<<<<<<
 *             slcwindow = (8,2)
 *             rngsize_slc = ann.query('slc_1_2x8 Columns')
 */
      __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_file, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 816, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_slcfiles, __pyx_t_7); if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(0, 816, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

      /* "kapok/uavsarc.pyx":817
 *         if len(file) == 1:
 *             slcfiles.append(file[0])
 *             slcwindow = (8,2)             # <<<<<<<<<<<<<<
 *             rngsize_slc = ann.query('slc_1_2x8 Columns')
 *             if num_segments > 1:
 */
      __Pyx_INCREF(__pyx_tuple__197);
      __Pyx_XDECREF_SET(__pyx_v_slcwindow, __pyx_tuple__197);

      /* "kapok/uavsarc.pyx":818
 *             slcfiles.append(file[0])
 *             slcwindow = (8,2)
 *             rngsize_slc = ann.query('slc_1_2x8 Columns')             # <<<<<<<<<<<<<<
 *             if num_segments > 1:
 *                 azsize_slc = np.zeros(num_segments,dtype='int32')
 */
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_ann, __pyx_n_s_query); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 818, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_tuple__198, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 818, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_XDECREF_SET(__pyx_v_rngsize_slc, __pyx_t_10);
      __pyx_t_10 = 0;

      /* "kapok/uavsarc.pyx":819
 *             slcwindow = (8,2)
 *             rngsize_slc = ann.query('slc_1_2x8 Columns')
 *             if num_segments > 1:             # <<<<<<<<<<<<<<
 *                 azsize_slc = np.zeros(num_segments,dtype='int32')
 *                 for n in range(num_segments):
 */
      __pyx_t_10 = PyObject_RichCompare(__pyx_v_num_segments, __pyx_int_1, Py_GT); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 819, __pyx_L1_error)
      __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 819, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      if (__pyx_t_8) {

        /* "kapok/uavsarc.pyx":820
 *             rngsize_slc = ann.query('slc_1_2x8 Columns')
 *             if num_segments > 1:
 *                 azsize_slc = np.zeros(num_segments,dtype='int32')             # <<<<<<<<<<<<<<
 *                 for n in range(num_segments):
 *                     azsize_slc[n] = ann.query('slc_'+str(n+1)+'_2x8 Rows')
 */
        __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 820, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_zeros); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 820, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 820, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        __Pyx_INCREF(__pyx_v_num_segments);
        __Pyx_GIVEREF(__pyx_v_num_segments);
        PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_v_num_segments);
        __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 820, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_n_u_int32) < 0) __PYX_ERR(0, 820, __pyx_L1_error)
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_10, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 820, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_XDECREF_SET(__pyx_v_azsize_slc, __pyx_t_2);
        __pyx_t_2 = 0;

        /* "kapok/uavsarc.pyx":821
 *             if num_segments > 1:
 *                 azsize_slc = np.zeros(num_segments,dtype='int32')
 *                 for n in range(num_segments):             # <<<<<<<<<<<<<<
 *                     azsize_slc[n] = ann.query('slc_'+str(n+1)+'_2x8 Rows')
 *             else:
 */
        __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 821, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_INCREF(__pyx_v_num_segments);
        __Pyx_GIVEREF(__pyx_v_num_segments);
        PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_num_segments);
        __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_2, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 821, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        if (likely(PyList_CheckExact(__pyx_t_6)) || PyTuple_CheckExact(__pyx_t_6)) {
          __pyx_t_2 = __pyx_t_6; __Pyx_INCREF(__pyx_t_2); __pyx_t_15 = 0;
          __pyx_t_16 = NULL;
        } else {
          __pyx_t_15 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 821, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_16 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 821, __pyx_L1_error)
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        for (;;) {
          if (likely(!__pyx_t_16)) {
            if (likely(PyList_CheckExact(__pyx_t_2))) {
              if (__pyx_t_15 >= PyList_GET_SIZE(__pyx_t_2)) break;
              #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
              __pyx_t_6 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_15); __Pyx_INCREF(__pyx_t_6); __pyx_t_15++; if (unlikely(0 < 0)) __PYX_ERR(0, 821, __pyx_L1_error)
              #else
              __pyx_t_6 = PySequence_ITEM(__pyx_t_2, __pyx_t_15); __pyx_t_15++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 821, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_6);
              #endif
            } else {
              if (__pyx_t_15 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
              #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
              __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_15); __Pyx_INCREF(__pyx_t_6); __pyx_t_15++; if (unlikely(0 < 0)) __PYX_ERR(0, 821, __pyx_L1_error)
              #else
              __pyx_t_6 = PySequence_ITEM(__pyx_t_2, __pyx_t_15); __pyx_t_15++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 821, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_6);
              #endif
            }
          } else {
            __pyx_t_6 = __pyx_t_16(__pyx_t_2);
            if (unlikely(!__pyx_t_6)) {
              PyObject* exc_type = PyErr_Occurred();
              if (exc_type) {
                if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
                else __PYX_ERR(0, 821, __pyx_L1_error)
              }
              break;
            }
            __Pyx_GOTREF(__pyx_t_6);
          }
          __Pyx_XDECREF_SET(__pyx_v_n, __pyx_t_6);
          __pyx_t_6 = 0;

          /* "kapok/uavsarc.pyx":822
 *                 azsize_slc = np.zeros(num_segments,dtype='int32')
 *                 for n in range(num_segments):
 *                     azsize_slc[n] = ann.query('slc_'+str(n+1)+'_2x8 Rows')             # <<<<<<<<<<<<<<
 *             else:
 *                 azsize_slc = ann.query('slc_1_8x2 Rows')
 */
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_ann, __pyx_n_s_query); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 822, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_7 = __Pyx_PyInt_AddObjC(__pyx_v_n, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 822, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
          __pyx_t_14 = PyTuple_New(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 822, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_14);
          __Pyx_GIVEREF(__pyx_t_7);
          PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_7);
          __pyx_t_7 = 0;
          __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)(&PyUnicode_Type)), __pyx_t_14, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 822, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
          __pyx_t_14 = __Pyx_PyUnicode_Concat(__pyx_n_u_slc, __pyx_t_7); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 822, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_14);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __pyx_t_7 = __Pyx_PyUnicode_Concat(__pyx_t_14, __pyx_kp_u_2x8_Rows); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 822, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
          __pyx_t_14 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_10))) {
            __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_10);
            if (likely(__pyx_t_14)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
              __Pyx_INCREF(__pyx_t_14);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_10, function);
            }
          }
          if (!__pyx_t_14) {
            __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 822, __pyx_L1_error)
            __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_GOTREF(__pyx_t_6);
          } else {
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_10)) {
              PyObject *__pyx_temp[2] = {__pyx_t_14, __pyx_t_7};
              __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_10, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 822, __pyx_L1_error)
              __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
              __Pyx_GOTREF(__pyx_t_6);
              __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_10)) {
              PyObject *__pyx_temp[2] = {__pyx_t_14, __pyx_t_7};
              __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_10, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 822, __pyx_L1_error)
              __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
              __Pyx_GOTREF(__pyx_t_6);
              __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
            } else
            #endif
            {
              __pyx_t_17 = PyTuple_New(1+1); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 822, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_17);
              __Pyx_GIVEREF(__pyx_t_14); PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_t_14); __pyx_t_14 = NULL;
              __Pyx_GIVEREF(__pyx_t_7);
              PyTuple_SET_ITEM(__pyx_t_17, 0+1, __pyx_t_7);
              __pyx_t_7 = 0;
              __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_17, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 822, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_6);
              __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          if (unlikely(PyObject_SetItem(__pyx_v_azsize_slc, __pyx_v_n, __pyx_t_6) < 0)) __PYX_ERR(0, 822, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

          /* "kapok/uavsarc.pyx":821
 *             if num_segments > 1:
 *                 azsize_slc = np.zeros(num_segments,dtype='int32')
 *                 for n in range(num_segments):             # <<<<<<<<<<<<<<
 *                     azsize_slc[n] = ann.query('slc_'+str(n+1)+'_2x8 Rows')
 *             else:
 */
        }
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

        /* "kapok/uavsarc.pyx":819
 *             slcwindow = (8,2)
 *             rngsize_slc = ann.query('slc_1_2x8 Columns')
 *             if num_segments > 1:             # <<<<<<<<<<<<<<
 *                 azsize_slc = np.zeros(num_segments,dtype='int32')
 *                 for n in range(num_segments):
 */
        goto __pyx_L20;
      }

      /* "kapok/uavsarc.pyx":824
 *                     azsize_slc[n] = ann.query('slc_'+str(n+1)+'_2x8 Rows')
 *             else:
 *                 azsize_slc = ann.query('slc_1_8x2 Rows')             # <<<<<<<<<<<<<<
 *         elif len(file) > 1:
 *             print('kapok.uavsar.quicklook | Too many SLC files matching pattern: "'+datapath+tracknames[tr]+'*_'+pol+'_*_2x8.slc'+'".  Aborting.')
 */
      /*else*/ {
        __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_ann, __pyx_n_s_query); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 824, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__199, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 824, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_XDECREF_SET(__pyx_v_azsize_slc, __pyx_t_6);
        __pyx_t_6 = 0;
      }
      __pyx_L20:;

      /* "kapok/uavsarc.pyx":815
 *         file = glob(datapath+tracknames[tr]+'*'+pol+'_*_s'+str(seg+1)+'_2x8.slc')
 * 
 *         if len(file) == 1:             # <<<<<<<<<<<<<<
 *             slcfiles.append(file[0])
 *             slcwindow = (8,2)
 */
      goto __pyx_L19;
    }

    /* "kapok/uavsarc.pyx":825
 *             else:
 *                 azsize_slc = ann.query('slc_1_8x2 Rows')
 *         elif len(file) > 1:             # <<<<<<<<<<<<<<
 *             print('kapok.uavsar.quicklook | Too many SLC files matching pattern: "'+datapath+tracknames[tr]+'*_'+pol+'_*_2x8.slc'+'".  Aborting.')
 *             return
 */
    __pyx_t_15 = PyObject_Length(__pyx_v_file); if (unlikely(__pyx_t_15 == -1)) __PYX_ERR(0, 825, __pyx_L1_error)
    __pyx_t_8 = ((__pyx_t_15 > 1) != 0);
    if (__pyx_t_8) {

      /* "kapok/uavsarc.pyx":826
 *                 azsize_slc = ann.query('slc_1_8x2 Rows')
 *         elif len(file) > 1:
 *             print('kapok.uavsar.quicklook | Too many SLC files matching pattern: "'+datapath+tracknames[tr]+'*_'+pol+'_*_2x8.slc'+'".  Aborting.')             # <<<<<<<<<<<<<<
 *             return
 *         else:
 */
      __pyx_t_6 = PyNumber_Add(__pyx_kp_u_kapok_uavsar_quicklook_Too_many, __pyx_v_datapath); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 826, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_2 = PyObject_GetItem(__pyx_v_tracknames, __pyx_v_tr); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 826, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_10 = PyNumber_Add(__pyx_t_6, __pyx_t_2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 826, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = PyNumber_Add(__pyx_t_10, __pyx_kp_u__34); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 826, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_10 = PyNumber_Add(__pyx_t_2, __pyx_v_pol); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 826, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = PyNumber_Add(__pyx_t_10, __pyx_kp_u_2x8_slc_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 826, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_10 = PyNumber_Add(__pyx_t_2, __pyx_kp_u_Aborting); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 826, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 826, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_10);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_10);
      __pyx_t_10 = 0;
      __pyx_t_10 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_t_2, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 826, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

      /* "kapok/uavsarc.pyx":827
 *         elif len(file) > 1:
 *             print('kapok.uavsar.quicklook | Too many SLC files matching pattern: "'+datapath+tracknames[tr]+'*_'+pol+'_*_2x8.slc'+'".  Aborting.')
 *             return             # <<<<<<<<<<<<<<
 *         else:
 *             file = glob(datapath+tracknames[tr]+'*'+pol+'_*_s'+str(seg+1)+'_4x1.slc')
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_r = Py_None; __Pyx_INCREF(Py_None);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;

      /* "kapok/uavsarc.pyx":825
 *             else:
 *                 azsize_slc = ann.query('slc_1_8x2 Rows')
 *         elif len(file) > 1:             # <<<<<<<<<<<<<<
 *             print('kapok.uavsar.quicklook | Too many SLC files matching pattern: "'+datapath+tracknames[tr]+'*_'+pol+'_*_2x8.slc'+'".  Aborting.')
 *             return
 */
    }

    /* "kapok/uavsarc.pyx":829
 *             return
 *         else:
 *             file = glob(datapath+tracknames[tr]+'*'+pol+'_*_s'+str(seg+1)+'_4x1.slc')             # <<<<<<<<<<<<<<
 * 
 *             if len(file) == 1:
 */
    /*else*/ {
      __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_glob); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 829, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_6 = PyObject_GetItem(__pyx_v_tracknames, __pyx_v_tr); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 829, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_17 = PyNumber_Add(__pyx_v_datapath, __pyx_t_6); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 829, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_17);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = PyNumber_Add(__pyx_t_17, __pyx_kp_u__33); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 829, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
      __pyx_t_17 = PyNumber_Add(__pyx_t_6, __pyx_v_pol); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 829, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_17);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = PyNumber_Add(__pyx_t_17, __pyx_kp_u_s); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 829, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
      __pyx_t_17 = __Pyx_PyInt_AddObjC(__pyx_v_seg, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 829, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_17);
      __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 829, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_17);
      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_17);
      __pyx_t_17 = 0;
      __pyx_t_17 = __Pyx_PyObject_Call(((PyObject *)(&PyUnicode_Type)), __pyx_t_7, NULL); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 829, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_17);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = PyNumber_Add(__pyx_t_6, __pyx_t_17); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 829, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
      __pyx_t_17 = PyNumber_Add(__pyx_t_7, __pyx_kp_u_4x1_slc); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 829, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_17);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
        __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_2);
        if (likely(__pyx_t_7)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
          __Pyx_INCREF(__pyx_t_7);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_2, function);
        }
      }
      if (!__pyx_t_7) {
        __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_17); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 829, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
        __Pyx_GOTREF(__pyx_t_10);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_2)) {
          PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_17};
          __pyx_t_10 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 829, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
          PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_17};
          __pyx_t_10 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 829, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
        } else
        #endif
        {
          __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 829, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_7); __pyx_t_7 = NULL;
          __Pyx_GIVEREF(__pyx_t_17);
          PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_17);
          __pyx_t_17 = 0;
          __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 829, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF_SET(__pyx_v_file, __pyx_t_10);
      __pyx_t_10 = 0;

      /* "kapok/uavsarc.pyx":831
 *             file = glob(datapath+tracknames[tr]+'*'+pol+'_*_s'+str(seg+1)+'_4x1.slc')
 * 
 *             if len(file) == 1:             # <<<<<<<<<<<<<<
 *                 slcfiles.append(file[0])
 *                 slcwindow = (4,1)
 */
      __pyx_t_15 = PyObject_Length(__pyx_v_file); if (unlikely(__pyx_t_15 == -1)) __PYX_ERR(0, 831, __pyx_L1_error)
      __pyx_t_8 = ((__pyx_t_15 == 1) != 0);
      if (__pyx_t_8) {

        /* "kapok/uavsarc.pyx":832
 * 
 *             if len(file) == 1:
 *                 slcfiles.append(file[0])             # <<<<<<<<<<<<<<
 *                 slcwindow = (4,1)
 *                 rngsize_slc = ann.query('slc_1_1x4 Columns')
 */
        __pyx_t_10 = __Pyx_GetItemInt(__pyx_v_file, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 832, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_slcfiles, __pyx_t_10); if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(0, 832, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

        /* "kapok/uavsarc.pyx":833
 *             if len(file) == 1:
 *                 slcfiles.append(file[0])
 *                 slcwindow = (4,1)             # <<<<<<<<<<<<<<
 *                 rngsize_slc = ann.query('slc_1_1x4 Columns')
 *                 if num_segments > 1:
 */
        __Pyx_INCREF(__pyx_tuple__200);
        __Pyx_XDECREF_SET(__pyx_v_slcwindow, __pyx_tuple__200);

        /* "kapok/uavsarc.pyx":834
 *                 slcfiles.append(file[0])
 *                 slcwindow = (4,1)
 *                 rngsize_slc = ann.query('slc_1_1x4 Columns')             # <<<<<<<<<<<<<<
 *                 if num_segments > 1:
 *                     azsize_slc = np.zeros(num_segments,dtype='int32')
 */
        __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_ann, __pyx_n_s_query); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 834, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_tuple__201, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 834, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_XDECREF_SET(__pyx_v_rngsize_slc, __pyx_t_2);
        __pyx_t_2 = 0;

        /* "kapok/uavsarc.pyx":835
 *                 slcwindow = (4,1)
 *                 rngsize_slc = ann.query('slc_1_1x4 Columns')
 *                 if num_segments > 1:             # <<<<<<<<<<<<<<
 *                     azsize_slc = np.zeros(num_segments,dtype='int32')
 *                     for n in range(num_segments):
 */
        __pyx_t_2 = PyObject_RichCompare(__pyx_v_num_segments, __pyx_int_1, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 835, __pyx_L1_error)
        __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 835, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        if (__pyx_t_8) {

          /* "kapok/uavsarc.pyx":836
 *                 rngsize_slc = ann.query('slc_1_1x4 Columns')
 *                 if num_segments > 1:
 *                     azsize_slc = np.zeros(num_segments,dtype='int32')             # <<<<<<<<<<<<<<
 *                     for n in range(num_segments):
 *                         azsize_slc[n] = ann.query('slc_'+str(n+1)+'_1x4 Rows')
 */
          __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 836, __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, 836, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 836, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_INCREF(__pyx_v_num_segments);
          __Pyx_GIVEREF(__pyx_v_num_segments);
          PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_num_segments);
          __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 836, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_n_u_int32) < 0) __PYX_ERR(0, 836, __pyx_L1_error)
          __pyx_t_17 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_2, __pyx_t_6); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 836, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_17);
          __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;
          __Pyx_XDECREF_SET(__pyx_v_azsize_slc, __pyx_t_17);
          __pyx_t_17 = 0;

          /* "kapok/uavsarc.pyx":837
 *                 if num_segments > 1:
 *                     azsize_slc = np.zeros(num_segments,dtype='int32')
 *                     for n in range(num_segments):             # <<<<<<<<<<<<<<
 *                         azsize_slc[n] = ann.query('slc_'+str(n+1)+'_1x4 Rows')
 *                 else:
 */
          __pyx_t_17 = PyTuple_New(1); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 837, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_17);
          __Pyx_INCREF(__pyx_v_num_segments);
          __Pyx_GIVEREF(__pyx_v_num_segments);
          PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_v_num_segments);
          __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_17, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 837, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
          if (likely(PyList_CheckExact(__pyx_t_6)) || PyTuple_CheckExact(__pyx_t_6)) {
            __pyx_t_17 = __pyx_t_6; __Pyx_INCREF(__pyx_t_17); __pyx_t_15 = 0;
            __pyx_t_16 = NULL;
          } else {
            __pyx_t_15 = -1; __pyx_t_17 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 837, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_17);
            __pyx_t_16 = Py_TYPE(__pyx_t_17)->tp_iternext; if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 837, __pyx_L1_error)
          }
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          for (;;) {
            if (likely(!__pyx_t_16)) {
              if (likely(PyList_CheckExact(__pyx_t_17))) {
                if (__pyx_t_15 >= PyList_GET_SIZE(__pyx_t_17)) break;
                #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
                __pyx_t_6 = PyList_GET_ITEM(__pyx_t_17, __pyx_t_15); __Pyx_INCREF(__pyx_t_6); __pyx_t_15++; if (unlikely(0 < 0)) __PYX_ERR(0, 837, __pyx_L1_error)
                #else
                __pyx_t_6 = PySequence_ITEM(__pyx_t_17, __pyx_t_15); __pyx_t_15++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 837, __pyx_L1_error)
                __Pyx_GOTREF(__pyx_t_6);
                #endif
              } else {
                if (__pyx_t_15 >= PyTuple_GET_SIZE(__pyx_t_17)) break;
                #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
                __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_17, __pyx_t_15); __Pyx_INCREF(__pyx_t_6); __pyx_t_15++; if (unlikely(0 < 0)) __PYX_ERR(0, 837, __pyx_L1_error)
                #else
                __pyx_t_6 = PySequence_ITEM(__pyx_t_17, __pyx_t_15); __pyx_t_15++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 837, __pyx_L1_error)
                __Pyx_GOTREF(__pyx_t_6);
                #endif
              }
            } else {
              __pyx_t_6 = __pyx_t_16(__pyx_t_17);
              if (unlikely(!__pyx_t_6)) {
                PyObject* exc_type = PyErr_Occurred();
                if (exc_type) {
                  if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
                  else __PYX_ERR(0, 837, __pyx_L1_error)
                }
                break;
              }
              __Pyx_GOTREF(__pyx_t_6);
            }
            __Pyx_XDECREF_SET(__pyx_v_n, __pyx_t_6);
            __pyx_t_6 = 0;

            /* "kapok/uavsarc.pyx":838
 *                     azsize_slc = np.zeros(num_segments,dtype='int32')
 *                     for n in range(num_segments):
 *                         azsize_slc[n] = ann.query('slc_'+str(n+1)+'_1x4 Rows')             # <<<<<<<<<<<<<<
 *                 else:
 *                     azsize_slc = ann.query('slc_1_1x4 Rows')
 */
            __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_ann, __pyx_n_s_query); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 838, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_2);
            __pyx_t_10 = __Pyx_PyInt_AddObjC(__pyx_v_n, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 838, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_10);
            __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 838, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_7);
            __Pyx_GIVEREF(__pyx_t_10);
            PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_10);
            __pyx_t_10 = 0;
            __pyx_t_10 = __Pyx_PyObject_Call(((PyObject *)(&PyUnicode_Type)), __pyx_t_7, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 838, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_10);
            __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
            __pyx_t_7 = __Pyx_PyUnicode_Concat(__pyx_n_u_slc, __pyx_t_10); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 838, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_7);
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __pyx_t_10 = __Pyx_PyUnicode_Concat(__pyx_t_7, __pyx_kp_u_1x4_Rows); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 838, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_10);
            __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
            __pyx_t_7 = NULL;
            if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
              __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_2);
              if (likely(__pyx_t_7)) {
                PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
                __Pyx_INCREF(__pyx_t_7);
                __Pyx_INCREF(function);
                __Pyx_DECREF_SET(__pyx_t_2, function);
              }
            }
            if (!__pyx_t_7) {
              __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_10); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 838, __pyx_L1_error)
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
              __Pyx_GOTREF(__pyx_t_6);
            } else {
              #if CYTHON_FAST_PYCALL
              if (PyFunction_Check(__pyx_t_2)) {
                PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_10};
                __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 838, __pyx_L1_error)
                __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
                __Pyx_GOTREF(__pyx_t_6);
                __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
              } else
              #endif
              #if CYTHON_FAST_PYCCALL
              if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
                PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_10};
                __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 838, __pyx_L1_error)
                __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
                __Pyx_GOTREF(__pyx_t_6);
                __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
              } else
              #endif
              {
                __pyx_t_14 = PyTuple_New(1+1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 838, __pyx_L1_error)
                __Pyx_GOTREF(__pyx_t_14);
                __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_7); __pyx_t_7 = NULL;
                __Pyx_GIVEREF(__pyx_t_10);
                PyTuple_SET_ITEM(__pyx_t_14, 0+1, __pyx_t_10);
                __pyx_t_10 = 0;
                __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_14, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 838, __pyx_L1_error)
                __Pyx_GOTREF(__pyx_t_6);
                __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
              }
            }
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            if (unlikely(PyObject_SetItem(__pyx_v_azsize_slc, __pyx_v_n, __pyx_t_6) < 0)) __PYX_ERR(0, 838, __pyx_L1_error)
            __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

            /* "kapok/uavsarc.pyx":837
 *                 if num_segments > 1:
 *                     azsize_slc = np.zeros(num_segments,dtype='int32')
 *                     for n in range(num_segments):             # <<<<<<<<<<<<<<
 *                         azsize_slc[n] = ann.query('slc_'+str(n+1)+'_1x4 Rows')
 *                 else:
 */
          }
          __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

          /* "kapok/uavsarc.pyx":835
 *                 slcwindow = (4,1)
 *                 rngsize_slc = ann.query('slc_1_1x4 Columns')
 *                 if num_segments > 1:             # <<<<<<<<<<<<<<
 *                     azsize_slc = np.zeros(num_segments,dtype='int32')
 *                     for n in range(num_segments):
 */
          goto __pyx_L24;
        }

        /* "kapok/uavsarc.pyx":840
 *                         azsize_slc[n] = ann.query('slc_'+str(n+1)+'_1x4 Rows')
 *                 else:
 *                     azsize_slc = ann.query('slc_1_1x4 Rows')             # <<<<<<<<<<<<<<
 *             elif len(file) > 1:
 *                 print('kapok.uavsar.quicklook | Too many SLC files matching pattern: "'+datapath+tracknames[tr]+'*_'+pol+'_*_1x4.slc'+'".  Aborting.')
 */
        /*else*/ {
          __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_v_ann, __pyx_n_s_query); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 840, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_17);
          __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_17, __pyx_tuple__202, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 840, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
          __Pyx_XDECREF_SET(__pyx_v_azsize_slc, __pyx_t_6);
          __pyx_t_6 = 0;
        }
        __pyx_L24:;

        /* "kapok/uavsarc.pyx":831
 *             file = glob(datapath+tracknames[tr]+'*'+pol+'_*_s'+str(seg+1)+'_4x1.slc')
 * 
 *             if len(file) == 1:             # <<<<<<<<<<<<<<
 *                 slcfiles.append(file[0])
 *                 slcwindow = (4,1)
 */
        goto __pyx_L23;
      }

      /* "kapok/uavsarc.pyx":841
 *                 else:
 *                     azsize_slc = ann.query('slc_1_1x4 Rows')
 *             elif len(file) > 1:             # <<<<<<<<<<<<<<
 *                 print('kapok.uavsar.quicklook | Too many SLC files matching pattern: "'+datapath+tracknames[tr]+'*_'+pol+'_*_1x4.slc'+'".  Aborting.')
 *                 return
 */
      __pyx_t_15 = PyObject_Length(__pyx_v_file); if (unlikely(__pyx_t_15 == -1)) __PYX_ERR(0, 841, __pyx_L1_error)
      __pyx_t_8 = ((__pyx_t_15 > 1) != 0);
      if (__pyx_t_8) {

        /* "kapok/uavsarc.pyx":842
 *                     azsize_slc = ann.query('slc_1_1x4 Rows')
 *             elif len(file) > 1:
 *                 print('kapok.uavsar.quicklook | Too many SLC files matching pattern: "'+datapath+tracknames[tr]+'*_'+pol+'_*_1x4.slc'+'".  Aborting.')             # <<<<<<<<<<<<<<
 *                 return
 *             else:
 */
        __pyx_t_6 = PyNumber_Add(__pyx_kp_u_kapok_uavsar_quicklook_Too_many, __pyx_v_datapath); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 842, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_17 = PyObject_GetItem(__pyx_v_tracknames, __pyx_v_tr); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 842, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_17);
        __pyx_t_2 = PyNumber_Add(__pyx_t_6, __pyx_t_17); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 842, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
        __pyx_t_17 = PyNumber_Add(__pyx_t_2, __pyx_kp_u__34); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 842, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_17);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_t_2 = PyNumber_Add(__pyx_t_17, __pyx_v_pol); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 842, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
        __pyx_t_17 = PyNumber_Add(__pyx_t_2, __pyx_kp_u_1x4_slc); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 842, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_17);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_t_2 = PyNumber_Add(__pyx_t_17, __pyx_kp_u_Aborting); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 842, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
        __pyx_t_17 = PyTuple_New(1); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 842, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_17);
        __Pyx_GIVEREF(__pyx_t_2);
        PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_t_2);
        __pyx_t_2 = 0;
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_t_17, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 842, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

        /* "kapok/uavsarc.pyx":843
 *             elif len(file) > 1:
 *                 print('kapok.uavsar.quicklook | Too many SLC files matching pattern: "'+datapath+tracknames[tr]+'*_'+pol+'_*_1x4.slc'+'".  Aborting.')
 *                 return             # <<<<<<<<<<<<<<
 *             else:
 *                 file = glob(datapath+tracknames[tr]+'*'+pol+'_*_s'+str(seg+1)+'_1x1.slc')
 */
        __Pyx_XDECREF(__pyx_r);
        __pyx_r = Py_None; __Pyx_INCREF(Py_None);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;

        /* "kapok/uavsarc.pyx":841
 *                 else:
 *                     azsize_slc = ann.query('slc_1_1x4 Rows')
 *             elif len(file) > 1:             # <<<<<<<<<<<<<<
 *                 print('kapok.uavsar.quicklook | Too many SLC files matching pattern: "'+datapath+tracknames[tr]+'*_'+pol+'_*_1x4.slc'+'".  Aborting.')
 *                 return
 */
      }

      /* "kapok/uavsarc.pyx":845
 *                 return
 *             else:
 *                 file = glob(datapath+tracknames[tr]+'*'+pol+'_*_s'+str(seg+1)+'_1x1.slc')             # <<<<<<<<<<<<<<
 * 
 *                 if len(file) == 1:
 */
      /*else*/ {
        __pyx_t_17 = __Pyx_GetModuleGlobalName(__pyx_n_s_glob); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 845, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_17);
        __pyx_t_6 = PyObject_GetItem(__pyx_v_tracknames, __pyx_v_tr); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 845, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_14 = PyNumber_Add(__pyx_v_datapath, __pyx_t_6); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 845, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_14);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_6 = PyNumber_Add(__pyx_t_14, __pyx_kp_u__33); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 845, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
        __pyx_t_14 = PyNumber_Add(__pyx_t_6, __pyx_v_pol); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 845, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_14);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_6 = PyNumber_Add(__pyx_t_14, __pyx_kp_u_s); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 845, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
        __pyx_t_14 = __Pyx_PyInt_AddObjC(__pyx_v_seg, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 845, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_14);
        __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 845, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        __Pyx_GIVEREF(__pyx_t_14);
        PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_14);
        __pyx_t_14 = 0;
        __pyx_t_14 = __Pyx_PyObject_Call(((PyObject *)(&PyUnicode_Type)), __pyx_t_10, NULL); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 845, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_14);
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __pyx_t_10 = PyNumber_Add(__pyx_t_6, __pyx_t_14); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 845, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
        __pyx_t_14 = PyNumber_Add(__pyx_t_10, __pyx_kp_u_1x1_slc); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 845, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_14);
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __pyx_t_10 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_17))) {
          __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_17);
          if (likely(__pyx_t_10)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_17);
            __Pyx_INCREF(__pyx_t_10);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_17, function);
          }
        }
        if (!__pyx_t_10) {
          __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_17, __pyx_t_14); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 845, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else {
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_17)) {
            PyObject *__pyx_temp[2] = {__pyx_t_10, __pyx_t_14};
            __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_17, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 845, __pyx_L1_error)
            __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_2);
            __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_17)) {
            PyObject *__pyx_temp[2] = {__pyx_t_10, __pyx_t_14};
            __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_17, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 845, __pyx_L1_error)
            __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_2);
            __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
          } else
          #endif
          {
            __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 845, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_6);
            __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_10); __pyx_t_10 = NULL;
            __Pyx_GIVEREF(__pyx_t_14);
            PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_14);
            __pyx_t_14 = 0;
            __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_17, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 845, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_2);
            __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          }
        }
        __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
        __Pyx_DECREF_SET(__pyx_v_file, __pyx_t_2);
        __pyx_t_2 = 0;

        /* "kapok/uavsarc.pyx":847
 *                 file = glob(datapath+tracknames[tr]+'*'+pol+'_*_s'+str(seg+1)+'_1x1.slc')
 * 
 *                 if len(file) == 1:             # <<<<<<<<<<<<<<
 *                     slcfiles.append(file[0])
 *                     slcwindow = (1,1)
 */
        __pyx_t_15 = PyObject_Length(__pyx_v_file); if (unlikely(__pyx_t_15 == -1)) __PYX_ERR(0, 847, __pyx_L1_error)
        __pyx_t_8 = ((__pyx_t_15 == 1) != 0);
        if (__pyx_t_8) {

          /* "kapok/uavsarc.pyx":848
 * 
 *                 if len(file) == 1:
 *                     slcfiles.append(file[0])             # <<<<<<<<<<<<<<
 *                     slcwindow = (1,1)
 *                     rngsize_slc = ann.query('slc_1_1x1 Columns')
 */
          __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_file, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 848, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_slcfiles, __pyx_t_2); if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(0, 848, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

          /* "kapok/uavsarc.pyx":849
 *                 if len(file) == 1:
 *                     slcfiles.append(file[0])
 *                     slcwindow = (1,1)             # <<<<<<<<<<<<<<
 *                     rngsize_slc = ann.query('slc_1_1x1 Columns')
 *                     if num_segments > 1:
 */
          __Pyx_INCREF(__pyx_tuple__203);
          __Pyx_XDECREF_SET(__pyx_v_slcwindow, __pyx_tuple__203);

          /* "kapok/uavsarc.pyx":850
 *                     slcfiles.append(file[0])
 *                     slcwindow = (1,1)
 *                     rngsize_slc = ann.query('slc_1_1x1 Columns')             # <<<<<<<<<<<<<<
 *                     if num_segments > 1:
 *                         azsize_slc = np.zeros(num_segments,dtype='int32')
 */
          __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_ann, __pyx_n_s_query); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 850, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_17 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__204, NULL); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 850, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_17);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_XDECREF_SET(__pyx_v_rngsize_slc, __pyx_t_17);
          __pyx_t_17 = 0;

          /* "kapok/uavsarc.pyx":851
 *                     slcwindow = (1,1)
 *                     rngsize_slc = ann.query('slc_1_1x1 Columns')
 *                     if num_segments > 1:             # <<<<<<<<<<<<<<
 *                         azsize_slc = np.zeros(num_segments,dtype='int32')
 *                         for n in range(num_segments):
 */
          __pyx_t_17 = PyObject_RichCompare(__pyx_v_num_segments, __pyx_int_1, Py_GT); __Pyx_XGOTREF(__pyx_t_17); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 851, __pyx_L1_error)
          __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_17); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 851, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
          if (__pyx_t_8) {

            /* "kapok/uavsarc.pyx":852
 *                     rngsize_slc = ann.query('slc_1_1x1 Columns')
 *                     if num_segments > 1:
 *                         azsize_slc = np.zeros(num_segments,dtype='int32')             # <<<<<<<<<<<<<<
 *                         for n in range(num_segments):
 *                             azsize_slc[n] = ann.query('slc_'+str(n+1)+'_1x1 Rows')
 */
            __pyx_t_17 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 852, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_17);
            __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_17, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 852, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_2);
            __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
            __pyx_t_17 = PyTuple_New(1); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 852, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_17);
            __Pyx_INCREF(__pyx_v_num_segments);
            __Pyx_GIVEREF(__pyx_v_num_segments);
            PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_v_num_segments);
            __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 852, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_6);
            if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_n_u_int32) < 0) __PYX_ERR(0, 852, __pyx_L1_error)
            __pyx_t_14 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_17, __pyx_t_6); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 852, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_14);
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
            __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
            __Pyx_XDECREF_SET(__pyx_v_azsize_slc, __pyx_t_14);
            __pyx_t_14 = 0;

            /* "kapok/uavsarc.pyx":853
 *                     if num_segments > 1:
 *                         azsize_slc = np.zeros(num_segments,dtype='int32')
 *                         for n in range(num_segments):             # <<<<<<<<<<<<<<
 *                             azsize_slc[n] = ann.query('slc_'+str(n+1)+'_1x1 Rows')
 *                     else:
 */
            __pyx_t_14 = PyTuple_New(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 853, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_14);
            __Pyx_INCREF(__pyx_v_num_segments);
            __Pyx_GIVEREF(__pyx_v_num_segments);
            PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_v_num_segments);
            __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_14, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 853, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_6);
            __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
            if (likely(PyList_CheckExact(__pyx_t_6)) || PyTuple_CheckExact(__pyx_t_6)) {
              __pyx_t_14 = __pyx_t_6; __Pyx_INCREF(__pyx_t_14); __pyx_t_15 = 0;
              __pyx_t_16 = NULL;
            } else {
              __pyx_t_15 = -1; __pyx_t_14 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 853, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_14);
              __pyx_t_16 = Py_TYPE(__pyx_t_14)->tp_iternext; if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 853, __pyx_L1_error)
            }
            __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
            for (;;) {
              if (likely(!__pyx_t_16)) {
                if (likely(PyList_CheckExact(__pyx_t_14))) {
                  if (__pyx_t_15 >= PyList_GET_SIZE(__pyx_t_14)) break;
                  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
                  __pyx_t_6 = PyList_GET_ITEM(__pyx_t_14, __pyx_t_15); __Pyx_INCREF(__pyx_t_6); __pyx_t_15++; if (unlikely(0 < 0)) __PYX_ERR(0, 853, __pyx_L1_error)
                  #else
                  __pyx_t_6 = PySequence_ITEM(__pyx_t_14, __pyx_t_15); __pyx_t_15++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 853, __pyx_L1_error)
                  __Pyx_GOTREF(__pyx_t_6);
                  #endif
                } else {
                  if (__pyx_t_15 >= PyTuple_GET_SIZE(__pyx_t_14)) break;
                  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
                  __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_14, __pyx_t_15); __Pyx_INCREF(__pyx_t_6); __pyx_t_15++; if (unlikely(0 < 0)) __PYX_ERR(0, 853, __pyx_L1_error)
                  #else
                  __pyx_t_6 = PySequence_ITEM(__pyx_t_14, __pyx_t_15); __pyx_t_15++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 853, __pyx_L1_error)
                  __Pyx_GOTREF(__pyx_t_6);
                  #endif
                }
              } else {
                __pyx_t_6 = __pyx_t_16(__pyx_t_14);
                if (unlikely(!__pyx_t_6)) {
                  PyObject* exc_type = PyErr_Occurred();
                  if (exc_type) {
                    if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
                    else __PYX_ERR(0, 853, __pyx_L1_error)
                  }
                  break;
                }
                __Pyx_GOTREF(__pyx_t_6);
              }
              __Pyx_XDECREF_SET(__pyx_v_n, __pyx_t_6);
              __pyx_t_6 = 0;

              /* "kapok/uavsarc.pyx":854
 *                         azsize_slc = np.zeros(num_segments,dtype='int32')
 *                         for n in range(num_segments):
 *                             azsize_slc[n] = ann.query('slc_'+str(n+1)+'_1x1 Rows')             # <<<<<<<<<<<<<<
 *                     else:
 *                         azsize_slc = ann.query('slc_1_1x1 Rows')
 */
              __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_v_ann, __pyx_n_s_query); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 854, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_17);
              __pyx_t_2 = __Pyx_PyInt_AddObjC(__pyx_v_n, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 854, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_2);
              __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 854, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_10);
              __Pyx_GIVEREF(__pyx_t_2);
              PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_2);
              __pyx_t_2 = 0;
              __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)(&PyUnicode_Type)), __pyx_t_10, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 854, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_2);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
              __pyx_t_10 = __Pyx_PyUnicode_Concat(__pyx_n_u_slc, __pyx_t_2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 854, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_10);
              __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
              __pyx_t_2 = __Pyx_PyUnicode_Concat(__pyx_t_10, __pyx_kp_u_1x1_Rows); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 854, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_2);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
              __pyx_t_10 = NULL;
              if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_17))) {
                __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_17);
                if (likely(__pyx_t_10)) {
                  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_17);
                  __Pyx_INCREF(__pyx_t_10);
                  __Pyx_INCREF(function);
                  __Pyx_DECREF_SET(__pyx_t_17, function);
                }
              }
              if (!__pyx_t_10) {
                __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_17, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 854, __pyx_L1_error)
                __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
                __Pyx_GOTREF(__pyx_t_6);
              } else {
                #if CYTHON_FAST_PYCALL
                if (PyFunction_Check(__pyx_t_17)) {
                  PyObject *__pyx_temp[2] = {__pyx_t_10, __pyx_t_2};
                  __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_17, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 854, __pyx_L1_error)
                  __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
                  __Pyx_GOTREF(__pyx_t_6);
                  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
                } else
                #endif
                #if CYTHON_FAST_PYCCALL
                if (__Pyx_PyFastCFunction_Check(__pyx_t_17)) {
                  PyObject *__pyx_temp[2] = {__pyx_t_10, __pyx_t_2};
                  __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_17, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 854, __pyx_L1_error)
                  __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
                  __Pyx_GOTREF(__pyx_t_6);
                  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
                } else
                #endif
                {
                  __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 854, __pyx_L1_error)
                  __Pyx_GOTREF(__pyx_t_7);
                  __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_10); __pyx_t_10 = NULL;
                  __Pyx_GIVEREF(__pyx_t_2);
                  PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_2);
                  __pyx_t_2 = 0;
                  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_17, __pyx_t_7, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 854, __pyx_L1_error)
                  __Pyx_GOTREF(__pyx_t_6);
                  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
                }
              }
              __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
              if (unlikely(PyObject_SetItem(__pyx_v_azsize_slc, __pyx_v_n, __pyx_t_6) < 0)) __PYX_ERR(0, 854, __pyx_L1_error)
              __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

              /* "kapok/uavsarc.pyx":853
 *                     if num_segments > 1:
 *                         azsize_slc = np.zeros(num_segments,dtype='int32')
 *                         for n in range(num_segments):             # <<<<<<<<<<<<<<
 *                             azsize_slc[n] = ann.query('slc_'+str(n+1)+'_1x1 Rows')
 *                     else:
 */
            }
            __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

            /* "kapok/uavsarc.pyx":851
 *                     slcwindow = (1,1)
 *                     rngsize_slc = ann.query('slc_1_1x1 Columns')
 *                     if num_segments > 1:             # <<<<<<<<<<<<<<
 *                         azsize_slc = np.zeros(num_segments,dtype='int32')
 *                         for n in range(num_segments):
 */
            goto __pyx_L28;
          }

          /* "kapok/uavsarc.pyx":856
 *                             azsize_slc[n] = ann.query('slc_'+str(n+1)+'_1x1 Rows')
 *                     else:
 *                         azsize_slc = ann.query('slc_1_1x1 Rows')             # <<<<<<<<<<<<<<
 *                 elif len(file) > 1:
 *                     print('kapok.uavsar.quicklook | Too many SLC files matching pattern: "'+datapath+tracknames[tr]+'*_'+pol+'_*_1x1.slc'+'".  Aborting.')
 */
          /*else*/ {
            __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_v_ann, __pyx_n_s_query); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 856, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_14);
            __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_14, __pyx_tuple__205, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 856, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_6);
            __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
            __Pyx_XDECREF_SET(__pyx_v_azsize_slc, __pyx_t_6);
            __pyx_t_6 = 0;
          }
          __pyx_L28:;

          /* "kapok/uavsarc.pyx":847
 *                 file = glob(datapath+tracknames[tr]+'*'+pol+'_*_s'+str(seg+1)+'_1x1.slc')
 * 
 *                 if len(file) == 1:             # <<<<<<<<<<<<<<
 *                     slcfiles.append(file[0])
 *                     slcwindow = (1,1)
 */
          goto __pyx_L27;
        }

        /* "kapok/uavsarc.pyx":857
 *                     else:
 *                         azsize_slc = ann.query('slc_1_1x1 Rows')
 *                 elif len(file) > 1:             # <<<<<<<<<<<<<<
 *                     print('kapok.uavsar.quicklook | Too many SLC files matching pattern: "'+datapath+tracknames[tr]+'*_'+pol+'_*_1x1.slc'+'".  Aborting.')
 *                     return
 */
        __pyx_t_15 = PyObject_Length(__pyx_v_file); if (unlikely(__pyx_t_15 == -1)) __PYX_ERR(0, 857, __pyx_L1_error)
        __pyx_t_8 = ((__pyx_t_15 > 1) != 0);
        if (__pyx_t_8) {

          /* "kapok/uavsarc.pyx":858
 *                         azsize_slc = ann.query('slc_1_1x1 Rows')
 *                 elif len(file) > 1:
 *                     print('kapok.uavsar.quicklook | Too many SLC files matching pattern: "'+datapath+tracknames[tr]+'*_'+pol+'_*_1x1.slc'+'".  Aborting.')             # <<<<<<<<<<<<<<
 *                     return
 *                 else:
 */
          __pyx_t_6 = PyNumber_Add(__pyx_kp_u_kapok_uavsar_quicklook_Too_many, __pyx_v_datapath); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 858, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          __pyx_t_14 = PyObject_GetItem(__pyx_v_tracknames, __pyx_v_tr); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 858, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_14);
          __pyx_t_17 = PyNumber_Add(__pyx_t_6, __pyx_t_14); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 858, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_17);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
          __pyx_t_14 = PyNumber_Add(__pyx_t_17, __pyx_kp_u__34); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 858, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_14);
          __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
          __pyx_t_17 = PyNumber_Add(__pyx_t_14, __pyx_v_pol); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 858, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_17);
          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
          __pyx_t_14 = PyNumber_Add(__pyx_t_17, __pyx_kp_u_1x1_slc_2); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 858, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_14);
          __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
          __pyx_t_17 = PyNumber_Add(__pyx_t_14, __pyx_kp_u_Aborting); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 858, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_17);
          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
          __pyx_t_14 = PyTuple_New(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 858, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_14);
          __Pyx_GIVEREF(__pyx_t_17);
          PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_17);
          __pyx_t_17 = 0;
          __pyx_t_17 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_t_14, NULL); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 858, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_17);
          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
          __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

          /* "kapok/uavsarc.pyx":859
 *                 elif len(file) > 1:
 *                     print('kapok.uavsar.quicklook | Too many SLC files matching pattern: "'+datapath+tracknames[tr]+'*_'+pol+'_*_1x1.slc'+'".  Aborting.')
 *                     return             # <<<<<<<<<<<<<<
 *                 else:
 *                     print('kapok.uavsar.quicklook | Cannot find SLC file matching pattern: "'+datapath+tracknames[tr]+'*_'+pol+'_*_1x1.slc'+'".  Aborting.')
 */
          __Pyx_XDECREF(__pyx_r);
          __pyx_r = Py_None; __Pyx_INCREF(Py_None);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          goto __pyx_L0;

          /* "kapok/uavsarc.pyx":857
 *                     else:
 *                         azsize_slc = ann.query('slc_1_1x1 Rows')
 *                 elif len(file) > 1:             # <<<<<<<<<<<<<<
 *                     print('kapok.uavsar.quicklook | Too many SLC files matching pattern: "'+datapath+tracknames[tr]+'*_'+pol+'_*_1x1.slc'+'".  Aborting.')
 *                     return
 */
        }

        /* "kapok/uavsarc.pyx":861
 *                     return
 *                 else:
 *                     print('kapok.uavsar.quicklook | Cannot find SLC file matching pattern: "'+datapath+tracknames[tr]+'*_'+pol+'_*_1x1.slc'+'".  Aborting.')             # <<<<<<<<<<<<<<
 *                     return
 * 
 */
        /*else*/ {
          __pyx_t_17 = PyNumber_Add(__pyx_kp_u_kapok_uavsar_quicklook_Cannot_fi_2, __pyx_v_datapath); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 861, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_17);
          __pyx_t_14 = PyObject_GetItem(__pyx_v_tracknames, __pyx_v_tr); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 861, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_14);
          __pyx_t_6 = PyNumber_Add(__pyx_t_17, __pyx_t_14); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 861, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
          __pyx_t_14 = PyNumber_Add(__pyx_t_6, __pyx_kp_u__34); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 861, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_14);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          __pyx_t_6 = PyNumber_Add(__pyx_t_14, __pyx_v_pol); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 861, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
          __pyx_t_14 = PyNumber_Add(__pyx_t_6, __pyx_kp_u_1x1_slc_2); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 861, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_14);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          __pyx_t_6 = PyNumber_Add(__pyx_t_14, __pyx_kp_u_Aborting); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 861, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
          __pyx_t_14 = PyTuple_New(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 861, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_14);
          __Pyx_GIVEREF(__pyx_t_6);
          PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_6);
          __pyx_t_6 = 0;
          __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_t_14, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 861, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

          /* "kapok/uavsarc.pyx":862
 *                 else:
 *                     print('kapok.uavsar.quicklook | Cannot find SLC file matching pattern: "'+datapath+tracknames[tr]+'*_'+pol+'_*_1x1.slc'+'".  Aborting.')
 *                     return             # <<<<<<<<<<<<<<
 * 
 * 
 */
          __Pyx_XDECREF(__pyx_r);
          __pyx_r = Py_None; __Pyx_INCREF(Py_None);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          goto __pyx_L0;
        }
        __pyx_L27:;
      }
      __pyx_L23:;
    }
    __pyx_L19:;

    /* "kapok/uavsarc.pyx":812
 * 
 *     slcfiles = []
 *     for seg in range(num_segments):             # <<<<<<<<<<<<<<
 *         file = glob(datapath+tracknames[tr]+'*'+pol+'_*_s'+str(seg+1)+'_2x8.slc')
 * 
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "kapok/uavsarc.pyx":865
 * 
 * 
 *     mlwin = (mlwin[0]//slcwindow[0],mlwin[1]//slcwindow[1])             # <<<<<<<<<<<<<<
 *     azsize = np.sum(azsize_slc) // mlwin[0]
 *     rngsize = rngsize_slc // mlwin[1]
 */
  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_mlwin, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 865, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (unlikely(!__pyx_v_slcwindow)) { __Pyx_RaiseUnboundLocalError("slcwindow"); __PYX_ERR(0, 865, __pyx_L1_error) }
  __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_slcwindow, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 865, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_14 = PyNumber_FloorDivide(__pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 865, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_mlwin, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 865, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (unlikely(!__pyx_v_slcwindow)) { __Pyx_RaiseUnboundLocalError("slcwindow"); __PYX_ERR(0, 865, __pyx_L1_error) }
  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_slcwindow, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 865, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_17 = PyNumber_FloorDivide(__pyx_t_6, __pyx_t_1); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 865, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_17);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 865, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_14);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_14);
  __Pyx_GIVEREF(__pyx_t_17);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_17);
  __pyx_t_14 = 0;
  __pyx_t_17 = 0;
  __Pyx_DECREF_SET(__pyx_v_mlwin, __pyx_t_1);
  __pyx_t_1 = 0;

  /* "kapok/uavsarc.pyx":866
 * 
 *     mlwin = (mlwin[0]//slcwindow[0],mlwin[1]//slcwindow[1])
 *     azsize = np.sum(azsize_slc) // mlwin[0]             # <<<<<<<<<<<<<<
 *     rngsize = rngsize_slc // mlwin[1]
 * 
 */
  __pyx_t_17 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 866, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_17);
  __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_17, __pyx_n_s_sum); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 866, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
  if (unlikely(!__pyx_v_azsize_slc)) { __Pyx_RaiseUnboundLocalError("azsize_slc"); __PYX_ERR(0, 866, __pyx_L1_error) }
  __pyx_t_17 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_14))) {
    __pyx_t_17 = PyMethod_GET_SELF(__pyx_t_14);
    if (likely(__pyx_t_17)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_14);
      __Pyx_INCREF(__pyx_t_17);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_14, function);
    }
  }
  if (!__pyx_t_17) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_14, __pyx_v_azsize_slc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 866, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_14)) {
      PyObject *__pyx_temp[2] = {__pyx_t_17, __pyx_v_azsize_slc};
      __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_14, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 866, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_14)) {
      PyObject *__pyx_temp[2] = {__pyx_t_17, __pyx_v_azsize_slc};
      __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_14, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 866, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else
    #endif
    {
      __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 866, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_17); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_17); __pyx_t_17 = NULL;
      __Pyx_INCREF(__pyx_v_azsize_slc);
      __Pyx_GIVEREF(__pyx_v_azsize_slc);
      PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_azsize_slc);
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_14, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 866, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  __pyx_t_14 = __Pyx_GetItemInt(__pyx_v_mlwin, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 866, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  __pyx_t_6 = PyNumber_FloorDivide(__pyx_t_1, __pyx_t_14); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 866, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  __pyx_v_azsize = __pyx_t_6;
  __pyx_t_6 = 0;

  /* "kapok/uavsarc.pyx":867
 *     mlwin = (mlwin[0]//slcwindow[0],mlwin[1]//slcwindow[1])
 *     azsize = np.sum(azsize_slc) // mlwin[0]
 *     rngsize = rngsize_slc // mlwin[1]             # <<<<<<<<<<<<<<
 * 
 *     # Get SLC dimensions for the 1x1 SLCs -- these get displayed on the plot axes.
 */
  if (unlikely(!__pyx_v_rngsize_slc)) { __Pyx_RaiseUnboundLocalError("rngsize_slc"); __PYX_ERR(0, 867, __pyx_L1_error) }
  __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_mlwin, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 867, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_14 = PyNumber_FloorDivide(__pyx_v_rngsize_slc, __pyx_t_6); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 867, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_v_rngsize = __pyx_t_14;
  __pyx_t_14 = 0;

  /* "kapok/uavsarc.pyx":870
 * 
 *     # Get SLC dimensions for the 1x1 SLCs -- these get displayed on the plot axes.
 *     rngsize_slc1x1 = ann.query('slc_1_1x1 Columns')             # <<<<<<<<<<<<<<
 *     if num_segments > 1:
 *         azsize_slc1x1 = np.zeros(num_segments,dtype='int32')
 */
  __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_v_ann, __pyx_n_s_query); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 870, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_14, __pyx_tuple__206, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 870, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  __pyx_v_rngsize_slc1x1 = __pyx_t_6;
  __pyx_t_6 = 0;

  /* "kapok/uavsarc.pyx":871
 *     # Get SLC dimensions for the 1x1 SLCs -- these get displayed on the plot axes.
 *     rngsize_slc1x1 = ann.query('slc_1_1x1 Columns')
 *     if num_segments > 1:             # <<<<<<<<<<<<<<
 *         azsize_slc1x1 = np.zeros(num_segments,dtype='int32')
 *         for n in range(num_segments):
 */
  __pyx_t_6 = PyObject_RichCompare(__pyx_v_num_segments, __pyx_int_1, Py_GT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 871, __pyx_L1_error)
  __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 871, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (__pyx_t_8) {

    /* "kapok/uavsarc.pyx":872
 *     rngsize_slc1x1 = ann.query('slc_1_1x1 Columns')
 *     if num_segments > 1:
 *         azsize_slc1x1 = np.zeros(num_segments,dtype='int32')             # <<<<<<<<<<<<<<
 *         for n in range(num_segments):
 *             azsize_slc1x1[n] = ann.query('slc_'+str(n+1)+'_1x1 Rows')
 */
    __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 872, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_zeros); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 872, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_14);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 872, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_INCREF(__pyx_v_num_segments);
    __Pyx_GIVEREF(__pyx_v_num_segments);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_num_segments);
    __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 872, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_n_u_int32) < 0) __PYX_ERR(0, 872, __pyx_L1_error)
    __pyx_t_17 = __Pyx_PyObject_Call(__pyx_t_14, __pyx_t_6, __pyx_t_1); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 872, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_17);
    __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_v_azsize_slc1x1 = __pyx_t_17;
    __pyx_t_17 = 0;

    /* "kapok/uavsarc.pyx":873
 *     if num_segments > 1:
 *         azsize_slc1x1 = np.zeros(num_segments,dtype='int32')
 *         for n in range(num_segments):             # <<<<<<<<<<<<<<
 *             azsize_slc1x1[n] = ann.query('slc_'+str(n+1)+'_1x1 Rows')
 *     else:
 */
    __pyx_t_17 = PyTuple_New(1); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 873, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_17);
    __Pyx_INCREF(__pyx_v_num_segments);
    __Pyx_GIVEREF(__pyx_v_num_segments);
    PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_v_num_segments);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_17, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 873, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
    if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
      __pyx_t_17 = __pyx_t_1; __Pyx_INCREF(__pyx_t_17); __pyx_t_12 = 0;
      __pyx_t_13 = NULL;
    } else {
      __pyx_t_12 = -1; __pyx_t_17 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 873, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_17);
      __pyx_t_13 = Py_TYPE(__pyx_t_17)->tp_iternext; if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 873, __pyx_L1_error)
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    for (;;) {
      if (likely(!__pyx_t_13)) {
        if (likely(PyList_CheckExact(__pyx_t_17))) {
          if (__pyx_t_12 >= PyList_GET_SIZE(__pyx_t_17)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_1 = PyList_GET_ITEM(__pyx_t_17, __pyx_t_12); __Pyx_INCREF(__pyx_t_1); __pyx_t_12++; if (unlikely(0 < 0)) __PYX_ERR(0, 873, __pyx_L1_error)
          #else
          __pyx_t_1 = PySequence_ITEM(__pyx_t_17, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 873, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          #endif
        } else {
          if (__pyx_t_12 >= PyTuple_GET_SIZE(__pyx_t_17)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_17, __pyx_t_12); __Pyx_INCREF(__pyx_t_1); __pyx_t_12++; if (unlikely(0 < 0)) __PYX_ERR(0, 873, __pyx_L1_error)
          #else
          __pyx_t_1 = PySequence_ITEM(__pyx_t_17, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 873, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          #endif
        }
      } else {
        __pyx_t_1 = __pyx_t_13(__pyx_t_17);
        if (unlikely(!__pyx_t_1)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(0, 873, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_1);
      }
      __Pyx_XDECREF_SET(__pyx_v_n, __pyx_t_1);
      __pyx_t_1 = 0;

      /* "kapok/uavsarc.pyx":874
 *         azsize_slc1x1 = np.zeros(num_segments,dtype='int32')
 *         for n in range(num_segments):
 *             azsize_slc1x1[n] = ann.query('slc_'+str(n+1)+'_1x1 Rows')             # <<<<<<<<<<<<<<
 *     else:
 *         azsize_slc1x1 = ann.query('slc_1_1x1 Rows')
 */
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_ann, __pyx_n_s_query); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 874, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_14 = __Pyx_PyInt_AddObjC(__pyx_v_n, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 874, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_14);
      __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 874, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_14);
      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_14);
      __pyx_t_14 = 0;
      __pyx_t_14 = __Pyx_PyObject_Call(((PyObject *)(&PyUnicode_Type)), __pyx_t_7, NULL); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 874, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_14);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = __Pyx_PyUnicode_Concat(__pyx_n_u_slc, __pyx_t_14); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 874, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
      __pyx_t_14 = __Pyx_PyUnicode_Concat(__pyx_t_7, __pyx_kp_u_1x1_Rows); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 874, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_14);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(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);
        }
      }
      if (!__pyx_t_7) {
        __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_14); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 874, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
        __Pyx_GOTREF(__pyx_t_1);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_14};
          __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 874, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_14};
          __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 874, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
        } else
        #endif
        {
          __pyx_t_2 = PyTuple_New(1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 874, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_7); __pyx_t_7 = NULL;
          __Pyx_GIVEREF(__pyx_t_14);
          PyTuple_SET_ITEM(__pyx_t_2, 0+1, __pyx_t_14);
          __pyx_t_14 = 0;
          __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 874, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(PyObject_SetItem(__pyx_v_azsize_slc1x1, __pyx_v_n, __pyx_t_1) < 0)) __PYX_ERR(0, 874, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "kapok/uavsarc.pyx":873
 *     if num_segments > 1:
 *         azsize_slc1x1 = np.zeros(num_segments,dtype='int32')
 *         for n in range(num_segments):             # <<<<<<<<<<<<<<
 *             azsize_slc1x1[n] = ann.query('slc_'+str(n+1)+'_1x1 Rows')
 *     else:
 */
    }
    __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

    /* "kapok/uavsarc.pyx":871
 *     # Get SLC dimensions for the 1x1 SLCs -- these get displayed on the plot axes.
 *     rngsize_slc1x1 = ann.query('slc_1_1x1 Columns')
 *     if num_segments > 1:             # <<<<<<<<<<<<<<
 *         azsize_slc1x1 = np.zeros(num_segments,dtype='int32')
 *         for n in range(num_segments):
 */
    goto __pyx_L31;
  }

  /* "kapok/uavsarc.pyx":876
 *             azsize_slc1x1[n] = ann.query('slc_'+str(n+1)+'_1x1 Rows')
 *     else:
 *         azsize_slc1x1 = ann.query('slc_1_1x1 Rows')             # <<<<<<<<<<<<<<
 * 
 * 
 */
  /*else*/ {
    __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_v_ann, __pyx_n_s_query); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 876, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_17);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_17, __pyx_tuple__207, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 876, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
    __pyx_v_azsize_slc1x1 = __pyx_t_1;
    __pyx_t_1 = 0;
  }
  __pyx_L31:;

  /* "kapok/uavsarc.pyx":880
 * 
 *     # Load and multilook quicklook intensity image.
 *     qlimage = np.zeros((azsize,rngsize),dtype='float32')             # <<<<<<<<<<<<<<
 * 
 *     num_blocks = int(np.sum(azsize_slc)*rngsize_slc*8/1e9)
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 880, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 880, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_17);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 880, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_azsize);
  __Pyx_GIVEREF(__pyx_v_azsize);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_azsize);
  __Pyx_INCREF(__pyx_v_rngsize);
  __Pyx_GIVEREF(__pyx_v_rngsize);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_rngsize);
  __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 880, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 880, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_n_u_float32) < 0) __PYX_ERR(0, 880, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_17, __pyx_t_6, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 880, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_qlimage = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "kapok/uavsarc.pyx":882
 *     qlimage = np.zeros((azsize,rngsize),dtype='float32')
 * 
 *     num_blocks = int(np.sum(azsize_slc)*rngsize_slc*8/1e9)             # <<<<<<<<<<<<<<
 *     if num_blocks < (num_segments + 1):
 *         num_blocks = num_segments + 1
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 882, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_sum); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 882, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(!__pyx_v_azsize_slc)) { __Pyx_RaiseUnboundLocalError("azsize_slc"); __PYX_ERR(0, 882, __pyx_L1_error) }
  __pyx_t_1 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_6);
    if (likely(__pyx_t_1)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_6, function);
    }
  }
  if (!__pyx_t_1) {
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_azsize_slc); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 882, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  } else {
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_6)) {
      PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_v_azsize_slc};
      __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 882, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_GOTREF(__pyx_t_2);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
      PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_v_azsize_slc};
      __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 882, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_GOTREF(__pyx_t_2);
    } else
    #endif
    {
      __pyx_t_17 = PyTuple_New(1+1); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 882, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_17);
      __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_t_1); __pyx_t_1 = NULL;
      __Pyx_INCREF(__pyx_v_azsize_slc);
      __Pyx_GIVEREF(__pyx_v_azsize_slc);
      PyTuple_SET_ITEM(__pyx_t_17, 0+1, __pyx_v_azsize_slc);
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_17, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 882, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (unlikely(!__pyx_v_rngsize_slc)) { __Pyx_RaiseUnboundLocalError("rngsize_slc"); __PYX_ERR(0, 882, __pyx_L1_error) }
  __pyx_t_6 = PyNumber_Multiply(__pyx_t_2, __pyx_v_rngsize_slc); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 882, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyNumber_Multiply(__pyx_t_6, __pyx_int_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 882, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_PyFloat_TrueDivideObjC(__pyx_t_2, __pyx_float_1e9, 1e9, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 882, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyNumber_Int(__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 882, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_v_num_blocks = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "kapok/uavsarc.pyx":883
 * 
 *     num_blocks = int(np.sum(azsize_slc)*rngsize_slc*8/1e9)
 *     if num_blocks < (num_segments + 1):             # <<<<<<<<<<<<<<
 *         num_blocks = num_segments + 1
 *     az_vector = np.round(np.linspace(0, azsize, num=num_blocks+1)).astype('int')
 */
  __pyx_t_2 = __Pyx_PyInt_AddObjC(__pyx_v_num_segments, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 883, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_6 = PyObject_RichCompare(__pyx_v_num_blocks, __pyx_t_2, Py_LT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 883, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 883, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (__pyx_t_8) {

    /* "kapok/uavsarc.pyx":884
 *     num_blocks = int(np.sum(azsize_slc)*rngsize_slc*8/1e9)
 *     if num_blocks < (num_segments + 1):
 *         num_blocks = num_segments + 1             # <<<<<<<<<<<<<<
 *     az_vector = np.round(np.linspace(0, azsize, num=num_blocks+1)).astype('int')
 *     az_vector[num_blocks] = azsize
 */
    __pyx_t_6 = __Pyx_PyInt_AddObjC(__pyx_v_num_segments, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 884, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF_SET(__pyx_v_num_blocks, __pyx_t_6);
    __pyx_t_6 = 0;

    /* "kapok/uavsarc.pyx":883
 * 
 *     num_blocks = int(np.sum(azsize_slc)*rngsize_slc*8/1e9)
 *     if num_blocks < (num_segments + 1):             # <<<<<<<<<<<<<<
 *         num_blocks = num_segments + 1
 *     az_vector = np.round(np.linspace(0, azsize, num=num_blocks+1)).astype('int')
 */
  }

  /* "kapok/uavsarc.pyx":885
 *     if num_blocks < (num_segments + 1):
 *         num_blocks = num_segments + 1
 *     az_vector = np.round(np.linspace(0, azsize, num=num_blocks+1)).astype('int')             # <<<<<<<<<<<<<<
 *     az_vector[num_blocks] = azsize
 * 
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 885, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_round); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 885, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_17);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 885, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_linspace); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 885, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 885, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_int_0);
  __Pyx_GIVEREF(__pyx_int_0);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_int_0);
  __Pyx_INCREF(__pyx_v_azsize);
  __Pyx_GIVEREF(__pyx_v_azsize);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_azsize);
  __pyx_t_14 = PyDict_New(); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 885, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  __pyx_t_7 = __Pyx_PyInt_AddObjC(__pyx_v_num_blocks, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 885, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_t_14, __pyx_n_s_num, __pyx_t_7) < 0) __PYX_ERR(0, 885, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_14); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 885, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  __pyx_t_14 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_17))) {
    __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_17);
    if (likely(__pyx_t_14)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_17);
      __Pyx_INCREF(__pyx_t_14);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_17, function);
    }
  }
  if (!__pyx_t_14) {
    __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_17, __pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 885, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_GOTREF(__pyx_t_6);
  } else {
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_17)) {
      PyObject *__pyx_temp[2] = {__pyx_t_14, __pyx_t_7};
      __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_17, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 885, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_17)) {
      PyObject *__pyx_temp[2] = {__pyx_t_14, __pyx_t_7};
      __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_17, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 885, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    } else
    #endif
    {
      __pyx_t_2 = PyTuple_New(1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 885, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_14); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_14); __pyx_t_14 = NULL;
      __Pyx_GIVEREF(__pyx_t_7);
      PyTuple_SET_ITEM(__pyx_t_2, 0+1, __pyx_t_7);
      __pyx_t_7 = 0;
      __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_17, __pyx_t_2, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 885, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
  __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_astype); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 885, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_17);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_17, __pyx_tuple__208, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 885, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
  __pyx_v_az_vector = __pyx_t_6;
  __pyx_t_6 = 0;

  /* "kapok/uavsarc.pyx":886
 *         num_blocks = num_segments + 1
 *     az_vector = np.round(np.linspace(0, azsize, num=num_blocks+1)).astype('int')
 *     az_vector[num_blocks] = azsize             # <<<<<<<<<<<<<<
 * 
 *     for n, azstart in enumerate(az_vector[0:-1]):
 */
  if (unlikely(PyObject_SetItem(__pyx_v_az_vector, __pyx_v_num_blocks, __pyx_v_azsize) < 0)) __PYX_ERR(0, 886, __pyx_L1_error)

  /* "kapok/uavsarc.pyx":888
 *     az_vector[num_blocks] = azsize
 * 
 *     for n, azstart in enumerate(az_vector[0:-1]):             # <<<<<<<<<<<<<<
 *         azend = az_vector[n+1]
 *         azstart_slc = azstart*mlwin[0]
 */
  __Pyx_INCREF(__pyx_int_0);
  __pyx_t_6 = __pyx_int_0;
  __pyx_t_17 = __Pyx_PyObject_GetSlice(__pyx_v_az_vector, 0, -1L, NULL, NULL, &__pyx_slice__209, 1, 1, 1); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 888, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_17);
  if (likely(PyList_CheckExact(__pyx_t_17)) || PyTuple_CheckExact(__pyx_t_17)) {
    __pyx_t_2 = __pyx_t_17; __Pyx_INCREF(__pyx_t_2); __pyx_t_12 = 0;
    __pyx_t_13 = NULL;
  } else {
    __pyx_t_12 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_17); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 888, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_13 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 888, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
  for (;;) {
    if (likely(!__pyx_t_13)) {
      if (likely(PyList_CheckExact(__pyx_t_2))) {
        if (__pyx_t_12 >= PyList_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_17 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_12); __Pyx_INCREF(__pyx_t_17); __pyx_t_12++; if (unlikely(0 < 0)) __PYX_ERR(0, 888, __pyx_L1_error)
        #else
        __pyx_t_17 = PySequence_ITEM(__pyx_t_2, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 888, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_17);
        #endif
      } else {
        if (__pyx_t_12 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_17 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_12); __Pyx_INCREF(__pyx_t_17); __pyx_t_12++; if (unlikely(0 < 0)) __PYX_ERR(0, 888, __pyx_L1_error)
        #else
        __pyx_t_17 = PySequence_ITEM(__pyx_t_2, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 888, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_17);
        #endif
      }
    } else {
      __pyx_t_17 = __pyx_t_13(__pyx_t_2);
      if (unlikely(!__pyx_t_17)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 888, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_17);
    }
    __Pyx_XDECREF_SET(__pyx_v_azstart, __pyx_t_17);
    __pyx_t_17 = 0;
    __Pyx_INCREF(__pyx_t_6);
    __Pyx_XDECREF_SET(__pyx_v_n, __pyx_t_6);
    __pyx_t_17 = __Pyx_PyInt_AddObjC(__pyx_t_6, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 888, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_17);
    __Pyx_DECREF(__pyx_t_6);
    __pyx_t_6 = __pyx_t_17;
    __pyx_t_17 = 0;

    /* "kapok/uavsarc.pyx":889
 * 
 *     for n, azstart in enumerate(az_vector[0:-1]):
 *         azend = az_vector[n+1]             # <<<<<<<<<<<<<<
 *         azstart_slc = azstart*mlwin[0]
 *         azend_slc = azend*mlwin[0]
 */
    __pyx_t_17 = __Pyx_PyInt_AddObjC(__pyx_v_n, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 889, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_17);
    __pyx_t_7 = PyObject_GetItem(__pyx_v_az_vector, __pyx_t_17); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 889, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
    __Pyx_XDECREF_SET(__pyx_v_azend, __pyx_t_7);
    __pyx_t_7 = 0;

    /* "kapok/uavsarc.pyx":890
 *     for n, azstart in enumerate(az_vector[0:-1]):
 *         azend = az_vector[n+1]
 *         azstart_slc = azstart*mlwin[0]             # <<<<<<<<<<<<<<
 *         azend_slc = azend*mlwin[0]
 *         seg_start, azoffset_start = findsegment(azstart_slc, azsize_slc)
 */
    __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_mlwin, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 890, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_17 = PyNumber_Multiply(__pyx_v_azstart, __pyx_t_7); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 890, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_17);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF_SET(__pyx_v_azstart_slc, __pyx_t_17);
    __pyx_t_17 = 0;

    /* "kapok/uavsarc.pyx":891
 *         azend = az_vector[n+1]
 *         azstart_slc = azstart*mlwin[0]
 *         azend_slc = azend*mlwin[0]             # <<<<<<<<<<<<<<
 *         seg_start, azoffset_start = findsegment(azstart_slc, azsize_slc)
 *         seg_end, azoffset_end = findsegment(azend_slc, azsize_slc)
 */
    __pyx_t_17 = __Pyx_GetItemInt(__pyx_v_mlwin, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 891, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_17);
    __pyx_t_7 = PyNumber_Multiply(__pyx_v_azend, __pyx_t_17); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 891, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
    __Pyx_XDECREF_SET(__pyx_v_azend_slc, __pyx_t_7);
    __pyx_t_7 = 0;

    /* "kapok/uavsarc.pyx":892
 *         azstart_slc = azstart*mlwin[0]
 *         azend_slc = azend*mlwin[0]
 *         seg_start, azoffset_start = findsegment(azstart_slc, azsize_slc)             # <<<<<<<<<<<<<<
 *         seg_end, azoffset_end = findsegment(azend_slc, azsize_slc)
 * 
 */
    __pyx_t_17 = __Pyx_GetModuleGlobalName(__pyx_n_s_findsegment); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 892, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_17);
    if (unlikely(!__pyx_v_azsize_slc)) { __Pyx_RaiseUnboundLocalError("azsize_slc"); __PYX_ERR(0, 892, __pyx_L1_error) }
    __pyx_t_14 = NULL;
    __pyx_t_18 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_17))) {
      __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_17);
      if (likely(__pyx_t_14)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_17);
        __Pyx_INCREF(__pyx_t_14);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_17, function);
        __pyx_t_18 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_17)) {
      PyObject *__pyx_temp[3] = {__pyx_t_14, __pyx_v_azstart_slc, __pyx_v_azsize_slc};
      __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_17, __pyx_temp+1-__pyx_t_18, 2+__pyx_t_18); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 892, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
      __Pyx_GOTREF(__pyx_t_7);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_17)) {
      PyObject *__pyx_temp[3] = {__pyx_t_14, __pyx_v_azstart_slc, __pyx_v_azsize_slc};
      __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_17, __pyx_temp+1-__pyx_t_18, 2+__pyx_t_18); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 892, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
      __Pyx_GOTREF(__pyx_t_7);
    } else
    #endif
    {
      __pyx_t_1 = PyTuple_New(2+__pyx_t_18); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 892, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (__pyx_t_14) {
        __Pyx_GIVEREF(__pyx_t_14); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_14); __pyx_t_14 = NULL;
      }
      __Pyx_INCREF(__pyx_v_azstart_slc);
      __Pyx_GIVEREF(__pyx_v_azstart_slc);
      PyTuple_SET_ITEM(__pyx_t_1, 0+__pyx_t_18, __pyx_v_azstart_slc);
      __Pyx_INCREF(__pyx_v_azsize_slc);
      __Pyx_GIVEREF(__pyx_v_azsize_slc);
      PyTuple_SET_ITEM(__pyx_t_1, 1+__pyx_t_18, __pyx_v_azsize_slc);
      __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_17, __pyx_t_1, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 892, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    }
    __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
    if ((likely(PyTuple_CheckExact(__pyx_t_7))) || (PyList_CheckExact(__pyx_t_7))) {
      PyObject* sequence = __pyx_t_7;
      #if !CYTHON_COMPILING_IN_PYPY
      Py_ssize_t size = Py_SIZE(sequence);
      #else
      Py_ssize_t size = PySequence_Size(sequence);
      #endif
      if (unlikely(size != 2)) {
        if (size > 2) __Pyx_RaiseTooManyValuesError(2);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        __PYX_ERR(0, 892, __pyx_L1_error)
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_17 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); 
      } else {
        __pyx_t_17 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_1 = PyList_GET_ITEM(sequence, 1); 
      }
      __Pyx_INCREF(__pyx_t_17);
      __Pyx_INCREF(__pyx_t_1);
      #else
      __pyx_t_17 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 892, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_17);
      __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 892, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      #endif
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    } else {
      Py_ssize_t index = -1;
      __pyx_t_14 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 892, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_14);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_19 = Py_TYPE(__pyx_t_14)->tp_iternext;
      index = 0; __pyx_t_17 = __pyx_t_19(__pyx_t_14); if (unlikely(!__pyx_t_17)) goto __pyx_L37_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_17);
      index = 1; __pyx_t_1 = __pyx_t_19(__pyx_t_14); if (unlikely(!__pyx_t_1)) goto __pyx_L37_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_1);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_19(__pyx_t_14), 2) < 0) __PYX_ERR(0, 892, __pyx_L1_error)
      __pyx_t_19 = NULL;
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
      goto __pyx_L38_unpacking_done;
      __pyx_L37_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
      __pyx_t_19 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(0, 892, __pyx_L1_error)
      __pyx_L38_unpacking_done:;
    }
    __Pyx_XDECREF_SET(__pyx_v_seg_start, __pyx_t_17);
    __pyx_t_17 = 0;
    __Pyx_XDECREF_SET(__pyx_v_azoffset_start, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "kapok/uavsarc.pyx":893
 *         azend_slc = azend*mlwin[0]
 *         seg_start, azoffset_start = findsegment(azstart_slc, azsize_slc)
 *         seg_end, azoffset_end = findsegment(azend_slc, azsize_slc)             # <<<<<<<<<<<<<<
 * 
 *         file = slcfiles[seg_start]
 */
    __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_findsegment); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 893, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (unlikely(!__pyx_v_azsize_slc)) { __Pyx_RaiseUnboundLocalError("azsize_slc"); __PYX_ERR(0, 893, __pyx_L1_error) }
    __pyx_t_17 = NULL;
    __pyx_t_18 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_17 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_17)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_17);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
        __pyx_t_18 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_1)) {
      PyObject *__pyx_temp[3] = {__pyx_t_17, __pyx_v_azend_slc, __pyx_v_azsize_slc};
      __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_18, 2+__pyx_t_18); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 893, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
      __Pyx_GOTREF(__pyx_t_7);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
      PyObject *__pyx_temp[3] = {__pyx_t_17, __pyx_v_azend_slc, __pyx_v_azsize_slc};
      __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_18, 2+__pyx_t_18); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 893, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
      __Pyx_GOTREF(__pyx_t_7);
    } else
    #endif
    {
      __pyx_t_14 = PyTuple_New(2+__pyx_t_18); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 893, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_14);
      if (__pyx_t_17) {
        __Pyx_GIVEREF(__pyx_t_17); PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_17); __pyx_t_17 = NULL;
      }
      __Pyx_INCREF(__pyx_v_azend_slc);
      __Pyx_GIVEREF(__pyx_v_azend_slc);
      PyTuple_SET_ITEM(__pyx_t_14, 0+__pyx_t_18, __pyx_v_azend_slc);
      __Pyx_INCREF(__pyx_v_azsize_slc);
      __Pyx_GIVEREF(__pyx_v_azsize_slc);
      PyTuple_SET_ITEM(__pyx_t_14, 1+__pyx_t_18, __pyx_v_azsize_slc);
      __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_14, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 893, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if ((likely(PyTuple_CheckExact(__pyx_t_7))) || (PyList_CheckExact(__pyx_t_7))) {
      PyObject* sequence = __pyx_t_7;
      #if !CYTHON_COMPILING_IN_PYPY
      Py_ssize_t size = Py_SIZE(sequence);
      #else
      Py_ssize_t size = PySequence_Size(sequence);
      #endif
      if (unlikely(size != 2)) {
        if (size > 2) __Pyx_RaiseTooManyValuesError(2);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        __PYX_ERR(0, 893, __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_14 = PyTuple_GET_ITEM(sequence, 1); 
      } else {
        __pyx_t_1 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_14 = PyList_GET_ITEM(sequence, 1); 
      }
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_14);
      #else
      __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 893, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_14 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 893, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_14);
      #endif
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    } else {
      Py_ssize_t index = -1;
      __pyx_t_17 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 893, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_17);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_19 = Py_TYPE(__pyx_t_17)->tp_iternext;
      index = 0; __pyx_t_1 = __pyx_t_19(__pyx_t_17); if (unlikely(!__pyx_t_1)) goto __pyx_L39_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_1);
      index = 1; __pyx_t_14 = __pyx_t_19(__pyx_t_17); if (unlikely(!__pyx_t_14)) goto __pyx_L39_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_14);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_19(__pyx_t_17), 2) < 0) __PYX_ERR(0, 893, __pyx_L1_error)
      __pyx_t_19 = NULL;
      __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
      goto __pyx_L40_unpacking_done;
      __pyx_L39_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
      __pyx_t_19 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(0, 893, __pyx_L1_error)
      __pyx_L40_unpacking_done:;
    }
    __Pyx_XDECREF_SET(__pyx_v_seg_end, __pyx_t_1);
    __pyx_t_1 = 0;
    __Pyx_XDECREF_SET(__pyx_v_azoffset_end, __pyx_t_14);
    __pyx_t_14 = 0;

    /* "kapok/uavsarc.pyx":895
 *         seg_end, azoffset_end = findsegment(azend_slc, azsize_slc)
 * 
 *         file = slcfiles[seg_start]             # <<<<<<<<<<<<<<
 * 
 *         if seg_start == seg_end:
 */
    __pyx_t_7 = PyObject_GetItem(__pyx_v_slcfiles, __pyx_v_seg_start); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 895, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_XDECREF_SET(__pyx_v_file, __pyx_t_7);
    __pyx_t_7 = 0;

    /* "kapok/uavsarc.pyx":897
 *         file = slcfiles[seg_start]
 * 
 *         if seg_start == seg_end:             # <<<<<<<<<<<<<<
 *             slc = getslcblock(file, rngsize_slc, azoffset_start, azoffset_end)
 *         else:
 */
    __pyx_t_7 = PyObject_RichCompare(__pyx_v_seg_start, __pyx_v_seg_end, Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 897, __pyx_L1_error)
    __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 897, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (__pyx_t_8) {

      /* "kapok/uavsarc.pyx":898
 * 
 *         if seg_start == seg_end:
 *             slc = getslcblock(file, rngsize_slc, azoffset_start, azoffset_end)             # <<<<<<<<<<<<<<
 *         else:
 *             file2 = slcfiles[seg_end]
 */
      __pyx_t_14 = __Pyx_GetModuleGlobalName(__pyx_n_s_getslcblock); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 898, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_14);
      if (unlikely(!__pyx_v_rngsize_slc)) { __Pyx_RaiseUnboundLocalError("rngsize_slc"); __PYX_ERR(0, 898, __pyx_L1_error) }
      __pyx_t_1 = NULL;
      __pyx_t_18 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_14))) {
        __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_14);
        if (likely(__pyx_t_1)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_14);
          __Pyx_INCREF(__pyx_t_1);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_14, function);
          __pyx_t_18 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_14)) {
        PyObject *__pyx_temp[5] = {__pyx_t_1, __pyx_v_file, __pyx_v_rngsize_slc, __pyx_v_azoffset_start, __pyx_v_azoffset_end};
        __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_14, __pyx_temp+1-__pyx_t_18, 4+__pyx_t_18); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 898, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_GOTREF(__pyx_t_7);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_14)) {
        PyObject *__pyx_temp[5] = {__pyx_t_1, __pyx_v_file, __pyx_v_rngsize_slc, __pyx_v_azoffset_start, __pyx_v_azoffset_end};
        __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_14, __pyx_temp+1-__pyx_t_18, 4+__pyx_t_18); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 898, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_GOTREF(__pyx_t_7);
      } else
      #endif
      {
        __pyx_t_17 = PyTuple_New(4+__pyx_t_18); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 898, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_17);
        if (__pyx_t_1) {
          __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_t_1); __pyx_t_1 = NULL;
        }
        __Pyx_INCREF(__pyx_v_file);
        __Pyx_GIVEREF(__pyx_v_file);
        PyTuple_SET_ITEM(__pyx_t_17, 0+__pyx_t_18, __pyx_v_file);
        __Pyx_INCREF(__pyx_v_rngsize_slc);
        __Pyx_GIVEREF(__pyx_v_rngsize_slc);
        PyTuple_SET_ITEM(__pyx_t_17, 1+__pyx_t_18, __pyx_v_rngsize_slc);
        __Pyx_INCREF(__pyx_v_azoffset_start);
        __Pyx_GIVEREF(__pyx_v_azoffset_start);
        PyTuple_SET_ITEM(__pyx_t_17, 2+__pyx_t_18, __pyx_v_azoffset_start);
        __Pyx_INCREF(__pyx_v_azoffset_end);
        __Pyx_GIVEREF(__pyx_v_azoffset_end);
        PyTuple_SET_ITEM(__pyx_t_17, 3+__pyx_t_18, __pyx_v_azoffset_end);
        __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_14, __pyx_t_17, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 898, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
      }
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
      __Pyx_XDECREF_SET(__pyx_v_slc, __pyx_t_7);
      __pyx_t_7 = 0;

      /* "kapok/uavsarc.pyx":897
 *         file = slcfiles[seg_start]
 * 
 *         if seg_start == seg_end:             # <<<<<<<<<<<<<<
 *             slc = getslcblock(file, rngsize_slc, azoffset_start, azoffset_end)
 *         else:
 */
      goto __pyx_L41;
    }

    /* "kapok/uavsarc.pyx":900
 *             slc = getslcblock(file, rngsize_slc, azoffset_start, azoffset_end)
 *         else:
 *             file2 = slcfiles[seg_end]             # <<<<<<<<<<<<<<
 *             slc = getslcblock(file, rngsize_slc, azoffset_start, azoffset_end, file2=file2, azsize=azsize_slc[seg_start])
 * 
 */
    /*else*/ {
      __pyx_t_7 = PyObject_GetItem(__pyx_v_slcfiles, __pyx_v_seg_end); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 900, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_XDECREF_SET(__pyx_v_file2, __pyx_t_7);
      __pyx_t_7 = 0;

      /* "kapok/uavsarc.pyx":901
 *         else:
 *             file2 = slcfiles[seg_end]
 *             slc = getslcblock(file, rngsize_slc, azoffset_start, azoffset_end, file2=file2, azsize=azsize_slc[seg_start])             # <<<<<<<<<<<<<<
 * 
 *         qlimage[azstart:azend,:] = mlook(np.real(slc*np.conj(slc)),mlwin)
 */
      __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_getslcblock); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 901, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      if (unlikely(!__pyx_v_rngsize_slc)) { __Pyx_RaiseUnboundLocalError("rngsize_slc"); __PYX_ERR(0, 901, __pyx_L1_error) }
      __pyx_t_14 = PyTuple_New(4); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 901, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_14);
      __Pyx_INCREF(__pyx_v_file);
      __Pyx_GIVEREF(__pyx_v_file);
      PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_v_file);
      __Pyx_INCREF(__pyx_v_rngsize_slc);
      __Pyx_GIVEREF(__pyx_v_rngsize_slc);
      PyTuple_SET_ITEM(__pyx_t_14, 1, __pyx_v_rngsize_slc);
      __Pyx_INCREF(__pyx_v_azoffset_start);
      __Pyx_GIVEREF(__pyx_v_azoffset_start);
      PyTuple_SET_ITEM(__pyx_t_14, 2, __pyx_v_azoffset_start);
      __Pyx_INCREF(__pyx_v_azoffset_end);
      __Pyx_GIVEREF(__pyx_v_azoffset_end);
      PyTuple_SET_ITEM(__pyx_t_14, 3, __pyx_v_azoffset_end);
      __pyx_t_17 = PyDict_New(); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 901, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_17);
      if (PyDict_SetItem(__pyx_t_17, __pyx_n_s_file2, __pyx_v_file2) < 0) __PYX_ERR(0, 901, __pyx_L1_error)
      if (unlikely(!__pyx_v_azsize_slc)) { __Pyx_RaiseUnboundLocalError("azsize_slc"); __PYX_ERR(0, 901, __pyx_L1_error) }
      __pyx_t_1 = PyObject_GetItem(__pyx_v_azsize_slc, __pyx_v_seg_start); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 901, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (PyDict_SetItem(__pyx_t_17, __pyx_n_s_azsize, __pyx_t_1) < 0) __PYX_ERR(0, 901, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_14, __pyx_t_17); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 901, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
      __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
      __Pyx_XDECREF_SET(__pyx_v_slc, __pyx_t_1);
      __pyx_t_1 = 0;
    }
    __pyx_L41:;

    /* "kapok/uavsarc.pyx":903
 *             slc = getslcblock(file, rngsize_slc, azoffset_start, azoffset_end, file2=file2, azsize=azsize_slc[seg_start])
 * 
 *         qlimage[azstart:azend,:] = mlook(np.real(slc*np.conj(slc)),mlwin)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_17 = __Pyx_GetModuleGlobalName(__pyx_n_s_mlook); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 903, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_17);
    __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 903, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_real); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 903, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_20 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 903, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_20);
    __pyx_t_21 = __Pyx_PyObject_GetAttrStr(__pyx_t_20, __pyx_n_s_conj); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 903, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_21);
    __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
    __pyx_t_20 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_21))) {
      __pyx_t_20 = PyMethod_GET_SELF(__pyx_t_21);
      if (likely(__pyx_t_20)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_21);
        __Pyx_INCREF(__pyx_t_20);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_21, function);
      }
    }
    if (!__pyx_t_20) {
      __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_21, __pyx_v_slc); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 903, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
    } else {
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_21)) {
        PyObject *__pyx_temp[2] = {__pyx_t_20, __pyx_v_slc};
        __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_21, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 903, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0;
        __Pyx_GOTREF(__pyx_t_7);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_21)) {
        PyObject *__pyx_temp[2] = {__pyx_t_20, __pyx_v_slc};
        __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_21, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 903, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0;
        __Pyx_GOTREF(__pyx_t_7);
      } else
      #endif
      {
        __pyx_t_22 = PyTuple_New(1+1); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 903, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_22);
        __Pyx_GIVEREF(__pyx_t_20); PyTuple_SET_ITEM(__pyx_t_22, 0, __pyx_t_20); __pyx_t_20 = NULL;
        __Pyx_INCREF(__pyx_v_slc);
        __Pyx_GIVEREF(__pyx_v_slc);
        PyTuple_SET_ITEM(__pyx_t_22, 0+1, __pyx_v_slc);
        __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_21, __pyx_t_22, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 903, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
      }
    }
    __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
    __pyx_t_21 = PyNumber_Multiply(__pyx_v_slc, __pyx_t_7); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 903, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_21);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_10))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_10);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_10, function);
      }
    }
    if (!__pyx_t_7) {
      __pyx_t_14 = __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_t_21); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 903, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
      __Pyx_GOTREF(__pyx_t_14);
    } else {
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_10)) {
        PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_21};
        __pyx_t_14 = __Pyx_PyFunction_FastCall(__pyx_t_10, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 903, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_GOTREF(__pyx_t_14);
        __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_10)) {
        PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_21};
        __pyx_t_14 = __Pyx_PyCFunction_FastCall(__pyx_t_10, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 903, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_GOTREF(__pyx_t_14);
        __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
      } else
      #endif
      {
        __pyx_t_22 = PyTuple_New(1+1); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 903, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_22);
        __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_22, 0, __pyx_t_7); __pyx_t_7 = NULL;
        __Pyx_GIVEREF(__pyx_t_21);
        PyTuple_SET_ITEM(__pyx_t_22, 0+1, __pyx_t_21);
        __pyx_t_21 = 0;
        __pyx_t_14 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_22, NULL); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 903, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_14);
        __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
      }
    }
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __pyx_t_10 = NULL;
    __pyx_t_18 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_17))) {
      __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_17);
      if (likely(__pyx_t_10)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_17);
        __Pyx_INCREF(__pyx_t_10);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_17, function);
        __pyx_t_18 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_17)) {
      PyObject *__pyx_temp[3] = {__pyx_t_10, __pyx_t_14, __pyx_v_mlwin};
      __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_17, __pyx_temp+1-__pyx_t_18, 2+__pyx_t_18); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 903, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_17)) {
      PyObject *__pyx_temp[3] = {__pyx_t_10, __pyx_t_14, __pyx_v_mlwin};
      __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_17, __pyx_temp+1-__pyx_t_18, 2+__pyx_t_18); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 903, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
    } else
    #endif
    {
      __pyx_t_22 = PyTuple_New(2+__pyx_t_18); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 903, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_22);
      if (__pyx_t_10) {
        __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_22, 0, __pyx_t_10); __pyx_t_10 = NULL;
      }
      __Pyx_GIVEREF(__pyx_t_14);
      PyTuple_SET_ITEM(__pyx_t_22, 0+__pyx_t_18, __pyx_t_14);
      __Pyx_INCREF(__pyx_v_mlwin);
      __Pyx_GIVEREF(__pyx_v_mlwin);
      PyTuple_SET_ITEM(__pyx_t_22, 1+__pyx_t_18, __pyx_v_mlwin);
      __pyx_t_14 = 0;
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_17, __pyx_t_22, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 903, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
    }
    __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
    __pyx_t_17 = PySlice_New(__pyx_v_azstart, __pyx_v_azend, Py_None); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 903, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_17);
    __pyx_t_22 = PyTuple_New(2); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 903, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_22);
    __Pyx_GIVEREF(__pyx_t_17);
    PyTuple_SET_ITEM(__pyx_t_22, 0, __pyx_t_17);
    __Pyx_INCREF(__pyx_slice__210);
    __Pyx_GIVEREF(__pyx_slice__210);
    PyTuple_SET_ITEM(__pyx_t_22, 1, __pyx_slice__210);
    __pyx_t_17 = 0;
    if (unlikely(PyObject_SetItem(__pyx_v_qlimage, __pyx_t_22, __pyx_t_1) < 0)) __PYX_ERR(0, 903, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "kapok/uavsarc.pyx":888
 *     az_vector[num_blocks] = azsize
 * 
 *     for n, azstart in enumerate(az_vector[0:-1]):             # <<<<<<<<<<<<<<
 *         azend = az_vector[n+1]
 *         azstart_slc = azstart*mlwin[0]
 */
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "kapok/uavsarc.pyx":906
 * 
 * 
 *     plt.figure()             # <<<<<<<<<<<<<<
 * 
 *     qlimage = np.real(qlimage)
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_plt, __pyx_n_s_figure); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 906, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_1)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (__pyx_t_1) {
    __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 906, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  } else {
    __pyx_t_6 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 906, __pyx_L1_error)
  }
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "kapok/uavsarc.pyx":908
 *     plt.figure()
 * 
 *     qlimage = np.real(qlimage)             # <<<<<<<<<<<<<<
 *     qlimage[qlimage <= 1e-10] = 1e-10
 *     qlimage = 10*np.log10(qlimage)
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 908, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_real); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 908, __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 && unlikely(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);
    }
  }
  if (!__pyx_t_2) {
    __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_qlimage); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 908, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
  } else {
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_1)) {
      PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_v_qlimage};
      __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 908, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_GOTREF(__pyx_t_6);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
      PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_v_qlimage};
      __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 908, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_GOTREF(__pyx_t_6);
    } else
    #endif
    {
      __pyx_t_22 = PyTuple_New(1+1); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 908, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_22);
      __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_22, 0, __pyx_t_2); __pyx_t_2 = NULL;
      __Pyx_INCREF(__pyx_v_qlimage);
      __Pyx_GIVEREF(__pyx_v_qlimage);
      PyTuple_SET_ITEM(__pyx_t_22, 0+1, __pyx_v_qlimage);
      __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_22, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 908, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF_SET(__pyx_v_qlimage, __pyx_t_6);
  __pyx_t_6 = 0;

  /* "kapok/uavsarc.pyx":909
 * 
 *     qlimage = np.real(qlimage)
 *     qlimage[qlimage <= 1e-10] = 1e-10             # <<<<<<<<<<<<<<
 *     qlimage = 10*np.log10(qlimage)
 * 
 */
  __pyx_t_6 = PyObject_RichCompare(__pyx_v_qlimage, __pyx_float_1eneg_10, Py_LE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 909, __pyx_L1_error)
  if (unlikely(PyObject_SetItem(__pyx_v_qlimage, __pyx_t_6, __pyx_float_1eneg_10) < 0)) __PYX_ERR(0, 909, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "kapok/uavsarc.pyx":910
 *     qlimage = np.real(qlimage)
 *     qlimage[qlimage <= 1e-10] = 1e-10
 *     qlimage = 10*np.log10(qlimage)             # <<<<<<<<<<<<<<
 * 
 *     plt.imshow(qlimage, vmin=-25, vmax=0, cmap='gray', aspect=0.25, interpolation='nearest', extent=(0,rngsize_slc1x1,np.sum(azsize_slc1x1),0))
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 910, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_22 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_log10); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 910, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_22);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_22))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_22);
    if (likely(__pyx_t_1)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_22);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_22, function);
    }
  }
  if (!__pyx_t_1) {
    __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_22, __pyx_v_qlimage); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 910, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
  } else {
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_22)) {
      PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_v_qlimage};
      __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_22, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 910, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_GOTREF(__pyx_t_6);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_22)) {
      PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_v_qlimage};
      __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_22, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 910, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_GOTREF(__pyx_t_6);
    } else
    #endif
    {
      __pyx_t_2 = PyTuple_New(1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 910, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); __pyx_t_1 = NULL;
      __Pyx_INCREF(__pyx_v_qlimage);
      __Pyx_GIVEREF(__pyx_v_qlimage);
      PyTuple_SET_ITEM(__pyx_t_2, 0+1, __pyx_v_qlimage);
      __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_22, __pyx_t_2, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 910, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
  __pyx_t_22 = PyNumber_Multiply(__pyx_int_10, __pyx_t_6); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 910, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_22);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF_SET(__pyx_v_qlimage, __pyx_t_22);
  __pyx_t_22 = 0;

  /* "kapok/uavsarc.pyx":912
 *     qlimage = 10*np.log10(qlimage)
 * 
 *     plt.imshow(qlimage, vmin=-25, vmax=0, cmap='gray', aspect=0.25, interpolation='nearest', extent=(0,rngsize_slc1x1,np.sum(azsize_slc1x1),0))             # <<<<<<<<<<<<<<
 *     plt.colorbar(label=pol+' Backscatter (dB)')
 *     plt.xlabel('Range Index')
 */
  __pyx_t_22 = __Pyx_PyObject_GetAttrStr(__pyx_v_plt, __pyx_n_s_imshow); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 912, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_22);
  __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 912, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_INCREF(__pyx_v_qlimage);
  __Pyx_GIVEREF(__pyx_v_qlimage);
  PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_qlimage);
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 912, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_vmin, __pyx_int_neg_25) < 0) __PYX_ERR(0, 912, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_vmax, __pyx_int_0) < 0) __PYX_ERR(0, 912, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_cmap, __pyx_n_u_gray) < 0) __PYX_ERR(0, 912, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_aspect, __pyx_float_0_25) < 0) __PYX_ERR(0, 912, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_interpolation, __pyx_n_u_nearest) < 0) __PYX_ERR(0, 912, __pyx_L1_error)
  __pyx_t_17 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 912, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_17);
  __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_17, __pyx_n_s_sum); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 912, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
  __pyx_t_17 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_14))) {
    __pyx_t_17 = PyMethod_GET_SELF(__pyx_t_14);
    if (likely(__pyx_t_17)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_14);
      __Pyx_INCREF(__pyx_t_17);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_14, function);
    }
  }
  if (!__pyx_t_17) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_14, __pyx_v_azsize_slc1x1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 912, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_14)) {
      PyObject *__pyx_temp[2] = {__pyx_t_17, __pyx_v_azsize_slc1x1};
      __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_14, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 912, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_14)) {
      PyObject *__pyx_temp[2] = {__pyx_t_17, __pyx_v_azsize_slc1x1};
      __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_14, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 912, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else
    #endif
    {
      __pyx_t_10 = PyTuple_New(1+1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 912, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_GIVEREF(__pyx_t_17); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_17); __pyx_t_17 = NULL;
      __Pyx_INCREF(__pyx_v_azsize_slc1x1);
      __Pyx_GIVEREF(__pyx_v_azsize_slc1x1);
      PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_v_azsize_slc1x1);
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_14, __pyx_t_10, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 912, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  __pyx_t_14 = PyTuple_New(4); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 912, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  __Pyx_INCREF(__pyx_int_0);
  __Pyx_GIVEREF(__pyx_int_0);
  PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_int_0);
  __Pyx_INCREF(__pyx_v_rngsize_slc1x1);
  __Pyx_GIVEREF(__pyx_v_rngsize_slc1x1);
  PyTuple_SET_ITEM(__pyx_t_14, 1, __pyx_v_rngsize_slc1x1);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_14, 2, __pyx_t_1);
  __Pyx_INCREF(__pyx_int_0);
  __Pyx_GIVEREF(__pyx_int_0);
  PyTuple_SET_ITEM(__pyx_t_14, 3, __pyx_int_0);
  __pyx_t_1 = 0;
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_extent, __pyx_t_14) < 0) __PYX_ERR(0, 912, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  __pyx_t_14 = __Pyx_PyObject_Call(__pyx_t_22, __pyx_t_6, __pyx_t_2); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 912, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "kapok/uavsarc.pyx":913
 * 
 *     plt.imshow(qlimage, vmin=-25, vmax=0, cmap='gray', aspect=0.25, interpolation='nearest', extent=(0,rngsize_slc1x1,np.sum(azsize_slc1x1),0))
 *     plt.colorbar(label=pol+' Backscatter (dB)')             # <<<<<<<<<<<<<<
 *     plt.xlabel('Range Index')
 *     plt.ylabel('Azimuth Index')
 */
  __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_v_plt, __pyx_n_s_colorbar); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 913, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 913, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_6 = PyNumber_Add(__pyx_v_pol, __pyx_kp_u_Backscatter_dB); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 913, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_label, __pyx_t_6) < 0) __PYX_ERR(0, 913, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_14, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 913, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "kapok/uavsarc.pyx":914
 *     plt.imshow(qlimage, vmin=-25, vmax=0, cmap='gray', aspect=0.25, interpolation='nearest', extent=(0,rngsize_slc1x1,np.sum(azsize_slc1x1),0))
 *     plt.colorbar(label=pol+' Backscatter (dB)')
 *     plt.xlabel('Range Index')             # <<<<<<<<<<<<<<
 *     plt.ylabel('Azimuth Index')
 *     plt.tight_layout()
 */
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_plt, __pyx_n_s_xlabel); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 914, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__211, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 914, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "kapok/uavsarc.pyx":915
 *     plt.colorbar(label=pol+' Backscatter (dB)')
 *     plt.xlabel('Range Index')
 *     plt.ylabel('Azimuth Index')             # <<<<<<<<<<<<<<
 *     plt.tight_layout()
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_plt, __pyx_n_s_ylabel); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 915, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__212, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 915, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "kapok/uavsarc.pyx":916
 *     plt.xlabel('Range Index')
 *     plt.ylabel('Azimuth Index')
 *     plt.tight_layout()             # <<<<<<<<<<<<<<
 * 
 *     if savefile is not None:
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_plt, __pyx_n_s_tight_layout); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 916, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_14 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_14)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_14);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (__pyx_t_14) {
    __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_14); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 916, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  } else {
    __pyx_t_6 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 916, __pyx_L1_error)
  }
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "kapok/uavsarc.pyx":918
 *     plt.tight_layout()
 * 
 *     if savefile is not None:             # <<<<<<<<<<<<<<
 *         plt.savefig(savefile, dpi=125, bbox_inches='tight', pad_inches=0.1)
 */
  __pyx_t_8 = (__pyx_v_savefile != Py_None);
  __pyx_t_9 = (__pyx_t_8 != 0);
  if (__pyx_t_9) {

    /* "kapok/uavsarc.pyx":919
 * 
 *     if savefile is not None:
 *         plt.savefig(savefile, dpi=125, bbox_inches='tight', pad_inches=0.1)             # <<<<<<<<<<<<<<
 */
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_plt, __pyx_n_s_savefig); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 919, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 919, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_v_savefile);
    __Pyx_GIVEREF(__pyx_v_savefile);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_savefile);
    __pyx_t_14 = PyDict_New(); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 919, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_14);
    if (PyDict_SetItem(__pyx_t_14, __pyx_n_s_dpi, __pyx_int_125) < 0) __PYX_ERR(0, 919, __pyx_L1_error)
    if (PyDict_SetItem(__pyx_t_14, __pyx_n_s_bbox_inches, __pyx_n_u_tight) < 0) __PYX_ERR(0, 919, __pyx_L1_error)
    if (PyDict_SetItem(__pyx_t_14, __pyx_n_s_pad_inches, __pyx_float_0_1) < 0) __PYX_ERR(0, 919, __pyx_L1_error)
    __pyx_t_22 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_2, __pyx_t_14); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 919, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_22);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
    __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;

    /* "kapok/uavsarc.pyx":918
 *     plt.tight_layout()
 * 
 *     if savefile is not None:             # <<<<<<<<<<<<<<
 *         plt.savefig(savefile, dpi=125, bbox_inches='tight', pad_inches=0.1)
 */
  }

  /* "kapok/uavsarc.pyx":756
 * 
 * 
 * def quicklook(infile, tr=0, pol='hh', mlwin=(40,10), savefile=None):             # <<<<<<<<<<<<<<
 *     """Display a quick look intensity image for a given UAVSAR SLC stack.
 * 
 */

  /* 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_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_XDECREF(__pyx_t_17);
  __Pyx_XDECREF(__pyx_t_20);
  __Pyx_XDECREF(__pyx_t_21);
  __Pyx_XDECREF(__pyx_t_22);
  __Pyx_AddTraceback("kapok.uavsarc.quicklook", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_plt);
  __Pyx_XDECREF(__pyx_v_ann);
  __Pyx_XDECREF(__pyx_v_temp);
  __Pyx_XDECREF(__pyx_v_num);
  __Pyx_XDECREF(__pyx_v_tracknames);
  __Pyx_XDECREF(__pyx_v_datapath);
  __Pyx_XDECREF(__pyx_v_num_segments);
  __Pyx_XDECREF(__pyx_v_slcfiles);
  __Pyx_XDECREF(__pyx_v_seg);
  __Pyx_XDECREF(__pyx_v_file);
  __Pyx_XDECREF(__pyx_v_slcwindow);
  __Pyx_XDECREF(__pyx_v_rngsize_slc);
  __Pyx_XDECREF(__pyx_v_azsize_slc);
  __Pyx_XDECREF(__pyx_v_n);
  __Pyx_XDECREF(__pyx_v_azsize);
  __Pyx_XDECREF(__pyx_v_rngsize);
  __Pyx_XDECREF(__pyx_v_rngsize_slc1x1);
  __Pyx_XDECREF(__pyx_v_azsize_slc1x1);
  __Pyx_XDECREF(__pyx_v_qlimage);
  __Pyx_XDECREF(__pyx_v_num_blocks);
  __Pyx_XDECREF(__pyx_v_az_vector);
  __Pyx_XDECREF(__pyx_v_azstart);
  __Pyx_XDECREF(__pyx_v_azend);
  __Pyx_XDECREF(__pyx_v_azstart_slc);
  __Pyx_XDECREF(__pyx_v_azend_slc);
  __Pyx_XDECREF(__pyx_v_seg_start);
  __Pyx_XDECREF(__pyx_v_azoffset_start);
  __Pyx_XDECREF(__pyx_v_seg_end);
  __Pyx_XDECREF(__pyx_v_azoffset_end);
  __Pyx_XDECREF(__pyx_v_slc);
  __Pyx_XDECREF(__pyx_v_file2);
  __Pyx_XDECREF(__pyx_v_pol);
  __Pyx_XDECREF(__pyx_v_mlwin);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":197
 *         # experimental exception made for __getbuffer__ and __releasebuffer__
 *         # -- the details of this may change.
 *         def __getbuffer__(ndarray self, Py_buffer* info, int flags):             # <<<<<<<<<<<<<<
 *             # This implementation of getbuffer is geared towards Cython
 *             # requirements, and does not yet fullfill the PEP.
 */

/* Python wrapper */
static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5numpy_7ndarray___getbuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags));

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

static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
  int __pyx_v_copy_shape;
  int __pyx_v_i;
  int __pyx_v_ndim;
  int __pyx_v_endian_detector;
  int __pyx_v_little_endian;
  int __pyx_v_t;
  char *__pyx_v_f;
  PyArray_Descr *__pyx_v_descr = 0;
  int __pyx_v_offset;
  int __pyx_v_hasfields;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  char *__pyx_t_7;
  __Pyx_RefNannySetupContext("__getbuffer__", 0);
  if (__pyx_v_info != NULL) {
    __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(__pyx_v_info->obj);
  }

  /* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":203
 *             # of flags
 * 
 *             if info == NULL: return             # <<<<<<<<<<<<<<
 * 
 *             cdef int copy_shape, i, ndim
 */
  __pyx_t_1 = ((__pyx_v_info == NULL) != 0);
  if (__pyx_t_1) {
    __pyx_r = 0;
    goto __pyx_L0;
  }

  /* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":206
 * 
 *             cdef int copy_shape, i, ndim
 *             cdef int endian_detector = 1             # <<<<<<<<<<<<<<
 *             cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
 * 
 */
  __pyx_v_endian_detector = 1;

  /* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":207
 *             cdef int copy_shape, i, ndim
 *             cdef int endian_detector = 1
 *             cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)             # <<<<<<<<<<<<<<
 * 
 *             ndim = PyArray_NDIM(self)
 */
  __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0);

  /* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":209
 *             cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
 * 
 *             ndim = PyArray_NDIM(self)             # <<<<<<<<<<<<<<
 * 
 *             if sizeof(npy_intp) != sizeof(Py_ssize_t):
 */
  __pyx_v_ndim = PyArray_NDIM(__pyx_v_self);

  /* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":211
 *             ndim = PyArray_NDIM(self)
 * 
 *             if sizeof(npy_intp) != sizeof(Py_ssize_t):             # <<<<<<<<<<<<<<
 *                 copy_shape = 1
 *             else:
 */
  __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0);
  if (__pyx_t_1) {

    /* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":212
 * 
 *             if sizeof(npy_intp) != sizeof(Py_ssize_t):
 *                 copy_shape = 1             # <<<<<<<<<<<<<<
 *             else:
 *                 copy_shape = 0
 */
    __pyx_v_copy_shape = 1;

    /* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":211
 *             ndim = PyArray_NDIM(self)
 * 
 *             if sizeof(npy_intp) != sizeof(Py_ssize_t):             # <<<<<<<<<<<<<<
 *                 copy_shape = 1
 *             else:
 */
    goto __pyx_L4;
  }

  /* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":214
 *                 copy_shape = 1
 *             else:
 *                 copy_shape = 0             # <<<<<<<<<<<<<<
 * 
 *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
 */
  /*else*/ {
    __pyx_v_copy_shape = 0;
  }
  __pyx_L4:;

  /* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":216
 *                 copy_shape = 0
 * 
 *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)             # <<<<<<<<<<<<<<
 *                 and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)):
 *                 raise ValueError(u"ndarray is not C contiguous")
 */
  __pyx_t_2 = (((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS) != 0);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L6_bool_binop_done;
  }

  /* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":217
 * 
 *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
 *                 and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)):             # <<<<<<<<<<<<<<
 *                 raise ValueError(u"ndarray is not C contiguous")
 * 
 */
  __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_C_CONTIGUOUS) != 0)) != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L6_bool_binop_done:;

  /* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":216
 *                 copy_shape = 0
 * 
 *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)             # <<<<<<<<<<<<<<
 *                 and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)):
 *                 raise ValueError(u"ndarray is not C contiguous")
 */
  if (__pyx_t_1) {

    /* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":218
 *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
 *                 and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)):
 *                 raise ValueError(u"ndarray is not C contiguous")             # <<<<<<<<<<<<<<
 * 
 *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
 */
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__213, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 218, __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, 218, __pyx_L1_error)

    /* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":216
 *                 copy_shape = 0
 * 
 *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)             # <<<<<<<<<<<<<<
 *                 and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)):
 *                 raise ValueError(u"ndarray is not C contiguous")
 */
  }

  /* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":220
 *                 raise ValueError(u"ndarray is not C contiguous")
 * 
 *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)             # <<<<<<<<<<<<<<
 *                 and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)):
 *                 raise ValueError(u"ndarray is not Fortran contiguous")
 */
  __pyx_t_2 = (((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS) != 0);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L9_bool_binop_done;
  }

  /* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":221
 * 
 *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
 *                 and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)):             # <<<<<<<<<<<<<<
 *                 raise ValueError(u"ndarray is not Fortran contiguous")
 * 
 */
  __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_F_CONTIGUOUS) != 0)) != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L9_bool_binop_done:;

  /* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":220
 *                 raise ValueError(u"ndarray is not C contiguous")
 * 
 *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)             # <<<<<<<<<<<<<<
 *                 and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)):
 *                 raise ValueError(u"ndarray is not Fortran contiguous")
 */
  if (__pyx_t_1) {

    /* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":222
 *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
 *                 and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)):
 *                 raise ValueError(u"ndarray is not Fortran contiguous")             # <<<<<<<<<<<<<<
 * 
 *             info.buf = PyArray_DATA(self)
 */
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__214, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 222, __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, 222, __pyx_L1_error)

    /* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":220
 *                 raise ValueError(u"ndarray is not C contiguous")
 * 
 *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)             # <<<<<<<<<<<<<<
 *                 and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)):
 *                 raise ValueError(u"ndarray is not Fortran contiguous")
 */
  }

  /* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":224
 *                 raise ValueError(u"ndarray is not Fortran contiguous")
 * 
 *             info.buf = PyArray_DATA(self)             # <<<<<<<<<<<<<<
 *             info.ndim = ndim
 *             if copy_shape:
 */
  __pyx_v_info->buf = PyArray_DATA(__pyx_v_self);

  /* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":225
 * 
 *             info.buf = PyArray_DATA(self)
 *             info.ndim = ndim             # <<<<<<<<<<<<<<
 *             if copy_shape:
 *                 # Allocate new buffer for strides and shape info.
 */
  __pyx_v_info->ndim = __pyx_v_ndim;

  /* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":226
 *             info.buf = PyArray_DATA(self)
 *             info.ndim = ndim
 *             if copy_shape:             # <<<<<<<<<<<<<<
 *                 # Allocate new buffer for strides and shape info.
 *                 # This is allocated as one block, strides first.
 */
  __pyx_t_1 = (__pyx_v_copy_shape != 0);
  if (__pyx_t_1) {

    /* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":229
 *                 # Allocate new buffer for strides and shape info.
 *                 # This is allocated as one block, strides first.
 *                 info.strides = <Py_ssize_t*>stdlib.malloc(sizeof(Py_ssize_t) * <size_t>ndim * 2)             # <<<<<<<<<<<<<<
 *                 info.shape = info.strides + ndim
 *                 for i in range(ndim):
 */
    __pyx_v_info->strides = ((Py_ssize_t *)malloc((((sizeof(Py_ssize_t)) * ((size_t)__pyx_v_ndim)) * 2)));

    /* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":230
 *                 # This is allocated as one block, strides first.
 *                 info.strides = <Py_ssize_t*>stdlib.malloc(sizeof(Py_ssize_t) * <size_t>ndim * 2)
 *                 info.shape = info.strides + ndim             # <<<<<<<<<<<<<<
 *                 for i in range(ndim):
 *                     info.strides[i] = PyArray_STRIDES(self)[i]
 */
    __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim);

    /* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":231
 *                 info.strides = <Py_ssize_t*>stdlib.malloc(sizeof(Py_ssize_t) * <size_t>ndim * 2)
 *                 info.shape = info.strides + ndim
 *                 for i in range(ndim):             # <<<<<<<<<<<<<<
 *                     info.strides[i] = PyArray_STRIDES(self)[i]
 *                     info.shape[i] = PyArray_DIMS(self)[i]
 */
    __pyx_t_4 = __pyx_v_ndim;
    for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
      __pyx_v_i = __pyx_t_5;

      /* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":232
 *                 info.shape = info.strides + ndim
 *                 for i in range(ndim):
 *                     info.strides[i] = PyArray_STRIDES(self)[i]             # <<<<<<<<<<<<<<
 *                     info.shape[i] = PyArray_DIMS(self)[i]
 *             else:
 */
      (__pyx_v_info->strides[__pyx_v_i]) = (PyArray_STRIDES(__pyx_v_self)[__pyx_v_i]);

      /* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":233
 *                 for i in range(ndim):
 *                     info.strides[i] = PyArray_STRIDES(self)[i]
 *                     info.shape[i] = PyArray_DIMS(self)[i]             # <<<<<<<<<<<<<<
 *             else:
 *                 info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
 */
      (__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(__pyx_v_self)[__pyx_v_i]);
    }

    /* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":226
 *             info.buf = PyArray_DATA(self)
 *             info.ndim = ndim
 *             if copy_shape:             # <<<<<<<<<<<<<<
 *                 # Allocate new buffer for strides and shape info.
 *                 # This is allocated as one block, strides first.
 */
    goto __pyx_L11;
  }

  /* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":235
 *                     info.shape[i] = PyArray_DIMS(self)[i]
 *             else:
 *                 info.strides = <Py_ssize_t*>PyArray_STRIDES(self)             # <<<<<<<<<<<<<<
 *                 info.shape = <Py_ssize_t*>PyArray_DIMS(self)
 *             info.suboffsets = NULL
 */
  /*else*/ {
    __pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(__pyx_v_self));

    /* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":236
 *             else:
 *                 info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
 *                 info.shape = <Py_ssize_t*>PyArray_DIMS(self)             # <<<<<<<<<<<<<<
 *             info.suboffsets = NULL
 *             info.itemsize = PyArray_ITEMSIZE(self)
 */
    __pyx_v_info->shape = ((Py_ssize_t *)PyArray_DIMS(__pyx_v_self));
  }
  __pyx_L11:;

  /* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":237
 *                 info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
 *                 info.shape = <Py_ssize_t*>PyArray_DIMS(self)
 *             info.suboffsets = NULL             # <<<<<<<<<<<<<<
 *             info.itemsize = PyArray_ITEMSIZE(self)
 *             info.readonly = not PyArray_ISWRITEABLE(self)
 */
  __pyx_v_info->suboffsets = NULL;

  /* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":238
 *                 info.shape = <Py_ssize_t*>PyArray_DIMS(self)
 *             info.suboffsets = NULL
 *             info.itemsize = PyArray_ITEMSIZE(self)             # <<<<<<<<<<<<<<
 *             info.readonly = not PyArray_ISWRITEABLE(self)
 * 
 */
  __pyx_v_info->itemsize = PyArray_ITEMSIZE(__pyx_v_self);

  /* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":239
 *             info.suboffsets = NULL
 *             info.itemsize = PyArray_ITEMSIZE(self)
 *             info.readonly = not PyArray_ISWRITEABLE(self)             # <<<<<<<<<<<<<<
 * 
 *             cdef int t
 */
  __pyx_v_info->readonly = (!(PyArray_ISWRITEABLE(__pyx_v_self) != 0));

  /* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":242
 * 
 *             cdef int t
 *             cdef char* f = NULL             # <<<<<<<<<<<<<<
 *             cdef dtype descr = self.descr
 *             cdef int offset
 */
  __pyx_v_f = NULL;

  /* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":243
 *             cdef int t
 *             cdef char* f = NULL
 *             cdef dtype descr = self.descr             # <<<<<<<<<<<<<<
 *             cdef int offset
 * 
 */
  __pyx_t_3 = ((PyObject *)__pyx_v_self->descr);
  __Pyx_INCREF(__pyx_t_3);
  __pyx_v_descr = ((PyArray_Descr *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":246
 *             cdef int offset
 * 
 *             cdef bint hasfields = PyDataType_HASFIELDS(descr)             # <<<<<<<<<<<<<<
 * 
 *             if not hasfields and not copy_shape:
 */
  __pyx_v_hasfields = PyDataType_HASFIELDS(__pyx_v_descr);

  /* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":248
 *             cdef bint hasfields = PyDataType_HASFIELDS(descr)
 * 
 *             if not hasfields and not copy_shape:             # <<<<<<<<<<<<<<
 *                 # do not call releasebuffer
 *                 info.obj = None
 */
  __pyx_t_2 = ((!(__pyx_v_hasfields != 0)) != 0);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L15_bool_binop_done;
  }
  __pyx_t_2 = ((!(__pyx_v_copy_shape != 0)) != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L15_bool_binop_done:;
  if (__pyx_t_1) {

    /* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":250
 *             if not hasfields and not copy_shape:
 *                 # do not call releasebuffer
 *                 info.obj = None             # <<<<<<<<<<<<<<
 *             else:
 *                 # need to call releasebuffer
 */
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    __Pyx_GOTREF(__pyx_v_info->obj);
    __Pyx_DECREF(__pyx_v_info->obj);
    __pyx_v_info->obj = Py_None;

    /* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":248
 *             cdef bint hasfields = PyDataType_HASFIELDS(descr)
 * 
 *             if not hasfields and not copy_shape:             # <<<<<<<<<<<<<<
 *                 # do not call releasebuffer
 *                 info.obj = None
 */
    goto __pyx_L14;
  }

  /* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":253
 *             else:
 *                 # need to call releasebuffer
 *                 info.obj = self             # <<<<<<<<<<<<<<
 * 
 *             if not hasfields:
 */
  /*else*/ {
    __Pyx_INCREF(((PyObject *)__pyx_v_self));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
    __Pyx_GOTREF(__pyx_v_info->obj);
    __Pyx_DECREF(__pyx_v_info->obj);
    __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
  }
  __pyx_L14:;

  /* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":255
 *                 info.obj = self
 * 
 *             if not hasfields:             # <<<<<<<<<<<<<<
 *                 t = descr.type_num
 *                 if ((descr.byteorder == c'>' and little_endian) or
 */
  __pyx_t_1 = ((!(__pyx_v_hasfields != 0)) != 0);
  if (__pyx_t_1) {

    /* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":256
 * 
 *             if not hasfields:
 *                 t = descr.type_num             # <<<<<<<<<<<<<<
 *                 if ((descr.byteorder == c'>' and little_endian) or
 *                     (descr.byteorder == c'<' and not little_endian)):
 */
    __pyx_t_4 = __pyx_v_descr->type_num;
    __pyx_v_t = __pyx_t_4;

    /* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":257
 *             if not hasfields:
 *                 t = descr.type_num
 *                 if ((descr.byteorder == c'>' and little_endian) or             # <<<<<<<<<<<<<<
 *                     (descr.byteorder == c'<' and not little_endian)):
 *                     raise ValueError(u"Non-native byte order not supported")
 */
    __pyx_t_2 = ((__pyx_v_descr->byteorder == '>') != 0);
    if (!__pyx_t_2) {
      goto __pyx_L20_next_or;
    } else {
    }
    __pyx_t_2 = (__pyx_v_little_endian != 0);
    if (!__pyx_t_2) {
    } else {
      __pyx_t_1 = __pyx_t_2;
      goto __pyx_L19_bool_binop_done;
    }
    __pyx_L20_next_or:;

    /* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":258
 *                 t = descr.type_num
 *                 if ((descr.byteorder == c'>' and little_endian) or
 *                     (descr.byteorder == c'<' and not little_endian)):             # <<<<<<<<<<<<<<
 *                     raise ValueError(u"Non-native byte order not supported")
 *                 if   t == NPY_BYTE:        f = "b"
 */
    __pyx_t_2 = ((__pyx_v_descr->byteorder == '<') != 0);
    if (__pyx_t_2) {
    } else {
      __pyx_t_1 = __pyx_t_2;
      goto __pyx_L19_bool_binop_done;
    }
    __pyx_t_2 = ((!(__pyx_v_little_endian != 0)) != 0);
    __pyx_t_1 = __pyx_t_2;
    __pyx_L19_bool_binop_done:;

    /* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":257
 *             if not hasfields:
 *                 t = descr.type_num
 *                 if ((descr.byteorder == c'>' and little_endian) or             # <<<<<<<<<<<<<<
 *                     (descr.byteorder == c'<' and not little_endian)):
 *                     raise ValueError(u"Non-native byte order not supported")
 */
    if (__pyx_t_1) {

      /* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":259
 *                 if ((descr.byteorder == c'>' and little_endian) or
 *                     (descr.byteorder == c'<' and not little_endian)):
 *                     raise ValueError(u"Non-native byte order not supported")             # <<<<<<<<<<<<<<
 *                 if   t == NPY_BYTE:        f = "b"
 *                 elif t == NPY_UBYTE:       f = "B"
 */
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__215, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 259, __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, 259, __pyx_L1_error)

      /* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":257
 *             if not hasfields:
 *                 t = descr.type_num
 *                 if ((descr.byteorder == c'>' and little_endian) or             # <<<<<<<<<<<<<<
 *                     (descr.byteorder == c'<' and not little_endian)):
 *                     raise ValueError(u"Non-native byte order not supported")
 */
    }

    /* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":260
 *                     (descr.byteorder == c'<' and not little_endian)):
 *                     raise ValueError(u"Non-native byte order not supported")
 *                 if   t == NPY_BYTE:        f = "b"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_UBYTE:       f = "B"
 *                 elif t == NPY_SHORT:       f = "h"
 */
    switch (__pyx_v_t) {
      case NPY_BYTE:
      __pyx_v_f = ((char *)"b");
      break;

      /* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":261
 *                     raise ValueError(u"Non-native byte order not supported")
 *                 if   t == NPY_BYTE:        f = "b"
 *                 elif t == NPY_UBYTE:       f = "B"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_SHORT:       f = "h"
 *                 elif t == NPY_USHORT:      f = "H"
 */
      case NPY_UBYTE:
      __pyx_v_f = ((char *)"B");
      break;

      /* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":262
 *                 if   t == NPY_BYTE:        f = "b"
 *                 elif t == NPY_UBYTE:       f = "B"
 *                 elif t == NPY_SHORT:       f = "h"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_USHORT:      f = "H"
 *                 elif t == NPY_INT:         f = "i"
 */
      case NPY_SHORT:
      __pyx_v_f = ((char *)"h");
      break;

      /* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":263
 *                 elif t == NPY_UBYTE:       f = "B"
 *                 elif t == NPY_SHORT:       f = "h"
 *                 elif t == NPY_USHORT:      f = "H"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_INT:         f = "i"
 *                 elif t == NPY_UINT:        f = "I"
 */
      case NPY_USHORT:
      __pyx_v_f = ((char *)"H");
      break;

      /* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":264
 *                 elif t == NPY_SHORT:       f = "h"
 *                 elif t == NPY_USHORT:      f = "H"
 *                 elif t == NPY_INT:         f = "i"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_UINT:        f = "I"
 *                 elif t == NPY_LONG:        f = "l"
 */
      case NPY_INT:
      __pyx_v_f = ((char *)"i");
      break;

      /* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":265
 *                 elif t == NPY_USHORT:      f = "H"
 *                 elif t == NPY_INT:         f = "i"
 *                 elif t == NPY_UINT:        f = "I"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_LONG:        f = "l"
 *                 elif t == NPY_ULONG:       f = "L"
 */
      case NPY_UINT:
      __pyx_v_f = ((char *)"I");
      break;

      /* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":266
 *                 elif t == NPY_INT:         f = "i"
 *                 elif t == NPY_UINT:        f = "I"
 *                 elif t == NPY_LONG:        f = "l"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_ULONG:       f = "L"
 *                 elif t == NPY_LONGLONG:    f = "q"
 */
      case NPY_LONG:
      __pyx_v_f = ((char *)"l");
      break;

      /* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":267
 *                 elif t == NPY_UINT:        f = "I"
 *                 elif t == NPY_LONG:        f = "l"
 *                 elif t == NPY_ULONG:       f = "L"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_LONGLONG:    f = "q"
 *                 elif t == NPY_ULONGLONG:   f = "Q"
 */
      case NPY_ULONG:
      __pyx_v_f = ((char *)"L");
      break;

      /* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":268
 *                 elif t == NPY_LONG:        f = "l"
 *                 elif t == NPY_ULONG:       f = "L"
 *                 elif t == NPY_LONGLONG:    f = "q"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_ULONGLONG:   f = "Q"
 *                 elif t == NPY_FLOAT:       f = "f"
 */
      case NPY_LONGLONG:
      __pyx_v_f = ((char *)"q");
      break;

      /* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":269
 *                 elif t == NPY_ULONG:       f = "L"
 *                 elif t == NPY_LONGLONG:    f = "q"
 *                 elif t == NPY_ULONGLONG:   f = "Q"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_FLOAT:       f = "f"
 *                 elif t == NPY_DOUBLE:      f = "d"
 */
      case NPY_ULONGLONG:
      __pyx_v_f = ((char *)"Q");
      break;

      /* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":270
 *                 elif t == NPY_LONGLONG:    f = "q"
 *                 elif t == NPY_ULONGLONG:   f = "Q"
 *                 elif t == NPY_FLOAT:       f = "f"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_DOUBLE:      f = "d"
 *                 elif t == NPY_LONGDOUBLE:  f = "g"
 */
      case NPY_FLOAT:
      __pyx_v_f = ((char *)"f");
      break;

      /* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":271
 *                 elif t == NPY_ULONGLONG:   f = "Q"
 *                 elif t == NPY_FLOAT:       f = "f"
 *                 elif t == NPY_DOUBLE:      f = "d"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_LONGDOUBLE:  f = "g"
 *                 elif t == NPY_CFLOAT:      f = "Zf"
 */
      case NPY_DOUBLE:
      __pyx_v_f = ((char *)"d");
      break;

      /* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":272
 *                 elif t == NPY_FLOAT:       f = "f"
 *                 elif t == NPY_DOUBLE:      f = "d"
 *                 elif t == NPY_LONGDOUBLE:  f = "g"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_CFLOAT:      f = "Zf"
 *                 elif t == NPY_CDOUBLE:     f = "Zd"
 */
      case NPY_LONGDOUBLE:
      __pyx_v_f = ((char *)"g");
      break;

      /* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":273
 *                 elif t == NPY_DOUBLE:      f = "d"
 *                 elif t == NPY_LONGDOUBLE:  f = "g"
 *                 elif t == NPY_CFLOAT:      f = "Zf"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_CDOUBLE:     f = "Zd"
 *                 elif t == NPY_CLONGDOUBLE: f = "Zg"
 */
      case NPY_CFLOAT:
      __pyx_v_f = ((char *)"Zf");
      break;

      /* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":274
 *                 elif t == NPY_LONGDOUBLE:  f = "g"
 *                 elif t == NPY_CFLOAT:      f = "Zf"
 *                 elif t == NPY_CDOUBLE:     f = "Zd"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_CLONGDOUBLE: f = "Zg"
 *                 elif t == NPY_OBJECT:      f = "O"
 */
      case NPY_CDOUBLE:
      __pyx_v_f = ((char *)"Zd");
      break;

      /* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":275
 *                 elif t == NPY_CFLOAT:      f = "Zf"
 *                 elif t == NPY_CDOUBLE:     f = "Zd"
 *                 elif t == NPY_CLONGDOUBLE: f = "Zg"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_OBJECT:      f = "O"
 *                 else:
 */
      case NPY_CLONGDOUBLE:
      __pyx_v_f = ((char *)"Zg");
      break;

      /* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":276
 *                 elif t == NPY_CDOUBLE:     f = "Zd"
 *                 elif t == NPY_CLONGDOUBLE: f = "Zg"
 *                 elif t == NPY_OBJECT:      f = "O"             # <<<<<<<<<<<<<<
 *                 else:
 *                     raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
 */
      case NPY_OBJECT:
      __pyx_v_f = ((char *)"O");
      break;
      default:

      /* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":278
 *                 elif t == NPY_OBJECT:      f = "O"
 *                 else:
 *                     raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)             # <<<<<<<<<<<<<<
 *                 info.format = f
 *                 return
 */
      __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 278, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_6 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 278, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 278, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6);
      __pyx_t_6 = 0;
      __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 278, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_Raise(__pyx_t_6, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __PYX_ERR(1, 278, __pyx_L1_error)
      break;
    }

    /* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":279
 *                 else:
 *                     raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
 *                 info.format = f             # <<<<<<<<<<<<<<
 *                 return
 *             else:
 */
    __pyx_v_info->format = __pyx_v_f;

    /* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":280
 *                     raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
 *                 info.format = f
 *                 return             # <<<<<<<<<<<<<<
 *             else:
 *                 info.format = <char*>stdlib.malloc(_buffer_format_string_len)
 */
    __pyx_r = 0;
    goto __pyx_L0;

    /* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":255
 *                 info.obj = self
 * 
 *             if not hasfields:             # <<<<<<<<<<<<<<
 *                 t = descr.type_num
 *                 if ((descr.byteorder == c'>' and little_endian) or
 */
  }

  /* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":282
 *                 return
 *             else:
 *                 info.format = <char*>stdlib.malloc(_buffer_format_string_len)             # <<<<<<<<<<<<<<
 *                 info.format[0] = c'^' # Native data types, manual alignment
 *                 offset = 0
 */
  /*else*/ {
    __pyx_v_info->format = ((char *)malloc(0xFF));

    /* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":283
 *             else:
 *                 info.format = <char*>stdlib.malloc(_buffer_format_string_len)
 *                 info.format[0] = c'^' # Native data types, manual alignment             # <<<<<<<<<<<<<<
 *                 offset = 0
 *                 f = _util_dtypestring(descr, info.format + 1,
 */
    (__pyx_v_info->format[0]) = '^';

    /* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":284
 *                 info.format = <char*>stdlib.malloc(_buffer_format_string_len)
 *                 info.format[0] = c'^' # Native data types, manual alignment
 *                 offset = 0             # <<<<<<<<<<<<<<
 *                 f = _util_dtypestring(descr, info.format + 1,
 *                                       info.format + _buffer_format_string_len,
 */
    __pyx_v_offset = 0;

    /* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":285
 *                 info.format[0] = c'^' # Native data types, manual alignment
 *                 offset = 0
 *                 f = _util_dtypestring(descr, info.format + 1,             # <<<<<<<<<<<<<<
 *                                       info.format + _buffer_format_string_len,
 *                                       &offset)
 */
    __pyx_t_7 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 0xFF), (&__pyx_v_offset)); if (unlikely(__pyx_t_7 == NULL)) __PYX_ERR(1, 285, __pyx_L1_error)
    __pyx_v_f = __pyx_t_7;

    /* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":288
 *                                       info.format + _buffer_format_string_len,
 *                                       &offset)
 *                 f[0] = c'\0' # Terminate format string             # <<<<<<<<<<<<<<
 * 
 *         def __releasebuffer__(ndarray self, Py_buffer* info):
 */
    (__pyx_v_f[0]) = '\x00';
  }

  /* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":197
 *         # experimental exception made for __getbuffer__ and __releasebuffer__
 *         # -- the details of this may change.
 *         def __getbuffer__(ndarray self, Py_buffer* info, int flags):             # <<<<<<<<<<<<<<
 *             # This implementation of getbuffer is geared towards Cython
 *             # requirements, and does not yet fullfill the PEP.
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("numpy.ndarray.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  if (__pyx_v_info != NULL && __pyx_v_info->obj != NULL) {
    __Pyx_GOTREF(__pyx_v_info->obj);
    __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = NULL;
  }
  goto __pyx_L2;
  __pyx_L0:;
  if (__pyx_v_info != NULL && __pyx_v_info->obj == Py_None) {
    __Pyx_GOTREF(Py_None);
    __Pyx_DECREF(Py_None); __pyx_v_info->obj = NULL;
  }
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_descr);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":290
 *                 f[0] = c'\0' # Terminate format string
 * 
 *         def __releasebuffer__(ndarray self, Py_buffer* info):             # <<<<<<<<<<<<<<
 *             if PyArray_HASFIELDS(self):
 *                 stdlib.free(info.format)
 */

/* Python wrapper */
static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info); /*proto*/
static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__releasebuffer__ (wrapper)", 0);
  __pyx_pf_5numpy_7ndarray_2__releasebuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info));

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

static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info) {
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("__releasebuffer__", 0);

  /* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":291
 * 
 *         def __releasebuffer__(ndarray self, Py_buffer* info):
 *             if PyArray_HASFIELDS(self):             # <<<<<<<<<<<<<<
 *                 stdlib.free(info.format)
 *             if sizeof(npy_intp) != sizeof(Py_ssize_t):
 */
  __pyx_t_1 = (PyArray_HASFIELDS(__pyx_v_self) != 0);
  if (__pyx_t_1) {

    /* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":292
 *         def __releasebuffer__(ndarray self, Py_buffer* info):
 *             if PyArray_HASFIELDS(self):
 *                 stdlib.free(info.format)             # <<<<<<<<<<<<<<
 *             if sizeof(npy_intp) != sizeof(Py_ssize_t):
 *                 stdlib.free(info.strides)
 */
    free(__pyx_v_info->format);

    /* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":291
 * 
 *         def __releasebuffer__(ndarray self, Py_buffer* info):
 *             if PyArray_HASFIELDS(self):             # <<<<<<<<<<<<<<
 *                 stdlib.free(info.format)
 *             if sizeof(npy_intp) != sizeof(Py_ssize_t):
 */
  }

  /* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":293
 *             if PyArray_HASFIELDS(self):
 *                 stdlib.free(info.format)
 *             if sizeof(npy_intp) != sizeof(Py_ssize_t):             # <<<<<<<<<<<<<<
 *                 stdlib.free(info.strides)
 *                 # info.shape was stored after info.strides in the same block
 */
  __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0);
  if (__pyx_t_1) {

    /* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":294
 *                 stdlib.free(info.format)
 *             if sizeof(npy_intp) != sizeof(Py_ssize_t):
 *                 stdlib.free(info.strides)             # <<<<<<<<<<<<<<
 *                 # info.shape was stored after info.strides in the same block
 * 
 */
    free(__pyx_v_info->strides);

    /* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":293
 *             if PyArray_HASFIELDS(self):
 *                 stdlib.free(info.format)
 *             if sizeof(npy_intp) != sizeof(Py_ssize_t):             # <<<<<<<<<<<<<<
 *                 stdlib.free(info.strides)
 *                 # info.shape was stored after info.strides in the same block
 */
  }

  /* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":290
 *                 f[0] = c'\0' # Terminate format string
 * 
 *         def __releasebuffer__(ndarray self, Py_buffer* info):             # <<<<<<<<<<<<<<
 *             if PyArray_HASFIELDS(self):
 *                 stdlib.free(info.format)
 */

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

/* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":770
 * ctypedef npy_cdouble     complex_t
 * 
 * cdef inline object PyArray_MultiIterNew1(a):             # <<<<<<<<<<<<<<
 *     return PyArray_MultiIterNew(1, <void*>a)
 * 
 */

static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0);

  /* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":771
 * 
 * cdef inline object PyArray_MultiIterNew1(a):
 *     return PyArray_MultiIterNew(1, <void*>a)             # <<<<<<<<<<<<<<
 * 
 * cdef inline object PyArray_MultiIterNew2(a, b):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 771, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":770
 * ctypedef npy_cdouble     complex_t
 * 
 * cdef inline object PyArray_MultiIterNew1(a):             # <<<<<<<<<<<<<<
 *     return PyArray_MultiIterNew(1, <void*>a)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":773
 *     return PyArray_MultiIterNew(1, <void*>a)
 * 
 * cdef inline object PyArray_MultiIterNew2(a, b):             # <<<<<<<<<<<<<<
 *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)
 * 
 */

static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0);

  /* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":774
 * 
 * cdef inline object PyArray_MultiIterNew2(a, b):
 *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)             # <<<<<<<<<<<<<<
 * 
 * cdef inline object PyArray_MultiIterNew3(a, b, c):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyArray_MultiIterNew(2, ((void *)__pyx_v_a), ((void *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 774, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":773
 *     return PyArray_MultiIterNew(1, <void*>a)
 * 
 * cdef inline object PyArray_MultiIterNew2(a, b):             # <<<<<<<<<<<<<<
 *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":776
 *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)
 * 
 * cdef inline object PyArray_MultiIterNew3(a, b, c):             # <<<<<<<<<<<<<<
 *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
 * 
 */

static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0);

  /* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":777
 * 
 * cdef inline object PyArray_MultiIterNew3(a, b, c):
 *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)             # <<<<<<<<<<<<<<
 * 
 * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyArray_MultiIterNew(3, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 777, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":776
 *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)
 * 
 * cdef inline object PyArray_MultiIterNew3(a, b, c):             # <<<<<<<<<<<<<<
 *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":779
 *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
 * 
 * cdef inline object PyArray_MultiIterNew4(a, b, c, d):             # <<<<<<<<<<<<<<
 *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
 * 
 */

static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0);

  /* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":780
 * 
 * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
 *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)             # <<<<<<<<<<<<<<
 * 
 * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyArray_MultiIterNew(4, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 780, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":779
 *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
 * 
 * cdef inline object PyArray_MultiIterNew4(a, b, c, d):             # <<<<<<<<<<<<<<
 *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":782
 *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
 * 
 * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):             # <<<<<<<<<<<<<<
 *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
 * 
 */

static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d, PyObject *__pyx_v_e) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0);

  /* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":783
 * 
 * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
 *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)             # <<<<<<<<<<<<<<
 * 
 * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyArray_MultiIterNew(5, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d), ((void *)__pyx_v_e)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 783, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":782
 *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
 * 
 * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):             # <<<<<<<<<<<<<<
 *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":785
 *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
 * 
 * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL:             # <<<<<<<<<<<<<<
 *     # Recursive utility function used in __getbuffer__ to get format
 *     # string. The new location in the format string is returned.
 */

static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx_v_descr, char *__pyx_v_f, char *__pyx_v_end, int *__pyx_v_offset) {
  PyArray_Descr *__pyx_v_child = 0;
  int __pyx_v_endian_detector;
  int __pyx_v_little_endian;
  PyObject *__pyx_v_fields = 0;
  PyObject *__pyx_v_childname = NULL;
  PyObject *__pyx_v_new_offset = NULL;
  PyObject *__pyx_v_t = NULL;
  char *__pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  long __pyx_t_8;
  char *__pyx_t_9;
  __Pyx_RefNannySetupContext("_util_dtypestring", 0);

  /* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":790
 * 
 *     cdef dtype child
 *     cdef int endian_detector = 1             # <<<<<<<<<<<<<<
 *     cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
 *     cdef tuple fields
 */
  __pyx_v_endian_detector = 1;

  /* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":791
 *     cdef dtype child
 *     cdef int endian_detector = 1
 *     cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)             # <<<<<<<<<<<<<<
 *     cdef tuple fields
 * 
 */
  __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0);

  /* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":794
 *     cdef tuple fields
 * 
 *     for childname in descr.names:             # <<<<<<<<<<<<<<
 *         fields = descr.fields[childname]
 *         child, new_offset = fields
 */
  if (unlikely(__pyx_v_descr->names == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
    __PYX_ERR(1, 794, __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, 794, __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, 794, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    #endif
    __Pyx_XDECREF_SET(__pyx_v_childname, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":795
 * 
 *     for childname in descr.names:
 *         fields = descr.fields[childname]             # <<<<<<<<<<<<<<
 *         child, new_offset = fields
 * 
 */
    if (unlikely(__pyx_v_descr->fields == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(1, 795, __pyx_L1_error)
    }
    __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 795, __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, 795, __pyx_L1_error)
    __Pyx_XDECREF_SET(__pyx_v_fields, ((PyObject*)__pyx_t_3));
    __pyx_t_3 = 0;

    /* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":796
 *     for childname in descr.names:
 *         fields = descr.fields[childname]
 *         child, new_offset = fields             # <<<<<<<<<<<<<<
 * 
 *         if (end - f) - <int>(new_offset - offset[0]) < 15:
 */
    if (likely(__pyx_v_fields != Py_None)) {
      PyObject* sequence = __pyx_v_fields;
      #if !CYTHON_COMPILING_IN_PYPY
      Py_ssize_t size = Py_SIZE(sequence);
      #else
      Py_ssize_t size = PySequence_Size(sequence);
      #endif
      if (unlikely(size != 2)) {
        if (size > 2) __Pyx_RaiseTooManyValuesError(2);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        __PYX_ERR(1, 796, __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, 796, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 796, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      #endif
    } else {
      __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 796, __pyx_L1_error)
    }
    if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) __PYX_ERR(1, 796, __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;

    /* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":798
 *         child, new_offset = fields
 * 
 *         if (end - f) - <int>(new_offset - offset[0]) < 15:             # <<<<<<<<<<<<<<
 *             raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
 * 
 */
    __pyx_t_4 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 798, __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, 798, __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, 798, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_6 = ((((__pyx_v_end - __pyx_v_f) - ((int)__pyx_t_5)) < 15) != 0);
    if (__pyx_t_6) {

      /* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":799
 * 
 *         if (end - f) - <int>(new_offset - offset[0]) < 15:
 *             raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")             # <<<<<<<<<<<<<<
 * 
 *         if ((child.byteorder == c'>' and little_endian) or
 */
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__216, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 799, __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, 799, __pyx_L1_error)

      /* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":798
 *         child, new_offset = fields
 * 
 *         if (end - f) - <int>(new_offset - offset[0]) < 15:             # <<<<<<<<<<<<<<
 *             raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
 * 
 */
    }

    /* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":801
 *             raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
 * 
 *         if ((child.byteorder == c'>' and little_endian) or             # <<<<<<<<<<<<<<
 *             (child.byteorder == c'<' and not little_endian)):
 *             raise ValueError(u"Non-native byte order not supported")
 */
    __pyx_t_7 = ((__pyx_v_child->byteorder == '>') != 0);
    if (!__pyx_t_7) {
      goto __pyx_L8_next_or;
    } else {
    }
    __pyx_t_7 = (__pyx_v_little_endian != 0);
    if (!__pyx_t_7) {
    } else {
      __pyx_t_6 = __pyx_t_7;
      goto __pyx_L7_bool_binop_done;
    }
    __pyx_L8_next_or:;

    /* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":802
 * 
 *         if ((child.byteorder == c'>' and little_endian) or
 *             (child.byteorder == c'<' and not little_endian)):             # <<<<<<<<<<<<<<
 *             raise ValueError(u"Non-native byte order not supported")
 *             # One could encode it in the format string and have Cython
 */
    __pyx_t_7 = ((__pyx_v_child->byteorder == '<') != 0);
    if (__pyx_t_7) {
    } else {
      __pyx_t_6 = __pyx_t_7;
      goto __pyx_L7_bool_binop_done;
    }
    __pyx_t_7 = ((!(__pyx_v_little_endian != 0)) != 0);
    __pyx_t_6 = __pyx_t_7;
    __pyx_L7_bool_binop_done:;

    /* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":801
 *             raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
 * 
 *         if ((child.byteorder == c'>' and little_endian) or             # <<<<<<<<<<<<<<
 *             (child.byteorder == c'<' and not little_endian)):
 *             raise ValueError(u"Non-native byte order not supported")
 */
    if (__pyx_t_6) {

      /* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":803
 *         if ((child.byteorder == c'>' and little_endian) or
 *             (child.byteorder == c'<' and not little_endian)):
 *             raise ValueError(u"Non-native byte order not supported")             # <<<<<<<<<<<<<<
 *             # One could encode it in the format string and have Cython
 *             # complain instead, BUT: < and > in format strings also imply
 */
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__217, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 803, __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, 803, __pyx_L1_error)

      /* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":801
 *             raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
 * 
 *         if ((child.byteorder == c'>' and little_endian) or             # <<<<<<<<<<<<<<
 *             (child.byteorder == c'<' and not little_endian)):
 *             raise ValueError(u"Non-native byte order not supported")
 */
    }

    /* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":813
 * 
 *         # Output padding bytes
 *         while offset[0] < new_offset:             # <<<<<<<<<<<<<<
 *             f[0] = 120 # "x"; pad byte
 *             f += 1
 */
    while (1) {
      __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 813, __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, 813, __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, 813, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (!__pyx_t_6) break;

      /* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":814
 *         # Output padding bytes
 *         while offset[0] < new_offset:
 *             f[0] = 120 # "x"; pad byte             # <<<<<<<<<<<<<<
 *             f += 1
 *             offset[0] += 1
 */
      (__pyx_v_f[0]) = 0x78;

      /* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":815
 *         while offset[0] < new_offset:
 *             f[0] = 120 # "x"; pad byte
 *             f += 1             # <<<<<<<<<<<<<<
 *             offset[0] += 1
 * 
 */
      __pyx_v_f = (__pyx_v_f + 1);

      /* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":816
 *             f[0] = 120 # "x"; pad byte
 *             f += 1
 *             offset[0] += 1             # <<<<<<<<<<<<<<
 * 
 *         offset[0] += child.itemsize
 */
      __pyx_t_8 = 0;
      (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + 1);
    }

    /* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":818
 *             offset[0] += 1
 * 
 *         offset[0] += child.itemsize             # <<<<<<<<<<<<<<
 * 
 *         if not PyDataType_HASFIELDS(child):
 */
    __pyx_t_8 = 0;
    (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + __pyx_v_child->elsize);

    /* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":820
 *         offset[0] += child.itemsize
 * 
 *         if not PyDataType_HASFIELDS(child):             # <<<<<<<<<<<<<<
 *             t = child.type_num
 *             if end - f < 5:
 */
    __pyx_t_6 = ((!(PyDataType_HASFIELDS(__pyx_v_child) != 0)) != 0);
    if (__pyx_t_6) {

      /* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":821
 * 
 *         if not PyDataType_HASFIELDS(child):
 *             t = child.type_num             # <<<<<<<<<<<<<<
 *             if end - f < 5:
 *                 raise RuntimeError(u"Format string allocated too short.")
 */
      __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_child->type_num); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 821, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_4);
      __pyx_t_4 = 0;

      /* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":822
 *         if not PyDataType_HASFIELDS(child):
 *             t = child.type_num
 *             if end - f < 5:             # <<<<<<<<<<<<<<
 *                 raise RuntimeError(u"Format string allocated too short.")
 * 
 */
      __pyx_t_6 = (((__pyx_v_end - __pyx_v_f) < 5) != 0);
      if (__pyx_t_6) {

        /* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":823
 *             t = child.type_num
 *             if end - f < 5:
 *                 raise RuntimeError(u"Format string allocated too short.")             # <<<<<<<<<<<<<<
 * 
 *             # Until ticket #99 is fixed, use integers to avoid warnings
 */
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__218, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 823, __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, 823, __pyx_L1_error)

        /* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":822
 *         if not PyDataType_HASFIELDS(child):
 *             t = child.type_num
 *             if end - f < 5:             # <<<<<<<<<<<<<<
 *                 raise RuntimeError(u"Format string allocated too short.")
 * 
 */
      }

      /* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":826
 * 
 *             # Until ticket #99 is fixed, use integers to avoid warnings
 *             if   t == NPY_BYTE:        f[0] =  98 #"b"             # <<<<<<<<<<<<<<
 *             elif t == NPY_UBYTE:       f[0] =  66 #"B"
 *             elif t == NPY_SHORT:       f[0] = 104 #"h"
 */
      __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_BYTE); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 826, __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, 826, __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, 826, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 98;
        goto __pyx_L15;
      }

      /* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":827
 *             # Until ticket #99 is fixed, use integers to avoid warnings
 *             if   t == NPY_BYTE:        f[0] =  98 #"b"
 *             elif t == NPY_UBYTE:       f[0] =  66 #"B"             # <<<<<<<<<<<<<<
 *             elif t == NPY_SHORT:       f[0] = 104 #"h"
 *             elif t == NPY_USHORT:      f[0] =  72 #"H"
 */
      __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UBYTE); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 827, __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, 827, __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, 827, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 66;
        goto __pyx_L15;
      }

      /* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":828
 *             if   t == NPY_BYTE:        f[0] =  98 #"b"
 *             elif t == NPY_UBYTE:       f[0] =  66 #"B"
 *             elif t == NPY_SHORT:       f[0] = 104 #"h"             # <<<<<<<<<<<<<<
 *             elif t == NPY_USHORT:      f[0] =  72 #"H"
 *             elif t == NPY_INT:         f[0] = 105 #"i"
 */
      __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_SHORT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 828, __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, 828, __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, 828, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 0x68;
        goto __pyx_L15;
      }

      /* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":829
 *             elif t == NPY_UBYTE:       f[0] =  66 #"B"
 *             elif t == NPY_SHORT:       f[0] = 104 #"h"
 *             elif t == NPY_USHORT:      f[0] =  72 #"H"             # <<<<<<<<<<<<<<
 *             elif t == NPY_INT:         f[0] = 105 #"i"
 *             elif t == NPY_UINT:        f[0] =  73 #"I"
 */
      __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_USHORT); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 829, __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, 829, __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, 829, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 72;
        goto __pyx_L15;
      }

      /* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":830
 *             elif t == NPY_SHORT:       f[0] = 104 #"h"
 *             elif t == NPY_USHORT:      f[0] =  72 #"H"
 *             elif t == NPY_INT:         f[0] = 105 #"i"             # <<<<<<<<<<<<<<
 *             elif t == NPY_UINT:        f[0] =  73 #"I"
 *             elif t == NPY_LONG:        f[0] = 108 #"l"
 */
      __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_INT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 830, __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, 830, __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, 830, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 0x69;
        goto __pyx_L15;
      }

      /* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":831
 *             elif t == NPY_USHORT:      f[0] =  72 #"H"
 *             elif t == NPY_INT:         f[0] = 105 #"i"
 *             elif t == NPY_UINT:        f[0] =  73 #"I"             # <<<<<<<<<<<<<<
 *             elif t == NPY_LONG:        f[0] = 108 #"l"
 *             elif t == NPY_ULONG:       f[0] = 76  #"L"
 */
      __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UINT); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 831, __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, 831, __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, 831, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 73;
        goto __pyx_L15;
      }

      /* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":832
 *             elif t == NPY_INT:         f[0] = 105 #"i"
 *             elif t == NPY_UINT:        f[0] =  73 #"I"
 *             elif t == NPY_LONG:        f[0] = 108 #"l"             # <<<<<<<<<<<<<<
 *             elif t == NPY_ULONG:       f[0] = 76  #"L"
 *             elif t == NPY_LONGLONG:    f[0] = 113 #"q"
 */
      __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 832, __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, 832, __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, 832, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 0x6C;
        goto __pyx_L15;
      }

      /* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":833
 *             elif t == NPY_UINT:        f[0] =  73 #"I"
 *             elif t == NPY_LONG:        f[0] = 108 #"l"
 *             elif t == NPY_ULONG:       f[0] = 76  #"L"             # <<<<<<<<<<<<<<
 *             elif t == NPY_LONGLONG:    f[0] = 113 #"q"
 *             elif t == NPY_ULONGLONG:   f[0] = 81  #"Q"
 */
      __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 833, __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, 833, __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, 833, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 76;
        goto __pyx_L15;
      }

      /* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":834
 *             elif t == NPY_LONG:        f[0] = 108 #"l"
 *             elif t == NPY_ULONG:       f[0] = 76  #"L"
 *             elif t == NPY_LONGLONG:    f[0] = 113 #"q"             # <<<<<<<<<<<<<<
 *             elif t == NPY_ULONGLONG:   f[0] = 81  #"Q"
 *             elif t == NPY_FLOAT:       f[0] = 102 #"f"
 */
      __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGLONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 834, __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, 834, __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, 834, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 0x71;
        goto __pyx_L15;
      }

      /* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":835
 *             elif t == NPY_ULONG:       f[0] = 76  #"L"
 *             elif t == NPY_LONGLONG:    f[0] = 113 #"q"
 *             elif t == NPY_ULONGLONG:   f[0] = 81  #"Q"             # <<<<<<<<<<<<<<
 *             elif t == NPY_FLOAT:       f[0] = 102 #"f"
 *             elif t == NPY_DOUBLE:      f[0] = 100 #"d"
 */
      __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONGLONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 835, __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, 835, __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, 835, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 81;
        goto __pyx_L15;
      }

      /* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":836
 *             elif t == NPY_LONGLONG:    f[0] = 113 #"q"
 *             elif t == NPY_ULONGLONG:   f[0] = 81  #"Q"
 *             elif t == NPY_FLOAT:       f[0] = 102 #"f"             # <<<<<<<<<<<<<<
 *             elif t == NPY_DOUBLE:      f[0] = 100 #"d"
 *             elif t == NPY_LONGDOUBLE:  f[0] = 103 #"g"
 */
      __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_FLOAT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 836, __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, 836, __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, 836, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 0x66;
        goto __pyx_L15;
      }

      /* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":837
 *             elif t == NPY_ULONGLONG:   f[0] = 81  #"Q"
 *             elif t == NPY_FLOAT:       f[0] = 102 #"f"
 *             elif t == NPY_DOUBLE:      f[0] = 100 #"d"             # <<<<<<<<<<<<<<
 *             elif t == NPY_LONGDOUBLE:  f[0] = 103 #"g"
 *             elif t == NPY_CFLOAT:      f[0] = 90; f[1] = 102; f += 1 # Zf
 */
      __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_DOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 837, __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, 837, __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, 837, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 0x64;
        goto __pyx_L15;
      }

      /* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":838
 *             elif t == NPY_FLOAT:       f[0] = 102 #"f"
 *             elif t == NPY_DOUBLE:      f[0] = 100 #"d"
 *             elif t == NPY_LONGDOUBLE:  f[0] = 103 #"g"             # <<<<<<<<<<<<<<
 *             elif t == NPY_CFLOAT:      f[0] = 90; f[1] = 102; f += 1 # Zf
 *             elif t == NPY_CDOUBLE:     f[0] = 90; f[1] = 100; f += 1 # Zd
 */
      __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 838, __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, 838, __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, 838, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 0x67;
        goto __pyx_L15;
      }

      /* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":839
 *             elif t == NPY_DOUBLE:      f[0] = 100 #"d"
 *             elif t == NPY_LONGDOUBLE:  f[0] = 103 #"g"
 *             elif t == NPY_CFLOAT:      f[0] = 90; f[1] = 102; f += 1 # Zf             # <<<<<<<<<<<<<<
 *             elif t == NPY_CDOUBLE:     f[0] = 90; f[1] = 100; f += 1 # Zd
 *             elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
 */
      __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CFLOAT); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 839, __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, 839, __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, 839, __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;
      }

      /* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":840
 *             elif t == NPY_LONGDOUBLE:  f[0] = 103 #"g"
 *             elif t == NPY_CFLOAT:      f[0] = 90; f[1] = 102; f += 1 # Zf
 *             elif t == NPY_CDOUBLE:     f[0] = 90; f[1] = 100; f += 1 # Zd             # <<<<<<<<<<<<<<
 *             elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
 *             elif t == NPY_OBJECT:      f[0] = 79 #"O"
 */
      __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 840, __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, 840, __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, 840, __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;
      }

      /* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":841
 *             elif t == NPY_CFLOAT:      f[0] = 90; f[1] = 102; f += 1 # Zf
 *             elif t == NPY_CDOUBLE:     f[0] = 90; f[1] = 100; f += 1 # Zd
 *             elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg             # <<<<<<<<<<<<<<
 *             elif t == NPY_OBJECT:      f[0] = 79 #"O"
 *             else:
 */
      __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 841, __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, 841, __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, 841, __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;
      }

      /* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":842
 *             elif t == NPY_CDOUBLE:     f[0] = 90; f[1] = 100; f += 1 # Zd
 *             elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
 *             elif t == NPY_OBJECT:      f[0] = 79 #"O"             # <<<<<<<<<<<<<<
 *             else:
 *                 raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
 */
      __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_OBJECT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 842, __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, 842, __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, 842, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 79;
        goto __pyx_L15;
      }

      /* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":844
 *             elif t == NPY_OBJECT:      f[0] = 79 #"O"
 *             else:
 *                 raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)             # <<<<<<<<<<<<<<
 *             f += 1
 *         else:
 */
      /*else*/ {
        __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 844, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 844, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_GIVEREF(__pyx_t_3);
        PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
        __pyx_t_3 = 0;
        __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 844, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_Raise(__pyx_t_3, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __PYX_ERR(1, 844, __pyx_L1_error)
      }
      __pyx_L15:;

      /* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":845
 *             else:
 *                 raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
 *             f += 1             # <<<<<<<<<<<<<<
 *         else:
 *             # Cython ignores struct boundary information ("T{...}"),
 */
      __pyx_v_f = (__pyx_v_f + 1);

      /* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":820
 *         offset[0] += child.itemsize
 * 
 *         if not PyDataType_HASFIELDS(child):             # <<<<<<<<<<<<<<
 *             t = child.type_num
 *             if end - f < 5:
 */
      goto __pyx_L13;
    }

    /* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":849
 *             # Cython ignores struct boundary information ("T{...}"),
 *             # so don't output it
 *             f = _util_dtypestring(child, f, end, offset)             # <<<<<<<<<<<<<<
 *     return f
 * 
 */
    /*else*/ {
      __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_9 == NULL)) __PYX_ERR(1, 849, __pyx_L1_error)
      __pyx_v_f = __pyx_t_9;
    }
    __pyx_L13:;

    /* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":794
 *     cdef tuple fields
 * 
 *     for childname in descr.names:             # <<<<<<<<<<<<<<
 *         fields = descr.fields[childname]
 *         child, new_offset = fields
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":850
 *             # so don't output it
 *             f = _util_dtypestring(child, f, end, offset)
 *     return f             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_f;
  goto __pyx_L0;

  /* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":785
 *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
 * 
 * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL:             # <<<<<<<<<<<<<<
 *     # Recursive utility function used in __getbuffer__ to get format
 *     # string. The new location in the format string is returned.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("numpy._util_dtypestring", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_child);
  __Pyx_XDECREF(__pyx_v_fields);
  __Pyx_XDECREF(__pyx_v_childname);
  __Pyx_XDECREF(__pyx_v_new_offset);
  __Pyx_XDECREF(__pyx_v_t);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":966
 * 
 * 
 * cdef inline void set_array_base(ndarray arr, object base):             # <<<<<<<<<<<<<<
 *      cdef PyObject* baseptr
 *      if base is None:
 */

static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) {
  PyObject *__pyx_v_baseptr;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  __Pyx_RefNannySetupContext("set_array_base", 0);

  /* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":968
 * cdef inline void set_array_base(ndarray arr, object base):
 *      cdef PyObject* baseptr
 *      if base is None:             # <<<<<<<<<<<<<<
 *          baseptr = NULL
 *      else:
 */
  __pyx_t_1 = (__pyx_v_base == Py_None);
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":969
 *      cdef PyObject* baseptr
 *      if base is None:
 *          baseptr = NULL             # <<<<<<<<<<<<<<
 *      else:
 *          Py_INCREF(base) # important to do this before decref below!
 */
    __pyx_v_baseptr = NULL;

    /* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":968
 * cdef inline void set_array_base(ndarray arr, object base):
 *      cdef PyObject* baseptr
 *      if base is None:             # <<<<<<<<<<<<<<
 *          baseptr = NULL
 *      else:
 */
    goto __pyx_L3;
  }

  /* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":971
 *          baseptr = NULL
 *      else:
 *          Py_INCREF(base) # important to do this before decref below!             # <<<<<<<<<<<<<<
 *          baseptr = <PyObject*>base
 *      Py_XDECREF(arr.base)
 */
  /*else*/ {
    Py_INCREF(__pyx_v_base);

    /* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":972
 *      else:
 *          Py_INCREF(base) # important to do this before decref below!
 *          baseptr = <PyObject*>base             # <<<<<<<<<<<<<<
 *      Py_XDECREF(arr.base)
 *      arr.base = baseptr
 */
    __pyx_v_baseptr = ((PyObject *)__pyx_v_base);
  }
  __pyx_L3:;

  /* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":973
 *          Py_INCREF(base) # important to do this before decref below!
 *          baseptr = <PyObject*>base
 *      Py_XDECREF(arr.base)             # <<<<<<<<<<<<<<
 *      arr.base = baseptr
 * 
 */
  Py_XDECREF(__pyx_v_arr->base);

  /* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":974
 *          baseptr = <PyObject*>base
 *      Py_XDECREF(arr.base)
 *      arr.base = baseptr             # <<<<<<<<<<<<<<
 * 
 * cdef inline object get_array_base(ndarray arr):
 */
  __pyx_v_arr->base = __pyx_v_baseptr;

  /* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":966
 * 
 * 
 * cdef inline void set_array_base(ndarray arr, object base):             # <<<<<<<<<<<<<<
 *      cdef PyObject* baseptr
 *      if base is None:
 */

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

/* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":976
 *      arr.base = baseptr
 * 
 * cdef inline object get_array_base(ndarray arr):             # <<<<<<<<<<<<<<
 *     if arr.base is NULL:
 *         return None
 */

static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("get_array_base", 0);

  /* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":977
 * 
 * cdef inline object get_array_base(ndarray arr):
 *     if arr.base is NULL:             # <<<<<<<<<<<<<<
 *         return None
 *     else:
 */
  __pyx_t_1 = ((__pyx_v_arr->base == NULL) != 0);
  if (__pyx_t_1) {

    /* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":978
 * cdef inline object get_array_base(ndarray arr):
 *     if arr.base is NULL:
 *         return None             # <<<<<<<<<<<<<<
 *     else:
 *         return <object>arr.base
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_None);
    __pyx_r = Py_None;
    goto __pyx_L0;

    /* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":977
 * 
 * cdef inline object get_array_base(ndarray arr):
 *     if arr.base is NULL:             # <<<<<<<<<<<<<<
 *         return None
 *     else:
 */
  }

  /* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":980
 *         return None
 *     else:
 *         return <object>arr.base             # <<<<<<<<<<<<<<
 * 
 * 
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(((PyObject *)__pyx_v_arr->base));
    __pyx_r = ((PyObject *)__pyx_v_arr->base);
    goto __pyx_L0;
  }

  /* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":976
 *      arr.base = baseptr
 * 
 * cdef inline object get_array_base(ndarray arr):             # <<<<<<<<<<<<<<
 *     if arr.base is NULL:
 *         return None
 */

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

/* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":985
 * # 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);

  /* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":986
 * # 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:*/ {

      /* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":987
 * 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 == -1)) __PYX_ERR(1, 987, __pyx_L3_error)

      /* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":986
 * # 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_L10_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign

    /* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":988
 *     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, 988, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);

      /* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":989
 *         _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__219, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 989, __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, 989, __pyx_L5_except_error)
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":986
 * # Cython code.
 * cdef inline int import_array() except -1:
 *     try:             # <<<<<<<<<<<<<<
 *         _import_array()
 *     except Exception:
 */
    __Pyx_PyThreadState_assign
    __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_L10_try_end:;
  }

  /* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":985
 * # 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;
}

/* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":991
 *         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);

  /* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":992
 * 
 * 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:*/ {

      /* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":993
 * 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 == -1)) __PYX_ERR(1, 993, __pyx_L3_error)

      /* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":992
 * 
 * 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_L10_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign

    /* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":994
 *     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, 994, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);

      /* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":995
 *         _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__220, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 995, __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, 995, __pyx_L5_except_error)
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":992
 * 
 * cdef inline int import_umath() except -1:
 *     try:             # <<<<<<<<<<<<<<
 *         _import_umath()
 *     except Exception:
 */
    __Pyx_PyThreadState_assign
    __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_L10_try_end:;
  }

  /* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":991
 *         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;
}

/* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":997
 *         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);

  /* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":998
 * 
 * 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:*/ {

      /* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":999
 * 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 == -1)) __PYX_ERR(1, 999, __pyx_L3_error)

      /* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":998
 * 
 * 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_L10_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign

    /* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":1000
 *     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, 1000, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);

      /* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":1001
 *         _import_umath()
 *     except Exception:
 *         raise ImportError("numpy.core.umath failed to import")             # <<<<<<<<<<<<<<
 */
      __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__221, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1001, __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, 1001, __pyx_L5_except_error)
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":998
 * 
 * cdef inline int import_ufunc() except -1:
 *     try:             # <<<<<<<<<<<<<<
 *         _import_umath()
 *     except Exception:
 */
    __Pyx_PyThreadState_assign
    __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_L10_try_end:;
  }

  /* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":997
 *         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}
};

#if PY_MAJOR_VERSION >= 3
static struct PyModuleDef __pyx_moduledef = {
  #if PY_VERSION_HEX < 0x03020000
    { PyObject_HEAD_INIT(NULL) NULL, 0, NULL },
  #else
    PyModuleDef_HEAD_INIT,
  #endif
    "uavsarc",
    __pyx_k_UAVSAR_Data_Import_Cython_Functi, /* m_doc */
    -1, /* m_size */
    __pyx_methods /* m_methods */,
    NULL, /* m_reload */
    NULL, /* m_traverse */
    NULL, /* m_clear */
    NULL /* m_free */
};
#endif

static __Pyx_StringTabEntry __pyx_string_tab[] = {
  {&__pyx_kp_u_1x1_Rows, __pyx_k_1x1_Rows, sizeof(__pyx_k_1x1_Rows), 0, 1, 0, 0},
  {&__pyx_kp_u_1x1_SLC_Azimuth_Pixel_Spacing, __pyx_k_1x1_SLC_Azimuth_Pixel_Spacing, sizeof(__pyx_k_1x1_SLC_Azimuth_Pixel_Spacing), 0, 1, 0, 0},
  {&__pyx_kp_u_1x1_SLC_Range_Pixel_Spacing, __pyx_k_1x1_SLC_Range_Pixel_Spacing, sizeof(__pyx_k_1x1_SLC_Range_Pixel_Spacing), 0, 1, 0, 0},
  {&__pyx_kp_u_1x1_slc, __pyx_k_1x1_slc, sizeof(__pyx_k_1x1_slc), 0, 1, 0, 0},
  {&__pyx_kp_u_1x1_slc_2, __pyx_k_1x1_slc_2, sizeof(__pyx_k_1x1_slc_2), 0, 1, 0, 0},
  {&__pyx_kp_u_1x4_Rows, __pyx_k_1x4_Rows, sizeof(__pyx_k_1x4_Rows), 0, 1, 0, 0},
  {&__pyx_kp_u_1x4_slc, __pyx_k_1x4_slc, sizeof(__pyx_k_1x4_slc), 0, 1, 0, 0},
  {&__pyx_n_u_2x8, __pyx_k_2x8, sizeof(__pyx_k_2x8), 0, 1, 0, 1},
  {&__pyx_kp_u_2x8_Columns, __pyx_k_2x8_Columns, sizeof(__pyx_k_2x8_Columns), 0, 1, 0, 0},
  {&__pyx_kp_u_2x8_Rows, __pyx_k_2x8_Rows, sizeof(__pyx_k_2x8_Rows), 0, 1, 0, 0},
  {&__pyx_kp_u_2x8_slc, __pyx_k_2x8_slc, sizeof(__pyx_k_2x8_slc), 0, 1, 0, 0},
  {&__pyx_kp_u_2x8_slc_2, __pyx_k_2x8_slc_2, sizeof(__pyx_k_2x8_slc_2), 0, 1, 0, 0},
  {&__pyx_kp_u_4x1_slc, __pyx_k_4x1_slc, sizeof(__pyx_k_4x1_slc), 0, 1, 0, 0},
  {&__pyx_kp_u_Aborting, __pyx_k_Aborting, sizeof(__pyx_k_Aborting), 0, 1, 0, 0},
  {&__pyx_n_s_Ann, __pyx_k_Ann, sizeof(__pyx_k_Ann), 0, 0, 1, 1},
  {&__pyx_n_s_Ann___init, __pyx_k_Ann___init, sizeof(__pyx_k_Ann___init), 0, 0, 1, 1},
  {&__pyx_n_s_Ann_query, __pyx_k_Ann_query, sizeof(__pyx_k_Ann_query), 0, 0, 1, 1},
  {&__pyx_kp_u_Average_Altitude, __pyx_k_Average_Altitude, sizeof(__pyx_k_Average_Altitude), 0, 1, 0, 0},
  {&__pyx_kp_u_Azimuth_Index, __pyx_k_Azimuth_Index, sizeof(__pyx_k_Azimuth_Index), 0, 1, 0, 0},
  {&__pyx_kp_u_Backscatter_dB, __pyx_k_Backscatter_dB, sizeof(__pyx_k_Backscatter_dB), 0, 1, 0, 0},
  {&__pyx_kp_s_C_Users_Michael_Dropbox_kapok_re, __pyx_k_C_Users_Michael_Dropbox_kapok_re, sizeof(__pyx_k_C_Users_Michael_Dropbox_kapok_re), 0, 0, 1, 0},
  {&__pyx_kp_u_Center_Wavelength, __pyx_k_Center_Wavelength, sizeof(__pyx_k_Center_Wavelength), 0, 1, 0, 0},
  {&__pyx_kp_s_Class_for_loading_and_interactin, __pyx_k_Class_for_loading_and_interactin, sizeof(__pyx_k_Class_for_loading_and_interactin), 0, 0, 1, 0},
  {&__pyx_kp_u_Covariance_Matrix, __pyx_k_Covariance_Matrix, sizeof(__pyx_k_Covariance_Matrix), 0, 1, 0, 0},
  {&__pyx_n_s_File, __pyx_k_File, sizeof(__pyx_k_File), 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_u_HH, __pyx_k_HH, sizeof(__pyx_k_HH), 0, 1, 0, 1},
  {&__pyx_n_u_HV, __pyx_k_HV, sizeof(__pyx_k_HV), 0, 1, 0, 1},
  {&__pyx_kp_u_Image_Starting_Slant_Range, __pyx_k_Image_Starting_Slant_Range, sizeof(__pyx_k_Image_Starting_Slant_Range), 0, 1, 0, 0},
  {&__pyx_n_s_ImportError, __pyx_k_ImportError, sizeof(__pyx_k_ImportError), 0, 0, 1, 1},
  {&__pyx_kp_u_Interferometric_Vertical_Wavenum, __pyx_k_Interferometric_Vertical_Wavenum, sizeof(__pyx_k_Interferometric_Vertical_Wavenum), 0, 1, 0, 0},
  {&__pyx_n_u_L090, __pyx_k_L090, sizeof(__pyx_k_L090), 0, 1, 0, 1},
  {&__pyx_n_u_Latitude, __pyx_k_Latitude, sizeof(__pyx_k_Latitude), 0, 1, 0, 1},
  {&__pyx_n_u_Longitude, __pyx_k_Longitude, sizeof(__pyx_k_Longitude), 0, 1, 0, 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_kp_u_Number_of_Azimuth_Looks_in_2x8_S, __pyx_k_Number_of_Azimuth_Looks_in_2x8_S, sizeof(__pyx_k_Number_of_Azimuth_Looks_in_2x8_S), 0, 1, 0, 0},
  {&__pyx_kp_u_Number_of_Range_Looks_in_2x8_SLC, __pyx_k_Number_of_Range_Looks_in_2x8_SLC, sizeof(__pyx_k_Number_of_Range_Looks_in_2x8_SLC), 0, 1, 0, 0},
  {&__pyx_kp_u_Number_of_Segments, __pyx_k_Number_of_Segments, sizeof(__pyx_k_Number_of_Segments), 0, 1, 0, 0},
  {&__pyx_kp_u_Peg_Heading, __pyx_k_Peg_Heading, sizeof(__pyx_k_Peg_Heading), 0, 1, 0, 0},
  {&__pyx_kp_u_Peg_Latitude, __pyx_k_Peg_Latitude, sizeof(__pyx_k_Peg_Latitude), 0, 1, 0, 0},
  {&__pyx_kp_u_Peg_Longitude, __pyx_k_Peg_Longitude, sizeof(__pyx_k_Peg_Longitude), 0, 1, 0, 0},
  {&__pyx_kp_u_Processor_DEM, __pyx_k_Processor_DEM, sizeof(__pyx_k_Processor_DEM), 0, 1, 0, 0},
  {&__pyx_kp_u_Range_Index, __pyx_k_Range_Index, sizeof(__pyx_k_Range_Index), 0, 1, 0, 0},
  {&__pyx_kp_u_Reference_Track_Incidence_Angle, __pyx_k_Reference_Track_Incidence_Angle, sizeof(__pyx_k_Reference_Track_Incidence_Angle), 0, 1, 0, 0},
  {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1},
  {&__pyx_n_u_S, __pyx_k_S, sizeof(__pyx_k_S), 0, 1, 0, 1},
  {&__pyx_n_s_Scene, __pyx_k_Scene, sizeof(__pyx_k_Scene), 0, 0, 1, 1},
  {&__pyx_kp_u_Site_Description, __pyx_k_Site_Description, sizeof(__pyx_k_Site_Description), 0, 1, 0, 0},
  {&__pyx_kp_u_Stack_Name, __pyx_k_Stack_Name, sizeof(__pyx_k_Stack_Name), 0, 1, 0, 0},
  {&__pyx_n_u_UAVSAR, __pyx_k_UAVSAR, sizeof(__pyx_k_UAVSAR), 0, 1, 0, 1},
  {&__pyx_n_u_URL, __pyx_k_URL, sizeof(__pyx_k_URL), 0, 1, 0, 1},
  {&__pyx_n_u_VV, __pyx_k_VV, sizeof(__pyx_k_VV), 0, 1, 0, 1},
  {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
  {&__pyx_kp_u__16, __pyx_k__16, sizeof(__pyx_k__16), 0, 1, 0, 0},
  {&__pyx_kp_u__177, __pyx_k__177, sizeof(__pyx_k__177), 0, 1, 0, 0},
  {&__pyx_kp_u__179, __pyx_k__179, sizeof(__pyx_k__179), 0, 1, 0, 0},
  {&__pyx_kp_u__181, __pyx_k__181, sizeof(__pyx_k__181), 0, 1, 0, 0},
  {&__pyx_kp_u__27, __pyx_k__27, sizeof(__pyx_k__27), 0, 1, 0, 0},
  {&__pyx_kp_u__28, __pyx_k__28, sizeof(__pyx_k__28), 0, 1, 0, 0},
  {&__pyx_kp_u__30, __pyx_k__30, sizeof(__pyx_k__30), 0, 1, 0, 0},
  {&__pyx_kp_u__31, __pyx_k__31, sizeof(__pyx_k__31), 0, 1, 0, 0},
  {&__pyx_n_s__33, __pyx_k__33, sizeof(__pyx_k__33), 0, 0, 1, 1},
  {&__pyx_kp_u__33, __pyx_k__33, sizeof(__pyx_k__33), 0, 1, 0, 0},
  {&__pyx_kp_u__34, __pyx_k__34, sizeof(__pyx_k__34), 0, 1, 0, 0},
  {&__pyx_kp_u__37, __pyx_k__37, sizeof(__pyx_k__37), 0, 1, 0, 0},
  {&__pyx_kp_u__38, __pyx_k__38, sizeof(__pyx_k__38), 0, 1, 0, 0},
  {&__pyx_kp_u__39, __pyx_k__39, sizeof(__pyx_k__39), 0, 1, 0, 0},
  {&__pyx_kp_u__40, __pyx_k__40, sizeof(__pyx_k__40), 0, 1, 0, 0},
  {&__pyx_kp_u__41, __pyx_k__41, sizeof(__pyx_k__41), 0, 1, 0, 0},
  {&__pyx_kp_u__42, __pyx_k__42, sizeof(__pyx_k__42), 0, 1, 0, 0},
  {&__pyx_kp_u__43, __pyx_k__43, sizeof(__pyx_k__43), 0, 1, 0, 0},
  {&__pyx_kp_u__46, __pyx_k__46, sizeof(__pyx_k__46), 0, 1, 0, 0},
  {&__pyx_kp_u__47, __pyx_k__47, sizeof(__pyx_k__47), 0, 1, 0, 0},
  {&__pyx_n_s_abs, __pyx_k_abs, sizeof(__pyx_k_abs), 0, 0, 1, 1},
  {&__pyx_kp_u_and_reference_track, __pyx_k_and_reference_track, sizeof(__pyx_k_and_reference_track), 0, 1, 0, 0},
  {&__pyx_n_s_ann, __pyx_k_ann, sizeof(__pyx_k_ann), 0, 0, 1, 1},
  {&__pyx_n_s_append, __pyx_k_append, sizeof(__pyx_k_append), 0, 0, 1, 1},
  {&__pyx_n_s_arccos, __pyx_k_arccos, sizeof(__pyx_k_arccos), 0, 0, 1, 1},
  {&__pyx_n_s_array, __pyx_k_array, sizeof(__pyx_k_array), 0, 0, 1, 1},
  {&__pyx_n_s_aspect, __pyx_k_aspect, sizeof(__pyx_k_aspect), 0, 0, 1, 1},
  {&__pyx_n_s_astype, __pyx_k_astype, sizeof(__pyx_k_astype), 0, 0, 1, 1},
  {&__pyx_n_s_attrs, __pyx_k_attrs, sizeof(__pyx_k_attrs), 0, 0, 1, 1},
  {&__pyx_n_u_average_altitude, __pyx_k_average_altitude, sizeof(__pyx_k_average_altitude), 0, 1, 0, 1},
  {&__pyx_n_s_axis, __pyx_k_axis, sizeof(__pyx_k_axis), 0, 0, 1, 1},
  {&__pyx_n_s_az, __pyx_k_az, sizeof(__pyx_k_az), 0, 0, 1, 1},
  {&__pyx_n_s_az_ml, __pyx_k_az_ml, sizeof(__pyx_k_az_ml), 0, 0, 1, 1},
  {&__pyx_n_s_az_vector, __pyx_k_az_vector, sizeof(__pyx_k_az_vector), 0, 0, 1, 1},
  {&__pyx_n_s_azbounds, __pyx_k_azbounds, sizeof(__pyx_k_azbounds), 0, 0, 1, 1},
  {&__pyx_n_s_azend, __pyx_k_azend, sizeof(__pyx_k_azend), 0, 0, 1, 1},
  {&__pyx_n_s_azend_slc, __pyx_k_azend_slc, sizeof(__pyx_k_azend_slc), 0, 0, 1, 1},
  {&__pyx_n_u_azimuth_bounds_slc, __pyx_k_azimuth_bounds_slc, sizeof(__pyx_k_azimuth_bounds_slc), 0, 1, 0, 1},
  {&__pyx_n_s_azllhend, __pyx_k_azllhend, sizeof(__pyx_k_azllhend), 0, 0, 1, 1},
  {&__pyx_n_s_azllhoffset, __pyx_k_azllhoffset, sizeof(__pyx_k_azllhoffset), 0, 0, 1, 1},
  {&__pyx_n_s_azllhstart, __pyx_k_azllhstart, sizeof(__pyx_k_azllhstart), 0, 0, 1, 1},
  {&__pyx_n_s_azoff, __pyx_k_azoff, sizeof(__pyx_k_azoff), 0, 0, 1, 1},
  {&__pyx_n_s_azoffset_end, __pyx_k_azoffset_end, sizeof(__pyx_k_azoffset_end), 0, 0, 1, 1},
  {&__pyx_n_s_azoffset_start, __pyx_k_azoffset_start, sizeof(__pyx_k_azoffset_start), 0, 0, 1, 1},
  {&__pyx_n_s_azposend, __pyx_k_azposend, sizeof(__pyx_k_azposend), 0, 0, 1, 1},
  {&__pyx_n_s_azposstart, __pyx_k_azposstart, sizeof(__pyx_k_azposstart), 0, 0, 1, 1},
  {&__pyx_n_s_azsize, __pyx_k_azsize, sizeof(__pyx_k_azsize), 0, 0, 1, 1},
  {&__pyx_n_s_azsize_slc, __pyx_k_azsize_slc, sizeof(__pyx_k_azsize_slc), 0, 0, 1, 1},
  {&__pyx_n_s_azsize_slc1x1, __pyx_k_azsize_slc1x1, sizeof(__pyx_k_azsize_slc1x1), 0, 0, 1, 1},
  {&__pyx_n_s_azslope, __pyx_k_azslope, sizeof(__pyx_k_azslope), 0, 0, 1, 1},
  {&__pyx_n_s_azstart, __pyx_k_azstart, sizeof(__pyx_k_azstart), 0, 0, 1, 1},
  {&__pyx_n_s_azstart_slc, __pyx_k_azstart_slc, sizeof(__pyx_k_azstart_slc), 0, 0, 1, 1},
  {&__pyx_n_s_base_enu, __pyx_k_base_enu, sizeof(__pyx_k_base_enu), 0, 0, 1, 1},
  {&__pyx_n_s_basefile, __pyx_k_basefile, sizeof(__pyx_k_basefile), 0, 0, 1, 1},
  {&__pyx_kp_u_baseline, __pyx_k_baseline, sizeof(__pyx_k_baseline), 0, 1, 0, 0},
  {&__pyx_n_s_baseline_2, __pyx_k_baseline_2, sizeof(__pyx_k_baseline_2), 0, 0, 1, 1},
  {&__pyx_n_s_baselinep, __pyx_k_baselinep, sizeof(__pyx_k_baselinep), 0, 0, 1, 1},
  {&__pyx_n_s_baselinepsign, __pyx_k_baselinepsign, sizeof(__pyx_k_baselinepsign), 0, 0, 1, 1},
  {&__pyx_n_s_basesch, __pyx_k_basesch, sizeof(__pyx_k_basesch), 0, 0, 1, 1},
  {&__pyx_n_u_basis, __pyx_k_basis, sizeof(__pyx_k_basis), 0, 1, 0, 1},
  {&__pyx_n_s_bbox_inches, __pyx_k_bbox_inches, sizeof(__pyx_k_bbox_inches), 0, 0, 1, 1},
  {&__pyx_n_s_byteoffset, __pyx_k_byteoffset, sizeof(__pyx_k_byteoffset), 0, 0, 1, 1},
  {&__pyx_n_u_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 1, 0, 1},
  {&__pyx_n_s_calcslope, __pyx_k_calcslope, sizeof(__pyx_k_calcslope), 0, 0, 1, 1},
  {&__pyx_n_s_close, __pyx_k_close, sizeof(__pyx_k_close), 0, 0, 1, 1},
  {&__pyx_n_s_cmap, __pyx_k_cmap, sizeof(__pyx_k_cmap), 0, 0, 1, 1},
  {&__pyx_n_s_col, __pyx_k_col, sizeof(__pyx_k_col), 0, 0, 1, 1},
  {&__pyx_n_s_colorbar, __pyx_k_colorbar, sizeof(__pyx_k_colorbar), 0, 0, 1, 1},
  {&__pyx_n_u_complex64, __pyx_k_complex64, sizeof(__pyx_k_complex64), 0, 1, 0, 1},
  {&__pyx_n_s_compression, __pyx_k_compression, sizeof(__pyx_k_compression), 0, 0, 1, 1},
  {&__pyx_n_u_compression, __pyx_k_compression, sizeof(__pyx_k_compression), 0, 1, 0, 1},
  {&__pyx_n_s_compression_opts, __pyx_k_compression_opts, sizeof(__pyx_k_compression_opts), 0, 0, 1, 1},
  {&__pyx_n_u_compression_opts, __pyx_k_compression_opts, sizeof(__pyx_k_compression_opts), 0, 1, 0, 1},
  {&__pyx_n_s_conj, __pyx_k_conj, sizeof(__pyx_k_conj), 0, 0, 1, 1},
  {&__pyx_n_s_cov, __pyx_k_cov, sizeof(__pyx_k_cov), 0, 0, 1, 1},
  {&__pyx_n_u_cov, __pyx_k_cov, sizeof(__pyx_k_cov), 0, 1, 0, 1},
  {&__pyx_n_u_cov_azimuth_pixel_spacing, __pyx_k_cov_azimuth_pixel_spacing, sizeof(__pyx_k_cov_azimuth_pixel_spacing), 0, 1, 0, 1},
  {&__pyx_n_u_cov_slant_range_pixel_spacing, __pyx_k_cov_slant_range_pixel_spacing, sizeof(__pyx_k_cov_slant_range_pixel_spacing), 0, 1, 0, 1},
  {&__pyx_n_s_create_dataset, __pyx_k_create_dataset, sizeof(__pyx_k_create_dataset), 0, 0, 1, 1},
  {&__pyx_n_s_ctime, __pyx_k_ctime, sizeof(__pyx_k_ctime), 0, 0, 1, 1},
  {&__pyx_n_s_cumsum, __pyx_k_cumsum, sizeof(__pyx_k_cumsum), 0, 0, 1, 1},
  {&__pyx_n_s_datapath, __pyx_k_datapath, sizeof(__pyx_k_datapath), 0, 0, 1, 1},
  {&__pyx_n_u_degrees, __pyx_k_degrees, sizeof(__pyx_k_degrees), 0, 1, 0, 1},
  {&__pyx_n_s_dem, __pyx_k_dem, sizeof(__pyx_k_dem), 0, 0, 1, 1},
  {&__pyx_n_u_dem, __pyx_k_dem, sizeof(__pyx_k_dem), 0, 1, 0, 1},
  {&__pyx_n_u_description, __pyx_k_description, sizeof(__pyx_k_description), 0, 1, 0, 1},
  {&__pyx_n_u_dim, __pyx_k_dim, sizeof(__pyx_k_dim), 0, 1, 0, 1},
  {&__pyx_n_u_dim_slc, __pyx_k_dim_slc, sizeof(__pyx_k_dim_slc), 0, 1, 0, 1},
  {&__pyx_n_s_dirname, __pyx_k_dirname, sizeof(__pyx_k_dirname), 0, 0, 1, 1},
  {&__pyx_n_s_doc, __pyx_k_doc, sizeof(__pyx_k_doc), 0, 0, 1, 1},
  {&__pyx_n_s_dpi, __pyx_k_dpi, sizeof(__pyx_k_dpi), 0, 0, 1, 1},
  {&__pyx_n_s_dtype, __pyx_k_dtype, sizeof(__pyx_k_dtype), 0, 0, 1, 1},
  {&__pyx_n_s_end, __pyx_k_end, sizeof(__pyx_k_end), 0, 0, 1, 1},
  {&__pyx_n_s_enumerate, __pyx_k_enumerate, sizeof(__pyx_k_enumerate), 0, 0, 1, 1},
  {&__pyx_n_s_extent, __pyx_k_extent, sizeof(__pyx_k_extent), 0, 0, 1, 1},
  {&__pyx_n_s_f, __pyx_k_f, sizeof(__pyx_k_f), 0, 0, 1, 1},
  {&__pyx_n_s_fd, __pyx_k_fd, sizeof(__pyx_k_fd), 0, 0, 1, 1},
  {&__pyx_n_s_figure, __pyx_k_figure, sizeof(__pyx_k_figure), 0, 0, 1, 1},
  {&__pyx_n_s_file, __pyx_k_file, sizeof(__pyx_k_file), 0, 0, 1, 1},
  {&__pyx_n_s_file2, __pyx_k_file2, sizeof(__pyx_k_file2), 0, 0, 1, 1},
  {&__pyx_n_s_file_alt, __pyx_k_file_alt, sizeof(__pyx_k_file_alt), 0, 0, 1, 1},
  {&__pyx_n_s_findsegment, __pyx_k_findsegment, sizeof(__pyx_k_findsegment), 0, 0, 1, 1},
  {&__pyx_n_u_float, __pyx_k_float, sizeof(__pyx_k_float), 0, 1, 0, 1},
  {&__pyx_n_u_float32, __pyx_k_float32, sizeof(__pyx_k_float32), 0, 1, 0, 1},
  {&__pyx_n_u_float64, __pyx_k_float64, sizeof(__pyx_k_float64), 0, 1, 0, 1},
  {&__pyx_n_s_floor, __pyx_k_floor, sizeof(__pyx_k_floor), 0, 0, 1, 1},
  {&__pyx_n_s_flush, __pyx_k_flush, sizeof(__pyx_k_flush), 0, 0, 1, 1},
  {&__pyx_n_s_getslcblock, __pyx_k_getslcblock, sizeof(__pyx_k_getslcblock), 0, 0, 1, 1},
  {&__pyx_n_s_glob, __pyx_k_glob, sizeof(__pyx_k_glob), 0, 0, 1, 1},
  {&__pyx_n_s_gradient, __pyx_k_gradient, sizeof(__pyx_k_gradient), 0, 0, 1, 1},
  {&__pyx_n_u_gray, __pyx_k_gray, sizeof(__pyx_k_gray), 0, 1, 0, 1},
  {&__pyx_kp_u_greater_than_number_of_SLC_colu, __pyx_k_greater_than_number_of_SLC_colu, sizeof(__pyx_k_greater_than_number_of_SLC_colu), 0, 1, 0, 0},
  {&__pyx_kp_u_greater_than_number_of_SLC_line, __pyx_k_greater_than_number_of_SLC_line, sizeof(__pyx_k_greater_than_number_of_SLC_line), 0, 1, 0, 0},
  {&__pyx_n_u_gzip, __pyx_k_gzip, sizeof(__pyx_k_gzip), 0, 1, 0, 1},
  {&__pyx_n_s_h5py, __pyx_k_h5py, sizeof(__pyx_k_h5py), 0, 0, 1, 1},
  {&__pyx_n_s_height_dot_normal, __pyx_k_height_dot_normal, sizeof(__pyx_k_height_dot_normal), 0, 0, 1, 1},
  {&__pyx_n_u_hh, __pyx_k_hh, sizeof(__pyx_k_hh), 0, 1, 0, 1},
  {&__pyx_n_s_iend, __pyx_k_iend, sizeof(__pyx_k_iend), 0, 0, 1, 1},
  {&__pyx_n_u_image_starting_slant_range, __pyx_k_image_starting_slant_range, sizeof(__pyx_k_image_starting_slant_range), 0, 1, 0, 1},
  {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
  {&__pyx_n_s_imshow, __pyx_k_imshow, sizeof(__pyx_k_imshow), 0, 0, 1, 1},
  {&__pyx_n_s_inc, __pyx_k_inc, sizeof(__pyx_k_inc), 0, 0, 1, 1},
  {&__pyx_n_u_inc, __pyx_k_inc, sizeof(__pyx_k_inc), 0, 1, 0, 1},
  {&__pyx_n_s_inc_buffer, __pyx_k_inc_buffer, sizeof(__pyx_k_inc_buffer), 0, 0, 1, 1},
  {&__pyx_n_s_inc_ref, __pyx_k_inc_ref, sizeof(__pyx_k_inc_ref), 0, 0, 1, 1},
  {&__pyx_n_s_incident_lkv, __pyx_k_incident_lkv, sizeof(__pyx_k_incident_lkv), 0, 0, 1, 1},
  {&__pyx_n_u_indexing, __pyx_k_indexing, sizeof(__pyx_k_indexing), 0, 1, 0, 1},
  {&__pyx_n_s_infile, __pyx_k_infile, sizeof(__pyx_k_infile), 0, 0, 1, 1},
  {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1},
  {&__pyx_n_s_insert, __pyx_k_insert, sizeof(__pyx_k_insert), 0, 0, 1, 1},
  {&__pyx_n_u_int, __pyx_k_int, sizeof(__pyx_k_int), 0, 1, 0, 1},
  {&__pyx_n_u_int32, __pyx_k_int32, sizeof(__pyx_k_int32), 0, 1, 0, 1},
  {&__pyx_n_s_interpolation, __pyx_k_interpolation, sizeof(__pyx_k_interpolation), 0, 0, 1, 1},
  {&__pyx_kp_u_is_larger_than_the_size_of_the, __pyx_k_is_larger_than_the_size_of_the, sizeof(__pyx_k_is_larger_than_the_size_of_the), 0, 1, 0, 0},
  {&__pyx_kp_u_is_less_than_zero_Setting_lower, __pyx_k_is_less_than_zero_Setting_lower, sizeof(__pyx_k_is_less_than_zero_Setting_lower), 0, 1, 0, 0},
  {&__pyx_n_s_isclose, __pyx_k_isclose, sizeof(__pyx_k_isclose), 0, 0, 1, 1},
  {&__pyx_n_s_istart, __pyx_k_istart, sizeof(__pyx_k_istart), 0, 0, 1, 1},
  {&__pyx_n_s_kapok, __pyx_k_kapok, sizeof(__pyx_k_kapok), 0, 0, 1, 1},
  {&__pyx_n_s_kapok_lib, __pyx_k_kapok_lib, sizeof(__pyx_k_kapok_lib), 0, 0, 1, 1},
  {&__pyx_kp_u_kapok_uavsar_fingsegment_SLC_row, __pyx_k_kapok_uavsar_fingsegment_SLC_row, sizeof(__pyx_k_kapok_uavsar_fingsegment_SLC_row), 0, 1, 0, 0},
  {&__pyx_kp_u_kapok_uavsar_getslcblock_file2_a, __pyx_k_kapok_uavsar_getslcblock_file2_a, sizeof(__pyx_k_kapok_uavsar_getslcblock_file2_a), 0, 1, 0, 0},
  {&__pyx_kp_u_kapok_uavsar_load_Adjusting_kz_t, __pyx_k_kapok_uavsar_load_Adjusting_kz_t, sizeof(__pyx_k_kapok_uavsar_load_Adjusting_kz_t), 0, 1, 0, 0},
  {&__pyx_kp_u_kapok_uavsar_load_Boxcar_averagi, __pyx_k_kapok_uavsar_load_Boxcar_averagi, sizeof(__pyx_k_kapok_uavsar_load_Boxcar_averagi), 0, 1, 0, 0},
  {&__pyx_kp_u_kapok_uavsar_load_Calculating_co, __pyx_k_kapok_uavsar_load_Calculating_co, sizeof(__pyx_k_kapok_uavsar_load_Calculating_co), 0, 1, 0, 0},
  {&__pyx_kp_u_kapok_uavsar_load_Calculating_in, __pyx_k_kapok_uavsar_load_Calculating_in, sizeof(__pyx_k_kapok_uavsar_load_Calculating_in), 0, 1, 0, 0},
  {&__pyx_kp_u_kapok_uavsar_load_Calculating_kz, __pyx_k_kapok_uavsar_load_Calculating_kz, sizeof(__pyx_k_kapok_uavsar_load_Calculating_kz), 0, 1, 0, 0},
  {&__pyx_kp_u_kapok_uavsar_load_Calculating_ma, __pyx_k_kapok_uavsar_load_Calculating_ma, sizeof(__pyx_k_kapok_uavsar_load_Calculating_ma), 0, 1, 0, 0},
  {&__pyx_kp_u_kapok_uavsar_load_Cannot_create, __pyx_k_kapok_uavsar_load_Cannot_create, sizeof(__pyx_k_kapok_uavsar_load_Cannot_create), 0, 1, 0, 0},
  {&__pyx_kp_u_kapok_uavsar_load_Cannot_create_2, __pyx_k_kapok_uavsar_load_Cannot_create_2, sizeof(__pyx_k_kapok_uavsar_load_Cannot_create_2), 0, 1, 0, 0},
  {&__pyx_kp_u_kapok_uavsar_load_Cannot_find_LK, __pyx_k_kapok_uavsar_load_Cannot_find_LK, sizeof(__pyx_k_kapok_uavsar_load_Cannot_find_LK), 0, 1, 0, 0},
  {&__pyx_kp_u_kapok_uavsar_load_Cannot_find_LL, __pyx_k_kapok_uavsar_load_Cannot_find_LL, sizeof(__pyx_k_kapok_uavsar_load_Cannot_find_LL), 0, 1, 0, 0},
  {&__pyx_kp_u_kapok_uavsar_load_Cannot_find_SL, __pyx_k_kapok_uavsar_load_Cannot_find_SL, sizeof(__pyx_k_kapok_uavsar_load_Cannot_find_SL), 0, 1, 0, 0},
  {&__pyx_kp_u_kapok_uavsar_load_Cannot_find_ba, __pyx_k_kapok_uavsar_load_Cannot_find_ba, sizeof(__pyx_k_kapok_uavsar_load_Cannot_find_ba), 0, 1, 0, 0},
  {&__pyx_kp_u_kapok_uavsar_load_Cannot_find_kz, __pyx_k_kapok_uavsar_load_Cannot_find_kz, sizeof(__pyx_k_kapok_uavsar_load_Cannot_find_kz), 0, 1, 0, 0},
  {&__pyx_kp_u_kapok_uavsar_load_Cannot_find_tr, __pyx_k_kapok_uavsar_load_Cannot_find_tr, sizeof(__pyx_k_kapok_uavsar_load_Cannot_find_tr), 0, 1, 0, 0},
  {&__pyx_kp_u_kapok_uavsar_load_Cannot_load_UA, __pyx_k_kapok_uavsar_load_Cannot_load_UA, sizeof(__pyx_k_kapok_uavsar_load_Cannot_load_UA), 0, 1, 0, 0},
  {&__pyx_kp_u_kapok_uavsar_load_Complete, __pyx_k_kapok_uavsar_load_Complete, sizeof(__pyx_k_kapok_uavsar_load_Complete), 0, 1, 0, 0},
  {&__pyx_kp_u_kapok_uavsar_load_Covariance_mat, __pyx_k_kapok_uavsar_load_Covariance_mat, sizeof(__pyx_k_kapok_uavsar_load_Covariance_mat), 0, 1, 0, 0},
  {&__pyx_kp_u_kapok_uavsar_load_Importing_DEM, __pyx_k_kapok_uavsar_load_Importing_DEM, sizeof(__pyx_k_kapok_uavsar_load_Importing_DEM), 0, 1, 0, 0},
  {&__pyx_kp_u_kapok_uavsar_load_Importing_kz_b, __pyx_k_kapok_uavsar_load_Importing_kz_b, sizeof(__pyx_k_kapok_uavsar_load_Importing_kz_b), 0, 1, 0, 0},
  {&__pyx_kp_u_kapok_uavsar_load_Importing_lati, __pyx_k_kapok_uavsar_load_Importing_lati, sizeof(__pyx_k_kapok_uavsar_load_Importing_lati), 0, 1, 0, 0},
  {&__pyx_kp_u_kapok_uavsar_load_Importing_long, __pyx_k_kapok_uavsar_load_Importing_long, sizeof(__pyx_k_kapok_uavsar_load_Importing_long), 0, 1, 0, 0},
  {&__pyx_kp_u_kapok_uavsar_load_Importing_meta, __pyx_k_kapok_uavsar_load_Importing_meta, sizeof(__pyx_k_kapok_uavsar_load_Importing_meta), 0, 1, 0, 0},
  {&__pyx_kp_u_kapok_uavsar_load_Invalid_azimut, __pyx_k_kapok_uavsar_load_Invalid_azimut, sizeof(__pyx_k_kapok_uavsar_load_Invalid_azimut), 0, 1, 0, 0},
  {&__pyx_kp_u_kapok_uavsar_load_Invalid_range, __pyx_k_kapok_uavsar_load_Invalid_range, sizeof(__pyx_k_kapok_uavsar_load_Invalid_range), 0, 1, 0, 0},
  {&__pyx_kp_u_kapok_uavsar_load_Loading_SLCs, __pyx_k_kapok_uavsar_load_Loading_SLCs, sizeof(__pyx_k_kapok_uavsar_load_Loading_SLCs), 0, 1, 0, 0},
  {&__pyx_kp_u_kapok_uavsar_load_Lower_azimuth, __pyx_k_kapok_uavsar_load_Lower_azimuth, sizeof(__pyx_k_kapok_uavsar_load_Lower_azimuth), 0, 1, 0, 0},
  {&__pyx_kp_u_kapok_uavsar_load_Lower_range_bo, __pyx_k_kapok_uavsar_load_Lower_range_bo, sizeof(__pyx_k_kapok_uavsar_load_Lower_range_bo), 0, 1, 0, 0},
  {&__pyx_kp_u_kapok_uavsar_load_Setting_upper, __pyx_k_kapok_uavsar_load_Setting_upper, sizeof(__pyx_k_kapok_uavsar_load_Setting_upper), 0, 1, 0, 0},
  {&__pyx_kp_u_kapok_uavsar_load_Setting_upper_2, __pyx_k_kapok_uavsar_load_Setting_upper_2, sizeof(__pyx_k_kapok_uavsar_load_Setting_upper_2), 0, 1, 0, 0},
  {&__pyx_kp_u_kapok_uavsar_load_Site_Descripti, __pyx_k_kapok_uavsar_load_Site_Descripti, sizeof(__pyx_k_kapok_uavsar_load_Site_Descripti), 0, 1, 0, 0},
  {&__pyx_kp_u_kapok_uavsar_load_Stack_ID, __pyx_k_kapok_uavsar_load_Stack_ID, sizeof(__pyx_k_kapok_uavsar_load_Stack_ID), 0, 1, 0, 0},
  {&__pyx_kp_u_kapok_uavsar_load_Too_many_LKV_f, __pyx_k_kapok_uavsar_load_Too_many_LKV_f, sizeof(__pyx_k_kapok_uavsar_load_Too_many_LKV_f), 0, 1, 0, 0},
  {&__pyx_kp_u_kapok_uavsar_load_Too_many_LLH_f, __pyx_k_kapok_uavsar_load_Too_many_LLH_f, sizeof(__pyx_k_kapok_uavsar_load_Too_many_LLH_f), 0, 1, 0, 0},
  {&__pyx_kp_u_kapok_uavsar_load_Too_many_SLC_f, __pyx_k_kapok_uavsar_load_Too_many_SLC_f, sizeof(__pyx_k_kapok_uavsar_load_Too_many_SLC_f), 0, 1, 0, 0},
  {&__pyx_kp_u_kapok_uavsar_load_URL, __pyx_k_kapok_uavsar_load_URL, sizeof(__pyx_k_kapok_uavsar_load_URL), 0, 1, 0, 0},
  {&__pyx_kp_u_kapok_uavsar_load_Upper_azimuth, __pyx_k_kapok_uavsar_load_Upper_azimuth, sizeof(__pyx_k_kapok_uavsar_load_Upper_azimuth), 0, 1, 0, 0},
  {&__pyx_kp_u_kapok_uavsar_load_Upper_range_bo, __pyx_k_kapok_uavsar_load_Upper_range_bo, sizeof(__pyx_k_kapok_uavsar_load_Upper_range_bo), 0, 1, 0, 0},
  {&__pyx_kp_u_kapok_uavsar_quicklook_Cannot_fi, __pyx_k_kapok_uavsar_quicklook_Cannot_fi, sizeof(__pyx_k_kapok_uavsar_quicklook_Cannot_fi), 0, 1, 0, 0},
  {&__pyx_kp_u_kapok_uavsar_quicklook_Cannot_fi_2, __pyx_k_kapok_uavsar_quicklook_Cannot_fi_2, sizeof(__pyx_k_kapok_uavsar_quicklook_Cannot_fi_2), 0, 1, 0, 0},
  {&__pyx_kp_u_kapok_uavsar_quicklook_Cannot_lo, __pyx_k_kapok_uavsar_quicklook_Cannot_lo, sizeof(__pyx_k_kapok_uavsar_quicklook_Cannot_lo), 0, 1, 0, 0},
  {&__pyx_kp_u_kapok_uavsar_quicklook_Too_many, __pyx_k_kapok_uavsar_quicklook_Too_many, sizeof(__pyx_k_kapok_uavsar_quicklook_Too_many), 0, 1, 0, 0},
  {&__pyx_n_s_kapok_uavsarc, __pyx_k_kapok_uavsarc, sizeof(__pyx_k_kapok_uavsarc), 0, 0, 1, 1},
  {&__pyx_n_s_keyword, __pyx_k_keyword, sizeof(__pyx_k_keyword), 0, 0, 1, 1},
  {&__pyx_n_s_kz, __pyx_k_kz, sizeof(__pyx_k_kz), 0, 0, 1, 1},
  {&__pyx_n_u_kz, __pyx_k_kz, sizeof(__pyx_k_kz), 0, 1, 0, 1},
  {&__pyx_kp_u_kz_2, __pyx_k_kz_2, sizeof(__pyx_k_kz_2), 0, 1, 0, 0},
  {&__pyx_kp_u_kz_Attempting_to_calculate_kz_f, __pyx_k_kz_Attempting_to_calculate_kz_f, sizeof(__pyx_k_kz_Attempting_to_calculate_kz_f), 0, 1, 0, 0},
  {&__pyx_n_s_kz_buffer, __pyx_k_kz_buffer, sizeof(__pyx_k_kz_buffer), 0, 0, 1, 1},
  {&__pyx_n_s_kz_cols, __pyx_k_kz_cols, sizeof(__pyx_k_kz_cols), 0, 0, 1, 1},
  {&__pyx_n_s_kz_rows, __pyx_k_kz_rows, sizeof(__pyx_k_kz_rows), 0, 0, 1, 1},
  {&__pyx_n_s_kz_temp, __pyx_k_kz_temp, sizeof(__pyx_k_kz_temp), 0, 0, 1, 1},
  {&__pyx_n_s_kzcalc, __pyx_k_kzcalc, sizeof(__pyx_k_kzcalc), 0, 0, 1, 1},
  {&__pyx_n_s_kzvertical, __pyx_k_kzvertical, sizeof(__pyx_k_kzvertical), 0, 0, 1, 1},
  {&__pyx_n_s_label, __pyx_k_label, sizeof(__pyx_k_label), 0, 0, 1, 1},
  {&__pyx_n_s_lat, __pyx_k_lat, sizeof(__pyx_k_lat), 0, 0, 1, 1},
  {&__pyx_n_u_lat, __pyx_k_lat, sizeof(__pyx_k_lat), 0, 1, 0, 1},
  {&__pyx_n_u_lexicographic, __pyx_k_lexicographic, sizeof(__pyx_k_lexicographic), 0, 1, 0, 1},
  {&__pyx_n_s_linalg, __pyx_k_linalg, sizeof(__pyx_k_linalg), 0, 0, 1, 1},
  {&__pyx_n_s_linspace, __pyx_k_linspace, sizeof(__pyx_k_linspace), 0, 0, 1, 1},
  {&__pyx_n_u_lkv, __pyx_k_lkv, sizeof(__pyx_k_lkv), 0, 1, 0, 1},
  {&__pyx_n_s_lkv_2, __pyx_k_lkv_2, sizeof(__pyx_k_lkv_2), 0, 0, 1, 1},
  {&__pyx_n_s_lkv_cols, __pyx_k_lkv_cols, sizeof(__pyx_k_lkv_cols), 0, 0, 1, 1},
  {&__pyx_n_s_lkv_rows, __pyx_k_lkv_rows, sizeof(__pyx_k_lkv_rows), 0, 0, 1, 1},
  {&__pyx_n_s_lkvmm, __pyx_k_lkvmm, sizeof(__pyx_k_lkvmm), 0, 0, 1, 1},
  {&__pyx_n_s_lkvname, __pyx_k_lkvname, sizeof(__pyx_k_lkvname), 0, 0, 1, 1},
  {&__pyx_n_s_lkvrowend, __pyx_k_lkvrowend, sizeof(__pyx_k_lkvrowend), 0, 0, 1, 1},
  {&__pyx_n_s_lkvrowstart, __pyx_k_lkvrowstart, sizeof(__pyx_k_lkvrowstart), 0, 0, 1, 1},
  {&__pyx_n_s_lkvtrimend, __pyx_k_lkvtrimend, sizeof(__pyx_k_lkvtrimend), 0, 0, 1, 1},
  {&__pyx_n_s_lkvtrimstart, __pyx_k_lkvtrimstart, sizeof(__pyx_k_lkvtrimstart), 0, 0, 1, 1},
  {&__pyx_n_u_llh, __pyx_k_llh, sizeof(__pyx_k_llh), 0, 1, 0, 1},
  {&__pyx_n_s_llh2enu, __pyx_k_llh2enu, sizeof(__pyx_k_llh2enu), 0, 0, 1, 1},
  {&__pyx_n_s_llh_2, __pyx_k_llh_2, sizeof(__pyx_k_llh_2), 0, 0, 1, 1},
  {&__pyx_n_s_llh_cols, __pyx_k_llh_cols, sizeof(__pyx_k_llh_cols), 0, 0, 1, 1},
  {&__pyx_n_s_llh_rows, __pyx_k_llh_rows, sizeof(__pyx_k_llh_rows), 0, 0, 1, 1},
  {&__pyx_n_s_llhname, __pyx_k_llhname, sizeof(__pyx_k_llhname), 0, 0, 1, 1},
  {&__pyx_n_s_load, __pyx_k_load, sizeof(__pyx_k_load), 0, 0, 1, 1},
  {&__pyx_n_s_loadtxt, __pyx_k_loadtxt, sizeof(__pyx_k_loadtxt), 0, 0, 1, 1},
  {&__pyx_n_s_log10, __pyx_k_log10, sizeof(__pyx_k_log10), 0, 0, 1, 1},
  {&__pyx_n_s_lon, __pyx_k_lon, sizeof(__pyx_k_lon), 0, 0, 1, 1},
  {&__pyx_n_u_lon, __pyx_k_lon, sizeof(__pyx_k_lon), 0, 1, 0, 1},
  {&__pyx_n_s_lookcrossv, __pyx_k_lookcrossv, sizeof(__pyx_k_lookcrossv), 0, 0, 1, 1},
  {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
  {&__pyx_n_s_matplotlib_pyplot, __pyx_k_matplotlib_pyplot, sizeof(__pyx_k_matplotlib_pyplot), 0, 0, 1, 1},
  {&__pyx_n_s_max, __pyx_k_max, sizeof(__pyx_k_max), 0, 0, 1, 1},
  {&__pyx_n_s_maxsplit, __pyx_k_maxsplit, sizeof(__pyx_k_maxsplit), 0, 0, 1, 1},
  {&__pyx_n_s_memmap, __pyx_k_memmap, sizeof(__pyx_k_memmap), 0, 0, 1, 1},
  {&__pyx_n_s_metaclass, __pyx_k_metaclass, sizeof(__pyx_k_metaclass), 0, 0, 1, 1},
  {&__pyx_n_u_meters, __pyx_k_meters, sizeof(__pyx_k_meters), 0, 1, 0, 1},
  {&__pyx_n_u_ml_window, __pyx_k_ml_window, sizeof(__pyx_k_ml_window), 0, 1, 0, 1},
  {&__pyx_n_s_mlook, __pyx_k_mlook, sizeof(__pyx_k_mlook), 0, 0, 1, 1},
  {&__pyx_n_s_mlwin, __pyx_k_mlwin, sizeof(__pyx_k_mlwin), 0, 0, 1, 1},
  {&__pyx_n_s_mlwin_lkv, __pyx_k_mlwin_lkv, sizeof(__pyx_k_mlwin_lkv), 0, 0, 1, 1},
  {&__pyx_n_s_mode, __pyx_k_mode, sizeof(__pyx_k_mode), 0, 0, 1, 1},
  {&__pyx_n_s_module, __pyx_k_module, sizeof(__pyx_k_module), 0, 0, 1, 1},
  {&__pyx_n_s_n, __pyx_k_n, sizeof(__pyx_k_n), 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_u_nearest, __pyx_k_nearest, sizeof(__pyx_k_nearest), 0, 1, 0, 1},
  {&__pyx_n_s_newaxis, __pyx_k_newaxis, sizeof(__pyx_k_newaxis), 0, 0, 1, 1},
  {&__pyx_n_s_norm, __pyx_k_norm, sizeof(__pyx_k_norm), 0, 0, 1, 1},
  {&__pyx_n_s_np, __pyx_k_np, sizeof(__pyx_k_np), 0, 0, 1, 1},
  {&__pyx_n_s_num, __pyx_k_num, sizeof(__pyx_k_num), 0, 0, 1, 1},
  {&__pyx_n_u_num_baselines, __pyx_k_num_baselines, sizeof(__pyx_k_num_baselines), 0, 1, 0, 1},
  {&__pyx_n_s_num_bl, __pyx_k_num_bl, sizeof(__pyx_k_num_bl), 0, 0, 1, 1},
  {&__pyx_n_s_num_blocks, __pyx_k_num_blocks, sizeof(__pyx_k_num_blocks), 0, 0, 1, 1},
  {&__pyx_n_s_num_cov_elements, __pyx_k_num_cov_elements, sizeof(__pyx_k_num_cov_elements), 0, 0, 1, 1},
  {&__pyx_n_s_num_pol, __pyx_k_num_pol, sizeof(__pyx_k_num_pol), 0, 0, 1, 1},
  {&__pyx_n_u_num_pol, __pyx_k_num_pol, sizeof(__pyx_k_num_pol), 0, 1, 0, 1},
  {&__pyx_n_s_num_segments, __pyx_k_num_segments, sizeof(__pyx_k_num_segments), 0, 0, 1, 1},
  {&__pyx_n_s_num_tracks, __pyx_k_num_tracks, sizeof(__pyx_k_num_tracks), 0, 0, 1, 1},
  {&__pyx_n_u_num_tracks, __pyx_k_num_tracks, sizeof(__pyx_k_num_tracks), 0, 1, 0, 1},
  {&__pyx_n_s_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 0, 1, 1},
  {&__pyx_kp_u_numpy_core_multiarray_failed_to, __pyx_k_numpy_core_multiarray_failed_to, sizeof(__pyx_k_numpy_core_multiarray_failed_to), 0, 1, 0, 0},
  {&__pyx_kp_u_numpy_core_umath_failed_to_impor, __pyx_k_numpy_core_umath_failed_to_impor, sizeof(__pyx_k_numpy_core_umath_failed_to_impor), 0, 1, 0, 0},
  {&__pyx_n_s_object, __pyx_k_object, sizeof(__pyx_k_object), 0, 0, 1, 1},
  {&__pyx_n_s_offset, __pyx_k_offset, sizeof(__pyx_k_offset), 0, 0, 1, 1},
  {&__pyx_n_s_open, __pyx_k_open, sizeof(__pyx_k_open), 0, 0, 1, 1},
  {&__pyx_n_s_os, __pyx_k_os, sizeof(__pyx_k_os), 0, 0, 1, 1},
  {&__pyx_n_s_os_path, __pyx_k_os_path, sizeof(__pyx_k_os_path), 0, 0, 1, 1},
  {&__pyx_n_s_outfile, __pyx_k_outfile, sizeof(__pyx_k_outfile), 0, 0, 1, 1},
  {&__pyx_n_s_overwrite, __pyx_k_overwrite, sizeof(__pyx_k_overwrite), 0, 0, 1, 1},
  {&__pyx_n_s_pad_inches, __pyx_k_pad_inches, sizeof(__pyx_k_pad_inches), 0, 0, 1, 1},
  {&__pyx_n_s_path, __pyx_k_path, sizeof(__pyx_k_path), 0, 0, 1, 1},
  {&__pyx_n_u_peg_heading, __pyx_k_peg_heading, sizeof(__pyx_k_peg_heading), 0, 1, 0, 1},
  {&__pyx_n_u_peg_latitude, __pyx_k_peg_latitude, sizeof(__pyx_k_peg_latitude), 0, 1, 0, 1},
  {&__pyx_n_u_peg_longitude, __pyx_k_peg_longitude, sizeof(__pyx_k_peg_longitude), 0, 1, 0, 1},
  {&__pyx_n_s_peghdg, __pyx_k_peghdg, sizeof(__pyx_k_peghdg), 0, 0, 1, 1},
  {&__pyx_n_s_peglat, __pyx_k_peglat, sizeof(__pyx_k_peglat), 0, 0, 1, 1},
  {&__pyx_n_s_peglon, __pyx_k_peglon, sizeof(__pyx_k_peglon), 0, 0, 1, 1},
  {&__pyx_n_s_pi, __pyx_k_pi, sizeof(__pyx_k_pi), 0, 0, 1, 1},
  {&__pyx_n_s_plt, __pyx_k_plt, sizeof(__pyx_k_plt), 0, 0, 1, 1},
  {&__pyx_n_s_pol, __pyx_k_pol, sizeof(__pyx_k_pol), 0, 0, 1, 1},
  {&__pyx_n_u_pol, __pyx_k_pol, sizeof(__pyx_k_pol), 0, 1, 0, 1},
  {&__pyx_n_s_pos, __pyx_k_pos, sizeof(__pyx_k_pos), 0, 0, 1, 1},
  {&__pyx_n_s_posmm, __pyx_k_posmm, sizeof(__pyx_k_posmm), 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_u_processor, __pyx_k_processor, sizeof(__pyx_k_processor), 0, 1, 0, 1},
  {&__pyx_n_u_production, __pyx_k_production, sizeof(__pyx_k_production), 0, 1, 0, 1},
  {&__pyx_n_s_proj_lkv_velocity, __pyx_k_proj_lkv_velocity, sizeof(__pyx_k_proj_lkv_velocity), 0, 0, 1, 1},
  {&__pyx_n_s_proj_reflkv_v, __pyx_k_proj_reflkv_v, sizeof(__pyx_k_proj_reflkv_v), 0, 0, 1, 1},
  {&__pyx_n_s_qlimage, __pyx_k_qlimage, sizeof(__pyx_k_qlimage), 0, 0, 1, 1},
  {&__pyx_n_s_qualname, __pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 0, 1, 1},
  {&__pyx_n_s_query, __pyx_k_query, sizeof(__pyx_k_query), 0, 0, 1, 1},
  {&__pyx_n_s_quicklook, __pyx_k_quicklook, sizeof(__pyx_k_quicklook), 0, 0, 1, 1},
  {&__pyx_n_u_r, __pyx_k_r, sizeof(__pyx_k_r), 0, 1, 0, 1},
  {&__pyx_n_s_radians, __pyx_k_radians, sizeof(__pyx_k_radians), 0, 0, 1, 1},
  {&__pyx_n_u_radians, __pyx_k_radians, sizeof(__pyx_k_radians), 0, 1, 0, 1},
  {&__pyx_kp_u_radians_meter, __pyx_k_radians_meter, sizeof(__pyx_k_radians_meter), 0, 1, 0, 0},
  {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1},
  {&__pyx_n_u_range_bounds_slc, __pyx_k_range_bounds_slc, sizeof(__pyx_k_range_bounds_slc), 0, 1, 0, 1},
  {&__pyx_n_s_read, __pyx_k_read, sizeof(__pyx_k_read), 0, 0, 1, 1},
  {&__pyx_n_s_real, __pyx_k_real, sizeof(__pyx_k_real), 0, 0, 1, 1},
  {&__pyx_n_s_refvelocity, __pyx_k_refvelocity, sizeof(__pyx_k_refvelocity), 0, 0, 1, 1},
  {&__pyx_n_s_rngbounds, __pyx_k_rngbounds, sizeof(__pyx_k_rngbounds), 0, 0, 1, 1},
  {&__pyx_n_s_rngllhend, __pyx_k_rngllhend, sizeof(__pyx_k_rngllhend), 0, 0, 1, 1},
  {&__pyx_n_s_rngllhoffset, __pyx_k_rngllhoffset, sizeof(__pyx_k_rngllhoffset), 0, 0, 1, 1},
  {&__pyx_n_s_rngllhstart, __pyx_k_rngllhstart, sizeof(__pyx_k_rngllhstart), 0, 0, 1, 1},
  {&__pyx_n_s_rngsize, __pyx_k_rngsize, sizeof(__pyx_k_rngsize), 0, 0, 1, 1},
  {&__pyx_n_s_rngsize_slc, __pyx_k_rngsize_slc, sizeof(__pyx_k_rngsize_slc), 0, 0, 1, 1},
  {&__pyx_n_s_rngsize_slc1x1, __pyx_k_rngsize_slc1x1, sizeof(__pyx_k_rngsize_slc1x1), 0, 0, 1, 1},
  {&__pyx_n_s_rngslope, __pyx_k_rngslope, sizeof(__pyx_k_rngslope), 0, 0, 1, 1},
  {&__pyx_n_s_round, __pyx_k_round, sizeof(__pyx_k_round), 0, 0, 1, 1},
  {&__pyx_n_s_row, __pyx_k_row, sizeof(__pyx_k_row), 0, 0, 1, 1},
  {&__pyx_n_s_rsplit, __pyx_k_rsplit, sizeof(__pyx_k_rsplit), 0, 0, 1, 1},
  {&__pyx_kp_u_s, __pyx_k_s, sizeof(__pyx_k_s), 0, 1, 0, 0},
  {&__pyx_kp_u_s_2, __pyx_k_s_2, sizeof(__pyx_k_s_2), 0, 1, 0, 0},
  {&__pyx_n_s_savefig, __pyx_k_savefig, sizeof(__pyx_k_savefig), 0, 0, 1, 1},
  {&__pyx_n_s_savefile, __pyx_k_savefile, sizeof(__pyx_k_savefile), 0, 0, 1, 1},
  {&__pyx_n_s_sbounds, __pyx_k_sbounds, sizeof(__pyx_k_sbounds), 0, 0, 1, 1},
  {&__pyx_n_s_sch2enu, __pyx_k_sch2enu, sizeof(__pyx_k_sch2enu), 0, 0, 1, 1},
  {&__pyx_n_s_scipy_ndimage_interpolation, __pyx_k_scipy_ndimage_interpolation, sizeof(__pyx_k_scipy_ndimage_interpolation), 0, 0, 1, 1},
  {&__pyx_n_s_seg, __pyx_k_seg, sizeof(__pyx_k_seg), 0, 0, 1, 1},
  {&__pyx_n_s_seg_end, __pyx_k_seg_end, sizeof(__pyx_k_seg_end), 0, 0, 1, 1},
  {&__pyx_n_s_seg_start, __pyx_k_seg_start, sizeof(__pyx_k_seg_start), 0, 0, 1, 1},
  {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1},
  {&__pyx_n_u_sensor, __pyx_k_sensor, sizeof(__pyx_k_sensor), 0, 1, 0, 1},
  {&__pyx_n_s_shape, __pyx_k_shape, sizeof(__pyx_k_shape), 0, 0, 1, 1},
  {&__pyx_n_s_shuffle, __pyx_k_shuffle, sizeof(__pyx_k_shuffle), 0, 0, 1, 1},
  {&__pyx_n_s_sign, __pyx_k_sign, sizeof(__pyx_k_sign), 0, 0, 1, 1},
  {&__pyx_n_s_sin, __pyx_k_sin, sizeof(__pyx_k_sin), 0, 0, 1, 1},
  {&__pyx_n_u_site, __pyx_k_site, sizeof(__pyx_k_site), 0, 1, 0, 1},
  {&__pyx_n_u_slc, __pyx_k_slc, sizeof(__pyx_k_slc), 0, 1, 0, 1},
  {&__pyx_kp_u_slc_1_1x1_Columns, __pyx_k_slc_1_1x1_Columns, sizeof(__pyx_k_slc_1_1x1_Columns), 0, 1, 0, 0},
  {&__pyx_kp_u_slc_1_1x1_Rows, __pyx_k_slc_1_1x1_Rows, sizeof(__pyx_k_slc_1_1x1_Rows), 0, 1, 0, 0},
  {&__pyx_kp_u_slc_1_1x1_mag_row_addr, __pyx_k_slc_1_1x1_mag_row_addr, sizeof(__pyx_k_slc_1_1x1_mag_row_addr), 0, 1, 0, 0},
  {&__pyx_kp_u_slc_1_1x1_mag_row_mult, __pyx_k_slc_1_1x1_mag_row_mult, sizeof(__pyx_k_slc_1_1x1_mag_row_mult), 0, 1, 0, 0},
  {&__pyx_kp_u_slc_1_1x4_Columns, __pyx_k_slc_1_1x4_Columns, sizeof(__pyx_k_slc_1_1x4_Columns), 0, 1, 0, 0},
  {&__pyx_kp_u_slc_1_1x4_Rows, __pyx_k_slc_1_1x4_Rows, sizeof(__pyx_k_slc_1_1x4_Rows), 0, 1, 0, 0},
  {&__pyx_kp_u_slc_1_2x8_Columns, __pyx_k_slc_1_2x8_Columns, sizeof(__pyx_k_slc_1_2x8_Columns), 0, 1, 0, 0},
  {&__pyx_kp_u_slc_1_8x2_Rows, __pyx_k_slc_1_8x2_Rows, sizeof(__pyx_k_slc_1_8x2_Rows), 0, 1, 0, 0},
  {&__pyx_n_s_slc_2, __pyx_k_slc_2, sizeof(__pyx_k_slc_2), 0, 0, 1, 1},
  {&__pyx_n_u_slc_azimuth_pixel_spacing, __pyx_k_slc_azimuth_pixel_spacing, sizeof(__pyx_k_slc_azimuth_pixel_spacing), 0, 1, 0, 1},
  {&__pyx_n_u_slc_slant_range_pixel_spacing, __pyx_k_slc_slant_range_pixel_spacing, sizeof(__pyx_k_slc_slant_range_pixel_spacing), 0, 1, 0, 1},
  {&__pyx_n_s_slca, __pyx_k_slca, sizeof(__pyx_k_slca), 0, 0, 1, 1},
  {&__pyx_n_s_slcb, __pyx_k_slcb, sizeof(__pyx_k_slcb), 0, 0, 1, 1},
  {&__pyx_n_s_slcfiles, __pyx_k_slcfiles, sizeof(__pyx_k_slcfiles), 0, 0, 1, 1},
  {&__pyx_n_s_slcnum, __pyx_k_slcnum, sizeof(__pyx_k_slcnum), 0, 0, 1, 1},
  {&__pyx_n_s_slcstack, __pyx_k_slcstack, sizeof(__pyx_k_slcstack), 0, 0, 1, 1},
  {&__pyx_n_s_slcwindow, __pyx_k_slcwindow, sizeof(__pyx_k_slcwindow), 0, 0, 1, 1},
  {&__pyx_n_u_slope_corrected, __pyx_k_slope_corrected, sizeof(__pyx_k_slope_corrected), 0, 1, 0, 1},
  {&__pyx_n_u_sm_window, __pyx_k_sm_window, sizeof(__pyx_k_sm_window), 0, 1, 0, 1},
  {&__pyx_n_s_smooth, __pyx_k_smooth, sizeof(__pyx_k_smooth), 0, 0, 1, 1},
  {&__pyx_n_s_smwin, __pyx_k_smwin, sizeof(__pyx_k_smwin), 0, 0, 1, 1},
  {&__pyx_n_s_spacing, __pyx_k_spacing, sizeof(__pyx_k_spacing), 0, 0, 1, 1},
  {&__pyx_n_s_split, __pyx_k_split, sizeof(__pyx_k_split), 0, 0, 1, 1},
  {&__pyx_n_s_sqrt, __pyx_k_sqrt, sizeof(__pyx_k_sqrt), 0, 0, 1, 1},
  {&__pyx_kp_u_sqrt_2_HV, __pyx_k_sqrt_2_HV, sizeof(__pyx_k_sqrt_2_HV), 0, 1, 0, 0},
  {&__pyx_n_s_square, __pyx_k_square, sizeof(__pyx_k_square), 0, 0, 1, 1},
  {&__pyx_n_s_sspacing, __pyx_k_sspacing, sizeof(__pyx_k_sspacing), 0, 0, 1, 1},
  {&__pyx_n_s_sstart, __pyx_k_sstart, sizeof(__pyx_k_sstart), 0, 0, 1, 1},
  {&__pyx_n_u_stack_name, __pyx_k_stack_name, sizeof(__pyx_k_stack_name), 0, 1, 0, 1},
  {&__pyx_n_u_stackline, __pyx_k_stackline, sizeof(__pyx_k_stackline), 0, 1, 0, 1},
  {&__pyx_n_u_stackline1, __pyx_k_stackline1, sizeof(__pyx_k_stackline1), 0, 1, 0, 1},
  {&__pyx_n_s_startswith, __pyx_k_startswith, sizeof(__pyx_k_startswith), 0, 0, 1, 1},
  {&__pyx_n_s_strip, __pyx_k_strip, sizeof(__pyx_k_strip), 0, 0, 1, 1},
  {&__pyx_n_u_subset, __pyx_k_subset, sizeof(__pyx_k_subset), 0, 1, 0, 1},
  {&__pyx_n_s_sum, __pyx_k_sum, sizeof(__pyx_k_sum), 0, 0, 1, 1},
  {&__pyx_n_s_tan, __pyx_k_tan, sizeof(__pyx_k_tan), 0, 0, 1, 1},
  {&__pyx_n_s_temp, __pyx_k_temp, sizeof(__pyx_k_temp), 0, 0, 1, 1},
  {&__pyx_n_s_tempdiff, __pyx_k_tempdiff, sizeof(__pyx_k_tempdiff), 0, 0, 1, 1},
  {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
  {&__pyx_n_u_tight, __pyx_k_tight, sizeof(__pyx_k_tight), 0, 1, 0, 1},
  {&__pyx_n_s_tight_layout, __pyx_k_tight_layout, sizeof(__pyx_k_tight_layout), 0, 0, 1, 1},
  {&__pyx_n_s_time, __pyx_k_time, sizeof(__pyx_k_time), 0, 0, 1, 1},
  {&__pyx_n_s_tr, __pyx_k_tr, sizeof(__pyx_k_tr), 0, 0, 1, 1},
  {&__pyx_n_u_track, __pyx_k_track, sizeof(__pyx_k_track), 0, 1, 0, 1},
  {&__pyx_n_s_tracklkv, __pyx_k_tracklkv, sizeof(__pyx_k_tracklkv), 0, 0, 1, 1},
  {&__pyx_n_s_tracknames, __pyx_k_tracknames, sizeof(__pyx_k_tracknames), 0, 0, 1, 1},
  {&__pyx_n_s_tracks, __pyx_k_tracks, sizeof(__pyx_k_tracks), 0, 0, 1, 1},
  {&__pyx_n_u_tracks, __pyx_k_tracks, sizeof(__pyx_k_tracks), 0, 1, 0, 1},
  {&__pyx_n_u_units, __pyx_k_units, sizeof(__pyx_k_units), 0, 1, 0, 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, __pyx_k_upper, sizeof(__pyx_k_upper), 0, 0, 1, 1},
  {&__pyx_n_u_url, __pyx_k_url, sizeof(__pyx_k_url), 0, 1, 0, 1},
  {&__pyx_n_s_val, __pyx_k_val, sizeof(__pyx_k_val), 0, 0, 1, 1},
  {&__pyx_n_s_velocity, __pyx_k_velocity, sizeof(__pyx_k_velocity), 0, 0, 1, 1},
  {&__pyx_n_s_vmax, __pyx_k_vmax, sizeof(__pyx_k_vmax), 0, 0, 1, 1},
  {&__pyx_n_s_vmin, __pyx_k_vmin, sizeof(__pyx_k_vmin), 0, 0, 1, 1},
  {&__pyx_n_s_vstack, __pyx_k_vstack, sizeof(__pyx_k_vstack), 0, 0, 1, 1},
  {&__pyx_n_u_w, __pyx_k_w, sizeof(__pyx_k_w), 0, 1, 0, 1},
  {&__pyx_n_s_wavelength, __pyx_k_wavelength, sizeof(__pyx_k_wavelength), 0, 0, 1, 1},
  {&__pyx_n_u_wavelength, __pyx_k_wavelength, sizeof(__pyx_k_wavelength), 0, 1, 0, 1},
  {&__pyx_n_s_where, __pyx_k_where, sizeof(__pyx_k_where), 0, 0, 1, 1},
  {&__pyx_n_u_x, __pyx_k_x, sizeof(__pyx_k_x), 0, 1, 0, 1},
  {&__pyx_n_s_xlabel, __pyx_k_xlabel, sizeof(__pyx_k_xlabel), 0, 0, 1, 1},
  {&__pyx_n_s_ylabel, __pyx_k_ylabel, sizeof(__pyx_k_ylabel), 0, 0, 1, 1},
  {&__pyx_n_s_zeros, __pyx_k_zeros, sizeof(__pyx_k_zeros), 0, 0, 1, 1},
  {&__pyx_n_s_zoom, __pyx_k_zoom, sizeof(__pyx_k_zoom), 0, 0, 1, 1},
  {0, 0, 0, 0, 0, 0, 0}
};
static int __Pyx_InitCachedBuiltins(void) {
  __pyx_builtin_object = __Pyx_GetBuiltinName(__pyx_n_s_object); if (!__pyx_builtin_object) __PYX_ERR(0, 638, __pyx_L1_error)
  __pyx_builtin_print = __Pyx_GetBuiltinName(__pyx_n_s_print); if (!__pyx_builtin_print) __PYX_ERR(0, 121, __pyx_L1_error)
  __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 147, __pyx_L1_error)
  __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(0, 304, __pyx_L1_error)
  __pyx_builtin_open = __Pyx_GetBuiltinName(__pyx_n_s_open); if (!__pyx_builtin_open) __PYX_ERR(0, 650, __pyx_L1_error)
  __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 673, __pyx_L1_error)
  __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(1, 799, __pyx_L1_error)
  __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(1, 989, __pyx_L1_error)
  return 0;
  __pyx_L1_error:;
  return -1;
}

static int __Pyx_InitCachedConstants(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);

  /* "kapok/uavsarc.pyx":45
 * 
 * 
 * def load(infile, outfile, mlwin=(20,5), smwin=(1,1), azbounds=None,             # <<<<<<<<<<<<<<
 *          rngbounds=None, tracks=None, compression='gzip',
 *          compression_opts=4, num_blocks=20, kzcalc=False, kzvertical=True,
 */
  __pyx_tuple_ = PyTuple_Pack(2, __pyx_int_20, __pyx_int_5); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 45, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple_);
  __Pyx_GIVEREF(__pyx_tuple_);
  __pyx_tuple__2 = PyTuple_Pack(2, __pyx_int_1, __pyx_int_1); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 45, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__2);
  __Pyx_GIVEREF(__pyx_tuple__2);

  /* "kapok/uavsarc.pyx":121
 *         ann = Ann(infile)
 *     except:
 *         print('kapok.uavsar.load | Cannot load UAVSAR annotation file. Aborting.')             # <<<<<<<<<<<<<<
 *         return
 * 
 */
  __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_u_kapok_uavsar_load_Cannot_load_UA); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 121, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__3);
  __Pyx_GIVEREF(__pyx_tuple__3);

  /* "kapok/uavsarc.pyx":130
 *             f = h5py.File(outfile,'w')
 *         except:
 *             print('kapok.uavsar.load | Cannot create new HDF5 file. Check if path is valid. Aborting.')             # <<<<<<<<<<<<<<
 *             return
 *     else:
 */
  __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_u_kapok_uavsar_load_Cannot_create); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 130, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__4);
  __Pyx_GIVEREF(__pyx_tuple__4);

  /* "kapok/uavsarc.pyx":136
 *             f = h5py.File(outfile,'x')
 *         except:
 *             print('kapok.uavsar.load | Cannot create new HDF5 file. Check if path is valid and ensure file does not already exist. Aborting.')             # <<<<<<<<<<<<<<
 *             return
 * 
 */
  __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_u_kapok_uavsar_load_Cannot_create_2); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 136, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__5);
  __Pyx_GIVEREF(__pyx_tuple__5);

  /* "kapok/uavsarc.pyx":143
 * 
 *     # Get SLC dimensions and number of segments.
 *     rngsize_slc = ann.query('slc_1_1x1 Columns')             # <<<<<<<<<<<<<<
 *     num_segments = ann.query('Number of Segments')
 *     if num_segments > 1:
 */
  __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_u_slc_1_1x1_Columns); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 143, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__6);
  __Pyx_GIVEREF(__pyx_tuple__6);

  /* "kapok/uavsarc.pyx":144
 *     # Get SLC dimensions and number of segments.
 *     rngsize_slc = ann.query('slc_1_1x1 Columns')
 *     num_segments = ann.query('Number of Segments')             # <<<<<<<<<<<<<<
 *     if num_segments > 1:
 *         azsize_slc = np.zeros(num_segments,dtype='int32')
 */
  __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_u_Number_of_Segments); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 144, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__7);
  __Pyx_GIVEREF(__pyx_tuple__7);

  /* "kapok/uavsarc.pyx":150
 *             azsize_slc[n] = ann.query('slc_'+str(n+1)+'_1x1 Rows')
 *     else:
 *         azsize_slc = ann.query('slc_1_1x1 Rows')             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_u_slc_1_1x1_Rows); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(0, 150, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__8);
  __Pyx_GIVEREF(__pyx_tuple__8);

  /* "kapok/uavsarc.pyx":154
 * 
 *     # Get track filenames and number of tracks.
 *     temp = ann.query('stackline1')             # <<<<<<<<<<<<<<
 *     num = 1
 *     if temp is not None:
 */
  __pyx_tuple__9 = PyTuple_Pack(1, __pyx_n_u_stackline1); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(0, 154, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__9);
  __Pyx_GIVEREF(__pyx_tuple__9);

  /* "kapok/uavsarc.pyx":157
 *     num = 1
 *     if temp is not None:
 *         tracknames = [temp.split('_L090')[0]]             # <<<<<<<<<<<<<<
 *         num += 1
 *         temp = ann.query('stackline'+str(num))
 */
  __pyx_tuple__10 = PyTuple_Pack(1, __pyx_n_u_L090); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(0, 157, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__10);
  __Pyx_GIVEREF(__pyx_tuple__10);

  /* "kapok/uavsarc.pyx":161
 *         temp = ann.query('stackline'+str(num))
 *         while temp is not None:
 *             tracknames.append(temp.split('_L090')[0])             # <<<<<<<<<<<<<<
 *             num += 1
 *             temp = ann.query('stackline'+str(num))
 */
  __pyx_tuple__11 = PyTuple_Pack(1, __pyx_n_u_L090); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(0, 161, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__11);
  __Pyx_GIVEREF(__pyx_tuple__11);

  /* "kapok/uavsarc.pyx":165
 *             temp = ann.query('stackline'+str(num))
 *     else:
 *         print('kapok.uavsar.load | Cannot find track names in UAVSAR annotation file.  Aborting.')             # <<<<<<<<<<<<<<
 *         return
 * 
 */
  __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_u_kapok_uavsar_load_Cannot_find_tr); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(0, 165, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__12);
  __Pyx_GIVEREF(__pyx_tuple__12);

  /* "kapok/uavsarc.pyx":180
 *     num_cov_elements = num_tracks*num_pol # Number of Covariance Matrix Elements in Each Row
 * 
 *     f.attrs['stack_name'] = ann.query('Stack Name')             # <<<<<<<<<<<<<<
 *     f.attrs['site'] = ann.query('Site Description')
 *     f.attrs['url'] = ann.query('URL')
 */
  __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_u_Stack_Name); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(0, 180, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__13);
  __Pyx_GIVEREF(__pyx_tuple__13);

  /* "kapok/uavsarc.pyx":181
 * 
 *     f.attrs['stack_name'] = ann.query('Stack Name')
 *     f.attrs['site'] = ann.query('Site Description')             # <<<<<<<<<<<<<<
 *     f.attrs['url'] = ann.query('URL')
 *     f.attrs['sensor'] = 'UAVSAR'
 */
  __pyx_tuple__14 = PyTuple_Pack(1, __pyx_kp_u_Site_Description); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(0, 181, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__14);
  __Pyx_GIVEREF(__pyx_tuple__14);

  /* "kapok/uavsarc.pyx":182
 *     f.attrs['stack_name'] = ann.query('Stack Name')
 *     f.attrs['site'] = ann.query('Site Description')
 *     f.attrs['url'] = ann.query('URL')             # <<<<<<<<<<<<<<
 *     f.attrs['sensor'] = 'UAVSAR'
 *     f.attrs['processor'] = 'production'
 */
  __pyx_tuple__15 = PyTuple_Pack(1, __pyx_n_u_URL); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(0, 182, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__15);
  __Pyx_GIVEREF(__pyx_tuple__15);

  /* "kapok/uavsarc.pyx":192
 *     print('kapok.uavsar.load | Importing metadata. ('+time.ctime()+')')
 * 
 *     f.attrs['average_altitude'] = ann.query('Average Altitude')             # <<<<<<<<<<<<<<
 *     f.attrs['image_starting_slant_range'] = ann.query('Image Starting Slant Range')*1000
 *     f.attrs['slc_azimuth_pixel_spacing'] = ann.query('1x1 SLC Azimuth Pixel Spacing')
 */
  __pyx_tuple__17 = PyTuple_Pack(1, __pyx_kp_u_Average_Altitude); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(0, 192, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__17);
  __Pyx_GIVEREF(__pyx_tuple__17);

  /* "kapok/uavsarc.pyx":193
 * 
 *     f.attrs['average_altitude'] = ann.query('Average Altitude')
 *     f.attrs['image_starting_slant_range'] = ann.query('Image Starting Slant Range')*1000             # <<<<<<<<<<<<<<
 *     f.attrs['slc_azimuth_pixel_spacing'] = ann.query('1x1 SLC Azimuth Pixel Spacing')
 *     f.attrs['slc_slant_range_pixel_spacing'] = ann.query('1x1 SLC Range Pixel Spacing')
 */
  __pyx_tuple__18 = PyTuple_Pack(1, __pyx_kp_u_Image_Starting_Slant_Range); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(0, 193, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__18);
  __Pyx_GIVEREF(__pyx_tuple__18);

  /* "kapok/uavsarc.pyx":194
 *     f.attrs['average_altitude'] = ann.query('Average Altitude')
 *     f.attrs['image_starting_slant_range'] = ann.query('Image Starting Slant Range')*1000
 *     f.attrs['slc_azimuth_pixel_spacing'] = ann.query('1x1 SLC Azimuth Pixel Spacing')             # <<<<<<<<<<<<<<
 *     f.attrs['slc_slant_range_pixel_spacing'] = ann.query('1x1 SLC Range Pixel Spacing')
 *     f.attrs['cov_azimuth_pixel_spacing'] = ann.query('1x1 SLC Azimuth Pixel Spacing') * mlwin[0]
 */
  __pyx_tuple__19 = PyTuple_Pack(1, __pyx_kp_u_1x1_SLC_Azimuth_Pixel_Spacing); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(0, 194, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__19);
  __Pyx_GIVEREF(__pyx_tuple__19);

  /* "kapok/uavsarc.pyx":195
 *     f.attrs['image_starting_slant_range'] = ann.query('Image Starting Slant Range')*1000
 *     f.attrs['slc_azimuth_pixel_spacing'] = ann.query('1x1 SLC Azimuth Pixel Spacing')
 *     f.attrs['slc_slant_range_pixel_spacing'] = ann.query('1x1 SLC Range Pixel Spacing')             # <<<<<<<<<<<<<<
 *     f.attrs['cov_azimuth_pixel_spacing'] = ann.query('1x1 SLC Azimuth Pixel Spacing') * mlwin[0]
 *     f.attrs['cov_slant_range_pixel_spacing'] = ann.query('1x1 SLC Range Pixel Spacing') * mlwin[1]
 */
  __pyx_tuple__20 = PyTuple_Pack(1, __pyx_kp_u_1x1_SLC_Range_Pixel_Spacing); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(0, 195, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__20);
  __Pyx_GIVEREF(__pyx_tuple__20);

  /* "kapok/uavsarc.pyx":196
 *     f.attrs['slc_azimuth_pixel_spacing'] = ann.query('1x1 SLC Azimuth Pixel Spacing')
 *     f.attrs['slc_slant_range_pixel_spacing'] = ann.query('1x1 SLC Range Pixel Spacing')
 *     f.attrs['cov_azimuth_pixel_spacing'] = ann.query('1x1 SLC Azimuth Pixel Spacing') * mlwin[0]             # <<<<<<<<<<<<<<
 *     f.attrs['cov_slant_range_pixel_spacing'] = ann.query('1x1 SLC Range Pixel Spacing') * mlwin[1]
 * 
 */
  __pyx_tuple__21 = PyTuple_Pack(1, __pyx_kp_u_1x1_SLC_Azimuth_Pixel_Spacing); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(0, 196, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__21);
  __Pyx_GIVEREF(__pyx_tuple__21);

  /* "kapok/uavsarc.pyx":197
 *     f.attrs['slc_slant_range_pixel_spacing'] = ann.query('1x1 SLC Range Pixel Spacing')
 *     f.attrs['cov_azimuth_pixel_spacing'] = ann.query('1x1 SLC Azimuth Pixel Spacing') * mlwin[0]
 *     f.attrs['cov_slant_range_pixel_spacing'] = ann.query('1x1 SLC Range Pixel Spacing') * mlwin[1]             # <<<<<<<<<<<<<<
 * 
 *     f.attrs['num_tracks'] = num_tracks
 */
  __pyx_tuple__22 = PyTuple_Pack(1, __pyx_kp_u_1x1_SLC_Range_Pixel_Spacing); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(0, 197, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__22);
  __Pyx_GIVEREF(__pyx_tuple__22);

  /* "kapok/uavsarc.pyx":207
 * 
 *     # Get SCH Peg from Annotation File
 *     peglat = ann.query('Peg Latitude')             # <<<<<<<<<<<<<<
 *     peglon = ann.query('Peg Longitude')
 *     peghdg = ann.query('Peg Heading')
 */
  __pyx_tuple__23 = PyTuple_Pack(1, __pyx_kp_u_Peg_Latitude); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(0, 207, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__23);
  __Pyx_GIVEREF(__pyx_tuple__23);

  /* "kapok/uavsarc.pyx":208
 *     # Get SCH Peg from Annotation File
 *     peglat = ann.query('Peg Latitude')
 *     peglon = ann.query('Peg Longitude')             # <<<<<<<<<<<<<<
 *     peghdg = ann.query('Peg Heading')
 *     f.attrs['peg_latitude'] = peglat
 */
  __pyx_tuple__24 = PyTuple_Pack(1, __pyx_kp_u_Peg_Longitude); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(0, 208, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__24);
  __Pyx_GIVEREF(__pyx_tuple__24);

  /* "kapok/uavsarc.pyx":209
 *     peglat = ann.query('Peg Latitude')
 *     peglon = ann.query('Peg Longitude')
 *     peghdg = ann.query('Peg Heading')             # <<<<<<<<<<<<<<
 *     f.attrs['peg_latitude'] = peglat
 *     f.attrs['peg_longitude'] = peglon
 */
  __pyx_tuple__25 = PyTuple_Pack(1, __pyx_kp_u_Peg_Heading); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(0, 209, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__25);
  __Pyx_GIVEREF(__pyx_tuple__25);

  /* "kapok/uavsarc.pyx":230
 * 
 *     if azbounds[1] <= azbounds[0]:
 *         print('kapok.uavsar.load | Invalid azimuth bounds.  Must be ascending.  Aborting.')             # <<<<<<<<<<<<<<
 *         return
 * 
 */
  __pyx_tuple__26 = PyTuple_Pack(1, __pyx_kp_u_kapok_uavsar_load_Invalid_azimut); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(0, 230, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__26);
  __Pyx_GIVEREF(__pyx_tuple__26);

  /* "kapok/uavsarc.pyx":248
 * 
 *     if rngbounds[1] <= rngbounds[0]:
 *         print('kapok.uavsar.load | Invalid range bounds.  Must be ascending.  Aborting.')             # <<<<<<<<<<<<<<
 *         return
 * 
 */
  __pyx_tuple__29 = PyTuple_Pack(1, __pyx_kp_u_kapok_uavsar_load_Invalid_range); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(0, 248, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__29);
  __Pyx_GIVEREF(__pyx_tuple__29);

  /* "kapok/uavsarc.pyx":280
 *     for seg in range(num_segments):
 *         for tr in range(num_tracks):
 *             for pol in ['HH','HV','VV']:             # <<<<<<<<<<<<<<
 *                 file = glob(datapath+tracknames[tr]+'*'+pol+'_*_s'+str(seg+1)+'_1x1.slc')
 * 
 */
  __pyx_tuple__32 = PyTuple_Pack(3, __pyx_n_u_HH, __pyx_n_u_HV, __pyx_n_u_VV); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(0, 280, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__32);
  __Pyx_GIVEREF(__pyx_tuple__32);

  /* "kapok/uavsarc.pyx":298
 * 
 *     # Calculate covariance matrix.
 *     az_vector = np.round(np.linspace(0, azsize, num=num_blocks+1)).astype('int')             # <<<<<<<<<<<<<<
 *     az_vector[num_blocks] = azsize
 * 
 */
  __pyx_tuple__35 = PyTuple_Pack(1, __pyx_n_u_int); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(0, 298, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__35);
  __Pyx_GIVEREF(__pyx_tuple__35);

  /* "kapok/uavsarc.pyx":304
 *     cdef unsigned long azstart, azend, azstart_slc, azend_slc, azoffset_start, azoffset_end
 * 
 *     for n, azstart in enumerate(az_vector[0:-1]):             # <<<<<<<<<<<<<<
 *         azend = az_vector[n+1]
 *         azstart_slc = azstart*mlwin[0] + azbounds[0]
 */
  __pyx_slice__36 = PySlice_New(__pyx_int_0, __pyx_int_neg_1, Py_None); if (unlikely(!__pyx_slice__36)) __PYX_ERR(0, 304, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__36);
  __Pyx_GIVEREF(__pyx_slice__36);

  /* "kapok/uavsarc.pyx":329
 * 
 *                 if (slcnum % 3) == 1: # HV Polarization
 *                     slcstack[slcnum] = np.sqrt(2)*slc             # <<<<<<<<<<<<<<
 *                 else: # HH or VV Polarization
 *                     slcstack[slcnum] = slc
 */
  __pyx_tuple__44 = PyTuple_Pack(1, __pyx_int_2); if (unlikely(!__pyx_tuple__44)) __PYX_ERR(0, 329, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__44);
  __Pyx_GIVEREF(__pyx_tuple__44);

  /* "kapok/uavsarc.pyx":334
 *             else:
 *                 if (slcnum % 3) == 1: # HV Polarization
 *                     slcstack[slcnum] = np.sqrt(2)*slc             # <<<<<<<<<<<<<<
 *                 else:  # HH or VV Polarization
 *                     slcstack[slcnum] = slc
 */
  __pyx_tuple__45 = PyTuple_Pack(1, __pyx_int_2); if (unlikely(!__pyx_tuple__45)) __PYX_ERR(0, 334, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__45);
  __Pyx_GIVEREF(__pyx_tuple__45);

  /* "kapok/uavsarc.pyx":342
 *             for col in range(row,num_cov_elements):
 *                 print('kapok.uavsar.load | Calculating matrix element: ('+str(row)+','+str(col)+'). ('+time.ctime()+')     ', end='\r')
 *                 cov[azstart:azend,:,row,col] = mlook(slcstack[row]*np.conj(slcstack[col]),mlwin)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_slice__48 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__48)) __PYX_ERR(0, 342, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__48);
  __Pyx_GIVEREF(__pyx_slice__48);

  /* "kapok/uavsarc.pyx":349
 * 
 *     # Boxcar Smoothing:
 *     if smwin != (1,1):             # <<<<<<<<<<<<<<
 *         print('kapok.uavsar.load | Boxcar averaging covariance matrix. ('+time.ctime()+')')
 *         for row in range(0,num_cov_elements):
 */
  __pyx_tuple__49 = PyTuple_Pack(2, __pyx_int_1, __pyx_int_1); if (unlikely(!__pyx_tuple__49)) __PYX_ERR(0, 349, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__49);
  __Pyx_GIVEREF(__pyx_tuple__49);

  /* "kapok/uavsarc.pyx":353
 *         for row in range(0,num_cov_elements):
 *             for col in range(row,num_cov_elements):
 *                 cov[:,:,row,col] = smooth(cov[:,:,row,col],smwin)             # <<<<<<<<<<<<<<
 * 
 *     cov.attrs['description'] = 'Covariance Matrix'
 */
  __pyx_slice__50 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__50)) __PYX_ERR(0, 353, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__50);
  __Pyx_GIVEREF(__pyx_slice__50);
  __pyx_slice__51 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__51)) __PYX_ERR(0, 353, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__51);
  __Pyx_GIVEREF(__pyx_slice__51);
  __pyx_slice__52 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__52)) __PYX_ERR(0, 353, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__52);
  __Pyx_GIVEREF(__pyx_slice__52);
  __pyx_slice__53 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__53)) __PYX_ERR(0, 353, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__53);
  __Pyx_GIVEREF(__pyx_slice__53);

  /* "kapok/uavsarc.pyx":364
 *     # Load LLH files.
 *     llh = None
 *     mlwin_lkv = (int(ann.query('Number of Azimuth Looks in 2x8 SLC')), int(ann.query('Number of Range Looks in 2x8 SLC')))             # <<<<<<<<<<<<<<
 * 
 *     for seg in range(num_segments):
 */
  __pyx_tuple__54 = PyTuple_Pack(1, __pyx_kp_u_Number_of_Azimuth_Looks_in_2x8_S); if (unlikely(!__pyx_tuple__54)) __PYX_ERR(0, 364, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__54);
  __Pyx_GIVEREF(__pyx_tuple__54);
  __pyx_tuple__55 = PyTuple_Pack(1, __pyx_kp_u_Number_of_Range_Looks_in_2x8_SLC); if (unlikely(!__pyx_tuple__55)) __PYX_ERR(0, 364, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__55);
  __Pyx_GIVEREF(__pyx_tuple__55);

  /* "kapok/uavsarc.pyx":401
 *     print('kapok.uavsar.load | Importing latitude values. ('+time.ctime()+')')
 *     lat = f.create_dataset('lat', (azsize, rngsize), dtype='float32', compression=compression, compression_opts=compression_opts)
 *     lat[:] = mlook(zoom(llh[azllhstart:azllhend,rngllhstart:rngllhend,0],mlwin_lkv),mlwin)[azllhoffset:(azllhoffset+azsize),rngllhoffset:(rngllhoffset+rngsize)]             # <<<<<<<<<<<<<<
 *     lat.attrs['units'] = 'degrees'
 *     lat.attrs['description'] = 'Latitude'
 */
  __pyx_slice__56 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__56)) __PYX_ERR(0, 401, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__56);
  __Pyx_GIVEREF(__pyx_slice__56);

  /* "kapok/uavsarc.pyx":408
 *     print('kapok.uavsar.load | Importing longitude values. ('+time.ctime()+')')
 *     lon = f.create_dataset('lon', (azsize, rngsize), dtype='float32', compression=compression, compression_opts=compression_opts)
 *     lon[:] = mlook(zoom(llh[azllhstart:azllhend,rngllhstart:rngllhend,1],mlwin_lkv),mlwin)[azllhoffset:(azllhoffset+azsize),rngllhoffset:(rngllhoffset+rngsize)]             # <<<<<<<<<<<<<<
 *     lon.attrs['units'] = 'degrees'
 *     lon.attrs['description'] = 'Longitude'
 */
  __pyx_slice__57 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__57)) __PYX_ERR(0, 408, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__57);
  __Pyx_GIVEREF(__pyx_slice__57);

  /* "kapok/uavsarc.pyx":415
 *     print('kapok.uavsar.load | Importing DEM heights. ('+time.ctime()+')')
 *     dem = f.create_dataset('dem', (azsize, rngsize), dtype='float32', compression=compression, compression_opts=compression_opts)
 *     dem[:] = mlook(zoom(llh[azllhstart:azllhend,rngllhstart:rngllhend,2],mlwin_lkv),mlwin)[azllhoffset:(azllhoffset+azsize),rngllhoffset:(rngllhoffset+rngsize)]             # <<<<<<<<<<<<<<
 *     dem.attrs['units'] = 'meters'
 *     dem.attrs['description'] = 'Processor DEM'
 */
  __pyx_slice__58 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__58)) __PYX_ERR(0, 415, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__58);
  __Pyx_GIVEREF(__pyx_slice__58);

  /* "kapok/uavsarc.pyx":420
 * 
 *     # Convert LLH to ENU coordinates.  Used to calculate platform position later.
 *     posmm = llh2enu(np.radians(llh[:,:,1]), np.radians(llh[:,:,0]), llh[:,:,2], peglat, peglon, peghdg)             # <<<<<<<<<<<<<<
 * 
 *     f.flush()
 */
  __pyx_slice__59 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__59)) __PYX_ERR(0, 420, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__59);
  __Pyx_GIVEREF(__pyx_slice__59);
  __pyx_slice__60 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__60)) __PYX_ERR(0, 420, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__60);
  __Pyx_GIVEREF(__pyx_slice__60);
  __pyx_tuple__61 = PyTuple_Pack(3, __pyx_slice__59, __pyx_slice__60, __pyx_int_1); if (unlikely(!__pyx_tuple__61)) __PYX_ERR(0, 420, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__61);
  __Pyx_GIVEREF(__pyx_tuple__61);
  __pyx_slice__62 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__62)) __PYX_ERR(0, 420, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__62);
  __Pyx_GIVEREF(__pyx_slice__62);
  __pyx_slice__63 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__63)) __PYX_ERR(0, 420, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__63);
  __Pyx_GIVEREF(__pyx_slice__63);
  __pyx_tuple__64 = PyTuple_Pack(3, __pyx_slice__62, __pyx_slice__63, __pyx_int_0); if (unlikely(!__pyx_tuple__64)) __PYX_ERR(0, 420, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__64);
  __Pyx_GIVEREF(__pyx_tuple__64);
  __pyx_slice__65 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__65)) __PYX_ERR(0, 420, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__65);
  __Pyx_GIVEREF(__pyx_slice__65);
  __pyx_slice__66 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__66)) __PYX_ERR(0, 420, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__66);
  __Pyx_GIVEREF(__pyx_slice__66);
  __pyx_tuple__67 = PyTuple_Pack(3, __pyx_slice__65, __pyx_slice__66, __pyx_int_2); if (unlikely(!__pyx_tuple__67)) __PYX_ERR(0, 420, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__67);
  __Pyx_GIVEREF(__pyx_tuple__67);

  /* "kapok/uavsarc.pyx":448
 * 
 *     # Get sensor wavelength from annotation file.
 *     wavelength = ann.query('Center Wavelength')             # <<<<<<<<<<<<<<
 *     wavelength /= 100 # convert from cm to m
 *     f.attrs['wavelength'] = wavelength
 */
  __pyx_tuple__68 = PyTuple_Pack(1, __pyx_kp_u_Center_Wavelength); if (unlikely(!__pyx_tuple__68)) __PYX_ERR(0, 448, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__68);
  __Pyx_GIVEREF(__pyx_tuple__68);

  /* "kapok/uavsarc.pyx":453
 * 
 *     # Starting S coordinate of SLCs, and S coordinate spacing (in meters).
 *     sstart = ann.query('slc_1_1x1_mag.row_addr')             # <<<<<<<<<<<<<<
 *     sspacing = ann.query('slc_1_1x1_mag.row_mult')
 * 
 */
  __pyx_tuple__69 = PyTuple_Pack(1, __pyx_kp_u_slc_1_1x1_mag_row_addr); if (unlikely(!__pyx_tuple__69)) __PYX_ERR(0, 453, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__69);
  __Pyx_GIVEREF(__pyx_tuple__69);

  /* "kapok/uavsarc.pyx":454
 *     # Starting S coordinate of SLCs, and S coordinate spacing (in meters).
 *     sstart = ann.query('slc_1_1x1_mag.row_addr')
 *     sspacing = ann.query('slc_1_1x1_mag.row_mult')             # <<<<<<<<<<<<<<
 * 
 *     # S Coordinate Bounds for Desired Subset:
 */
  __pyx_tuple__70 = PyTuple_Pack(1, __pyx_kp_u_slc_1_1x1_mag_row_mult); if (unlikely(!__pyx_tuple__70)) __PYX_ERR(0, 454, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__70);
  __Pyx_GIVEREF(__pyx_tuple__70);

  /* "kapok/uavsarc.pyx":466
 *     print('kapok.uavsar.load | Calculating incidence angle values from reference track look vector. ('+time.ctime()+')')
 *     refvelocity = np.gradient(posmm, axis=0)
 *     refvelocity = refvelocity / (np.linalg.norm(refvelocity,axis=2)[:,:,np.newaxis])             # <<<<<<<<<<<<<<
 * 
 *     proj_reflkv_v = np.sum(lkvmm*refvelocity,axis=2)[:,:,np.newaxis]*refvelocity
 */
  __pyx_slice__71 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__71)) __PYX_ERR(0, 466, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__71);
  __Pyx_GIVEREF(__pyx_slice__71);
  __pyx_slice__72 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__72)) __PYX_ERR(0, 466, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__72);
  __Pyx_GIVEREF(__pyx_slice__72);

  /* "kapok/uavsarc.pyx":468
 *     refvelocity = refvelocity / (np.linalg.norm(refvelocity,axis=2)[:,:,np.newaxis])
 * 
 *     proj_reflkv_v = np.sum(lkvmm*refvelocity,axis=2)[:,:,np.newaxis]*refvelocity             # <<<<<<<<<<<<<<
 * 
 *     incident_lkv = lkvmm - proj_reflkv_v
 */
  __pyx_slice__73 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__73)) __PYX_ERR(0, 468, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__73);
  __Pyx_GIVEREF(__pyx_slice__73);
  __pyx_slice__74 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__74)) __PYX_ERR(0, 468, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__74);
  __Pyx_GIVEREF(__pyx_slice__74);

  /* "kapok/uavsarc.pyx":471
 * 
 *     incident_lkv = lkvmm - proj_reflkv_v
 *     inc_ref = np.arccos(np.abs(incident_lkv[:,:,2])/np.linalg.norm(incident_lkv,axis=2))             # <<<<<<<<<<<<<<
 * 
 *     # Initialize incidence angle dataset (stores reference track incidence angle):
 */
  __pyx_slice__75 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__75)) __PYX_ERR(0, 471, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__75);
  __Pyx_GIVEREF(__pyx_slice__75);
  __pyx_slice__76 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__76)) __PYX_ERR(0, 471, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__76);
  __Pyx_GIVEREF(__pyx_slice__76);
  __pyx_tuple__77 = PyTuple_Pack(3, __pyx_slice__75, __pyx_slice__76, __pyx_int_2); if (unlikely(!__pyx_tuple__77)) __PYX_ERR(0, 471, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__77);
  __Pyx_GIVEREF(__pyx_tuple__77);

  /* "kapok/uavsarc.pyx":477
 *     inc.attrs['units'] = 'radians'
 *     inc.attrs['description'] = 'Reference Track Incidence Angle'
 *     inc[:] = mlook(zoom(inc_ref[azllhstart:azllhend,rngllhstart:rngllhend],mlwin_lkv),mlwin)[azllhoffset:(azllhoffset+azsize),rngllhoffset:(rngllhoffset+rngsize)]             # <<<<<<<<<<<<<<
 *     del refvelocity, proj_reflkv_v, incident_lkv, inc_ref
 * 
 */
  __pyx_slice__78 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__78)) __PYX_ERR(0, 477, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__78);
  __Pyx_GIVEREF(__pyx_slice__78);

  /* "kapok/uavsarc.pyx":546
 *             if not kzcalc:
 *                 # kz files appear to be kz_i0 rather than kz_0i.  Multiplying by -1 so that in the Scene object, kz_ij = kz[j] - kz[i].
 *                 kz[tr,:,:] = -1*mlook(zoom(kz_temp[azllhstart:azllhend,rngllhstart:rngllhend],mlwin_lkv),mlwin)[azllhoffset:(azllhoffset+azsize),rngllhoffset:(rngllhoffset+rngsize)]             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_slice__79 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__79)) __PYX_ERR(0, 546, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__79);
  __Pyx_GIVEREF(__pyx_slice__79);
  __pyx_slice__80 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__80)) __PYX_ERR(0, 546, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__80);
  __Pyx_GIVEREF(__pyx_slice__80);

  /* "kapok/uavsarc.pyx":562
 * 
 *             # Normalize kz values by dot product.
 *             kz[:] *= height_dot_normal[np.newaxis,:,:]             # <<<<<<<<<<<<<<
 *             del height_dot_normal, rngslope, azslope
 * 
 */
  __pyx_slice__81 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__81)) __PYX_ERR(0, 562, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__81);
  __Pyx_GIVEREF(__pyx_slice__81);
  __pyx_slice__82 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__82)) __PYX_ERR(0, 562, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__82);
  __Pyx_GIVEREF(__pyx_slice__82);
  __pyx_slice__83 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__83)) __PYX_ERR(0, 562, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__83);
  __Pyx_GIVEREF(__pyx_slice__83);

  /* "kapok/uavsarc.pyx":580
 *                 return
 * 
 *             istart = np.where(np.isclose(basesch[:,0],sbounds[0]))[0][0] # index of first azimuth line in subset             # <<<<<<<<<<<<<<
 *             iend = np.where(np.isclose(basesch[:,0],sbounds[1]))[0][0] # index of last azimuth line in subset
 *             base_enu[:] = sch2enu(basesch[istart:iend,1],basesch[istart:iend,2],basesch[istart:iend,3], peglat, peglon, peghdg)[0:base_enu.shape[0],:]
 */
  __pyx_slice__84 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__84)) __PYX_ERR(0, 580, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__84);
  __Pyx_GIVEREF(__pyx_slice__84);
  __pyx_tuple__85 = PyTuple_Pack(2, __pyx_slice__84, __pyx_int_0); if (unlikely(!__pyx_tuple__85)) __PYX_ERR(0, 580, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__85);
  __Pyx_GIVEREF(__pyx_tuple__85);

  /* "kapok/uavsarc.pyx":581
 * 
 *             istart = np.where(np.isclose(basesch[:,0],sbounds[0]))[0][0] # index of first azimuth line in subset
 *             iend = np.where(np.isclose(basesch[:,0],sbounds[1]))[0][0] # index of last azimuth line in subset             # <<<<<<<<<<<<<<
 *             base_enu[:] = sch2enu(basesch[istart:iend,1],basesch[istart:iend,2],basesch[istart:iend,3], peglat, peglon, peghdg)[0:base_enu.shape[0],:]
 * 
 */
  __pyx_slice__86 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__86)) __PYX_ERR(0, 581, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__86);
  __Pyx_GIVEREF(__pyx_slice__86);
  __pyx_tuple__87 = PyTuple_Pack(2, __pyx_slice__86, __pyx_int_0); if (unlikely(!__pyx_tuple__87)) __PYX_ERR(0, 581, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__87);
  __Pyx_GIVEREF(__pyx_tuple__87);

  /* "kapok/uavsarc.pyx":582
 *             istart = np.where(np.isclose(basesch[:,0],sbounds[0]))[0][0] # index of first azimuth line in subset
 *             iend = np.where(np.isclose(basesch[:,0],sbounds[1]))[0][0] # index of last azimuth line in subset
 *             base_enu[:] = sch2enu(basesch[istart:iend,1],basesch[istart:iend,2],basesch[istart:iend,3], peglat, peglon, peghdg)[0:base_enu.shape[0],:]             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_slice__88 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__88)) __PYX_ERR(0, 582, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__88);
  __Pyx_GIVEREF(__pyx_slice__88);
  __pyx_slice__89 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__89)) __PYX_ERR(0, 582, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__89);
  __Pyx_GIVEREF(__pyx_slice__89);

  /* "kapok/uavsarc.pyx":598
 * 
 *                 # Current track look vector.
 *                 tracklkv[:,:,0] = (zoom(lkv[lkvrowstart:lkvrowend,:,0],mlwin_lkv)[lkvtrimstart:lkvtrimend] + base_enu[azstart:azend,np.newaxis,0])[0:mlwin[0],0:rngsize_slc]             # <<<<<<<<<<<<<<
 *                 tracklkv[:,:,1] = (zoom(lkv[lkvrowstart:lkvrowend,:,1],mlwin_lkv)[lkvtrimstart:lkvtrimend] + base_enu[azstart:azend,np.newaxis,1])[0:mlwin[0],0:rngsize_slc]
 *                 tracklkv[:,:,2] = (zoom(lkv[lkvrowstart:lkvrowend,:,2],mlwin_lkv)[lkvtrimstart:lkvtrimend] + base_enu[azstart:azend,np.newaxis,2])[0:mlwin[0],0:rngsize_slc]
 */
  __pyx_slice__90 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__90)) __PYX_ERR(0, 598, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__90);
  __Pyx_GIVEREF(__pyx_slice__90);
  __pyx_slice__91 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__91)) __PYX_ERR(0, 598, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__91);
  __Pyx_GIVEREF(__pyx_slice__91);
  __pyx_slice__92 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__92)) __PYX_ERR(0, 598, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__92);
  __Pyx_GIVEREF(__pyx_slice__92);
  __pyx_tuple__93 = PyTuple_Pack(3, __pyx_slice__91, __pyx_slice__92, __pyx_int_0); if (unlikely(!__pyx_tuple__93)) __PYX_ERR(0, 598, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__93);
  __Pyx_GIVEREF(__pyx_tuple__93);

  /* "kapok/uavsarc.pyx":599
 *                 # Current track look vector.
 *                 tracklkv[:,:,0] = (zoom(lkv[lkvrowstart:lkvrowend,:,0],mlwin_lkv)[lkvtrimstart:lkvtrimend] + base_enu[azstart:azend,np.newaxis,0])[0:mlwin[0],0:rngsize_slc]
 *                 tracklkv[:,:,1] = (zoom(lkv[lkvrowstart:lkvrowend,:,1],mlwin_lkv)[lkvtrimstart:lkvtrimend] + base_enu[azstart:azend,np.newaxis,1])[0:mlwin[0],0:rngsize_slc]             # <<<<<<<<<<<<<<
 *                 tracklkv[:,:,2] = (zoom(lkv[lkvrowstart:lkvrowend,:,2],mlwin_lkv)[lkvtrimstart:lkvtrimend] + base_enu[azstart:azend,np.newaxis,2])[0:mlwin[0],0:rngsize_slc]
 * 
 */
  __pyx_slice__94 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__94)) __PYX_ERR(0, 599, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__94);
  __Pyx_GIVEREF(__pyx_slice__94);
  __pyx_slice__95 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__95)) __PYX_ERR(0, 599, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__95);
  __Pyx_GIVEREF(__pyx_slice__95);
  __pyx_slice__96 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__96)) __PYX_ERR(0, 599, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__96);
  __Pyx_GIVEREF(__pyx_slice__96);
  __pyx_tuple__97 = PyTuple_Pack(3, __pyx_slice__95, __pyx_slice__96, __pyx_int_1); if (unlikely(!__pyx_tuple__97)) __PYX_ERR(0, 599, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__97);
  __Pyx_GIVEREF(__pyx_tuple__97);

  /* "kapok/uavsarc.pyx":600
 *                 tracklkv[:,:,0] = (zoom(lkv[lkvrowstart:lkvrowend,:,0],mlwin_lkv)[lkvtrimstart:lkvtrimend] + base_enu[azstart:azend,np.newaxis,0])[0:mlwin[0],0:rngsize_slc]
 *                 tracklkv[:,:,1] = (zoom(lkv[lkvrowstart:lkvrowend,:,1],mlwin_lkv)[lkvtrimstart:lkvtrimend] + base_enu[azstart:azend,np.newaxis,1])[0:mlwin[0],0:rngsize_slc]
 *                 tracklkv[:,:,2] = (zoom(lkv[lkvrowstart:lkvrowend,:,2],mlwin_lkv)[lkvtrimstart:lkvtrimend] + base_enu[azstart:azend,np.newaxis,2])[0:mlwin[0],0:rngsize_slc]             # <<<<<<<<<<<<<<
 * 
 *                 # Platform velocity vector.
 */
  __pyx_slice__98 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__98)) __PYX_ERR(0, 600, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__98);
  __Pyx_GIVEREF(__pyx_slice__98);
  __pyx_slice__99 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__99)) __PYX_ERR(0, 600, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__99);
  __Pyx_GIVEREF(__pyx_slice__99);
  __pyx_slice__100 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__100)) __PYX_ERR(0, 600, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__100);
  __Pyx_GIVEREF(__pyx_slice__100);
  __pyx_tuple__101 = PyTuple_Pack(3, __pyx_slice__99, __pyx_slice__100, __pyx_int_2); if (unlikely(!__pyx_tuple__101)) __PYX_ERR(0, 600, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__101);
  __Pyx_GIVEREF(__pyx_tuple__101);

  /* "kapok/uavsarc.pyx":603
 * 
 *                 # Platform velocity vector.
 *                 velocity[:,:,0] = np.gradient(zoom(pos[lkvrowstart:lkvrowend,:,0],mlwin_lkv)[lkvtrimstart:lkvtrimend] + base_enu[azstart:azend,np.newaxis,0], axis=0)[0:mlwin[0],0:rngsize_slc]             # <<<<<<<<<<<<<<
 *                 velocity[:,:,1] = np.gradient(zoom(pos[lkvrowstart:lkvrowend,:,1],mlwin_lkv)[lkvtrimstart:lkvtrimend] + base_enu[azstart:azend,np.newaxis,1], axis=0)[0:mlwin[0],0:rngsize_slc]
 *                 velocity[:,:,2] = np.gradient(zoom(pos[lkvrowstart:lkvrowend,:,2],mlwin_lkv)[lkvtrimstart:lkvtrimend] + base_enu[azstart:azend,np.newaxis,2], axis=0)[0:mlwin[0],0:rngsize_slc]
 */
  __pyx_slice__102 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__102)) __PYX_ERR(0, 603, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__102);
  __Pyx_GIVEREF(__pyx_slice__102);
  __pyx_slice__103 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__103)) __PYX_ERR(0, 603, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__103);
  __Pyx_GIVEREF(__pyx_slice__103);
  __pyx_slice__104 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__104)) __PYX_ERR(0, 603, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__104);
  __Pyx_GIVEREF(__pyx_slice__104);
  __pyx_tuple__105 = PyTuple_Pack(3, __pyx_slice__103, __pyx_slice__104, __pyx_int_0); if (unlikely(!__pyx_tuple__105)) __PYX_ERR(0, 603, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__105);
  __Pyx_GIVEREF(__pyx_tuple__105);

  /* "kapok/uavsarc.pyx":604
 *                 # Platform velocity vector.
 *                 velocity[:,:,0] = np.gradient(zoom(pos[lkvrowstart:lkvrowend,:,0],mlwin_lkv)[lkvtrimstart:lkvtrimend] + base_enu[azstart:azend,np.newaxis,0], axis=0)[0:mlwin[0],0:rngsize_slc]
 *                 velocity[:,:,1] = np.gradient(zoom(pos[lkvrowstart:lkvrowend,:,1],mlwin_lkv)[lkvtrimstart:lkvtrimend] + base_enu[azstart:azend,np.newaxis,1], axis=0)[0:mlwin[0],0:rngsize_slc]             # <<<<<<<<<<<<<<
 *                 velocity[:,:,2] = np.gradient(zoom(pos[lkvrowstart:lkvrowend,:,2],mlwin_lkv)[lkvtrimstart:lkvtrimend] + base_enu[azstart:azend,np.newaxis,2], axis=0)[0:mlwin[0],0:rngsize_slc]
 *                 velocity = velocity / (np.linalg.norm(velocity,axis=2)[:,:,np.newaxis])
 */
  __pyx_slice__106 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__106)) __PYX_ERR(0, 604, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__106);
  __Pyx_GIVEREF(__pyx_slice__106);
  __pyx_slice__107 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__107)) __PYX_ERR(0, 604, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__107);
  __Pyx_GIVEREF(__pyx_slice__107);
  __pyx_slice__108 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__108)) __PYX_ERR(0, 604, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__108);
  __Pyx_GIVEREF(__pyx_slice__108);
  __pyx_tuple__109 = PyTuple_Pack(3, __pyx_slice__107, __pyx_slice__108, __pyx_int_1); if (unlikely(!__pyx_tuple__109)) __PYX_ERR(0, 604, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__109);
  __Pyx_GIVEREF(__pyx_tuple__109);

  /* "kapok/uavsarc.pyx":605
 *                 velocity[:,:,0] = np.gradient(zoom(pos[lkvrowstart:lkvrowend,:,0],mlwin_lkv)[lkvtrimstart:lkvtrimend] + base_enu[azstart:azend,np.newaxis,0], axis=0)[0:mlwin[0],0:rngsize_slc]
 *                 velocity[:,:,1] = np.gradient(zoom(pos[lkvrowstart:lkvrowend,:,1],mlwin_lkv)[lkvtrimstart:lkvtrimend] + base_enu[azstart:azend,np.newaxis,1], axis=0)[0:mlwin[0],0:rngsize_slc]
 *                 velocity[:,:,2] = np.gradient(zoom(pos[lkvrowstart:lkvrowend,:,2],mlwin_lkv)[lkvtrimstart:lkvtrimend] + base_enu[azstart:azend,np.newaxis,2], axis=0)[0:mlwin[0],0:rngsize_slc]             # <<<<<<<<<<<<<<
 *                 velocity = velocity / (np.linalg.norm(velocity,axis=2)[:,:,np.newaxis])
 * 
 */
  __pyx_slice__110 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__110)) __PYX_ERR(0, 605, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__110);
  __Pyx_GIVEREF(__pyx_slice__110);
  __pyx_slice__111 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__111)) __PYX_ERR(0, 605, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__111);
  __Pyx_GIVEREF(__pyx_slice__111);
  __pyx_slice__112 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__112)) __PYX_ERR(0, 605, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__112);
  __Pyx_GIVEREF(__pyx_slice__112);
  __pyx_tuple__113 = PyTuple_Pack(3, __pyx_slice__111, __pyx_slice__112, __pyx_int_2); if (unlikely(!__pyx_tuple__113)) __PYX_ERR(0, 605, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__113);
  __Pyx_GIVEREF(__pyx_tuple__113);

  /* "kapok/uavsarc.pyx":606
 *                 velocity[:,:,1] = np.gradient(zoom(pos[lkvrowstart:lkvrowend,:,1],mlwin_lkv)[lkvtrimstart:lkvtrimend] + base_enu[azstart:azend,np.newaxis,1], axis=0)[0:mlwin[0],0:rngsize_slc]
 *                 velocity[:,:,2] = np.gradient(zoom(pos[lkvrowstart:lkvrowend,:,2],mlwin_lkv)[lkvtrimstart:lkvtrimend] + base_enu[azstart:azend,np.newaxis,2], axis=0)[0:mlwin[0],0:rngsize_slc]
 *                 velocity = velocity / (np.linalg.norm(velocity,axis=2)[:,:,np.newaxis])             # <<<<<<<<<<<<<<
 * 
 *                 # Project look vector onto velocity vector.
 */
  __pyx_slice__114 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__114)) __PYX_ERR(0, 606, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__114);
  __Pyx_GIVEREF(__pyx_slice__114);
  __pyx_slice__115 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__115)) __PYX_ERR(0, 606, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__115);
  __Pyx_GIVEREF(__pyx_slice__115);

  /* "kapok/uavsarc.pyx":609
 * 
 *                 # Project look vector onto velocity vector.
 *                 proj_lkv_velocity = np.sum(tracklkv*velocity,axis=2)[:,:,np.newaxis]*velocity             # <<<<<<<<<<<<<<
 * 
 *                 # Get incidence angle with same dimensions as single-look kz buffer.
 */
  __pyx_slice__116 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__116)) __PYX_ERR(0, 609, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__116);
  __Pyx_GIVEREF(__pyx_slice__116);
  __pyx_slice__117 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__117)) __PYX_ERR(0, 609, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__117);
  __Pyx_GIVEREF(__pyx_slice__117);

  /* "kapok/uavsarc.pyx":612
 * 
 *                 # Get incidence angle with same dimensions as single-look kz buffer.
 *                 inc_buffer[:,0:rngsize*mlwin[1]] = zoom(inc[az_ml,:][np.newaxis,:],mlwin)             # <<<<<<<<<<<<<<
 *                 inc_buffer[:,rngsize*mlwin[1]:] = inc_buffer[:,(rngsize*mlwin[1]-1)][:,np.newaxis]
 * 
 */
  __pyx_slice__118 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__118)) __PYX_ERR(0, 612, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__118);
  __Pyx_GIVEREF(__pyx_slice__118);
  __pyx_slice__119 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__119)) __PYX_ERR(0, 612, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__119);
  __Pyx_GIVEREF(__pyx_slice__119);
  __pyx_slice__120 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__120)) __PYX_ERR(0, 612, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__120);
  __Pyx_GIVEREF(__pyx_slice__120);

  /* "kapok/uavsarc.pyx":613
 *                 # Get incidence angle with same dimensions as single-look kz buffer.
 *                 inc_buffer[:,0:rngsize*mlwin[1]] = zoom(inc[az_ml,:][np.newaxis,:],mlwin)
 *                 inc_buffer[:,rngsize*mlwin[1]:] = inc_buffer[:,(rngsize*mlwin[1]-1)][:,np.newaxis]             # <<<<<<<<<<<<<<
 * 
 *                 # Component of look vector orthogonal to velocity.
 */
  __pyx_slice__121 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__121)) __PYX_ERR(0, 613, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__121);
  __Pyx_GIVEREF(__pyx_slice__121);
  __pyx_slice__122 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__122)) __PYX_ERR(0, 613, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__122);
  __Pyx_GIVEREF(__pyx_slice__122);
  __pyx_slice__123 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__123)) __PYX_ERR(0, 613, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__123);
  __Pyx_GIVEREF(__pyx_slice__123);

  /* "kapok/uavsarc.pyx":616
 * 
 *                 # Component of look vector orthogonal to velocity.
 *                 lookcrossv[:,:,0] = tracklkv[:,:,1]*velocity[:,:,2] - tracklkv[:,:,2]*velocity[:,:,1]             # <<<<<<<<<<<<<<
 *                 lookcrossv[:,:,1] = tracklkv[:,:,2]*velocity[:,:,0] - tracklkv[:,:,0]*velocity[:,:,2]
 *                 lookcrossv[:,:,2] = tracklkv[:,:,0]*velocity[:,:,1] - tracklkv[:,:,1]*velocity[:,:,0]
 */
  __pyx_slice__124 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__124)) __PYX_ERR(0, 616, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__124);
  __Pyx_GIVEREF(__pyx_slice__124);
  __pyx_slice__125 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__125)) __PYX_ERR(0, 616, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__125);
  __Pyx_GIVEREF(__pyx_slice__125);
  __pyx_tuple__126 = PyTuple_Pack(3, __pyx_slice__124, __pyx_slice__125, __pyx_int_1); if (unlikely(!__pyx_tuple__126)) __PYX_ERR(0, 616, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__126);
  __Pyx_GIVEREF(__pyx_tuple__126);
  __pyx_slice__127 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__127)) __PYX_ERR(0, 616, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__127);
  __Pyx_GIVEREF(__pyx_slice__127);
  __pyx_slice__128 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__128)) __PYX_ERR(0, 616, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__128);
  __Pyx_GIVEREF(__pyx_slice__128);
  __pyx_tuple__129 = PyTuple_Pack(3, __pyx_slice__127, __pyx_slice__128, __pyx_int_2); if (unlikely(!__pyx_tuple__129)) __PYX_ERR(0, 616, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__129);
  __Pyx_GIVEREF(__pyx_tuple__129);
  __pyx_slice__130 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__130)) __PYX_ERR(0, 616, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__130);
  __Pyx_GIVEREF(__pyx_slice__130);
  __pyx_slice__131 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__131)) __PYX_ERR(0, 616, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__131);
  __Pyx_GIVEREF(__pyx_slice__131);
  __pyx_tuple__132 = PyTuple_Pack(3, __pyx_slice__130, __pyx_slice__131, __pyx_int_2); if (unlikely(!__pyx_tuple__132)) __PYX_ERR(0, 616, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__132);
  __Pyx_GIVEREF(__pyx_tuple__132);
  __pyx_slice__133 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__133)) __PYX_ERR(0, 616, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__133);
  __Pyx_GIVEREF(__pyx_slice__133);
  __pyx_slice__134 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__134)) __PYX_ERR(0, 616, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__134);
  __Pyx_GIVEREF(__pyx_slice__134);
  __pyx_tuple__135 = PyTuple_Pack(3, __pyx_slice__133, __pyx_slice__134, __pyx_int_1); if (unlikely(!__pyx_tuple__135)) __PYX_ERR(0, 616, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__135);
  __Pyx_GIVEREF(__pyx_tuple__135);
  __pyx_slice__136 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__136)) __PYX_ERR(0, 616, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__136);
  __Pyx_GIVEREF(__pyx_slice__136);
  __pyx_slice__137 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__137)) __PYX_ERR(0, 616, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__137);
  __Pyx_GIVEREF(__pyx_slice__137);
  __pyx_tuple__138 = PyTuple_Pack(3, __pyx_slice__136, __pyx_slice__137, __pyx_int_0); if (unlikely(!__pyx_tuple__138)) __PYX_ERR(0, 616, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__138);
  __Pyx_GIVEREF(__pyx_tuple__138);

  /* "kapok/uavsarc.pyx":617
 *                 # Component of look vector orthogonal to velocity.
 *                 lookcrossv[:,:,0] = tracklkv[:,:,1]*velocity[:,:,2] - tracklkv[:,:,2]*velocity[:,:,1]
 *                 lookcrossv[:,:,1] = tracklkv[:,:,2]*velocity[:,:,0] - tracklkv[:,:,0]*velocity[:,:,2]             # <<<<<<<<<<<<<<
 *                 lookcrossv[:,:,2] = tracklkv[:,:,0]*velocity[:,:,1] - tracklkv[:,:,1]*velocity[:,:,0]
 * 
 */
  __pyx_slice__139 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__139)) __PYX_ERR(0, 617, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__139);
  __Pyx_GIVEREF(__pyx_slice__139);
  __pyx_slice__140 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__140)) __PYX_ERR(0, 617, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__140);
  __Pyx_GIVEREF(__pyx_slice__140);
  __pyx_tuple__141 = PyTuple_Pack(3, __pyx_slice__139, __pyx_slice__140, __pyx_int_2); if (unlikely(!__pyx_tuple__141)) __PYX_ERR(0, 617, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__141);
  __Pyx_GIVEREF(__pyx_tuple__141);
  __pyx_slice__142 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__142)) __PYX_ERR(0, 617, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__142);
  __Pyx_GIVEREF(__pyx_slice__142);
  __pyx_slice__143 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__143)) __PYX_ERR(0, 617, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__143);
  __Pyx_GIVEREF(__pyx_slice__143);
  __pyx_tuple__144 = PyTuple_Pack(3, __pyx_slice__142, __pyx_slice__143, __pyx_int_0); if (unlikely(!__pyx_tuple__144)) __PYX_ERR(0, 617, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__144);
  __Pyx_GIVEREF(__pyx_tuple__144);
  __pyx_slice__145 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__145)) __PYX_ERR(0, 617, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__145);
  __Pyx_GIVEREF(__pyx_slice__145);
  __pyx_slice__146 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__146)) __PYX_ERR(0, 617, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__146);
  __Pyx_GIVEREF(__pyx_slice__146);
  __pyx_tuple__147 = PyTuple_Pack(3, __pyx_slice__145, __pyx_slice__146, __pyx_int_0); if (unlikely(!__pyx_tuple__147)) __PYX_ERR(0, 617, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__147);
  __Pyx_GIVEREF(__pyx_tuple__147);
  __pyx_slice__148 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__148)) __PYX_ERR(0, 617, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__148);
  __Pyx_GIVEREF(__pyx_slice__148);
  __pyx_slice__149 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__149)) __PYX_ERR(0, 617, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__149);
  __Pyx_GIVEREF(__pyx_slice__149);
  __pyx_tuple__150 = PyTuple_Pack(3, __pyx_slice__148, __pyx_slice__149, __pyx_int_2); if (unlikely(!__pyx_tuple__150)) __PYX_ERR(0, 617, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__150);
  __Pyx_GIVEREF(__pyx_tuple__150);
  __pyx_slice__151 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__151)) __PYX_ERR(0, 617, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__151);
  __Pyx_GIVEREF(__pyx_slice__151);
  __pyx_slice__152 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__152)) __PYX_ERR(0, 617, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__152);
  __Pyx_GIVEREF(__pyx_slice__152);
  __pyx_tuple__153 = PyTuple_Pack(3, __pyx_slice__151, __pyx_slice__152, __pyx_int_1); if (unlikely(!__pyx_tuple__153)) __PYX_ERR(0, 617, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__153);
  __Pyx_GIVEREF(__pyx_tuple__153);

  /* "kapok/uavsarc.pyx":618
 *                 lookcrossv[:,:,0] = tracklkv[:,:,1]*velocity[:,:,2] - tracklkv[:,:,2]*velocity[:,:,1]
 *                 lookcrossv[:,:,1] = tracklkv[:,:,2]*velocity[:,:,0] - tracklkv[:,:,0]*velocity[:,:,2]
 *                 lookcrossv[:,:,2] = tracklkv[:,:,0]*velocity[:,:,1] - tracklkv[:,:,1]*velocity[:,:,0]             # <<<<<<<<<<<<<<
 * 
 *                 # Baseline and perpendicular baseline.
 */
  __pyx_slice__154 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__154)) __PYX_ERR(0, 618, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__154);
  __Pyx_GIVEREF(__pyx_slice__154);
  __pyx_slice__155 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__155)) __PYX_ERR(0, 618, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__155);
  __Pyx_GIVEREF(__pyx_slice__155);
  __pyx_tuple__156 = PyTuple_Pack(3, __pyx_slice__154, __pyx_slice__155, __pyx_int_0); if (unlikely(!__pyx_tuple__156)) __PYX_ERR(0, 618, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__156);
  __Pyx_GIVEREF(__pyx_tuple__156);
  __pyx_slice__157 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__157)) __PYX_ERR(0, 618, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__157);
  __Pyx_GIVEREF(__pyx_slice__157);
  __pyx_slice__158 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__158)) __PYX_ERR(0, 618, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__158);
  __Pyx_GIVEREF(__pyx_slice__158);
  __pyx_tuple__159 = PyTuple_Pack(3, __pyx_slice__157, __pyx_slice__158, __pyx_int_1); if (unlikely(!__pyx_tuple__159)) __PYX_ERR(0, 618, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__159);
  __Pyx_GIVEREF(__pyx_tuple__159);
  __pyx_slice__160 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__160)) __PYX_ERR(0, 618, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__160);
  __Pyx_GIVEREF(__pyx_slice__160);
  __pyx_slice__161 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__161)) __PYX_ERR(0, 618, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__161);
  __Pyx_GIVEREF(__pyx_slice__161);
  __pyx_tuple__162 = PyTuple_Pack(3, __pyx_slice__160, __pyx_slice__161, __pyx_int_1); if (unlikely(!__pyx_tuple__162)) __PYX_ERR(0, 618, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__162);
  __Pyx_GIVEREF(__pyx_tuple__162);
  __pyx_slice__163 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__163)) __PYX_ERR(0, 618, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__163);
  __Pyx_GIVEREF(__pyx_slice__163);
  __pyx_slice__164 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__164)) __PYX_ERR(0, 618, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__164);
  __Pyx_GIVEREF(__pyx_slice__164);
  __pyx_tuple__165 = PyTuple_Pack(3, __pyx_slice__163, __pyx_slice__164, __pyx_int_0); if (unlikely(!__pyx_tuple__165)) __PYX_ERR(0, 618, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__165);
  __Pyx_GIVEREF(__pyx_tuple__165);
  __pyx_slice__166 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__166)) __PYX_ERR(0, 618, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__166);
  __Pyx_GIVEREF(__pyx_slice__166);
  __pyx_slice__167 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__167)) __PYX_ERR(0, 618, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__167);
  __Pyx_GIVEREF(__pyx_slice__167);
  __pyx_tuple__168 = PyTuple_Pack(3, __pyx_slice__166, __pyx_slice__167, __pyx_int_2); if (unlikely(!__pyx_tuple__168)) __PYX_ERR(0, 618, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__168);
  __Pyx_GIVEREF(__pyx_tuple__168);

  /* "kapok/uavsarc.pyx":622
 *                 # Baseline and perpendicular baseline.
 *                 baseline = base_enu[azstart:azend]
 *                 baselinepsign = np.sum(baseline[:,np.newaxis,:]*lookcrossv,axis=2)/np.sum(lookcrossv*lookcrossv,axis=2)             # <<<<<<<<<<<<<<
 *                 baselinep = np.linalg.norm((np.sum(baseline[:,np.newaxis,:]*lookcrossv,axis=2)/np.sum(lookcrossv*lookcrossv,axis=2))[:,:,np.newaxis]*lookcrossv,axis=2)
 * 
 */
  __pyx_slice__169 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__169)) __PYX_ERR(0, 622, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__169);
  __Pyx_GIVEREF(__pyx_slice__169);
  __pyx_slice__170 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__170)) __PYX_ERR(0, 622, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__170);
  __Pyx_GIVEREF(__pyx_slice__170);

  /* "kapok/uavsarc.pyx":623
 *                 baseline = base_enu[azstart:azend]
 *                 baselinepsign = np.sum(baseline[:,np.newaxis,:]*lookcrossv,axis=2)/np.sum(lookcrossv*lookcrossv,axis=2)
 *                 baselinep = np.linalg.norm((np.sum(baseline[:,np.newaxis,:]*lookcrossv,axis=2)/np.sum(lookcrossv*lookcrossv,axis=2))[:,:,np.newaxis]*lookcrossv,axis=2)             # <<<<<<<<<<<<<<
 * 
 *                 # Calculate kz.
 */
  __pyx_slice__171 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__171)) __PYX_ERR(0, 623, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__171);
  __Pyx_GIVEREF(__pyx_slice__171);
  __pyx_slice__172 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__172)) __PYX_ERR(0, 623, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__172);
  __Pyx_GIVEREF(__pyx_slice__172);
  __pyx_slice__173 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__173)) __PYX_ERR(0, 623, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__173);
  __Pyx_GIVEREF(__pyx_slice__173);
  __pyx_slice__174 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__174)) __PYX_ERR(0, 623, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__174);
  __Pyx_GIVEREF(__pyx_slice__174);

  /* "kapok/uavsarc.pyx":628
 *                 kz_buffer = (4*np.pi/wavelength) * baselinep / (np.linalg.norm(tracklkv,axis=2)*np.sin(inc_buffer)) * np.sign(baselinepsign)
 * 
 *                 kz[tr,az_ml,:] = mlook(kz_buffer[:,rngbounds[0]:rngbounds[1]], mlwin)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_slice__175 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__175)) __PYX_ERR(0, 628, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__175);
  __Pyx_GIVEREF(__pyx_slice__175);
  __pyx_slice__176 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__176)) __PYX_ERR(0, 628, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__176);
  __Pyx_GIVEREF(__pyx_slice__176);

  /* "kapok/uavsarc.pyx":651
 *         self.file = file
 *         fd = open(self.file, 'r')
 *         self.ann = fd.read().split('\n')             # <<<<<<<<<<<<<<
 *         return
 * 
 */
  __pyx_tuple__178 = PyTuple_Pack(1, __pyx_kp_u__177); if (unlikely(!__pyx_tuple__178)) __PYX_ERR(0, 651, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__178);
  __Pyx_GIVEREF(__pyx_tuple__178);

  /* "kapok/uavsarc.pyx":668
 *             if self.ann[n].startswith(keyword):
 *                 try:
 *                     val = self.ann[n].rsplit('=')[-1].split(';')[0].split()[0]             # <<<<<<<<<<<<<<
 *                     val = np.array(val,dtype='float') # if we can convert the string to a number, do so
 *                     if (val - np.floor(val)) == 0:
 */
  __pyx_tuple__180 = PyTuple_Pack(1, __pyx_kp_u__179); if (unlikely(!__pyx_tuple__180)) __PYX_ERR(0, 668, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__180);
  __Pyx_GIVEREF(__pyx_tuple__180);
  __pyx_tuple__182 = PyTuple_Pack(1, __pyx_kp_u__181); if (unlikely(!__pyx_tuple__182)) __PYX_ERR(0, 668, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__182);
  __Pyx_GIVEREF(__pyx_tuple__182);

  /* "kapok/uavsarc.pyx":674
 *                     return val
 *                 except ValueError: # if we can't convert the string to a number, leave it as a string
 *                     val = self.ann[n].split('=',maxsplit=1)[-1].split(';')[0].strip()             # <<<<<<<<<<<<<<
 *                     return val
 * 
 */
  __pyx_tuple__183 = PyTuple_Pack(1, __pyx_kp_u__179); if (unlikely(!__pyx_tuple__183)) __PYX_ERR(0, 674, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__183);
  __Pyx_GIVEREF(__pyx_tuple__183);
  __pyx_tuple__184 = PyTuple_Pack(1, __pyx_kp_u__181); if (unlikely(!__pyx_tuple__184)) __PYX_ERR(0, 674, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__184);
  __Pyx_GIVEREF(__pyx_tuple__184);

  /* "kapok/uavsarc.pyx":693
 * 
 *     """
 *     azstart = np.insert(np.cumsum(azsize), 0, 0)[0:-1]             # <<<<<<<<<<<<<<
 * 
 *     if az <= np.sum(azsize):
 */
  __pyx_slice__185 = PySlice_New(__pyx_int_0, __pyx_int_neg_1, Py_None); if (unlikely(!__pyx_slice__185)) __PYX_ERR(0, 693, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__185);
  __Pyx_GIVEREF(__pyx_slice__185);

  /* "kapok/uavsarc.pyx":741
 *         slc = np.memmap(file, dtype='complex64', mode='c', offset=byteoffset, shape=(azend-azstart,rngsize))
 *         if rngbounds is not None:
 *             slc = slc[:,rngbounds[0]:rngbounds[1]]             # <<<<<<<<<<<<<<
 *         return slc
 *     elif azsize is None:
 */
  __pyx_slice__186 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__186)) __PYX_ERR(0, 741, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__186);
  __Pyx_GIVEREF(__pyx_slice__186);

  /* "kapok/uavsarc.pyx":744
 *         return slc
 *     elif azsize is None:
 *         print('kapok.uavsar.getslcblock: "file2" argument specified, but "azsize" argument missing. Aborting.')             # <<<<<<<<<<<<<<
 *         return
 *     else:
 */
  __pyx_tuple__187 = PyTuple_Pack(1, __pyx_kp_u_kapok_uavsar_getslcblock_file2_a); if (unlikely(!__pyx_tuple__187)) __PYX_ERR(0, 744, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__187);
  __Pyx_GIVEREF(__pyx_tuple__187);

  /* "kapok/uavsarc.pyx":751
 *         slcb = np.memmap(file2, dtype='complex64', mode='c', shape=(azend,rngsize))
 *         if rngbounds is not None:
 *             slca = slca[:,rngbounds[0]:rngbounds[1]]             # <<<<<<<<<<<<<<
 *             slcb = slcb[:,rngbounds[0]:rngbounds[1]]
 *         return np.vstack((slca,slcb))
 */
  __pyx_slice__188 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__188)) __PYX_ERR(0, 751, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__188);
  __Pyx_GIVEREF(__pyx_slice__188);

  /* "kapok/uavsarc.pyx":752
 *         if rngbounds is not None:
 *             slca = slca[:,rngbounds[0]:rngbounds[1]]
 *             slcb = slcb[:,rngbounds[0]:rngbounds[1]]             # <<<<<<<<<<<<<<
 *         return np.vstack((slca,slcb))
 * 
 */
  __pyx_slice__189 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__189)) __PYX_ERR(0, 752, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__189);
  __Pyx_GIVEREF(__pyx_slice__189);

  /* "kapok/uavsarc.pyx":756
 * 
 * 
 * def quicklook(infile, tr=0, pol='hh', mlwin=(40,10), savefile=None):             # <<<<<<<<<<<<<<
 *     """Display a quick look intensity image for a given UAVSAR SLC stack.
 * 
 */
  __pyx_tuple__190 = PyTuple_Pack(2, __pyx_int_40, __pyx_int_10); if (unlikely(!__pyx_tuple__190)) __PYX_ERR(0, 756, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__190);
  __Pyx_GIVEREF(__pyx_tuple__190);

  /* "kapok/uavsarc.pyx":781
 *         ann = Ann(infile)
 *     except:
 *         print('kapok.uavsar.quicklook | Cannot load UAVSAR annotation file. Aborting.')             # <<<<<<<<<<<<<<
 *         return
 * 
 */
  __pyx_tuple__191 = PyTuple_Pack(1, __pyx_kp_u_kapok_uavsar_quicklook_Cannot_lo); if (unlikely(!__pyx_tuple__191)) __PYX_ERR(0, 781, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__191);
  __Pyx_GIVEREF(__pyx_tuple__191);

  /* "kapok/uavsarc.pyx":786
 * 
 *     # Get track filenames and number of tracks.
 *     temp = ann.query('stackline1')             # <<<<<<<<<<<<<<
 *     num = 1
 *     if temp is not None:
 */
  __pyx_tuple__192 = PyTuple_Pack(1, __pyx_n_u_stackline1); if (unlikely(!__pyx_tuple__192)) __PYX_ERR(0, 786, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__192);
  __Pyx_GIVEREF(__pyx_tuple__192);

  /* "kapok/uavsarc.pyx":789
 *     num = 1
 *     if temp is not None:
 *         tracknames = [temp.split('_L090')[0]]             # <<<<<<<<<<<<<<
 *         num += 1
 *         temp = ann.query('stackline'+str(num))
 */
  __pyx_tuple__193 = PyTuple_Pack(1, __pyx_n_u_L090); if (unlikely(!__pyx_tuple__193)) __PYX_ERR(0, 789, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__193);
  __Pyx_GIVEREF(__pyx_tuple__193);

  /* "kapok/uavsarc.pyx":793
 *         temp = ann.query('stackline'+str(num))
 *         while temp is not None:
 *             tracknames.append(temp.split('_L090')[0])             # <<<<<<<<<<<<<<
 *             num += 1
 *             temp = ann.query('stackline'+str(num))
 */
  __pyx_tuple__194 = PyTuple_Pack(1, __pyx_n_u_L090); if (unlikely(!__pyx_tuple__194)) __PYX_ERR(0, 793, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__194);
  __Pyx_GIVEREF(__pyx_tuple__194);

  /* "kapok/uavsarc.pyx":797
 *             temp = ann.query('stackline'+str(num))
 *     else:
 *         print('kapok.uavsar.quicklook | Cannot find track names in UAVSAR annotation file.  Aborting.')             # <<<<<<<<<<<<<<
 *         return
 * 
 */
  __pyx_tuple__195 = PyTuple_Pack(1, __pyx_kp_u_kapok_uavsar_quicklook_Cannot_fi); if (unlikely(!__pyx_tuple__195)) __PYX_ERR(0, 797, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__195);
  __Pyx_GIVEREF(__pyx_tuple__195);

  /* "kapok/uavsarc.pyx":809
 * 
 *     # Get filenames and dimensions of SLCs for each segment.
 *     num_segments = ann.query('Number of Segments')             # <<<<<<<<<<<<<<
 * 
 *     slcfiles = []
 */
  __pyx_tuple__196 = PyTuple_Pack(1, __pyx_kp_u_Number_of_Segments); if (unlikely(!__pyx_tuple__196)) __PYX_ERR(0, 809, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__196);
  __Pyx_GIVEREF(__pyx_tuple__196);

  /* "kapok/uavsarc.pyx":817
 *         if len(file) == 1:
 *             slcfiles.append(file[0])
 *             slcwindow = (8,2)             # <<<<<<<<<<<<<<
 *             rngsize_slc = ann.query('slc_1_2x8 Columns')
 *             if num_segments > 1:
 */
  __pyx_tuple__197 = PyTuple_Pack(2, __pyx_int_8, __pyx_int_2); if (unlikely(!__pyx_tuple__197)) __PYX_ERR(0, 817, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__197);
  __Pyx_GIVEREF(__pyx_tuple__197);

  /* "kapok/uavsarc.pyx":818
 *             slcfiles.append(file[0])
 *             slcwindow = (8,2)
 *             rngsize_slc = ann.query('slc_1_2x8 Columns')             # <<<<<<<<<<<<<<
 *             if num_segments > 1:
 *                 azsize_slc = np.zeros(num_segments,dtype='int32')
 */
  __pyx_tuple__198 = PyTuple_Pack(1, __pyx_kp_u_slc_1_2x8_Columns); if (unlikely(!__pyx_tuple__198)) __PYX_ERR(0, 818, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__198);
  __Pyx_GIVEREF(__pyx_tuple__198);

  /* "kapok/uavsarc.pyx":824
 *                     azsize_slc[n] = ann.query('slc_'+str(n+1)+'_2x8 Rows')
 *             else:
 *                 azsize_slc = ann.query('slc_1_8x2 Rows')             # <<<<<<<<<<<<<<
 *         elif len(file) > 1:
 *             print('kapok.uavsar.quicklook | Too many SLC files matching pattern: "'+datapath+tracknames[tr]+'*_'+pol+'_*_2x8.slc'+'".  Aborting.')
 */
  __pyx_tuple__199 = PyTuple_Pack(1, __pyx_kp_u_slc_1_8x2_Rows); if (unlikely(!__pyx_tuple__199)) __PYX_ERR(0, 824, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__199);
  __Pyx_GIVEREF(__pyx_tuple__199);

  /* "kapok/uavsarc.pyx":833
 *             if len(file) == 1:
 *                 slcfiles.append(file[0])
 *                 slcwindow = (4,1)             # <<<<<<<<<<<<<<
 *                 rngsize_slc = ann.query('slc_1_1x4 Columns')
 *                 if num_segments > 1:
 */
  __pyx_tuple__200 = PyTuple_Pack(2, __pyx_int_4, __pyx_int_1); if (unlikely(!__pyx_tuple__200)) __PYX_ERR(0, 833, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__200);
  __Pyx_GIVEREF(__pyx_tuple__200);

  /* "kapok/uavsarc.pyx":834
 *                 slcfiles.append(file[0])
 *                 slcwindow = (4,1)
 *                 rngsize_slc = ann.query('slc_1_1x4 Columns')             # <<<<<<<<<<<<<<
 *                 if num_segments > 1:
 *                     azsize_slc = np.zeros(num_segments,dtype='int32')
 */
  __pyx_tuple__201 = PyTuple_Pack(1, __pyx_kp_u_slc_1_1x4_Columns); if (unlikely(!__pyx_tuple__201)) __PYX_ERR(0, 834, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__201);
  __Pyx_GIVEREF(__pyx_tuple__201);

  /* "kapok/uavsarc.pyx":840
 *                         azsize_slc[n] = ann.query('slc_'+str(n+1)+'_1x4 Rows')
 *                 else:
 *                     azsize_slc = ann.query('slc_1_1x4 Rows')             # <<<<<<<<<<<<<<
 *             elif len(file) > 1:
 *                 print('kapok.uavsar.quicklook | Too many SLC files matching pattern: "'+datapath+tracknames[tr]+'*_'+pol+'_*_1x4.slc'+'".  Aborting.')
 */
  __pyx_tuple__202 = PyTuple_Pack(1, __pyx_kp_u_slc_1_1x4_Rows); if (unlikely(!__pyx_tuple__202)) __PYX_ERR(0, 840, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__202);
  __Pyx_GIVEREF(__pyx_tuple__202);

  /* "kapok/uavsarc.pyx":849
 *                 if len(file) == 1:
 *                     slcfiles.append(file[0])
 *                     slcwindow = (1,1)             # <<<<<<<<<<<<<<
 *                     rngsize_slc = ann.query('slc_1_1x1 Columns')
 *                     if num_segments > 1:
 */
  __pyx_tuple__203 = PyTuple_Pack(2, __pyx_int_1, __pyx_int_1); if (unlikely(!__pyx_tuple__203)) __PYX_ERR(0, 849, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__203);
  __Pyx_GIVEREF(__pyx_tuple__203);

  /* "kapok/uavsarc.pyx":850
 *                     slcfiles.append(file[0])
 *                     slcwindow = (1,1)
 *                     rngsize_slc = ann.query('slc_1_1x1 Columns')             # <<<<<<<<<<<<<<
 *                     if num_segments > 1:
 *                         azsize_slc = np.zeros(num_segments,dtype='int32')
 */
  __pyx_tuple__204 = PyTuple_Pack(1, __pyx_kp_u_slc_1_1x1_Columns); if (unlikely(!__pyx_tuple__204)) __PYX_ERR(0, 850, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__204);
  __Pyx_GIVEREF(__pyx_tuple__204);

  /* "kapok/uavsarc.pyx":856
 *                             azsize_slc[n] = ann.query('slc_'+str(n+1)+'_1x1 Rows')
 *                     else:
 *                         azsize_slc = ann.query('slc_1_1x1 Rows')             # <<<<<<<<<<<<<<
 *                 elif len(file) > 1:
 *                     print('kapok.uavsar.quicklook | Too many SLC files matching pattern: "'+datapath+tracknames[tr]+'*_'+pol+'_*_1x1.slc'+'".  Aborting.')
 */
  __pyx_tuple__205 = PyTuple_Pack(1, __pyx_kp_u_slc_1_1x1_Rows); if (unlikely(!__pyx_tuple__205)) __PYX_ERR(0, 856, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__205);
  __Pyx_GIVEREF(__pyx_tuple__205);

  /* "kapok/uavsarc.pyx":870
 * 
 *     # Get SLC dimensions for the 1x1 SLCs -- these get displayed on the plot axes.
 *     rngsize_slc1x1 = ann.query('slc_1_1x1 Columns')             # <<<<<<<<<<<<<<
 *     if num_segments > 1:
 *         azsize_slc1x1 = np.zeros(num_segments,dtype='int32')
 */
  __pyx_tuple__206 = PyTuple_Pack(1, __pyx_kp_u_slc_1_1x1_Columns); if (unlikely(!__pyx_tuple__206)) __PYX_ERR(0, 870, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__206);
  __Pyx_GIVEREF(__pyx_tuple__206);

  /* "kapok/uavsarc.pyx":876
 *             azsize_slc1x1[n] = ann.query('slc_'+str(n+1)+'_1x1 Rows')
 *     else:
 *         azsize_slc1x1 = ann.query('slc_1_1x1 Rows')             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_tuple__207 = PyTuple_Pack(1, __pyx_kp_u_slc_1_1x1_Rows); if (unlikely(!__pyx_tuple__207)) __PYX_ERR(0, 876, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__207);
  __Pyx_GIVEREF(__pyx_tuple__207);

  /* "kapok/uavsarc.pyx":885
 *     if num_blocks < (num_segments + 1):
 *         num_blocks = num_segments + 1
 *     az_vector = np.round(np.linspace(0, azsize, num=num_blocks+1)).astype('int')             # <<<<<<<<<<<<<<
 *     az_vector[num_blocks] = azsize
 * 
 */
  __pyx_tuple__208 = PyTuple_Pack(1, __pyx_n_u_int); if (unlikely(!__pyx_tuple__208)) __PYX_ERR(0, 885, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__208);
  __Pyx_GIVEREF(__pyx_tuple__208);

  /* "kapok/uavsarc.pyx":888
 *     az_vector[num_blocks] = azsize
 * 
 *     for n, azstart in enumerate(az_vector[0:-1]):             # <<<<<<<<<<<<<<
 *         azend = az_vector[n+1]
 *         azstart_slc = azstart*mlwin[0]
 */
  __pyx_slice__209 = PySlice_New(__pyx_int_0, __pyx_int_neg_1, Py_None); if (unlikely(!__pyx_slice__209)) __PYX_ERR(0, 888, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__209);
  __Pyx_GIVEREF(__pyx_slice__209);

  /* "kapok/uavsarc.pyx":903
 *             slc = getslcblock(file, rngsize_slc, azoffset_start, azoffset_end, file2=file2, azsize=azsize_slc[seg_start])
 * 
 *         qlimage[azstart:azend,:] = mlook(np.real(slc*np.conj(slc)),mlwin)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_slice__210 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__210)) __PYX_ERR(0, 903, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__210);
  __Pyx_GIVEREF(__pyx_slice__210);

  /* "kapok/uavsarc.pyx":914
 *     plt.imshow(qlimage, vmin=-25, vmax=0, cmap='gray', aspect=0.25, interpolation='nearest', extent=(0,rngsize_slc1x1,np.sum(azsize_slc1x1),0))
 *     plt.colorbar(label=pol+' Backscatter (dB)')
 *     plt.xlabel('Range Index')             # <<<<<<<<<<<<<<
 *     plt.ylabel('Azimuth Index')
 *     plt.tight_layout()
 */
  __pyx_tuple__211 = PyTuple_Pack(1, __pyx_kp_u_Range_Index); if (unlikely(!__pyx_tuple__211)) __PYX_ERR(0, 914, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__211);
  __Pyx_GIVEREF(__pyx_tuple__211);

  /* "kapok/uavsarc.pyx":915
 *     plt.colorbar(label=pol+' Backscatter (dB)')
 *     plt.xlabel('Range Index')
 *     plt.ylabel('Azimuth Index')             # <<<<<<<<<<<<<<
 *     plt.tight_layout()
 * 
 */
  __pyx_tuple__212 = PyTuple_Pack(1, __pyx_kp_u_Azimuth_Index); if (unlikely(!__pyx_tuple__212)) __PYX_ERR(0, 915, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__212);
  __Pyx_GIVEREF(__pyx_tuple__212);

  /* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":218
 *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
 *                 and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)):
 *                 raise ValueError(u"ndarray is not C contiguous")             # <<<<<<<<<<<<<<
 * 
 *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
 */
  __pyx_tuple__213 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_C_contiguous); if (unlikely(!__pyx_tuple__213)) __PYX_ERR(1, 218, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__213);
  __Pyx_GIVEREF(__pyx_tuple__213);

  /* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":222
 *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
 *                 and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)):
 *                 raise ValueError(u"ndarray is not Fortran contiguous")             # <<<<<<<<<<<<<<
 * 
 *             info.buf = PyArray_DATA(self)
 */
  __pyx_tuple__214 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_Fortran_contiguou); if (unlikely(!__pyx_tuple__214)) __PYX_ERR(1, 222, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__214);
  __Pyx_GIVEREF(__pyx_tuple__214);

  /* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":259
 *                 if ((descr.byteorder == c'>' and little_endian) or
 *                     (descr.byteorder == c'<' and not little_endian)):
 *                     raise ValueError(u"Non-native byte order not supported")             # <<<<<<<<<<<<<<
 *                 if   t == NPY_BYTE:        f = "b"
 *                 elif t == NPY_UBYTE:       f = "B"
 */
  __pyx_tuple__215 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__215)) __PYX_ERR(1, 259, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__215);
  __Pyx_GIVEREF(__pyx_tuple__215);

  /* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":799
 * 
 *         if (end - f) - <int>(new_offset - offset[0]) < 15:
 *             raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")             # <<<<<<<<<<<<<<
 * 
 *         if ((child.byteorder == c'>' and little_endian) or
 */
  __pyx_tuple__216 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor); if (unlikely(!__pyx_tuple__216)) __PYX_ERR(1, 799, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__216);
  __Pyx_GIVEREF(__pyx_tuple__216);

  /* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":803
 *         if ((child.byteorder == c'>' and little_endian) or
 *             (child.byteorder == c'<' and not little_endian)):
 *             raise ValueError(u"Non-native byte order not supported")             # <<<<<<<<<<<<<<
 *             # One could encode it in the format string and have Cython
 *             # complain instead, BUT: < and > in format strings also imply
 */
  __pyx_tuple__217 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__217)) __PYX_ERR(1, 803, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__217);
  __Pyx_GIVEREF(__pyx_tuple__217);

  /* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":823
 *             t = child.type_num
 *             if end - f < 5:
 *                 raise RuntimeError(u"Format string allocated too short.")             # <<<<<<<<<<<<<<
 * 
 *             # Until ticket #99 is fixed, use integers to avoid warnings
 */
  __pyx_tuple__218 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor_2); if (unlikely(!__pyx_tuple__218)) __PYX_ERR(1, 823, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__218);
  __Pyx_GIVEREF(__pyx_tuple__218);

  /* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":989
 *         _import_array()
 *     except Exception:
 *         raise ImportError("numpy.core.multiarray failed to import")             # <<<<<<<<<<<<<<
 * 
 * cdef inline int import_umath() except -1:
 */
  __pyx_tuple__219 = PyTuple_Pack(1, __pyx_kp_u_numpy_core_multiarray_failed_to); if (unlikely(!__pyx_tuple__219)) __PYX_ERR(1, 989, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__219);
  __Pyx_GIVEREF(__pyx_tuple__219);

  /* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":995
 *         _import_umath()
 *     except Exception:
 *         raise ImportError("numpy.core.umath failed to import")             # <<<<<<<<<<<<<<
 * 
 * cdef inline int import_ufunc() except -1:
 */
  __pyx_tuple__220 = PyTuple_Pack(1, __pyx_kp_u_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__220)) __PYX_ERR(1, 995, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__220);
  __Pyx_GIVEREF(__pyx_tuple__220);

  /* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":1001
 *         _import_umath()
 *     except Exception:
 *         raise ImportError("numpy.core.umath failed to import")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__221 = PyTuple_Pack(1, __pyx_kp_u_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__221)) __PYX_ERR(1, 1001, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__221);
  __Pyx_GIVEREF(__pyx_tuple__221);

  /* "kapok/uavsarc.pyx":45
 * 
 * 
 * def load(infile, outfile, mlwin=(20,5), smwin=(1,1), azbounds=None,             # <<<<<<<<<<<<<<
 *          rngbounds=None, tracks=None, compression='gzip',
 *          compression_opts=4, num_blocks=20, kzcalc=False, kzvertical=True,
 */
  __pyx_tuple__222 = PyTuple_Pack(115, __pyx_n_s_infile, __pyx_n_s_outfile, __pyx_n_s_mlwin, __pyx_n_s_smwin, __pyx_n_s_azbounds, __pyx_n_s_rngbounds, __pyx_n_s_tracks, __pyx_n_s_compression, __pyx_n_s_compression_opts, __pyx_n_s_num_blocks, __pyx_n_s_kzcalc, __pyx_n_s_kzvertical, __pyx_n_s_overwrite, __pyx_n_s_ann, __pyx_n_s_f, __pyx_n_s_n, __pyx_n_s_tr, __pyx_n_s_rngsize_slc, __pyx_n_s_num_segments, __pyx_n_s_azsize_slc, __pyx_n_s_temp, __pyx_n_s_num, __pyx_n_s_tracknames, __pyx_n_s_num_tracks, __pyx_n_s_num_bl, __pyx_n_s_num_pol, __pyx_n_s_num_cov_elements, __pyx_n_s_peglat, __pyx_n_s_peglon, __pyx_n_s_peghdg, __pyx_n_s_azsize, __pyx_n_s_rngsize, __pyx_n_s_datapath, __pyx_n_s_slcfiles, __pyx_n_s_seg, __pyx_n_s_pol, __pyx_n_s_file, __pyx_n_s_cov, __pyx_n_s_az_vector, __pyx_n_s_seg_start, __pyx_n_s_seg_end, __pyx_n_s_row, __pyx_n_s_col, __pyx_n_s_azstart, __pyx_n_s_azend, __pyx_n_s_azstart_slc, __pyx_n_s_azend_slc, __pyx_n_s_azoffset_start, __pyx_n_s_azoffset_end, __pyx_n_s_slcnum, __pyx_n_s_slc_2, __pyx_n_s_file2, __pyx_n_s_slcstack, __pyx_n_s_llh_2, __pyx_n_s_mlwin_lkv, __pyx_n_s_llhname, __pyx_n_s_llh_rows, __pyx_n_s_llh_cols, __pyx_n_s_azllhstart, __pyx_n_s_azllhend, __pyx_n_s_azllhoffset, __pyx_n_s_rngllhstart, __pyx_n_s_rngllhend, __pyx_n_s_rngllhoffset, __pyx_n_s_lat, __pyx_n_s_lon, __pyx_n_s_dem, __pyx_n_s_posmm, __pyx_n_s_lkvmm, __pyx_n_s_lkvname, __pyx_n_s_lkv_rows, __pyx_n_s_lkv_cols, __pyx_n_s_wavelength, __pyx_n_s_sstart, __pyx_n_s_sspacing, __pyx_n_s_sbounds, __pyx_n_s_refvelocity, __pyx_n_s_proj_reflkv_v, __pyx_n_s_incident_lkv, __pyx_n_s_inc_ref, __pyx_n_s_inc, __pyx_n_s_kz, __pyx_n_s_lkv_2, __pyx_n_s_pos, __pyx_n_s_inc_buffer, __pyx_n_s_kz_buffer, __pyx_n_s_tracklkv, __pyx_n_s_velocity, __pyx_n_s_lookcrossv, __pyx_n_s_tempdiff, __pyx_n_s_proj_lkv_velocity, __pyx_n_s_base_enu, __pyx_n_s_baseline_2, __pyx_n_s_baselinep, __pyx_n_s_baselinepsign, __pyx_n_s_az_ml, __pyx_n_s_lkvrowstart, __pyx_n_s_lkvrowend, __pyx_n_s_lkvtrimstart, __pyx_n_s_lkvtrimend, __pyx_n_s_azposstart, __pyx_n_s_azposend, __pyx_n_s_kz_temp, __pyx_n_s_file_alt, __pyx_n_s_kz_rows, __pyx_n_s_kz_cols, __pyx_n_s_calcslope, __pyx_n_s_spacing, __pyx_n_s_rngslope, __pyx_n_s_azslope, __pyx_n_s_height_dot_normal, __pyx_n_s_basefile, __pyx_n_s_basesch, __pyx_n_s_istart, __pyx_n_s_iend); if (unlikely(!__pyx_tuple__222)) __PYX_ERR(0, 45, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__222);
  __Pyx_GIVEREF(__pyx_tuple__222);
  __pyx_codeobj__223 = (PyObject*)__Pyx_PyCode_New(13, 0, 115, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__222, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_C_Users_Michael_Dropbox_kapok_re, __pyx_n_s_load, 45, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__223)) __PYX_ERR(0, 45, __pyx_L1_error)

  /* "kapok/uavsarc.pyx":641
 *     """Class for loading and interacting with a UAVSAR annotation file."""
 * 
 *     def __init__(self, file):             # <<<<<<<<<<<<<<
 *         """Load in the specified .ann file as a list of strings and
 *             initialize.
 */
  __pyx_tuple__224 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_file, __pyx_n_s_fd); if (unlikely(!__pyx_tuple__224)) __PYX_ERR(0, 641, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__224);
  __Pyx_GIVEREF(__pyx_tuple__224);
  __pyx_codeobj__225 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__224, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_C_Users_Michael_Dropbox_kapok_re, __pyx_n_s_init, 641, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__225)) __PYX_ERR(0, 641, __pyx_L1_error)

  /* "kapok/uavsarc.pyx":655
 * 
 * 
 *     def query(self, keyword):             # <<<<<<<<<<<<<<
 *         """Query the annotation file for the specified annotation keyword.
 * 
 */
  __pyx_tuple__226 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_keyword, __pyx_n_s_n, __pyx_n_s_val); if (unlikely(!__pyx_tuple__226)) __PYX_ERR(0, 655, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__226);
  __Pyx_GIVEREF(__pyx_tuple__226);
  __pyx_codeobj__227 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__226, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_C_Users_Michael_Dropbox_kapok_re, __pyx_n_s_query, 655, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__227)) __PYX_ERR(0, 655, __pyx_L1_error)

  /* "kapok/uavsarc.pyx":680
 * 
 * 
 * def findsegment(az,azsize):             # <<<<<<<<<<<<<<
 *     """For a given azimuth index, return the segment number and
 *     the azimuth index within the given segment.
 */
  __pyx_tuple__228 = PyTuple_Pack(5, __pyx_n_s_az, __pyx_n_s_azsize, __pyx_n_s_azstart, __pyx_n_s_seg, __pyx_n_s_azoff); if (unlikely(!__pyx_tuple__228)) __PYX_ERR(0, 680, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__228);
  __Pyx_GIVEREF(__pyx_tuple__228);
  __pyx_codeobj__229 = (PyObject*)__Pyx_PyCode_New(2, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__228, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_C_Users_Michael_Dropbox_kapok_re, __pyx_n_s_findsegment, 680, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__229)) __PYX_ERR(0, 680, __pyx_L1_error)

  /* "kapok/uavsarc.pyx":706
 * 
 * 
 * def getslcblock(file, rngsize, azstart, azend, rngbounds=None, file2=None,             # <<<<<<<<<<<<<<
 *                 azsize=None):
 *     """Load SLC data into a NumPy array buffer.  If the file2 argument is
 */
  __pyx_tuple__230 = PyTuple_Pack(11, __pyx_n_s_file, __pyx_n_s_rngsize, __pyx_n_s_azstart, __pyx_n_s_azend, __pyx_n_s_rngbounds, __pyx_n_s_file2, __pyx_n_s_azsize, __pyx_n_s_byteoffset, __pyx_n_s_slc_2, __pyx_n_s_slca, __pyx_n_s_slcb); if (unlikely(!__pyx_tuple__230)) __PYX_ERR(0, 706, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__230);
  __Pyx_GIVEREF(__pyx_tuple__230);
  __pyx_codeobj__231 = (PyObject*)__Pyx_PyCode_New(7, 0, 11, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__230, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_C_Users_Michael_Dropbox_kapok_re, __pyx_n_s_getslcblock, 706, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__231)) __PYX_ERR(0, 706, __pyx_L1_error)

  /* "kapok/uavsarc.pyx":756
 * 
 * 
 * def quicklook(infile, tr=0, pol='hh', mlwin=(40,10), savefile=None):             # <<<<<<<<<<<<<<
 *     """Display a quick look intensity image for a given UAVSAR SLC stack.
 * 
 */
  __pyx_tuple__232 = PyTuple_Pack(36, __pyx_n_s_infile, __pyx_n_s_tr, __pyx_n_s_pol, __pyx_n_s_mlwin, __pyx_n_s_savefile, __pyx_n_s_plt, __pyx_n_s_ann, __pyx_n_s_temp, __pyx_n_s_num, __pyx_n_s_tracknames, __pyx_n_s_datapath, __pyx_n_s_num_segments, __pyx_n_s_slcfiles, __pyx_n_s_seg, __pyx_n_s_file, __pyx_n_s_slcwindow, __pyx_n_s_rngsize_slc, __pyx_n_s_azsize_slc, __pyx_n_s_n, __pyx_n_s_azsize, __pyx_n_s_rngsize, __pyx_n_s_rngsize_slc1x1, __pyx_n_s_azsize_slc1x1, __pyx_n_s_qlimage, __pyx_n_s_num_blocks, __pyx_n_s_az_vector, __pyx_n_s_azstart, __pyx_n_s_azend, __pyx_n_s_azstart_slc, __pyx_n_s_azend_slc, __pyx_n_s_seg_start, __pyx_n_s_azoffset_start, __pyx_n_s_seg_end, __pyx_n_s_azoffset_end, __pyx_n_s_slc_2, __pyx_n_s_file2); if (unlikely(!__pyx_tuple__232)) __PYX_ERR(0, 756, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__232);
  __Pyx_GIVEREF(__pyx_tuple__232);
  __pyx_codeobj__233 = (PyObject*)__Pyx_PyCode_New(5, 0, 36, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__232, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_C_Users_Michael_Dropbox_kapok_re, __pyx_n_s_quicklook, 756, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__233)) __PYX_ERR(0, 756, __pyx_L1_error)
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_RefNannyFinishContext();
  return -1;
}

static int __Pyx_InitGlobals(void) {
  if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  __pyx_float_0_1 = PyFloat_FromDouble(0.1); if (unlikely(!__pyx_float_0_1)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_float_1e9 = PyFloat_FromDouble(1e9); if (unlikely(!__pyx_float_1e9)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_float_0_25 = PyFloat_FromDouble(0.25); if (unlikely(!__pyx_float_0_25)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_float_1eneg_5 = PyFloat_FromDouble(1e-5); if (unlikely(!__pyx_float_1eneg_5)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_float_1eneg_10 = PyFloat_FromDouble(1e-10); if (unlikely(!__pyx_float_1eneg_10)) __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_8 = PyInt_FromLong(8); if (unlikely(!__pyx_int_8)) __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_20 = PyInt_FromLong(20); if (unlikely(!__pyx_int_20)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_40 = PyInt_FromLong(40); if (unlikely(!__pyx_int_40)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_100 = PyInt_FromLong(100); if (unlikely(!__pyx_int_100)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_125 = PyInt_FromLong(125); if (unlikely(!__pyx_int_125)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_1000 = PyInt_FromLong(1000); if (unlikely(!__pyx_int_1000)) __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)
  __pyx_int_neg_25 = PyInt_FromLong(-25); if (unlikely(!__pyx_int_neg_25)) __PYX_ERR(0, 1, __pyx_L1_error)
  return 0;
  __pyx_L1_error:;
  return -1;
}

#if PY_MAJOR_VERSION < 3
PyMODINIT_FUNC inituavsarc(void); /*proto*/
PyMODINIT_FUNC inituavsarc(void)
#else
PyMODINIT_FUNC PyInit_uavsarc(void); /*proto*/
PyMODINIT_FUNC PyInit_uavsarc(void)
#endif
{
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannyDeclarations
  #if CYTHON_REFNANNY
  __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
  if (!__Pyx_RefNanny) {
      PyErr_Clear();
      __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
      if (!__Pyx_RefNanny)
          Py_FatalError("failed to import 'refnanny' module");
  }
  #endif
  __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_uavsarc(void)", 0);
  if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  __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_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 PY_MAJOR_VERSION < 3
  __pyx_m = Py_InitModule4("uavsarc", __pyx_methods, __pyx_k_UAVSAR_Data_Import_Cython_Functi, 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)
  __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)
  #if CYTHON_COMPILING_IN_PYPY
  Py_INCREF(__pyx_b);
  #endif
  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_kapok__uavsarc) {
    if (PyObject_SetAttrString(__pyx_m, "__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, "kapok.uavsarc")) {
      if (unlikely(PyDict_SetItemString(modules, "kapok.uavsarc", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
    }
  }
  #endif
  /*--- Builtin init code ---*/
  if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  /*--- Constants init code ---*/
  if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  /*--- Global init code ---*/
  /*--- Variable export code ---*/
  /*--- Function export code ---*/
  /*--- Type init code ---*/
  /*--- Type import code ---*/
  __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "type", 
  #if CYTHON_COMPILING_IN_PYPY
  sizeof(PyTypeObject),
  #else
  sizeof(PyHeapTypeObject),
  #endif
  0); if (unlikely(!__pyx_ptype_7cpython_4type_type)) __PYX_ERR(2, 9, __pyx_L1_error)
  __pyx_ptype_5numpy_dtype = __Pyx_ImportType("numpy", "dtype", sizeof(PyArray_Descr), 0); if (unlikely(!__pyx_ptype_5numpy_dtype)) __PYX_ERR(1, 155, __pyx_L1_error)
  __pyx_ptype_5numpy_flatiter = __Pyx_ImportType("numpy", "flatiter", sizeof(PyArrayIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_flatiter)) __PYX_ERR(1, 168, __pyx_L1_error)
  __pyx_ptype_5numpy_broadcast = __Pyx_ImportType("numpy", "broadcast", sizeof(PyArrayMultiIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_broadcast)) __PYX_ERR(1, 172, __pyx_L1_error)
  __pyx_ptype_5numpy_ndarray = __Pyx_ImportType("numpy", "ndarray", sizeof(PyArrayObject), 0); if (unlikely(!__pyx_ptype_5numpy_ndarray)) __PYX_ERR(1, 181, __pyx_L1_error)
  __pyx_ptype_5numpy_ufunc = __Pyx_ImportType("numpy", "ufunc", sizeof(PyUFuncObject), 0); if (unlikely(!__pyx_ptype_5numpy_ufunc)) __PYX_ERR(1, 861, __pyx_L1_error)
  /*--- Variable import code ---*/
  /*--- 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

  /* "kapok/uavsarc.pyx":27
 * 
 * """
 * import os             # <<<<<<<<<<<<<<
 * import os.path
 * import time
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_os, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 27, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_os, __pyx_t_1) < 0) __PYX_ERR(0, 27, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "kapok/uavsarc.pyx":28
 * """
 * import os
 * import os.path             # <<<<<<<<<<<<<<
 * import time
 * from glob import glob
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_os_path, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 28, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_os, __pyx_t_1) < 0) __PYX_ERR(0, 28, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "kapok/uavsarc.pyx":29
 * import os
 * import os.path
 * import time             # <<<<<<<<<<<<<<
 * from glob import glob
 * 
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_time, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 29, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_time, __pyx_t_1) < 0) __PYX_ERR(0, 29, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "kapok/uavsarc.pyx":30
 * import os.path
 * import time
 * from glob import glob             # <<<<<<<<<<<<<<
 * 
 * import numpy as np
 */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 30, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_n_s_glob);
  __Pyx_GIVEREF(__pyx_n_s_glob);
  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_glob);
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_glob, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 30, __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_glob); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 30, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_glob, __pyx_t_1) < 0) __PYX_ERR(0, 30, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "kapok/uavsarc.pyx":32
 * from glob import glob
 * 
 * import numpy as np             # <<<<<<<<<<<<<<
 * import h5py
 * from scipy.ndimage.interpolation import zoom
 */
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_numpy, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 32, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_2) < 0) __PYX_ERR(0, 32, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "kapok/uavsarc.pyx":33
 * 
 * import numpy as np
 * import h5py             # <<<<<<<<<<<<<<
 * from scipy.ndimage.interpolation import zoom
 * 
 */
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_h5py, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 33, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_h5py, __pyx_t_2) < 0) __PYX_ERR(0, 33, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "kapok/uavsarc.pyx":34
 * import numpy as np
 * import h5py
 * from scipy.ndimage.interpolation import zoom             # <<<<<<<<<<<<<<
 * 
 * import kapok
 */
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 34, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_n_s_zoom);
  __Pyx_GIVEREF(__pyx_n_s_zoom);
  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_zoom);
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_scipy_ndimage_interpolation, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 34, __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_zoom); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 34, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_zoom, __pyx_t_2) < 0) __PYX_ERR(0, 34, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "kapok/uavsarc.pyx":36
 * from scipy.ndimage.interpolation import zoom
 * 
 * import kapok             # <<<<<<<<<<<<<<
 * from kapok.lib import mlook, smooth, sch2enu, llh2enu
 * 
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_kapok, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 36, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_kapok, __pyx_t_1) < 0) __PYX_ERR(0, 36, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "kapok/uavsarc.pyx":37
 * 
 * import kapok
 * from kapok.lib import mlook, smooth, sch2enu, llh2enu             # <<<<<<<<<<<<<<
 * 
 * cimport numpy as np
 */
  __pyx_t_1 = PyList_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 37, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_n_s_mlook);
  __Pyx_GIVEREF(__pyx_n_s_mlook);
  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_mlook);
  __Pyx_INCREF(__pyx_n_s_smooth);
  __Pyx_GIVEREF(__pyx_n_s_smooth);
  PyList_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_smooth);
  __Pyx_INCREF(__pyx_n_s_sch2enu);
  __Pyx_GIVEREF(__pyx_n_s_sch2enu);
  PyList_SET_ITEM(__pyx_t_1, 2, __pyx_n_s_sch2enu);
  __Pyx_INCREF(__pyx_n_s_llh2enu);
  __Pyx_GIVEREF(__pyx_n_s_llh2enu);
  PyList_SET_ITEM(__pyx_t_1, 3, __pyx_n_s_llh2enu);
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_kapok_lib, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 37, __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_mlook); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 37, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_mlook, __pyx_t_1) < 0) __PYX_ERR(0, 37, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_smooth); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 37, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_smooth, __pyx_t_1) < 0) __PYX_ERR(0, 37, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_sch2enu); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 37, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_sch2enu, __pyx_t_1) < 0) __PYX_ERR(0, 37, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_llh2enu); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 37, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_llh2enu, __pyx_t_1) < 0) __PYX_ERR(0, 37, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "kapok/uavsarc.pyx":41
 * cimport numpy as np
 * cimport cython
 * np.import_array()             # <<<<<<<<<<<<<<
 * np.import_ufunc()
 * 
 */
  __pyx_t_3 = __pyx_f_5numpy_import_array(); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 41, __pyx_L1_error)

  /* "kapok/uavsarc.pyx":42
 * cimport cython
 * np.import_array()
 * np.import_ufunc()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_3 = __pyx_f_5numpy_import_ufunc(); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 42, __pyx_L1_error)

  /* "kapok/uavsarc.pyx":45
 * 
 * 
 * def load(infile, outfile, mlwin=(20,5), smwin=(1,1), azbounds=None,             # <<<<<<<<<<<<<<
 *          rngbounds=None, tracks=None, compression='gzip',
 *          compression_opts=4, num_blocks=20, kzcalc=False, kzvertical=True,
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_5kapok_7uavsarc_1load, NULL, __pyx_n_s_kapok_uavsarc); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 45, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_load, __pyx_t_2) < 0) __PYX_ERR(0, 45, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "kapok/uavsarc.pyx":638
 * 
 * 
 * class Ann(object):             # <<<<<<<<<<<<<<
 *     """Class for loading and interacting with a UAVSAR annotation file."""
 * 
 */
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 638, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_builtin_object);
  __Pyx_GIVEREF(__pyx_builtin_object);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_builtin_object);
  __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 638, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_Ann, __pyx_n_s_Ann, (PyObject *) NULL, __pyx_n_s_kapok_uavsarc, __pyx_kp_s_Class_for_loading_and_interactin); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 638, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);

  /* "kapok/uavsarc.pyx":641
 *     """Class for loading and interacting with a UAVSAR annotation file."""
 * 
 *     def __init__(self, file):             # <<<<<<<<<<<<<<
 *         """Load in the specified .ann file as a list of strings and
 *             initialize.
 */
  __pyx_t_5 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5kapok_7uavsarc_3Ann_1__init__, 0, __pyx_n_s_Ann___init, NULL, __pyx_n_s_kapok_uavsarc, __pyx_d, ((PyObject *)__pyx_codeobj__225)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 641, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyObject_SetItem(__pyx_t_4, __pyx_n_s_init, __pyx_t_5) < 0) __PYX_ERR(0, 641, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "kapok/uavsarc.pyx":655
 * 
 * 
 *     def query(self, keyword):             # <<<<<<<<<<<<<<
 *         """Query the annotation file for the specified annotation keyword.
 * 
 */
  __pyx_t_5 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5kapok_7uavsarc_3Ann_3query, 0, __pyx_n_s_Ann_query, NULL, __pyx_n_s_kapok_uavsarc, __pyx_d, ((PyObject *)__pyx_codeobj__227)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 655, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyObject_SetItem(__pyx_t_4, __pyx_n_s_query, __pyx_t_5) < 0) __PYX_ERR(0, 655, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "kapok/uavsarc.pyx":638
 * 
 * 
 * class Ann(object):             # <<<<<<<<<<<<<<
 *     """Class for loading and interacting with a UAVSAR annotation file."""
 * 
 */
  __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_Ann, __pyx_t_2, __pyx_t_4, NULL, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 638, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Ann, __pyx_t_5) < 0) __PYX_ERR(0, 638, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "kapok/uavsarc.pyx":680
 * 
 * 
 * def findsegment(az,azsize):             # <<<<<<<<<<<<<<
 *     """For a given azimuth index, return the segment number and
 *     the azimuth index within the given segment.
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_5kapok_7uavsarc_3findsegment, NULL, __pyx_n_s_kapok_uavsarc); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 680, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_findsegment, __pyx_t_2) < 0) __PYX_ERR(0, 680, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "kapok/uavsarc.pyx":706
 * 
 * 
 * def getslcblock(file, rngsize, azstart, azend, rngbounds=None, file2=None,             # <<<<<<<<<<<<<<
 *                 azsize=None):
 *     """Load SLC data into a NumPy array buffer.  If the file2 argument is
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_5kapok_7uavsarc_5getslcblock, NULL, __pyx_n_s_kapok_uavsarc); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 706, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_getslcblock, __pyx_t_2) < 0) __PYX_ERR(0, 706, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "kapok/uavsarc.pyx":756
 * 
 * 
 * def quicklook(infile, tr=0, pol='hh', mlwin=(40,10), savefile=None):             # <<<<<<<<<<<<<<
 *     """Display a quick look intensity image for a given UAVSAR SLC stack.
 * 
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_5kapok_7uavsarc_7quicklook, NULL, __pyx_n_s_kapok_uavsarc); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 756, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_quicklook, __pyx_t_2) < 0) __PYX_ERR(0, 756, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "kapok/uavsarc.pyx":1
 * # -*- coding: utf-8 -*-             # <<<<<<<<<<<<<<
 * # cython: language_level=3
 * """UAVSAR Data Import Cython Functions
 */
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  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;

  /* "../../../../Program Files/Miniconda3/lib/site-packages/Cython/Includes/numpy/__init__.pxd":997
 *         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);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  if (__pyx_m) {
    if (__pyx_d) {
      __Pyx_AddTraceback("init kapok.uavsarc", __pyx_clineno, __pyx_lineno, __pyx_filename);
    }
    Py_DECREF(__pyx_m); __pyx_m = 0;
  } else if (!PyErr_Occurred()) {
    PyErr_SetString(PyExc_ImportError, "init kapok.uavsarc");
  }
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  #if PY_MAJOR_VERSION < 3
  return;
  #else
  return __pyx_m;
  #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((char *)modname);
    if (!m) goto end;
    p = PyObject_GetAttrString(m, (char *)"RefNannyAPI");
    if (!p) goto end;
    r = PyLong_AsVoidPtr(p);
end:
    Py_XDECREF(p);
    Py_XDECREF(m);
    return (__Pyx_RefNannyAPIStruct *)r;
}
#endif

/* 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;
}

/* GetModuleGlobalName */
static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) {
    PyObject *result;
#if !CYTHON_AVOID_BORROWED_REFS
    result = PyDict_GetItem(__pyx_d, name);
    if (likely(result)) {
        Py_INCREF(result);
    } else {
#else
    result = PyObject_GetItem(__pyx_d, name);
    if (!result) {
        PyErr_Clear();
#endif
        result = __Pyx_GetBuiltinName(name);
    }
    return result;
}

/* 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);
    PyObject *result;
    int flags;
    assert(PyCFunction_Check(func));
    assert(METH_FASTCALL == PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST));
    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());
    return (*((__Pyx_PyCFunctionFast)meth)) (self, args, nargs, NULL);
}
#endif  // CYTHON_FAST_PYCCALL

/* PyFunctionFastCall */
  #if CYTHON_FAST_PYCALL
#include "frameobject.h"
static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
                                               PyObject *globals) {
    PyFrameObject *f;
    PyThreadState *tstate = PyThreadState_GET();
    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 = f->f_localsplus;
    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, int 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, nargs,
                               k, (int)nk,
                               d, (int)nd, kwdefs, closure);
#else
    result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
                               args, nargs,
                               k, (int)nk,
                               d, (int)nd, closure);
#endif
    Py_XDECREF(kwtuple);
done:
    Py_LeaveRecursiveCall();
    return result;
}
#endif  // CPython < 3.6
#endif  // CYTHON_FAST_PYCALL

/* 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

/* 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

/* 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
#ifdef __Pyx_CyFunction_USED
    if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) {
#else
    if (likely(PyCFunction_Check(func))) {
#endif
        if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
            return __Pyx_PyObject_CallMethO(func, arg);
#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

/* SaveResetException */
    #if CYTHON_FAST_THREAD_STATE
static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
    *type = tstate->exc_type;
    *value = tstate->exc_value;
    *tb = tstate->exc_traceback;
    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;
    tmp_type = tstate->exc_type;
    tmp_value = tstate->exc_value;
    tmp_tb = tstate->exc_traceback;
    tstate->exc_type = type;
    tstate->exc_value = value;
    tstate->exc_traceback = tb;
    Py_XDECREF(tmp_type);
    Py_XDECREF(tmp_value);
    Py_XDECREF(tmp_tb);
}
#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
    tmp_type = tstate->exc_type;
    tmp_value = tstate->exc_value;
    tmp_tb = tstate->exc_traceback;
    tstate->exc_type = local_type;
    tstate->exc_value = local_value;
    tstate->exc_traceback = local_tb;
    Py_XDECREF(tmp_type);
    Py_XDECREF(tmp_value);
    Py_XDECREF(tmp_tb);
#else
    PyErr_SetExcInfo(local_type, local_value, local_tb);
#endif
    return 0;
bad:
    *type = 0;
    *value = 0;
    *tb = 0;
    Py_XDECREF(local_type);
    Py_XDECREF(local_value);
    Py_XDECREF(local_tb);
    return -1;
}

/* SetItemInt */
      static CYTHON_INLINE int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v) {
    int r;
    if (!j) return -1;
    r = PyObject_SetItem(o, j, v);
    Py_DECREF(j);
    return r;
}
static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v, int is_list,
                                               CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) {
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
    if (is_list || PyList_CheckExact(o)) {
        Py_ssize_t n = (!wraparound) ? i : ((likely(i >= 0)) ? i : i + PyList_GET_SIZE(o));
        if ((!boundscheck) || likely((n >= 0) & (n < PyList_GET_SIZE(o)))) {
            PyObject* old = PyList_GET_ITEM(o, n);
            Py_INCREF(v);
            PyList_SET_ITEM(o, n, v);
            Py_DECREF(old);
            return 1;
        }
    } else {
        PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
        if (likely(m && m->sq_ass_item)) {
            if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
                Py_ssize_t l = m->sq_length(o);
                if (likely(l >= 0)) {
                    i += l;
                } else {
                    if (!PyErr_ExceptionMatches(PyExc_OverflowError))
                        return -1;
                    PyErr_Clear();
                }
            }
            return m->sq_ass_item(o, i, v);
        }
    }
#else
#if CYTHON_COMPILING_IN_PYPY
    if (is_list || (PySequence_Check(o) && !PyDict_Check(o))) {
#else
    if (is_list || PySequence_Check(o)) {
#endif
        return PySequence_SetItem(o, i, v);
    }
#endif
    return __Pyx_SetItemInt_Generic(o, PyInt_FromSsize_t(i), v);
}

/* GetItemInt */
        static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
    PyObject *r;
    if (!j) return NULL;
    r = PyObject_GetItem(o, j);
    Py_DECREF(j);
    return r;
}
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
                                                              CYTHON_NCP_UNUSED int wraparound,
                                                              CYTHON_NCP_UNUSED int boundscheck) {
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    if (wraparound & unlikely(i < 0)) i += PyList_GET_SIZE(o);
    if ((!boundscheck) || likely((0 <= i) & (i < PyList_GET_SIZE(o)))) {
        PyObject *r = PyList_GET_ITEM(o, i);
        Py_INCREF(r);
        return r;
    }
    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
#else
    return PySequence_GetItem(o, i);
#endif
}
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
                                                              CYTHON_NCP_UNUSED int wraparound,
                                                              CYTHON_NCP_UNUSED int boundscheck) {
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    if (wraparound & unlikely(i < 0)) i += PyTuple_GET_SIZE(o);
    if ((!boundscheck) || likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) {
        PyObject *r = PyTuple_GET_ITEM(o, i);
        Py_INCREF(r);
        return r;
    }
    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
#else
    return PySequence_GetItem(o, i);
#endif
}
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list,
                                                     CYTHON_NCP_UNUSED int wraparound,
                                                     CYTHON_NCP_UNUSED int boundscheck) {
#if CYTHON_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((n >= 0) & (n < PyList_GET_SIZE(o))))) {
            PyObject *r = PyList_GET_ITEM(o, n);
            Py_INCREF(r);
            return r;
        }
    }
    else if (PyTuple_CheckExact(o)) {
        Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
        if ((!boundscheck) || likely((n >= 0) & (n < PyTuple_GET_SIZE(o)))) {
            PyObject *r = PyTuple_GET_ITEM(o, n);
            Py_INCREF(r);
            return r;
        }
    } else {
        PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
        if (likely(m && m->sq_item)) {
            if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
                Py_ssize_t l = m->sq_length(o);
                if (likely(l >= 0)) {
                    i += l;
                } else {
                    if (!PyErr_ExceptionMatches(PyExc_OverflowError))
                        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, CYTHON_UNUSED int inplace) {
    #if PY_MAJOR_VERSION < 3
    if (likely(PyInt_CheckExact(op1))) {
        const long b = intval;
        long x;
        long a = PyInt_AS_LONG(op1);
            x = (long)((unsigned long)a + b);
            if (likely((x^a) >= 0 || (x^b) >= 0))
                return PyInt_FromLong(x);
            return PyLong_Type.tp_as_number->nb_add(op1, op2);
    }
    #endif
    #if CYTHON_USE_PYLONG_INTERNALS
    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
                    }
                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
                    }
                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
                    }
                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
                    }
                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
                    }
                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
                    }
                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

/* PyObjectCallMethod1 */
        static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) {
    PyObject *method, *result = NULL;
    method = __Pyx_PyObject_GetAttrStr(obj, method_name);
    if (unlikely(!method)) goto done;
#if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(method))) {
        PyObject *self = PyMethod_GET_SELF(method);
        if (likely(self)) {
            PyObject *args;
            PyObject *function = PyMethod_GET_FUNCTION(method);
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(function)) {
                PyObject *args[2] = {self, arg};
                result = __Pyx_PyFunction_FastCall(function, args, 2);
                goto done;
            }
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(function)) {
                PyObject *args[2] = {self, arg};
                result = __Pyx_PyCFunction_FastCall(function, args, 2);
                goto done;
            }
            #endif
            args = PyTuple_New(2);
            if (unlikely(!args)) goto done;
            Py_INCREF(self);
            PyTuple_SET_ITEM(args, 0, self);
            Py_INCREF(arg);
            PyTuple_SET_ITEM(args, 1, arg);
            Py_INCREF(function);
            Py_DECREF(method); method = NULL;
            result = __Pyx_PyObject_Call(function, args, NULL);
            Py_DECREF(args);
            Py_DECREF(function);
            return result;
        }
    }
#endif
    result = __Pyx_PyObject_CallOneArg(method, arg);
done:
    Py_XDECREF(method);
    return result;
}

/* append */
        static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x) {
    if (likely(PyList_CheckExact(L))) {
        if (unlikely(__Pyx_PyList_Append(L, x) < 0)) return -1;
    } else {
        PyObject* retval = __Pyx_PyObject_CallMethod1(L, __pyx_n_s_append, x);
        if (unlikely(!retval))
            return -1;
        Py_DECREF(retval);
    }
    return 0;
}

/* PyIntBinop */
        #if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_PyInt_TrueDivideObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED int inplace) {
    #if PY_MAJOR_VERSION < 3
    if (likely(PyInt_CheckExact(op1))) {
        const long b = intval;
        long a = PyInt_AS_LONG(op1);
            if (8 * sizeof(long) <= 53 || likely(labs(a) <= (1L << 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;
                    }
                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;
                    }
                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;
                    }
                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;
                    }
                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;
                    }
                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;
                    }
                default: return PyLong_Type.tp_as_number->nb_true_divide(op1, op2);
            }
        }
                if ((8 * sizeof(long) <= 53 || likely(labs(a) <= (1L << 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;
            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

/* PyIntBinop */
        #if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_PyInt_SubtractObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED int inplace) {
    #if PY_MAJOR_VERSION < 3
    if (likely(PyInt_CheckExact(op1))) {
        const long b = intval;
        long x;
        long a = PyInt_AS_LONG(op1);
            x = (long)((unsigned long)a - b);
            if (likely((x^a) >= 0 || (x^~b) >= 0))
                return PyInt_FromLong(x);
            return PyLong_Type.tp_as_number->nb_subtract(op1, op2);
    }
    #endif
    #if CYTHON_USE_PYLONG_INTERNALS
    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
                    }
                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
                    }
                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
                    }
                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
                    }
                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
                    }
                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
                    }
                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

/* 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) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) {
#else
    if (likely(PyCFunction_Check(func))) {
#endif
        if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) {
            return __Pyx_PyObject_CallMethO(func, NULL);
        }
    }
    return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL);
}
#endif

/* 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 = 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;
        }
        kind = __Pyx_PyUnicode_KIND(s1);
        if (kind != __Pyx_PyUnicode_KIND(s2)) {
            goto return_ne;
        }
        data1 = __Pyx_PyUnicode_DATA(s1);
        data2 = __Pyx_PyUnicode_DATA(s2);
        if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) {
            goto return_ne;
        } else if (length == 1) {
            goto return_eq;
        } else {
            int result = memcmp(data1, data2, (size_t)(length * kind));
            #if PY_MAJOR_VERSION < 3
            Py_XDECREF(owned_ref);
            #endif
            return (equals == Py_EQ) ? (result == 0) : (result != 0);
        }
    } else if ((s1 == Py_None) & s2_is_unicode) {
        goto return_ne;
    } else if ((s2 == Py_None) & s1_is_unicode) {
        goto return_ne;
    } else {
        int result;
        PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
        if (!py_result)
            return -1;
        result = __Pyx_PyObject_IsTrue(py_result);
        Py_DECREF(py_result);
        return result;
    }
return_eq:
    #if PY_MAJOR_VERSION < 3
    Py_XDECREF(owned_ref);
    #endif
    return (equals == Py_EQ);
return_ne:
    #if PY_MAJOR_VERSION < 3
    Py_XDECREF(owned_ref);
    #endif
    return (equals == Py_NE);
#endif
}

/* SliceObject */
          static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(PyObject* obj,
        Py_ssize_t cstart, Py_ssize_t cstop,
        PyObject** _py_start, PyObject** _py_stop, PyObject** _py_slice,
        int has_cstart, int has_cstop, CYTHON_UNUSED int wraparound) {
#if CYTHON_USE_TYPE_SLOTS
    PyMappingMethods* mp;
#if PY_MAJOR_VERSION < 3
    PySequenceMethods* ms = Py_TYPE(obj)->tp_as_sequence;
    if (likely(ms && ms->sq_slice)) {
        if (!has_cstart) {
            if (_py_start && (*_py_start != Py_None)) {
                cstart = __Pyx_PyIndex_AsSsize_t(*_py_start);
                if ((cstart == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad;
            } else
                cstart = 0;
        }
        if (!has_cstop) {
            if (_py_stop && (*_py_stop != Py_None)) {
                cstop = __Pyx_PyIndex_AsSsize_t(*_py_stop);
                if ((cstop == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad;
            } else
                cstop = PY_SSIZE_T_MAX;
        }
        if (wraparound && unlikely((cstart < 0) | (cstop < 0)) && likely(ms->sq_length)) {
            Py_ssize_t l = ms->sq_length(obj);
            if (likely(l >= 0)) {
                if (cstop < 0) {
                    cstop += l;
                    if (cstop < 0) cstop = 0;
                }
                if (cstart < 0) {
                    cstart += l;
                    if (cstart < 0) cstart = 0;
                }
            } else {
                if (!PyErr_ExceptionMatches(PyExc_OverflowError))
                    goto bad;
                PyErr_Clear();
            }
        }
        return ms->sq_slice(obj, cstart, cstop);
    }
#endif
    mp = Py_TYPE(obj)->tp_as_mapping;
    if (likely(mp && mp->mp_subscript))
#endif
    {
        PyObject* result;
        PyObject *py_slice, *py_start, *py_stop;
        if (_py_slice) {
            py_slice = *_py_slice;
        } else {
            PyObject* owned_start = NULL;
            PyObject* owned_stop = NULL;
            if (_py_start) {
                py_start = *_py_start;
            } else {
                if (has_cstart) {
                    owned_start = py_start = PyInt_FromSsize_t(cstart);
                    if (unlikely(!py_start)) goto bad;
                } else
                    py_start = Py_None;
            }
            if (_py_stop) {
                py_stop = *_py_stop;
            } else {
                if (has_cstop) {
                    owned_stop = py_stop = PyInt_FromSsize_t(cstop);
                    if (unlikely(!py_stop)) {
                        Py_XDECREF(owned_start);
                        goto bad;
                    }
                } else
                    py_stop = Py_None;
            }
            py_slice = PySlice_New(py_start, py_stop, Py_None);
            Py_XDECREF(owned_start);
            Py_XDECREF(owned_stop);
            if (unlikely(!py_slice)) goto bad;
        }
#if CYTHON_USE_TYPE_SLOTS
        result = mp->mp_subscript(obj, py_slice);
#else
        result = PyObject_GetItem(obj, py_slice);
#endif
        if (!_py_slice) {
            Py_DECREF(py_slice);
        }
        return result;
    }
    PyErr_Format(PyExc_TypeError,
        "'%.200s' object is unsliceable", Py_TYPE(obj)->tp_name);
bad:
    return NULL;
}

/* 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 = PyThreadState_GET();
    PyObject* exc_type = tstate->curexc_type;
    if (unlikely(exc_type)) {
        if (likely(exc_type == PyExc_StopIteration) || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)) {
            PyObject *exc_value, *exc_tb;
            exc_value = tstate->curexc_value;
            exc_tb = tstate->curexc_traceback;
            tstate->curexc_type = 0;
            tstate->curexc_value = 0;
            tstate->curexc_traceback = 0;
            Py_DECREF(exc_type);
            Py_XDECREF(exc_value);
            Py_XDECREF(exc_tb);
            return 0;
        } else {
            return -1;
        }
    }
    return 0;
#else
    if (unlikely(PyErr_Occurred())) {
        if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) {
            PyErr_Clear();
            return 0;
        } else {
            return -1;
        }
    }
    return 0;
#endif
}

/* 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;
}

/* PyIntBinop */
          #if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_PyInt_EqObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED int 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))) {
        const long b = intval;
        long a;
        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;
                    }
                case 2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    }
                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;
                    }
                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;
                    }
                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;
                    }
                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;
                    }
                #if PyLong_SHIFT < 30 && PyLong_SHIFT != 15
                default: return PyLong_Type.tp_richcompare(op1, op2, Py_EQ);
                #else
                default: Py_RETURN_FALSE;
                #endif
            }
        }
            if (a == b) {
                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);
}
#endif

/* PyIntBinop */
          #if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_PyInt_RemainderObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED int inplace) {
    #if PY_MAJOR_VERSION < 3
    if (likely(PyInt_CheckExact(op1))) {
        const long b = intval;
        long x;
        long a = PyInt_AS_LONG(op1);
            x = a % b;
            x += ((x != 0) & ((x ^ b) < 0)) * b;
            return PyInt_FromLong(x);
    }
    #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
                    }
                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
                    }
                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
                    }
                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
                    }
                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
                    }
                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
                    }
                default: return PyLong_Type.tp_as_number->nb_remainder(op1, op2);
            }
        }
                x = a % b;
                x += ((x != 0) & ((x ^ b) < 0)) * b;
            return PyLong_FromLong(x);
#ifdef HAVE_LONG_LONG
        long_long:
                llx = lla % llb;
                llx += ((llx != 0) & ((llx ^ llb) < 0)) * llb;
            return PyLong_FromLongLong(llx);
#endif
        
        
    }
    #endif
    return (inplace ? PyNumber_InPlaceRemainder : PyNumber_Remainder)(op1, op2);
}
#endif

/* None */
          static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) {
    PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname);
}

/* SliceObject */
          static CYTHON_INLINE int __Pyx_PyObject_SetSlice(PyObject* obj, PyObject* value,
        Py_ssize_t cstart, Py_ssize_t cstop,
        PyObject** _py_start, PyObject** _py_stop, PyObject** _py_slice,
        int has_cstart, int has_cstop, CYTHON_UNUSED int wraparound) {
#if CYTHON_USE_TYPE_SLOTS
    PyMappingMethods* mp;
#if PY_MAJOR_VERSION < 3
    PySequenceMethods* ms = Py_TYPE(obj)->tp_as_sequence;
    if (likely(ms && ms->sq_ass_slice)) {
        if (!has_cstart) {
            if (_py_start && (*_py_start != Py_None)) {
                cstart = __Pyx_PyIndex_AsSsize_t(*_py_start);
                if ((cstart == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad;
            } else
                cstart = 0;
        }
        if (!has_cstop) {
            if (_py_stop && (*_py_stop != Py_None)) {
                cstop = __Pyx_PyIndex_AsSsize_t(*_py_stop);
                if ((cstop == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad;
            } else
                cstop = PY_SSIZE_T_MAX;
        }
        if (wraparound && unlikely((cstart < 0) | (cstop < 0)) && likely(ms->sq_length)) {
            Py_ssize_t l = ms->sq_length(obj);
            if (likely(l >= 0)) {
                if (cstop < 0) {
                    cstop += l;
                    if (cstop < 0) cstop = 0;
                }
                if (cstart < 0) {
                    cstart += l;
                    if (cstart < 0) cstart = 0;
                }
            } else {
                if (!PyErr_ExceptionMatches(PyExc_OverflowError))
                    goto bad;
                PyErr_Clear();
            }
        }
        return ms->sq_ass_slice(obj, cstart, cstop, value);
    }
#endif
    mp = Py_TYPE(obj)->tp_as_mapping;
    if (likely(mp && mp->mp_ass_subscript))
#endif
    {
        int result;
        PyObject *py_slice, *py_start, *py_stop;
        if (_py_slice) {
            py_slice = *_py_slice;
        } else {
            PyObject* owned_start = NULL;
            PyObject* owned_stop = NULL;
            if (_py_start) {
                py_start = *_py_start;
            } else {
                if (has_cstart) {
                    owned_start = py_start = PyInt_FromSsize_t(cstart);
                    if (unlikely(!py_start)) goto bad;
                } else
                    py_start = Py_None;
            }
            if (_py_stop) {
                py_stop = *_py_stop;
            } else {
                if (has_cstop) {
                    owned_stop = py_stop = PyInt_FromSsize_t(cstop);
                    if (unlikely(!py_stop)) {
                        Py_XDECREF(owned_start);
                        goto bad;
                    }
                } else
                    py_stop = Py_None;
            }
            py_slice = PySlice_New(py_start, py_stop, Py_None);
            Py_XDECREF(owned_start);
            Py_XDECREF(owned_stop);
            if (unlikely(!py_slice)) goto bad;
        }
#if CYTHON_USE_TYPE_SLOTS
        result = mp->mp_ass_subscript(obj, py_slice, value);
#else
        result = value ? PyObject_SetItem(obj, py_slice, value) : PyObject_DelItem(obj, py_slice);
#endif
        if (!_py_slice) {
            Py_DECREF(py_slice);
        }
        return result;
    }
    PyErr_Format(PyExc_TypeError,
        "'%.200s' object does not support slice %.10s",
        Py_TYPE(obj)->tp_name, value ? "assignment" : "deletion");
bad:
    return -1;
}

/* 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(PyObject_TypeCheck(obj, type)))
        return 1;
    PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s",
                 Py_TYPE(obj)->tp_name, type->tp_name);
    return 0;
}

/* BufferFormatCheck */
          static CYTHON_INLINE int __Pyx_IsLittleEndian(void) {
  unsigned int n = 1;
  return *(unsigned char*)(&n) != 0;
}
static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
                              __Pyx_BufFmt_StackElem* stack,
                              __Pyx_TypeInfo* type) {
  stack[0].field = &ctx->root;
  stack[0].parent_offset = 0;
  ctx->root.type = type;
  ctx->root.name = "buffer dtype";
  ctx->root.offset = 0;
  ctx->head = stack;
  ctx->head->field = &ctx->root;
  ctx->fmt_offset = 0;
  ctx->head->parent_offset = 0;
  ctx->new_packmode = '@';
  ctx->enc_packmode = '@';
  ctx->new_count = 1;
  ctx->enc_count = 0;
  ctx->enc_type = 0;
  ctx->is_complex = 0;
  ctx->is_valid_array = 0;
  ctx->struct_alignment = 0;
  while (type->typegroup == 'S') {
    ++ctx->head;
    ctx->head->field = type->fields;
    ctx->head->parent_offset = 0;
    type = type->fields->type;
  }
}
static int __Pyx_BufFmt_ParseNumber(const char** ts) {
    int count;
    const char* t = *ts;
    if (*t < '0' || *t > '9') {
      return -1;
    } else {
        count = *t++ - '0';
        while (*t >= '0' && *t < '9') {
            count *= 10;
            count += *t++ - '0';
        }
    }
    *ts = t;
    return count;
}
static int __Pyx_BufFmt_ExpectNumber(const char **ts) {
    int number = __Pyx_BufFmt_ParseNumber(ts);
    if (number == -1)
        PyErr_Format(PyExc_ValueError,\
                     "Does not understand character buffer dtype format string ('%c')", **ts);
    return number;
}
static void __Pyx_BufFmt_RaiseUnexpectedChar(char ch) {
  PyErr_Format(PyExc_ValueError,
               "Unexpected format string character: '%c'", ch);
}
static const char* __Pyx_BufFmt_DescribeTypeChar(char ch, int is_complex) {
  switch (ch) {
    case 'c': return "'char'";
    case 'b': return "'signed char'";
    case 'B': return "'unsigned char'";
    case 'h': return "'short'";
    case 'H': return "'unsigned short'";
    case 'i': return "'int'";
    case 'I': return "'unsigned int'";
    case 'l': return "'long'";
    case 'L': return "'unsigned long'";
    case 'q': return "'long long'";
    case 'Q': return "'unsigned long long'";
    case 'f': return (is_complex ? "'complex float'" : "'float'");
    case 'd': return (is_complex ? "'complex double'" : "'double'");
    case 'g': return (is_complex ? "'complex long double'" : "'long double'");
    case 'T': return "a struct";
    case 'O': return "Python object";
    case 'P': return "a pointer";
    case 's': case 'p': return "a string";
    case 0: return "end";
    default: return "unparseable format string";
  }
}
static size_t __Pyx_BufFmt_TypeCharToStandardSize(char ch, int is_complex) {
  switch (ch) {
    case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
    case 'h': case 'H': return 2;
    case 'i': case 'I': case 'l': case 'L': return 4;
    case 'q': case 'Q': return 8;
    case 'f': return (is_complex ? 8 : 4);
    case 'd': return (is_complex ? 16 : 8);
    case 'g': {
      PyErr_SetString(PyExc_ValueError, "Python does not define a standard format string size for long double ('g')..");
      return 0;
    }
    case 'O': case 'P': return sizeof(void*);
    default:
      __Pyx_BufFmt_RaiseUnexpectedChar(ch);
      return 0;
    }
}
static size_t __Pyx_BufFmt_TypeCharToNativeSize(char ch, int is_complex) {
  switch (ch) {
    case 'c': case 'b': case 'B': case 's': case 'p': return 1;
    case 'h': case 'H': return sizeof(short);
    case 'i': case 'I': return sizeof(int);
    case 'l': case 'L': return sizeof(long);
    #ifdef HAVE_LONG_LONG
    case 'q': case 'Q': return sizeof(PY_LONG_LONG);
    #endif
    case 'f': return sizeof(float) * (is_complex ? 2 : 1);
    case 'd': return sizeof(double) * (is_complex ? 2 : 1);
    case 'g': return sizeof(long double) * (is_complex ? 2 : 1);
    case 'O': case 'P': return sizeof(void*);
    default: {
      __Pyx_BufFmt_RaiseUnexpectedChar(ch);
      return 0;
    }
  }
}
typedef struct { char c; short x; } __Pyx_st_short;
typedef struct { char c; int x; } __Pyx_st_int;
typedef struct { char c; long x; } __Pyx_st_long;
typedef struct { char c; float x; } __Pyx_st_float;
typedef struct { char c; double x; } __Pyx_st_double;
typedef struct { char c; long double x; } __Pyx_st_longdouble;
typedef struct { char c; void *x; } __Pyx_st_void_p;
#ifdef HAVE_LONG_LONG
typedef struct { char c; PY_LONG_LONG x; } __Pyx_st_longlong;
#endif
static size_t __Pyx_BufFmt_TypeCharToAlignment(char ch, CYTHON_UNUSED int is_complex) {
  switch (ch) {
    case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
    case 'h': case 'H': return sizeof(__Pyx_st_short) - sizeof(short);
    case 'i': case 'I': return sizeof(__Pyx_st_int) - sizeof(int);
    case 'l': case 'L': return sizeof(__Pyx_st_long) - sizeof(long);
#ifdef HAVE_LONG_LONG
    case 'q': case 'Q': return sizeof(__Pyx_st_longlong) - sizeof(PY_LONG_LONG);
#endif
    case 'f': return sizeof(__Pyx_st_float) - sizeof(float);
    case 'd': return sizeof(__Pyx_st_double) - sizeof(double);
    case 'g': return sizeof(__Pyx_st_longdouble) - sizeof(long double);
    case 'P': case 'O': return sizeof(__Pyx_st_void_p) - sizeof(void*);
    default:
      __Pyx_BufFmt_RaiseUnexpectedChar(ch);
      return 0;
    }
}
/* These are for computing the padding at the end of the struct to align
   on the first member of the struct. This will probably the same as above,
   but we don't have any guarantees.
 */
typedef struct { short x; char c; } __Pyx_pad_short;
typedef struct { int x; char c; } __Pyx_pad_int;
typedef struct { long x; char c; } __Pyx_pad_long;
typedef struct { float x; char c; } __Pyx_pad_float;
typedef struct { double x; char c; } __Pyx_pad_double;
typedef struct { long double x; char c; } __Pyx_pad_longdouble;
typedef struct { void *x; char c; } __Pyx_pad_void_p;
#ifdef HAVE_LONG_LONG
typedef struct { PY_LONG_LONG x; char c; } __Pyx_pad_longlong;
#endif
static size_t __Pyx_BufFmt_TypeCharToPadding(char ch, CYTHON_UNUSED int is_complex) {
  switch (ch) {
    case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
    case 'h': case 'H': return sizeof(__Pyx_pad_short) - sizeof(short);
    case 'i': case 'I': return sizeof(__Pyx_pad_int) - sizeof(int);
    case 'l': case 'L': return sizeof(__Pyx_pad_long) - sizeof(long);
#ifdef HAVE_LONG_LONG
    case 'q': case 'Q': return sizeof(__Pyx_pad_longlong) - sizeof(PY_LONG_LONG);
#endif
    case 'f': return sizeof(__Pyx_pad_float) - sizeof(float);
    case 'd': return sizeof(__Pyx_pad_double) - sizeof(double);
    case 'g': return sizeof(__Pyx_pad_longdouble) - sizeof(long double);
    case 'P': case 'O': return sizeof(__Pyx_pad_void_p) - sizeof(void*);
    default:
      __Pyx_BufFmt_RaiseUnexpectedChar(ch);
      return 0;
    }
}
static char __Pyx_BufFmt_TypeCharToGroup(char ch, int is_complex) {
  switch (ch) {
    case 'c':
        return 'H';
    case 'b': case 'h': case 'i':
    case 'l': case 'q': case 's': case 'p':
        return 'I';
    case 'B': case 'H': case 'I': case 'L': case 'Q':
        return 'U';
    case 'f': case 'd': case 'g':
        return (is_complex ? 'C' : 'R');
    case 'O':
        return 'O';
    case 'P':
        return 'P';
    default: {
      __Pyx_BufFmt_RaiseUnexpectedChar(ch);
      return 0;
    }
  }
}
static void __Pyx_BufFmt_RaiseExpected(__Pyx_BufFmt_Context* ctx) {
  if (ctx->head == NULL || ctx->head->field == &ctx->root) {
    const char* expected;
    const char* quote;
    if (ctx->head == NULL) {
      expected = "end";
      quote = "";
    } else {
      expected = ctx->head->field->type->name;
      quote = "'";
    }
    PyErr_Format(PyExc_ValueError,
                 "Buffer dtype mismatch, expected %s%s%s but got %s",
                 quote, expected, quote,
                 __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex));
  } else {
    __Pyx_StructField* field = ctx->head->field;
    __Pyx_StructField* parent = (ctx->head - 1)->field;
    PyErr_Format(PyExc_ValueError,
                 "Buffer dtype mismatch, expected '%s' but got %s in '%s.%s'",
                 field->type->name, __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex),
                 parent->type->name, field->name);
  }
}
static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) {
  char group;
  size_t size, offset, arraysize = 1;
  if (ctx->enc_type == 0) return 0;
  if (ctx->head->field->type->arraysize[0]) {
    int i, ndim = 0;
    if (ctx->enc_type == 's' || ctx->enc_type == 'p') {
        ctx->is_valid_array = ctx->head->field->type->ndim == 1;
        ndim = 1;
        if (ctx->enc_count != ctx->head->field->type->arraysize[0]) {
            PyErr_Format(PyExc_ValueError,
                         "Expected a dimension of size %zu, got %zu",
                         ctx->head->field->type->arraysize[0], ctx->enc_count);
            return -1;
        }
    }
    if (!ctx->is_valid_array) {
      PyErr_Format(PyExc_ValueError, "Expected %d dimensions, got %d",
                   ctx->head->field->type->ndim, ndim);
      return -1;
    }
    for (i = 0; i < ctx->head->field->type->ndim; i++) {
      arraysize *= ctx->head->field->type->arraysize[i];
    }
    ctx->is_valid_array = 0;
    ctx->enc_count = 1;
  }
  group = __Pyx_BufFmt_TypeCharToGroup(ctx->enc_type, ctx->is_complex);
  do {
    __Pyx_StructField* field = ctx->head->field;
    __Pyx_TypeInfo* type = field->type;
    if (ctx->enc_packmode == '@' || ctx->enc_packmode == '^') {
      size = __Pyx_BufFmt_TypeCharToNativeSize(ctx->enc_type, ctx->is_complex);
    } else {
      size = __Pyx_BufFmt_TypeCharToStandardSize(ctx->enc_type, ctx->is_complex);
    }
    if (ctx->enc_packmode == '@') {
      size_t align_at = __Pyx_BufFmt_TypeCharToAlignment(ctx->enc_type, ctx->is_complex);
      size_t align_mod_offset;
      if (align_at == 0) return -1;
      align_mod_offset = ctx->fmt_offset % align_at;
      if (align_mod_offset > 0) ctx->fmt_offset += align_at - align_mod_offset;
      if (ctx->struct_alignment == 0)
          ctx->struct_alignment = __Pyx_BufFmt_TypeCharToPadding(ctx->enc_type,
                                                                 ctx->is_complex);
    }
    if (type->size != size || type->typegroup != group) {
      if (type->typegroup == 'C' && type->fields != NULL) {
        size_t parent_offset = ctx->head->parent_offset + field->offset;
        ++ctx->head;
        ctx->head->field = type->fields;
        ctx->head->parent_offset = parent_offset;
        continue;
      }
      if ((type->typegroup == 'H' || group == 'H') && type->size == size) {
      } else {
          __Pyx_BufFmt_RaiseExpected(ctx);
          return -1;
      }
    }
    offset = ctx->head->parent_offset + field->offset;
    if (ctx->fmt_offset != offset) {
      PyErr_Format(PyExc_ValueError,
                   "Buffer dtype mismatch; next field is at offset %" CYTHON_FORMAT_SSIZE_T "d but %" CYTHON_FORMAT_SSIZE_T "d expected",
                   (Py_ssize_t)ctx->fmt_offset, (Py_ssize_t)offset);
      return -1;
    }
    ctx->fmt_offset += size;
    if (arraysize)
      ctx->fmt_offset += (arraysize - 1) * size;
    --ctx->enc_count;
    while (1) {
      if (field == &ctx->root) {
        ctx->head = NULL;
        if (ctx->enc_count != 0) {
          __Pyx_BufFmt_RaiseExpected(ctx);
          return -1;
        }
        break;
      }
      ctx->head->field = ++field;
      if (field->type == NULL) {
        --ctx->head;
        field = ctx->head->field;
        continue;
      } else if (field->type->typegroup == 'S') {
        size_t parent_offset = ctx->head->parent_offset + field->offset;
        if (field->type->fields->type == NULL) continue;
        field = field->type->fields;
        ++ctx->head;
        ctx->head->field = field;
        ctx->head->parent_offset = parent_offset;
        break;
      } else {
        break;
      }
    }
  } while (ctx->enc_count);
  ctx->enc_type = 0;
  ctx->is_complex = 0;
  return 0;
}
static CYTHON_INLINE PyObject *
__pyx_buffmt_parse_array(__Pyx_BufFmt_Context* ctx, const char** tsp)
{
    const char *ts = *tsp;
    int i = 0, number;
    int ndim = ctx->head->field->type->ndim;
;
    ++ts;
    if (ctx->new_count != 1) {
        PyErr_SetString(PyExc_ValueError,
                        "Cannot handle repeated arrays in format string");
        return NULL;
    }
    if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
    while (*ts && *ts != ')') {
        switch (*ts) {
            case ' ': case '\f': case '\r': case '\n': case '\t': case '\v':  continue;
            default:  break;
        }
        number = __Pyx_BufFmt_ExpectNumber(&ts);
        if (number == -1) return NULL;
        if (i < ndim && (size_t) number != ctx->head->field->type->arraysize[i])
            return PyErr_Format(PyExc_ValueError,
                        "Expected a dimension of size %zu, got %d",
                        ctx->head->field->type->arraysize[i], number);
        if (*ts != ',' && *ts != ')')
            return PyErr_Format(PyExc_ValueError,
                                "Expected a comma in format string, got '%c'", *ts);
        if (*ts == ',') ts++;
        i++;
    }
    if (i != ndim)
        return PyErr_Format(PyExc_ValueError, "Expected %d dimension(s), got %d",
                            ctx->head->field->type->ndim, i);
    if (!*ts) {
        PyErr_SetString(PyExc_ValueError,
                        "Unexpected end of format string, expected ')'");
        return NULL;
    }
    ctx->is_valid_array = 1;
    ctx->new_count = 1;
    *tsp = ++ts;
    return Py_None;
}
static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts) {
  int got_Z = 0;
  while (1) {
    switch(*ts) {
      case 0:
        if (ctx->enc_type != 0 && ctx->head == NULL) {
          __Pyx_BufFmt_RaiseExpected(ctx);
          return NULL;
        }
        if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
        if (ctx->head != NULL) {
          __Pyx_BufFmt_RaiseExpected(ctx);
          return NULL;
        }
        return ts;
      case ' ':
      case '\r':
      case '\n':
        ++ts;
        break;
      case '<':
        if (!__Pyx_IsLittleEndian()) {
          PyErr_SetString(PyExc_ValueError, "Little-endian buffer not supported on big-endian compiler");
          return NULL;
        }
        ctx->new_packmode = '=';
        ++ts;
        break;
      case '>':
      case '!':
        if (__Pyx_IsLittleEndian()) {
          PyErr_SetString(PyExc_ValueError, "Big-endian buffer not supported on little-endian compiler");
          return NULL;
        }
        ctx->new_packmode = '=';
        ++ts;
        break;
      case '=':
      case '@':
      case '^':
        ctx->new_packmode = *ts++;
        break;
      case 'T':
        {
          const char* ts_after_sub;
          size_t i, struct_count = ctx->new_count;
          size_t struct_alignment = ctx->struct_alignment;
          ctx->new_count = 1;
          ++ts;
          if (*ts != '{') {
            PyErr_SetString(PyExc_ValueError, "Buffer acquisition: Expected '{' after 'T'");
            return NULL;
          }
          if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
          ctx->enc_type = 0;
          ctx->enc_count = 0;
          ctx->struct_alignment = 0;
          ++ts;
          ts_after_sub = ts;
          for (i = 0; i != struct_count; ++i) {
            ts_after_sub = __Pyx_BufFmt_CheckString(ctx, ts);
            if (!ts_after_sub) return NULL;
          }
          ts = ts_after_sub;
          if (struct_alignment) ctx->struct_alignment = struct_alignment;
        }
        break;
      case '}':
        {
          size_t alignment = ctx->struct_alignment;
          ++ts;
          if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
          ctx->enc_type = 0;
          if (alignment && ctx->fmt_offset % alignment) {
            ctx->fmt_offset += alignment - (ctx->fmt_offset % alignment);
          }
        }
        return ts;
      case 'x':
        if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
        ctx->fmt_offset += ctx->new_count;
        ctx->new_count = 1;
        ctx->enc_count = 0;
        ctx->enc_type = 0;
        ctx->enc_packmode = ctx->new_packmode;
        ++ts;
        break;
      case 'Z':
        got_Z = 1;
        ++ts;
        if (*ts != 'f' && *ts != 'd' && *ts != 'g') {
          __Pyx_BufFmt_RaiseUnexpectedChar('Z');
          return NULL;
        }
      case 'c': case 'b': case 'B': case 'h': case 'H': case 'i': case 'I':
      case 'l': case 'L': case 'q': case 'Q':
      case 'f': case 'd': case 'g':
      case 'O': case 'p':
        if (ctx->enc_type == *ts && got_Z == ctx->is_complex &&
            ctx->enc_packmode == ctx->new_packmode) {
          ctx->enc_count += ctx->new_count;
          ctx->new_count = 1;
          got_Z = 0;
          ++ts;
          break;
        }
      case 's':
        if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
        ctx->enc_count = ctx->new_count;
        ctx->enc_packmode = ctx->new_packmode;
        ctx->enc_type = *ts;
        ctx->is_complex = got_Z;
        ++ts;
        ctx->new_count = 1;
        got_Z = 0;
        break;
      case ':':
        ++ts;
        while(*ts != ':') ++ts;
        ++ts;
        break;
      case '(':
        if (!__pyx_buffmt_parse_array(ctx, &ts)) return NULL;
        break;
      default:
        {
          int number = __Pyx_BufFmt_ExpectNumber(&ts);
          if (number == -1) return NULL;
          ctx->new_count = (size_t)number;
        }
    }
  }
}
static CYTHON_INLINE void __Pyx_ZeroBuffer(Py_buffer* buf) {
  buf->buf = NULL;
  buf->obj = NULL;
  buf->strides = __Pyx_zeros;
  buf->shape = __Pyx_zeros;
  buf->suboffsets = __Pyx_minusones;
}
static CYTHON_INLINE int __Pyx_GetBufferAndValidate(
        Py_buffer* buf, PyObject* obj,  __Pyx_TypeInfo* dtype, int flags,
        int nd, int cast, __Pyx_BufFmt_StackElem* stack)
{
  if (obj == Py_None || obj == NULL) {
    __Pyx_ZeroBuffer(buf);
    return 0;
  }
  buf->buf = NULL;
  if (__Pyx_GetBuffer(obj, buf, flags) == -1) goto fail;
  if (buf->ndim != nd) {
    PyErr_Format(PyExc_ValueError,
                 "Buffer has wrong number of dimensions (expected %d, got %d)",
                 nd, buf->ndim);
    goto fail;
  }
  if (!cast) {
    __Pyx_BufFmt_Context ctx;
    __Pyx_BufFmt_Init(&ctx, stack, dtype);
    if (!__Pyx_BufFmt_CheckString(&ctx, buf->format)) goto fail;
  }
  if ((unsigned)buf->itemsize != dtype->size) {
    PyErr_Format(PyExc_ValueError,
      "Item size of buffer (%" CYTHON_FORMAT_SSIZE_T "d byte%s) does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_T "d byte%s)",
      buf->itemsize, (buf->itemsize > 1) ? "s" : "",
      dtype->name, (Py_ssize_t)dtype->size, (dtype->size > 1) ? "s" : "");
    goto fail;
  }
  if (buf->suboffsets == NULL) buf->suboffsets = __Pyx_minusones;
  return 0;
fail:;
  __Pyx_ZeroBuffer(buf);
  return -1;
}
static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info) {
  if (info->buf == NULL) return;
  if (info->suboffsets == __Pyx_minusones) info->suboffsets = NULL;
  __Pyx_ReleaseBuffer(info);
}

/* 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_VERSION_HEX < 0x03030000
    PyObject *py_import;
    py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
    if (!py_import)
        goto bad;
    #endif
    if (from_list)
        list = from_list;
    else {
        empty_list = PyList_New(0);
        if (!empty_list)
            goto bad;
        list = empty_list;
    }
    global_dict = PyModule_GetDict(__pyx_m);
    if (!global_dict)
        goto bad;
    empty_dict = PyDict_New();
    if (!empty_dict)
        goto bad;
    {
        #if PY_MAJOR_VERSION >= 3
        if (level == -1) {
            if (strchr(__Pyx_MODULE_NAME, '.')) {
                #if PY_VERSION_HEX < 0x03030000
                PyObject *py_level = PyInt_FromLong(1);
                if (!py_level)
                    goto bad;
                module = PyObject_CallFunctionObjArgs(py_import,
                    name, global_dict, empty_dict, list, py_level, NULL);
                Py_DECREF(py_level);
                #else
                module = PyImport_ImportModuleLevelObject(
                    name, global_dict, empty_dict, list, 1);
                #endif
                if (!module) {
                    if (!PyErr_ExceptionMatches(PyExc_ImportError))
                        goto bad;
                    PyErr_Clear();
                }
            }
            level = 0;
        }
        #endif
        if (!module) {
            #if PY_VERSION_HEX < 0x03030000
            PyObject *py_level = PyInt_FromLong(level);
            if (!py_level)
                goto bad;
            module = PyObject_CallFunctionObjArgs(py_import,
                name, global_dict, empty_dict, list, py_level, NULL);
            Py_DECREF(py_level);
            #else
            module = PyImport_ImportModuleLevelObject(
                name, global_dict, empty_dict, list, level);
            #endif
        }
    }
bad:
    #if PY_VERSION_HEX < 0x03030000
    Py_XDECREF(py_import);
    #endif
    Py_XDECREF(empty_list);
    Py_XDECREF(empty_dict);
    return module;
}

/* 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;
}

/* BufferFallbackError */
            static void __Pyx_RaiseBufferFallbackError(void) {
  PyErr_SetString(PyExc_ValueError,
     "Buffer acquisition failed on assignment; and then reacquiring the old buffer failed too!");
}

/* 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

/* PyErrExceptionMatches */
            #if CYTHON_FAST_THREAD_STATE
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;
    return PyErr_GivenExceptionMatches(exc_type, err);
}
#endif

/* PyFloatBinop */
            #if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_PyFloat_TrueDivideObjC(PyObject *op1, PyObject *op2, double floatval, CYTHON_UNUSED int inplace) {
    const double b = floatval;
    double a, result;
    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) (1L<<53))) {
                        if (size == -2)
                            a = -a;
                        break;
                    }
                }
            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) (1L<<53))) {
                        if (size == -3)
                            a = -a;
                        break;
                    }
                }
            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) (1L<<53))) {
                        if (size == -4)
                            a = -a;
                        break;
                    }
                }
            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

/* 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 PY_VERSION_HEX >= 0x03030000
    if (cause) {
#else
    if (cause && cause != Py_None) {
#endif
        PyObject *fixed_cause;
        if (cause == Py_None) {
            fixed_cause = NULL;
        } else if (PyExceptionClass_Check(cause)) {
            fixed_cause = PyObject_CallObject(cause, NULL);
            if (fixed_cause == NULL)
                goto bad;
        } else if (PyExceptionInstance_Check(cause)) {
            fixed_cause = cause;
            Py_INCREF(fixed_cause);
        } else {
            PyErr_SetString(PyExc_TypeError,
                            "exception causes must derive from "
                            "BaseException");
            goto bad;
        }
        PyException_SetCause(value, fixed_cause);
    }
    PyErr_SetObject(type, value);
    if (tb) {
#if CYTHON_COMPILING_IN_PYPY
        PyObject *tmp_type, *tmp_value, *tmp_tb;
        PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
        Py_INCREF(tb);
        PyErr_Restore(tmp_type, tmp_value, tb);
        Py_XDECREF(tmp_tb);
#else
        PyThreadState *tstate = PyThreadState_GET();
        PyObject* tmp_tb = tstate->curexc_traceback;
        if (tb != tmp_tb) {
            Py_INCREF(tb);
            tstate->curexc_traceback = tb;
            Py_XDECREF(tmp_tb);
        }
#endif
    }
bad:
    Py_XDECREF(owned_instance);
    return;
}
#endif

/* RaiseNoneIterError */
                static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
}

/* 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;
}

/* 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 */
                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)
{
    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)
{
    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)
{
    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)
{
    Py_INCREF(op->func_qualname);
    return op->func_qualname;
}
static int
__Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value)
{
    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)
{
    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)
{
    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)
{
    Py_INCREF(op->func_globals);
    return op->func_globals;
}
static PyObject *
__Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op)
{
    Py_INCREF(Py_None);
    return Py_None;
}
static PyObject *
__Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op)
{
    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) {
    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) {
    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) {
    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) {
    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) {
    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) {
    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(__pyx_CyFunctionObject, func.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)
{
    PyObject_GC_UnTrack(m);
    if (__Pyx_CyFunction_weakreflist(m) != NULL)
        PyObject_ClearWeakRefs((PyObject *) m);
    __Pyx_CyFunction_clear(m);
    PyObject_GC_Del(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)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 = PySequence_ITEM(arg, 0);
                if (unlikely(!arg0)) return NULL;
                result = (*meth)(self, arg0);
                Py_DECREF(arg0);
                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
};
static int __pyx_CyFunction_init(void) {
    __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type);
    if (__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 (!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);
}

/* 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;
}

/* 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;
    py_code = __pyx_find_code_object(c_line ? c_line : py_line);
    if (!py_code) {
        py_code = __Pyx_CreateCodeObjectForTraceback(
            funcname, c_line, py_line, filename);
        if (!py_code) goto bad;
        __pyx_insert_code_object(c_line ? c_line : py_line, py_code);
    }
    py_frame = PyFrame_New(
        PyThreadState_GET(), /*PyThreadState *tstate,*/
        py_code,             /*PyCodeObject *code,*/
        __pyx_d,      /*PyObject *globals,*/
        0                    /*PyObject *locals*/
    );
    if (!py_frame) goto bad;
    __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 (PyObject_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) return __pyx_pw_5numpy_7ndarray_1__getbuffer__(obj, view, flags);
    PyErr_Format(PyExc_TypeError, "'%.200s' does not have the buffer interface", Py_TYPE(obj)->tp_name);
    return -1;
}
static void __Pyx_ReleaseBuffer(Py_buffer *view) {
    PyObject *obj = view->obj;
    if (!obj) return;
    if (PyObject_CheckBuffer(obj)) {
        PyBuffer_Release(view);
        return;
    }
        if (PyObject_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) { __pyx_pw_5numpy_7ndarray_3__releasebuffer__(obj, view); return; }
    Py_DECREF(obj);
    view->obj = NULL;
}
#endif


                    /* 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_long(long value) {
    const long neg_one = (long) -1, const_zero = (long) 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(long) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(long) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#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_unsigned_int(unsigned int value) {
    const unsigned int neg_one = (unsigned int) -1, const_zero = (unsigned int) 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(unsigned int) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(unsigned int) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(unsigned int) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(unsigned int) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(unsigned 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(unsigned int),
                                     little, !is_unsigned);
    }
}

/* CIntToPy */
                    static CYTHON_INLINE PyObject* __Pyx_PyInt_From_unsigned_long(unsigned long value) {
    const unsigned long neg_one = (unsigned long) -1, const_zero = (unsigned long) 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(unsigned long) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(unsigned long) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(unsigned long) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(unsigned long) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(unsigned 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(unsigned long),
                                     little, !is_unsigned);
    }
}

/* CIntToPy */
                    static CYTHON_INLINE PyObject* __Pyx_PyInt_From_Py_intptr_t(Py_intptr_t value) {
    const Py_intptr_t neg_one = (Py_intptr_t) -1, const_zero = (Py_intptr_t) 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(Py_intptr_t) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(Py_intptr_t) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#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);
    }
}

/* 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 = 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 = 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:
                        z = __Pyx_c_prod_float(a, a);
                        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;
                }
                r = a.real;
                theta = 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 = 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 = 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:
                        z = __Pyx_c_prod_double(a, a);
                        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;
                }
                r = a.real;
                theta = 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_int(int value) {
    const int neg_one = (int) -1, const_zero = (int) 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(int) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(int) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#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_enum__NPY_TYPES(enum NPY_TYPES value) {
    const enum NPY_TYPES neg_one = (enum NPY_TYPES) -1, const_zero = (enum NPY_TYPES) 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(enum NPY_TYPES) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(enum NPY_TYPES) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#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 unsigned int __Pyx_PyInt_As_unsigned_int(PyObject *x) {
    const unsigned int neg_one = (unsigned int) -1, const_zero = (unsigned int) 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(unsigned int) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(unsigned int, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (unsigned 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 (unsigned int) 0;
                case  1: __PYX_VERIFY_RETURN_INT(unsigned int, digit, digits[0])
                case 2:
                    if (8 * sizeof(unsigned int) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(unsigned int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(unsigned int) >= 2 * PyLong_SHIFT) {
                            return (unsigned int) (((((unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(unsigned int) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(unsigned int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(unsigned int) >= 3 * PyLong_SHIFT) {
                            return (unsigned int) (((((((unsigned int)digits[2]) << PyLong_SHIFT) | (unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(unsigned int) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(unsigned 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(unsigned int) >= 4 * PyLong_SHIFT) {
                            return (unsigned int) (((((((((unsigned int)digits[3]) << PyLong_SHIFT) | (unsigned int)digits[2]) << PyLong_SHIFT) | (unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned 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 (unsigned int) -1;
                if (unlikely(result == 1))
                    goto raise_neg_overflow;
            }
#endif
            if (sizeof(unsigned int) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT_EXC(unsigned int, unsigned long, PyLong_AsUnsignedLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(unsigned int) <= sizeof(unsigned PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(unsigned 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 (unsigned int) 0;
                case -1: __PYX_VERIFY_RETURN_INT(unsigned int, sdigit, (sdigit) (-(sdigit)digits[0]))
                case  1: __PYX_VERIFY_RETURN_INT(unsigned int,  digit, +digits[0])
                case -2:
                    if (8 * sizeof(unsigned int) - 1 > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(unsigned int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(unsigned int) - 1 > 2 * PyLong_SHIFT) {
                            return (unsigned int) (((unsigned int)-1)*(((((unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if (8 * sizeof(unsigned int) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(unsigned int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(unsigned int) - 1 > 2 * PyLong_SHIFT) {
                            return (unsigned int) ((((((unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if (8 * sizeof(unsigned int) - 1 > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(unsigned int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(unsigned int) - 1 > 3 * PyLong_SHIFT) {
                            return (unsigned int) (((unsigned int)-1)*(((((((unsigned int)digits[2]) << PyLong_SHIFT) | (unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(unsigned int) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(unsigned int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(unsigned int) - 1 > 3 * PyLong_SHIFT) {
                            return (unsigned int) ((((((((unsigned int)digits[2]) << PyLong_SHIFT) | (unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if (8 * sizeof(unsigned int) - 1 > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(unsigned 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(unsigned int) - 1 > 4 * PyLong_SHIFT) {
                            return (unsigned int) (((unsigned int)-1)*(((((((((unsigned int)digits[3]) << PyLong_SHIFT) | (unsigned int)digits[2]) << PyLong_SHIFT) | (unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(unsigned int) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(unsigned 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(unsigned int) - 1 > 4 * PyLong_SHIFT) {
                            return (unsigned int) ((((((((((unsigned int)digits[3]) << PyLong_SHIFT) | (unsigned int)digits[2]) << PyLong_SHIFT) | (unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0])));
                        }
                    }
                    break;
            }
#endif
            if (sizeof(unsigned int) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT_EXC(unsigned int, long, PyLong_AsLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(unsigned int) <= sizeof(PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(unsigned 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
            unsigned 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 (unsigned int) -1;
        }
    } else {
        unsigned int val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (unsigned int) -1;
        val = __Pyx_PyInt_As_unsigned_int(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to unsigned int");
    return (unsigned int) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to unsigned int");
    return (unsigned int) -1;
}

/* CIntFromPy */
                    static CYTHON_INLINE unsigned long __Pyx_PyInt_As_unsigned_long(PyObject *x) {
    const unsigned long neg_one = (unsigned long) -1, const_zero = (unsigned long) 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(unsigned long) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(unsigned long, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (unsigned 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 (unsigned long) 0;
                case  1: __PYX_VERIFY_RETURN_INT(unsigned long, digit, digits[0])
                case 2:
                    if (8 * sizeof(unsigned long) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(unsigned long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(unsigned long) >= 2 * PyLong_SHIFT) {
                            return (unsigned long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(unsigned long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(unsigned long) >= 3 * PyLong_SHIFT) {
                            return (unsigned long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(unsigned 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(unsigned long) >= 4 * PyLong_SHIFT) {
                            return (unsigned long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned 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 (unsigned long) -1;
                if (unlikely(result == 1))
                    goto raise_neg_overflow;
            }
#endif
            if (sizeof(unsigned long) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT_EXC(unsigned long, unsigned long, PyLong_AsUnsignedLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(unsigned long) <= sizeof(unsigned PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(unsigned 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 (unsigned long) 0;
                case -1: __PYX_VERIFY_RETURN_INT(unsigned long, sdigit, (sdigit) (-(sdigit)digits[0]))
                case  1: __PYX_VERIFY_RETURN_INT(unsigned long,  digit, +digits[0])
                case -2:
                    if (8 * sizeof(unsigned long) - 1 > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(unsigned long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(unsigned long) - 1 > 2 * PyLong_SHIFT) {
                            return (unsigned long) (((unsigned long)-1)*(((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if (8 * sizeof(unsigned long) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(unsigned long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(unsigned long) - 1 > 2 * PyLong_SHIFT) {
                            return (unsigned long) ((((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if (8 * sizeof(unsigned long) - 1 > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(unsigned long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(unsigned long) - 1 > 3 * PyLong_SHIFT) {
                            return (unsigned long) (((unsigned long)-1)*(((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(unsigned long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(unsigned long) - 1 > 3 * PyLong_SHIFT) {
                            return (unsigned long) ((((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if (8 * sizeof(unsigned long) - 1 > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(unsigned 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(unsigned long) - 1 > 4 * PyLong_SHIFT) {
                            return (unsigned long) (((unsigned long)-1)*(((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(unsigned 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(unsigned long) - 1 > 4 * PyLong_SHIFT) {
                            return (unsigned long) ((((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])));
                        }
                    }
                    break;
            }
#endif
            if (sizeof(unsigned long) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT_EXC(unsigned long, long, PyLong_AsLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(unsigned long) <= sizeof(PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(unsigned 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
            unsigned 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 (unsigned long) -1;
        }
    } else {
        unsigned long val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (unsigned long) -1;
        val = __Pyx_PyInt_As_unsigned_long(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to unsigned long");
    return (unsigned long) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to unsigned long");
    return (unsigned long) -1;
}

/* CIntFromPy */
                    static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
    const long neg_one = (long) -1, const_zero = (long) 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(long) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (long) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (long) 0;
                case  1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0])
                case 2:
                    if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (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;
}

/* CIntFromPy */
                    static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
    const int neg_one = (int) -1, const_zero = (int) 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(int) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (int) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (int) 0;
                case  1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0])
                case 2:
                    if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (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;
}

/* 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;
}

/* ModuleImport */
                    #ifndef __PYX_HAVE_RT_ImportModule
#define __PYX_HAVE_RT_ImportModule
static PyObject *__Pyx_ImportModule(const char *name) {
    PyObject *py_name = 0;
    PyObject *py_module = 0;
    py_name = __Pyx_PyIdentifier_FromString(name);
    if (!py_name)
        goto bad;
    py_module = PyImport_Import(py_name);
    Py_DECREF(py_name);
    return py_module;
bad:
    Py_XDECREF(py_name);
    return 0;
}
#endif

/* TypeImport */
                    #ifndef __PYX_HAVE_RT_ImportType
#define __PYX_HAVE_RT_ImportType
static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name,
    size_t size, int strict)
{
    PyObject *py_module = 0;
    PyObject *result = 0;
    PyObject *py_name = 0;
    char warning[200];
    Py_ssize_t basicsize;
#ifdef Py_LIMITED_API
    PyObject *py_basicsize;
#endif
    py_module = __Pyx_ImportModule(module_name);
    if (!py_module)
        goto bad;
    py_name = __Pyx_PyIdentifier_FromString(class_name);
    if (!py_name)
        goto bad;
    result = PyObject_GetAttr(py_module, py_name);
    Py_DECREF(py_name);
    py_name = 0;
    Py_DECREF(py_module);
    py_module = 0;
    if (!result)
        goto bad;
    if (!PyType_Check(result)) {
        PyErr_Format(PyExc_TypeError,
            "%.200s.%.200s is not a type object",
            module_name, class_name);
        goto bad;
    }
#ifndef Py_LIMITED_API
    basicsize = ((PyTypeObject *)result)->tp_basicsize;
#else
    py_basicsize = PyObject_GetAttrString(result, "__basicsize__");
    if (!py_basicsize)
        goto bad;
    basicsize = PyLong_AsSsize_t(py_basicsize);
    Py_DECREF(py_basicsize);
    py_basicsize = 0;
    if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
        goto bad;
#endif
    if (!strict && (size_t)basicsize > size) {
        PyOS_snprintf(warning, sizeof(warning),
            "%s.%s size changed, may indicate binary incompatibility. Expected %zd, got %zd",
            module_name, class_name, basicsize, size);
        if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad;
    }
    else if ((size_t)basicsize != size) {
        PyErr_Format(PyExc_ValueError,
            "%.200s.%.200s has the wrong size, try recompiling. Expected %zd, got %zd",
            module_name, class_name, basicsize, size);
        goto bad;
    }
    return (PyTypeObject *)result;
bad:
    Py_XDECREF(py_module);
    Py_XDECREF(result);
    return NULL;
}
#endif

/* 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;
        ++t;
    }
    return 0;
}

static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
    return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
}
static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) {
    Py_ssize_t ignore;
    return __Pyx_PyObject_AsStringAndSize(o, &ignore);
}
static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
#if CYTHON_COMPILING_IN_CPYTHON && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
    if (
#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
            __Pyx_sys_getdefaultencoding_not_ascii &&
#endif
            PyUnicode_Check(o)) {
#if PY_VERSION_HEX < 0x03030000
        char* defenc_c;
        PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
        if (!defenc) return NULL;
        defenc_c = PyBytes_AS_STRING(defenc);
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
        {
            char* end = defenc_c + PyBytes_GET_SIZE(defenc);
            char* c;
            for (c = defenc_c; c < end; c++) {
                if ((unsigned char) (*c) >= 128) {
                    PyUnicode_AsASCIIString(o);
                    return NULL;
                }
            }
        }
#endif
        *length = PyBytes_GET_SIZE(defenc);
        return defenc_c;
#else
        if (__Pyx_PyUnicode_READY(o) == -1) return NULL;
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
        if (PyUnicode_IS_ASCII(o)) {
            *length = PyUnicode_GET_LENGTH(o);
            return PyUnicode_AsUTF8(o);
        } else {
            PyUnicode_AsASCIIString(o);
            return NULL;
        }
#else
        return PyUnicode_AsUTF8AndSize(o, length);
#endif
#endif
    } else
#endif
#if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
    if (PyByteArray_Check(o)) {
        *length = PyByteArray_GET_SIZE(o);
        return PyByteArray_AS_STRING(o);
    } else
#endif
    {
        char* result;
        int r = PyBytes_AsStringAndSize(o, &result, length);
        if (unlikely(r < 0)) {
            return NULL;
        } else {
            return result;
        }
    }
}
static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
   int is_true = x == Py_True;
   if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
   else return PyObject_IsTrue(x);
}
static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
#if CYTHON_USE_TYPE_SLOTS
  PyNumberMethods *m;
#endif
  const char *name = NULL;
  PyObject *res = NULL;
#if PY_MAJOR_VERSION < 3
  if (PyInt_Check(x) || PyLong_Check(x))
#else
  if (PyLong_Check(x))
#endif
    return __Pyx_NewRef(x);
#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 = PyNumber_Int(x);
  }
  else if (m && m->nb_long) {
    name = "long";
    res = PyNumber_Long(x);
  }
  #else
  if (m && m->nb_int) {
    name = "int";
    res = PyNumber_Long(x);
  }
  #endif
#else
  res = PyNumber_Int(x);
#endif
  if (res) {
#if PY_MAJOR_VERSION < 3
    if (!PyInt_Check(res) && !PyLong_Check(res)) {
#else
    if (!PyLong_Check(res)) {
#endif
      PyErr_Format(PyExc_TypeError,
                   "__%.4s__ returned non-%.4s (type %.200s)",
                   name, name, Py_TYPE(res)->tp_name);
      Py_DECREF(res);
      return NULL;
    }
  }
  else if (!PyErr_Occurred()) {
    PyErr_SetString(PyExc_TypeError,
                    "an integer is required");
  }
  return res;
}
static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
  Py_ssize_t ival;
  PyObject *x;
#if PY_MAJOR_VERSION < 3
  if (likely(PyInt_CheckExact(b))) {
    if (sizeof(Py_ssize_t) >= sizeof(long))
        return PyInt_AS_LONG(b);
    else
        return PyInt_AsSsize_t(x);
  }
#endif
  if (likely(PyLong_CheckExact(b))) {
    #if CYTHON_USE_PYLONG_INTERNALS
    const digit* digits = ((PyLongObject*)b)->ob_digit;
    const Py_ssize_t size = Py_SIZE(b);
    if (likely(__Pyx_sst_abs(size) <= 1)) {
        ival = likely(size) ? digits[0] : 0;
        if (size == -1) ival = -ival;
        return ival;
    } else {
      switch (size) {
         case 2:
           if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
             return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (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_PyInt_FromSize_t(size_t ival) {
    return PyInt_FromSize_t(ival);
}


#endif /* Py_PYTHON_H */
