Generated by Cython 0.18 on Wed Mar 13 18:08:06 2013

Raw output: splitBBoxLUT.c

     1: #!/usr/bin/env python

      /* "splitBBoxLUT.pyx":1
     * #!/usr/bin/env python             # <<<<<<<<<<<<<<
     * # -*- coding: utf-8 -*-
     * #
     */
      __pyx_t_8 = PyDict_New(); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_8));
      if (PyObject_SetAttr(__pyx_m, __pyx_n_s____test__, ((PyObject *)__pyx_t_8)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;

     2: # -*- coding: utf-8 -*-

     3: #

     4: #    Project: Azimuthal integration

     5: #             https://forge.epn-campus.eu/projects/azimuthal

     6: #

     7: #    File: "$Id$"

     8: #

     9: #    Copyright (C) European Synchrotron Radiation Facility, Grenoble, France

     10: #

     11: #    Principal author:       Jérôme Kieffer (Jerome.Kieffer@ESRF.eu)

     12: #

     13: #    This program is free software: you can redistribute it and/or modify

     14: #    it under the terms of the GNU General Public License as published by

     15: #    the Free Software Foundation, either version 3 of the License, or

     16: #    (at your option) any later version.

     17: #

     18: #    This program is distributed in the hope that it will be useful,

     19: #    but WITHOUT ANY WARRANTY; without even the implied warranty of

     20: #    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the

     21: #    GNU General Public License for more details.

     22: #

     23: #    You should have received a copy of the GNU General Public License

     24: #    along with this program.  If not, see <http://www.gnu.org/licenses/>.

     25: #

     26:

     27: #

     28: import cython

     29: import os

      /* "splitBBoxLUT.pyx":29
     * #
     * import cython
     * import os             # <<<<<<<<<<<<<<
     * from cython.parallel import prange
     * from libc.string cimport memset
     */
      __pyx_t_1 = __Pyx_Import(((PyObject *)__pyx_n_s__os), 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      if (PyObject_SetAttr(__pyx_m, __pyx_n_s__os, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

     30: from cython.parallel import prange

     31: from libc.string cimport memset

     32: import numpy

      /* "splitBBoxLUT.pyx":32
     * from cython.parallel import prange
     * from libc.string cimport memset
     * import numpy             # <<<<<<<<<<<<<<
     * cimport numpy
     * from libc.math cimport fabs
     */
      __pyx_t_1 = __Pyx_Import(((PyObject *)__pyx_n_s__numpy), 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      if (PyObject_SetAttr(__pyx_m, __pyx_n_s__numpy, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

     33: cimport numpy

     34: from libc.math cimport fabs

     35: cdef struct lut_point:

    /* "splitBBoxLUT.pyx":35
     * cimport numpy
     * from libc.math cimport fabs
     * cdef struct lut_point:             # <<<<<<<<<<<<<<
     *     numpy.int32_t idx
     *     numpy.float32_t coef
     */
    struct __pyx_t_12splitBBoxLUT_lut_point {
      __pyx_t_5numpy_int32_t idx;
      __pyx_t_5numpy_float32_t coef;
    };

     36:     numpy.int32_t idx

     37:     numpy.float32_t coef

     38: try:

      /* "splitBBoxLUT.pyx":38
     *     numpy.int32_t idx
     *     numpy.float32_t coef
     * try:             # <<<<<<<<<<<<<<
     *     from fastcrc import crc32
     * except:
     */
      {
        __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4);
        __Pyx_XGOTREF(__pyx_t_2);
        __Pyx_XGOTREF(__pyx_t_3);
        __Pyx_XGOTREF(__pyx_t_4);
        /*try:*/ {

     39:     from fastcrc import crc32

          /* "splitBBoxLUT.pyx":39
     *     numpy.float32_t coef
     * try:
     *     from fastcrc import crc32             # <<<<<<<<<<<<<<
     * except:
     *     from zlib import crc32
     */
          __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L2_error;}
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_INCREF(((PyObject *)__pyx_n_s__crc32));
          PyList_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_n_s__crc32));
          __Pyx_GIVEREF(((PyObject *)__pyx_n_s__crc32));
          __pyx_t_5 = __Pyx_Import(((PyObject *)__pyx_n_s__fastcrc), ((PyObject *)__pyx_t_1), -1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L2_error;}
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
          __pyx_t_1 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__crc32);
          if (__pyx_t_1 == NULL) {
            if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseImportError(__pyx_n_s__crc32);
            if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L2_error;}
          }
          __Pyx_GOTREF(__pyx_t_1);
          if (PyObject_SetAttr(__pyx_m, __pyx_n_s__crc32, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L2_error;}
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        goto __pyx_L9_try_end;
        __pyx_L2_error:;
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

     40: except:

        /* "splitBBoxLUT.pyx":40
     * try:
     *     from fastcrc import crc32
     * except:             # <<<<<<<<<<<<<<
     *     from zlib import crc32
     * EPS32 = (1.0 + numpy.finfo(numpy.float32).eps)
     */
        /*except:*/ {
          __Pyx_AddTraceback("splitBBoxLUT", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_1, &__pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L4_except_error;}
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_GOTREF(__pyx_t_6);

     41:     from zlib import crc32

          /* "splitBBoxLUT.pyx":41
     *     from fastcrc import crc32
     * except:
     *     from zlib import crc32             # <<<<<<<<<<<<<<
     * EPS32 = (1.0 + numpy.finfo(numpy.float32).eps)
     *
     */
          __pyx_t_7 = PyList_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L4_except_error;}
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_INCREF(((PyObject *)__pyx_n_s__crc32));
          PyList_SET_ITEM(__pyx_t_7, 0, ((PyObject *)__pyx_n_s__crc32));
          __Pyx_GIVEREF(((PyObject *)__pyx_n_s__crc32));
          __pyx_t_8 = __Pyx_Import(((PyObject *)__pyx_n_s__zlib), ((PyObject *)__pyx_t_7), -1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L4_except_error;}
          __Pyx_GOTREF(__pyx_t_8);
          __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
          __pyx_t_7 = PyObject_GetAttr(__pyx_t_8, __pyx_n_s__crc32);
          if (__pyx_t_7 == NULL) {
            if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseImportError(__pyx_n_s__crc32);
            if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L4_except_error;}
          }
          __Pyx_GOTREF(__pyx_t_7);
          if (PyObject_SetAttr(__pyx_m, __pyx_n_s__crc32, __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L4_except_error;}
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          goto __pyx_L3_exception_handled;
        }
        __pyx_L4_except_error:;
        __Pyx_XGIVEREF(__pyx_t_2);
        __Pyx_XGIVEREF(__pyx_t_3);
        __Pyx_XGIVEREF(__pyx_t_4);
        __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
        goto __pyx_L1_error;
        __pyx_L3_exception_handled:;
        __Pyx_XGIVEREF(__pyx_t_2);
        __Pyx_XGIVEREF(__pyx_t_3);
        __Pyx_XGIVEREF(__pyx_t_4);
        __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
        __pyx_L9_try_end:;
      }

     42: EPS32 = (1.0 + numpy.finfo(numpy.float32).eps)

      /* "splitBBoxLUT.pyx":42
     * except:
     *     from zlib import crc32
     * EPS32 = (1.0 + numpy.finfo(numpy.float32).eps)             # <<<<<<<<<<<<<<
     *
     * @cython.cdivision(True)
     */
      __pyx_t_6 = PyFloat_FromDouble(1.0); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_5 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__finfo); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_8 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__float32); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_8);
      __Pyx_GIVEREF(__pyx_t_8);
      __pyx_t_8 = 0;
      __pyx_t_8 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
      __pyx_t_1 = PyObject_GetAttr(__pyx_t_8, __pyx_n_s__eps); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_8 = PyNumber_Add(__pyx_t_6, __pyx_t_1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (PyObject_SetAttr(__pyx_m, __pyx_n_s__EPS32, __pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

     43:

     44: @cython.cdivision(True)

     45: cdef float getBinNr( float x0, float pos0_min, float delta) nogil:

    /* "splitBBoxLUT.pyx":45
     *
     * @cython.cdivision(True)
     * cdef float getBinNr( float x0, float pos0_min, float delta) nogil:             # <<<<<<<<<<<<<<
     *     """
     *     calculate the bin number for any point
     */

    static float __pyx_f_12splitBBoxLUT_getBinNr(float __pyx_v_x0, float __pyx_v_pos0_min, float __pyx_v_delta) {
      float __pyx_r;

     46:     """

     47:     calculate the bin number for any point

     48:     param x0: current position

     49:     param pos0_min: position minimum

     50:     param delta: bin width

     51:     """

     52:     return (x0 - pos0_min) / delta

      /* "splitBBoxLUT.pyx":52
     *     param delta: bin width
     *     """
     *     return (x0 - pos0_min) / delta             # <<<<<<<<<<<<<<
     *
     * class HistoBBox1d(object):
     */
      __pyx_r = ((__pyx_v_x0 - __pyx_v_pos0_min) / __pyx_v_delta);
      goto __pyx_L0;

      __pyx_r = 0;
      __pyx_L0:;
      return __pyx_r;
    }

     53:

     54: class HistoBBox1d(object):

      /* "splitBBoxLUT.pyx":54
     *     return (x0 - pos0_min) / delta
     *
     * class HistoBBox1d(object):             # <<<<<<<<<<<<<<
     *     @cython.boundscheck(False)
     *     def __init__(self,
     */
      __pyx_t_8 = PyDict_New(); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_8));

      /* "splitBBoxLUT.pyx":54
     *     return (x0 - pos0_min) / delta
     *
     * class HistoBBox1d(object):             # <<<<<<<<<<<<<<
     *     @cython.boundscheck(False)
     *     def __init__(self,
     */
      __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_INCREF(__pyx_builtin_object);
      PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_builtin_object);
      __Pyx_GIVEREF(__pyx_builtin_object);
      __pyx_t_6 = __Pyx_CreateClass(((PyObject *)__pyx_t_1), ((PyObject *)__pyx_t_8), __pyx_n_s__HistoBBox1d, __pyx_n_s__HistoBBox1d, __pyx_n_s__splitBBoxLUT); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
      if (PyObject_SetAttr(__pyx_m, __pyx_n_s__HistoBBox1d, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;

     55:     @cython.boundscheck(False)

     56:     def __init__(self,

    /* "splitBBoxLUT.pyx":56
     * class HistoBBox1d(object):
     *     @cython.boundscheck(False)
     *     def __init__(self,             # <<<<<<<<<<<<<<
     *                  pos0,
     *                  delta_pos0,
     */

    static PyObject *__pyx_pf_12splitBBoxLUT_11HistoBBox1d_6__defaults__(CYTHON_UNUSED PyObject *__pyx_self) {
      PyObject *__pyx_r = NULL;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__defaults__", 0);
      __Pyx_XDECREF(__pyx_r);

      /* "splitBBoxLUT.pyx":56
     * class HistoBBox1d(object):
     *     @cython.boundscheck(False)
     *     def __init__(self,             # <<<<<<<<<<<<<<
     *                  pos0,
     *                  delta_pos0,
     */
      __pyx_t_2 = PyTuple_New(9); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(((PyObject *)Py_None));
      PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)Py_None));
      __Pyx_GIVEREF(((PyObject *)Py_None));
      __Pyx_INCREF(((PyObject *)Py_None));
      PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)Py_None));
      __Pyx_GIVEREF(((PyObject *)Py_None));
      PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_1);
      __Pyx_INCREF(((PyObject *)Py_None));
      PyTuple_SET_ITEM(__pyx_t_2, 3, ((PyObject *)Py_None));
      __Pyx_GIVEREF(((PyObject *)Py_None));
      __Pyx_INCREF(((PyObject *)Py_None));
      PyTuple_SET_ITEM(__pyx_t_2, 4, ((PyObject *)Py_None));
      __Pyx_GIVEREF(((PyObject *)Py_None));
      __Pyx_INCREF(((PyObject *)Py_None));
      PyTuple_SET_ITEM(__pyx_t_2, 5, ((PyObject *)Py_None));
      __Pyx_GIVEREF(((PyObject *)Py_None));
      __Pyx_INCREF(((PyObject *)Py_None));
      PyTuple_SET_ITEM(__pyx_t_2, 6, ((PyObject *)Py_None));
      __Pyx_GIVEREF(((PyObject *)Py_None));
      __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_allow_pos0_neg);
      PyTuple_SET_ITEM(__pyx_t_2, 7, __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_allow_pos0_neg);
      __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_allow_pos0_neg);
      __Pyx_INCREF(((PyObject *)((PyObject*)__pyx_n_s__undefined)));
      PyTuple_SET_ITEM(__pyx_t_2, 8, ((PyObject *)((PyObject*)__pyx_n_s__undefined)));
      __Pyx_GIVEREF(((PyObject *)((PyObject*)__pyx_n_s__undefined)));
      __pyx_t_1 = 0;
      __pyx_r = ((PyObject *)__pyx_t_2);
      __pyx_t_2 = 0;
      goto __pyx_L0;

      __pyx_r = Py_None; __Pyx_INCREF(Py_None);
      goto __pyx_L0;
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_AddTraceback("splitBBoxLUT.HistoBBox1d.__defaults__", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    /* Python wrapper */
    static PyObject *__pyx_pw_12splitBBoxLUT_11HistoBBox1d_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
    static PyMethodDef __pyx_mdef_12splitBBoxLUT_11HistoBBox1d_1__init__ = {__Pyx_NAMESTR("__init__"), (PyCFunction)__pyx_pw_12splitBBoxLUT_11HistoBBox1d_1__init__, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
    static PyObject *__pyx_pw_12splitBBoxLUT_11HistoBBox1d_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
      PyObject *__pyx_v_self = 0;
      PyObject *__pyx_v_pos0 = 0;
      PyObject *__pyx_v_delta_pos0 = 0;
      PyObject *__pyx_v_pos1 = 0;
      PyObject *__pyx_v_delta_pos1 = 0;
      int __pyx_v_bins;
      PyObject *__pyx_v_pos0Range = 0;
      PyObject *__pyx_v_pos1Range = 0;
      PyObject *__pyx_v_mask = 0;
      PyObject *__pyx_v_mask_checksum = 0;
      PyObject *__pyx_v_allow_pos0_neg = 0;
      PyObject *__pyx_v_unit = 0;
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
      {
        static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__self,&__pyx_n_s__pos0,&__pyx_n_s__delta_pos0,&__pyx_n_s__pos1,&__pyx_n_s__delta_pos1,&__pyx_n_s__bins,&__pyx_n_s__pos0Range,&__pyx_n_s__pos1Range,&__pyx_n_s__mask,&__pyx_n_s__mask_checksum,&__pyx_n_s__allow_pos0_neg,&__pyx_n_s__unit,0};
        PyObject* values[12] = {0,0,0,0,0,0,0,0,0,0,0,0};
        __pyx_defaults *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self);
        values[3] = ((PyObject *)((PyObject *)Py_None));
        values[4] = ((PyObject *)((PyObject *)Py_None));
        values[6] = ((PyObject *)((PyObject *)Py_None));
        values[7] = ((PyObject *)((PyObject *)Py_None));
        values[8] = ((PyObject *)((PyObject *)Py_None));
        values[9] = ((PyObject *)((PyObject *)Py_None));
        values[10] = __pyx_dynamic_args->__pyx_arg_allow_pos0_neg;
        values[11] = ((PyObject *)((PyObject*)__pyx_n_s__undefined));
        if (unlikely(__pyx_kwds)) {
          Py_ssize_t kw_args;
          const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
          switch (pos_args) {
            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__self)) != 0)) kw_args--;
            else goto __pyx_L5_argtuple_error;
            case  1:
            if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__pos0)) != 0)) kw_args--;
            else {
              __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 12, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
            }
            case  2:
            if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__delta_pos0)) != 0)) kw_args--;
            else {
              __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 12, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
            }
            case  3:
            if (kw_args > 0) {
              PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__pos1);
              if (value) { values[3] = value; kw_args--; }
            }
            case  4:
            if (kw_args > 0) {
              PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__delta_pos1);
              if (value) { values[4] = value; kw_args--; }
            }
            case  5:
            if (kw_args > 0) {
              PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__bins);
              if (value) { values[5] = value; kw_args--; }
            }
            case  6:
            if (kw_args > 0) {
              PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__pos0Range);
              if (value) { values[6] = value; kw_args--; }
            }
            case  7:
            if (kw_args > 0) {
              PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__pos1Range);
              if (value) { values[7] = value; kw_args--; }
            }
            case  8:
            if (kw_args > 0) {
              PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__mask);
              if (value) { values[8] = value; kw_args--; }
            }
            case  9:
            if (kw_args > 0) {
              PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__mask_checksum);
              if (value) { values[9] = value; kw_args--; }
            }
            case 10:
            if (kw_args > 0) {
              PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__allow_pos0_neg);
              if (value) { values[10] = value; kw_args--; }
            }
            case 11:
            if (kw_args > 0) {
              PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__unit);
              if (value) { values[11] = value; kw_args--; }
            }
          }
          if (unlikely(kw_args > 0)) {
            if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
          }
        } else {
          switch (PyTuple_GET_SIZE(__pyx_args)) {
            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);
            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_self = values[0];
        __pyx_v_pos0 = values[1];
        __pyx_v_delta_pos0 = values[2];
        __pyx_v_pos1 = values[3];
        __pyx_v_delta_pos1 = values[4];
        if (values[5]) {
          __pyx_v_bins = __Pyx_PyInt_AsInt(values[5]); if (unlikely((__pyx_v_bins == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        } else {
          __pyx_v_bins = ((int)((int)100));
        }
        __pyx_v_pos0Range = values[6];
        __pyx_v_pos1Range = values[7];
        __pyx_v_mask = values[8];
        __pyx_v_mask_checksum = values[9];
        __pyx_v_allow_pos0_neg = values[10];
        __pyx_v_unit = values[11];
      }
      goto __pyx_L4_argument_unpacking_done;
      __pyx_L5_argtuple_error:;
      __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 12, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      __pyx_L3_error:;
      __Pyx_AddTraceback("splitBBoxLUT.HistoBBox1d.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __Pyx_RefNannyFinishContext();
      return NULL;
      __pyx_L4_argument_unpacking_done:;
      __pyx_r = __pyx_pf_12splitBBoxLUT_11HistoBBox1d___init__(__pyx_self, __pyx_v_self, __pyx_v_pos0, __pyx_v_delta_pos0, __pyx_v_pos1, __pyx_v_delta_pos1, __pyx_v_bins, __pyx_v_pos0Range, __pyx_v_pos1Range, __pyx_v_mask, __pyx_v_mask_checksum, __pyx_v_allow_pos0_neg, __pyx_v_unit);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_12splitBBoxLUT_11HistoBBox1d___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_pos0, PyObject *__pyx_v_delta_pos0, PyObject *__pyx_v_pos1, PyObject *__pyx_v_delta_pos1, int __pyx_v_bins, PyObject *__pyx_v_pos0Range, PyObject *__pyx_v_pos1Range, PyObject *__pyx_v_mask, PyObject *__pyx_v_mask_checksum, PyObject *__pyx_v_allow_pos0_neg, PyObject *__pyx_v_unit) {
      PyObject *__pyx_v_pos0_maxin = NULL;
      PyObject *__pyx_v_pos1_maxin = NULL;
      PyObject *__pyx_r = NULL;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__init__", 0);

      /* "splitBBoxLUT.pyx":56
     * class HistoBBox1d(object):
     *     @cython.boundscheck(False)
     *     def __init__(self,             # <<<<<<<<<<<<<<
     *                  pos0,
     *                  delta_pos0,
     */
      __pyx_k_tuple_54 = PyTuple_Pack(16, ((PyObject *)__pyx_n_s__self), ((PyObject *)__pyx_n_s__pos0), ((PyObject *)__pyx_n_s__delta_pos0), ((PyObject *)__pyx_n_s__pos1), ((PyObject *)__pyx_n_s__delta_pos1), ((PyObject *)__pyx_n_s__bins), ((PyObject *)__pyx_n_s__pos0Range), ((PyObject *)__pyx_n_s__pos1Range), ((PyObject *)__pyx_n_s__mask), ((PyObject *)__pyx_n_s__mask_checksum), ((PyObject *)__pyx_n_s__allow_pos0_neg), ((PyObject *)__pyx_n_s__unit), ((PyObject *)__pyx_n_s__i), ((PyObject *)__pyx_n_s__size), ((PyObject *)__pyx_n_s__pos0_maxin), ((PyObject *)__pyx_n_s__pos1_maxin)); if (unlikely(!__pyx_k_tuple_54)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_k_tuple_54);
      __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_54));

      /* "splitBBoxLUT.pyx":56
     * class HistoBBox1d(object):
     *     @cython.boundscheck(False)
     *     def __init__(self,             # <<<<<<<<<<<<<<
     *                  pos0,
     *                  delta_pos0,
     */
      __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_12splitBBoxLUT_11HistoBBox1d_1__init__, 0, __pyx_n_s_57, NULL, __pyx_n_s__splitBBoxLUT, ((PyObject *)__pyx_k_codeobj_55)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      if (!__Pyx_CyFunction_InitDefaults(__pyx_t_1, sizeof(__pyx_defaults), 1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_k_codeobj_55 = (PyObject*)__Pyx_PyCode_New(12, 0, 16, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_54, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_56, __pyx_n_s____init__, 56, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_55)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

     57:                  pos0,

     58:                  delta_pos0,

     59:                  pos1=None,

     60:                  delta_pos1=None,

     61:                  int bins=100,

      /* "splitBBoxLUT.pyx":61
     *                  pos1=None,
     *                  delta_pos1=None,
     *                  int bins=100,             # <<<<<<<<<<<<<<
     *                  pos0Range=None,
     *                  pos1Range=None,
     */
      __pyx_t_1 = PyInt_FromLong(((int)100)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);

     62:                  pos0Range=None,

     63:                  pos1Range=None,

     64:                  mask=None,

     65:                  mask_checksum=None,

     66:                  allow_pos0_neg=False,

      /* "splitBBoxLUT.pyx":66
     *                  mask=None,
     *                  mask_checksum=None,
     *                  allow_pos0_neg=False,             # <<<<<<<<<<<<<<
     *                  unit="undefined"):
     *
     */
      __pyx_t_6 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_t_1)->__pyx_arg_allow_pos0_neg = __pyx_t_6;
      __Pyx_GIVEREF(__pyx_t_6);
      __pyx_t_6 = 0;
      __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_1, __pyx_pf_12splitBBoxLUT_11HistoBBox1d_6__defaults__);
      if (PyObject_SetItem(__pyx_t_8, __pyx_n_s____init__, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

     67:                  unit="undefined"):

     68:

     69:         cdef int i, size

     70:         self.size = pos0.size

      /* "splitBBoxLUT.pyx":70
     *
     *         cdef int i, size
     *         self.size = pos0.size             # <<<<<<<<<<<<<<
     *         assert delta_pos0.size == self.size
     *         self.bins = bins
     */
      __pyx_t_1 = PyObject_GetAttr(__pyx_v_pos0, __pyx_n_s__size); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__size, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

     71:         assert delta_pos0.size == self.size

      /* "splitBBoxLUT.pyx":71
     *         cdef int i, size
     *         self.size = pos0.size
     *         assert delta_pos0.size == self.size             # <<<<<<<<<<<<<<
     *         self.bins = bins
     *         self.lut_size = 0
     */
      #ifndef CYTHON_WITHOUT_ASSERTIONS
      __pyx_t_1 = PyObject_GetAttr(__pyx_v_delta_pos0, __pyx_n_s__size); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__size); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_4)) {
        PyErr_SetNone(PyExc_AssertionError);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      #endif

     72:         self.bins = bins

      /* "splitBBoxLUT.pyx":72
     *         self.size = pos0.size
     *         assert delta_pos0.size == self.size
     *         self.bins = bins             # <<<<<<<<<<<<<<
     *         self.lut_size = 0
     *         self.cpos0 = numpy.ascontiguousarray(pos0.ravel(), dtype=numpy.float32)
     */
      __pyx_t_3 = PyInt_FromLong(__pyx_v_bins); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__bins, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

     73:         self.lut_size = 0

      /* "splitBBoxLUT.pyx":73
     *         assert delta_pos0.size == self.size
     *         self.bins = bins
     *         self.lut_size = 0             # <<<<<<<<<<<<<<
     *         self.cpos0 = numpy.ascontiguousarray(pos0.ravel(), dtype=numpy.float32)
     *         self.dpos0 = numpy.ascontiguousarray(delta_pos0.ravel(), dtype=numpy.float32)
     */
      if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__lut_size, __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

     74:         self.cpos0 = numpy.ascontiguousarray(pos0.ravel(), dtype=numpy.float32)

      /* "splitBBoxLUT.pyx":74
     *         self.bins = bins
     *         self.lut_size = 0
     *         self.cpos0 = numpy.ascontiguousarray(pos0.ravel(), dtype=numpy.float32)             # <<<<<<<<<<<<<<
     *         self.dpos0 = numpy.ascontiguousarray(delta_pos0.ravel(), dtype=numpy.float32)
     *         self.cpos0_sup = self.cpos0 + self.dpos0
     */
      __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_2 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__ascontiguousarray); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = PyObject_GetAttr(__pyx_v_pos0, __pyx_n_s__ravel); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_1 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_1));
      __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__float32); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__dtype), __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_3), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
      if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__cpos0, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

     75:         self.dpos0 = numpy.ascontiguousarray(delta_pos0.ravel(), dtype=numpy.float32)

      /* "splitBBoxLUT.pyx":75
     *         self.lut_size = 0
     *         self.cpos0 = numpy.ascontiguousarray(pos0.ravel(), dtype=numpy.float32)
     *         self.dpos0 = numpy.ascontiguousarray(delta_pos0.ravel(), dtype=numpy.float32)             # <<<<<<<<<<<<<<
     *         self.cpos0_sup = self.cpos0 + self.dpos0
     *         self.cpos0_inf = self.cpos0 - self.dpos0
     */
      __pyx_t_6 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_1 = PyObject_GetAttr(__pyx_t_6, __pyx_n_s__ascontiguousarray); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = PyObject_GetAttr(__pyx_v_delta_pos0, __pyx_n_s__ravel); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_3 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      __pyx_t_3 = 0;
      __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_3));
      __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_5 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__float32); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__dtype), __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_6), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
      if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__dpos0, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

     76:         self.cpos0_sup = self.cpos0 + self.dpos0

      /* "splitBBoxLUT.pyx":76
     *         self.cpos0 = numpy.ascontiguousarray(pos0.ravel(), dtype=numpy.float32)
     *         self.dpos0 = numpy.ascontiguousarray(delta_pos0.ravel(), dtype=numpy.float32)
     *         self.cpos0_sup = self.cpos0 + self.dpos0             # <<<<<<<<<<<<<<
     *         self.cpos0_inf = self.cpos0 - self.dpos0
     *         self.pos0Range = pos0Range
     */
      __pyx_t_5 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__cpos0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__dpos0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__cpos0_sup, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

     77:         self.cpos0_inf = self.cpos0 - self.dpos0

      /* "splitBBoxLUT.pyx":77
     *         self.dpos0 = numpy.ascontiguousarray(delta_pos0.ravel(), dtype=numpy.float32)
     *         self.cpos0_sup = self.cpos0 + self.dpos0
     *         self.cpos0_inf = self.cpos0 - self.dpos0             # <<<<<<<<<<<<<<
     *         self.pos0Range = pos0Range
     *         self.pos1Range = pos1Range
     */
      __pyx_t_6 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__cpos0); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__dpos0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_5 = PyNumber_Subtract(__pyx_t_6, __pyx_t_3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__cpos0_inf, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

     78:         self.pos0Range = pos0Range

      /* "splitBBoxLUT.pyx":78
     *         self.cpos0_sup = self.cpos0 + self.dpos0
     *         self.cpos0_inf = self.cpos0 - self.dpos0
     *         self.pos0Range = pos0Range             # <<<<<<<<<<<<<<
     *         self.pos1Range = pos1Range
     *         if pos0Range is not None and len(pos0Range) > 1:
     */
      if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__pos0Range, __pyx_v_pos0Range) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

     79:         self.pos1Range = pos1Range

      /* "splitBBoxLUT.pyx":79
     *         self.cpos0_inf = self.cpos0 - self.dpos0
     *         self.pos0Range = pos0Range
     *         self.pos1Range = pos1Range             # <<<<<<<<<<<<<<
     *         if pos0Range is not None and len(pos0Range) > 1:
     *             self.pos0_min = min(pos0Range)
     */
      if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__pos1Range, __pyx_v_pos1Range) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

     80:         if pos0Range is not None and len(pos0Range) > 1:

      /* "splitBBoxLUT.pyx":80
     *         self.pos0Range = pos0Range
     *         self.pos1Range = pos1Range
     *         if pos0Range is not None and len(pos0Range) > 1:             # <<<<<<<<<<<<<<
     *             self.pos0_min = min(pos0Range)
     *             pos0_maxin = max(pos0Range)
     */
      __pyx_t_4 = (__pyx_v_pos0Range != Py_None);
      if (__pyx_t_4) {
        __pyx_t_7 = PyObject_Length(__pyx_v_pos0Range); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_t_8 = (__pyx_t_7 > 1);
        __pyx_t_9 = __pyx_t_8;
      } else {
        __pyx_t_9 = __pyx_t_4;
      }
      if (__pyx_t_9) {

     81:             self.pos0_min = min(pos0Range)

        /* "splitBBoxLUT.pyx":81
     *         self.pos1Range = pos1Range
     *         if pos0Range is not None and len(pos0Range) > 1:
     *             self.pos0_min = min(pos0Range)             # <<<<<<<<<<<<<<
     *             pos0_maxin = max(pos0Range)
     *         else:
     */
        __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_INCREF(__pyx_v_pos0Range);
        PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_pos0Range);
        __Pyx_GIVEREF(__pyx_v_pos0Range);
        __pyx_t_3 = PyObject_Call(__pyx_builtin_min, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
        if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__pos0_min, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

     82:             pos0_maxin = max(pos0Range)

        /* "splitBBoxLUT.pyx":82
     *         if pos0Range is not None and len(pos0Range) > 1:
     *             self.pos0_min = min(pos0Range)
     *             pos0_maxin = max(pos0Range)             # <<<<<<<<<<<<<<
     *         else:
     *             self.pos0_min = (self.cpos0_inf).min()
     */
        __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_INCREF(__pyx_v_pos0Range);
        PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_pos0Range);
        __Pyx_GIVEREF(__pyx_v_pos0Range);
        __pyx_t_5 = PyObject_Call(__pyx_builtin_max, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
        __pyx_v_pos0_maxin = __pyx_t_5;
        __pyx_t_5 = 0;
        goto __pyx_L3;
      }
      /*else*/ {

     83:         else:

     84:             self.pos0_min = (self.cpos0_inf).min()

        /* "splitBBoxLUT.pyx":84
     *             pos0_maxin = max(pos0Range)
     *         else:
     *             self.pos0_min = (self.cpos0_inf).min()             # <<<<<<<<<<<<<<
     *             pos0_maxin = (self.cpos0_sup).max()
     *         if (not allow_pos0_neg) and self.pos0_min < 0:
     */
        __pyx_t_5 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__cpos0_inf); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_3 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__min); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__pos0_min, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

     85:             pos0_maxin = (self.cpos0_sup).max()

        /* "splitBBoxLUT.pyx":85
     *         else:
     *             self.pos0_min = (self.cpos0_inf).min()
     *             pos0_maxin = (self.cpos0_sup).max()             # <<<<<<<<<<<<<<
     *         if (not allow_pos0_neg) and self.pos0_min < 0:
     *             self.pos0_min = 0
     */
        __pyx_t_5 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__cpos0_sup); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_3 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__max); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_v_pos0_maxin = __pyx_t_5;
        __pyx_t_5 = 0;
      }
      __pyx_L3:;

     86:         if (not allow_pos0_neg) and self.pos0_min < 0:

      /* "splitBBoxLUT.pyx":86
     *             self.pos0_min = (self.cpos0_inf).min()
     *             pos0_maxin = (self.cpos0_sup).max()
     *         if (not allow_pos0_neg) and self.pos0_min < 0:             # <<<<<<<<<<<<<<
     *             self.pos0_min = 0
     *         self.pos0_max = pos0_maxin * EPS32
     */
      __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_v_allow_pos0_neg); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_4 = (!__pyx_t_9);
      if (__pyx_t_4) {
        __pyx_t_5 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__pos0_min); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_3 = PyObject_RichCompare(__pyx_t_5, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_8 = __pyx_t_9;
      } else {
        __pyx_t_8 = __pyx_t_4;
      }
      if (__pyx_t_8) {

     87:             self.pos0_min = 0

        /* "splitBBoxLUT.pyx":87
     *             pos0_maxin = (self.cpos0_sup).max()
     *         if (not allow_pos0_neg) and self.pos0_min < 0:
     *             self.pos0_min = 0             # <<<<<<<<<<<<<<
     *         self.pos0_max = pos0_maxin * EPS32
     *
     */
        if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__pos0_min, __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        goto __pyx_L4;
      }
      __pyx_L4:;

     88:         self.pos0_max = pos0_maxin * EPS32

      /* "splitBBoxLUT.pyx":88
     *         if (not allow_pos0_neg) and self.pos0_min < 0:
     *             self.pos0_min = 0
     *         self.pos0_max = pos0_maxin * EPS32             # <<<<<<<<<<<<<<
     *
     *         if pos1Range is not None and len(pos1Range) > 1:
     */
      __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__EPS32); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_5 = PyNumber_Multiply(__pyx_v_pos0_maxin, __pyx_t_3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__pos0_max, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

     89:

     90:         if pos1Range is not None and len(pos1Range) > 1:

      /* "splitBBoxLUT.pyx":90
     *         self.pos0_max = pos0_maxin * EPS32
     *
     *         if pos1Range is not None and len(pos1Range) > 1:             # <<<<<<<<<<<<<<
     *             assert pos1.size == self.size
     *             assert delta_pos1.size == self.size
     */
      __pyx_t_8 = (__pyx_v_pos1Range != Py_None);
      if (__pyx_t_8) {
        __pyx_t_7 = PyObject_Length(__pyx_v_pos1Range); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_t_4 = (__pyx_t_7 > 1);
        __pyx_t_9 = __pyx_t_4;
      } else {
        __pyx_t_9 = __pyx_t_8;
      }
      if (__pyx_t_9) {

     91:             assert pos1.size == self.size

        /* "splitBBoxLUT.pyx":91
     *
     *         if pos1Range is not None and len(pos1Range) > 1:
     *             assert pos1.size == self.size             # <<<<<<<<<<<<<<
     *             assert delta_pos1.size == self.size
     *             self.check_pos1 = True
     */
        #ifndef CYTHON_WITHOUT_ASSERTIONS
        __pyx_t_5 = PyObject_GetAttr(__pyx_v_pos1, __pyx_n_s__size); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__size); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_6 = PyObject_RichCompare(__pyx_t_5, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (unlikely(!__pyx_t_9)) {
          PyErr_SetNone(PyExc_AssertionError);
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        #endif

     92:             assert delta_pos1.size == self.size

        /* "splitBBoxLUT.pyx":92
     *         if pos1Range is not None and len(pos1Range) > 1:
     *             assert pos1.size == self.size
     *             assert delta_pos1.size == self.size             # <<<<<<<<<<<<<<
     *             self.check_pos1 = True
     *             self.cpos1_min = numpy.ascontiguousarray((pos1-delta_pos1).ravel(), dtype=numpy.float32)
     */
        #ifndef CYTHON_WITHOUT_ASSERTIONS
        __pyx_t_6 = PyObject_GetAttr(__pyx_v_delta_pos1, __pyx_n_s__size); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__size); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_5 = PyObject_RichCompare(__pyx_t_6, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (unlikely(!__pyx_t_9)) {
          PyErr_SetNone(PyExc_AssertionError);
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        #endif

     93:             self.check_pos1 = True

        /* "splitBBoxLUT.pyx":93
     *             assert pos1.size == self.size
     *             assert delta_pos1.size == self.size
     *             self.check_pos1 = True             # <<<<<<<<<<<<<<
     *             self.cpos1_min = numpy.ascontiguousarray((pos1-delta_pos1).ravel(), dtype=numpy.float32)
     *             self.cpos1_max = numpy.ascontiguousarray((pos1+delta_pos1).ravel(), dtype=numpy.float32)
     */
        __pyx_t_5 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__check_pos1, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

     94:             self.cpos1_min = numpy.ascontiguousarray((pos1-delta_pos1).ravel(), dtype=numpy.float32)

        /* "splitBBoxLUT.pyx":94
     *             assert delta_pos1.size == self.size
     *             self.check_pos1 = True
     *             self.cpos1_min = numpy.ascontiguousarray((pos1-delta_pos1).ravel(), dtype=numpy.float32)             # <<<<<<<<<<<<<<
     *             self.cpos1_max = numpy.ascontiguousarray((pos1+delta_pos1).ravel(), dtype=numpy.float32)
     *             self.pos1_min = min(pos1Range)
     */
        __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_3 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__ascontiguousarray); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = PyNumber_Subtract(__pyx_v_pos1, __pyx_v_delta_pos1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_6 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__ravel); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_6);
        PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5);
        __Pyx_GIVEREF(__pyx_t_5);
        __pyx_t_5 = 0;
        __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(((PyObject *)__pyx_t_5));
        __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__float32); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        if (PyDict_SetItem(__pyx_t_5, ((PyObject *)__pyx_n_s__dtype), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_6), ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
        __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
        if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__cpos1_min, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

     95:             self.cpos1_max = numpy.ascontiguousarray((pos1+delta_pos1).ravel(), dtype=numpy.float32)

        /* "splitBBoxLUT.pyx":95
     *             self.check_pos1 = True
     *             self.cpos1_min = numpy.ascontiguousarray((pos1-delta_pos1).ravel(), dtype=numpy.float32)
     *             self.cpos1_max = numpy.ascontiguousarray((pos1+delta_pos1).ravel(), dtype=numpy.float32)             # <<<<<<<<<<<<<<
     *             self.pos1_min = min(pos1Range)
     *             pos1_maxin = max(pos1Range)
     */
        __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_5 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__ascontiguousarray); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_t_2 = PyNumber_Add(__pyx_v_pos1, __pyx_v_delta_pos1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_6 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__ravel); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_t_2 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_6);
        PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2);
        __Pyx_GIVEREF(__pyx_t_2);
        __pyx_t_2 = 0;
        __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(((PyObject *)__pyx_t_2));
        __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_1 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__float32); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__dtype), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_t_1 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_6), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
        __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
        if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__cpos1_max, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

     96:             self.pos1_min = min(pos1Range)

        /* "splitBBoxLUT.pyx":96
     *             self.cpos1_min = numpy.ascontiguousarray((pos1-delta_pos1).ravel(), dtype=numpy.float32)
     *             self.cpos1_max = numpy.ascontiguousarray((pos1+delta_pos1).ravel(), dtype=numpy.float32)
     *             self.pos1_min = min(pos1Range)             # <<<<<<<<<<<<<<
     *             pos1_maxin = max(pos1Range)
     *             self.pos1_max = pos1_maxin * EPS32
     */
        __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_INCREF(__pyx_v_pos1Range);
        PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_pos1Range);
        __Pyx_GIVEREF(__pyx_v_pos1Range);
        __pyx_t_2 = PyObject_Call(__pyx_builtin_min, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
        if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__pos1_min, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

     97:             pos1_maxin = max(pos1Range)

        /* "splitBBoxLUT.pyx":97
     *             self.cpos1_max = numpy.ascontiguousarray((pos1+delta_pos1).ravel(), dtype=numpy.float32)
     *             self.pos1_min = min(pos1Range)
     *             pos1_maxin = max(pos1Range)             # <<<<<<<<<<<<<<
     *             self.pos1_max = pos1_maxin * EPS32
     *         else:
     */
        __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_INCREF(__pyx_v_pos1Range);
        PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_pos1Range);
        __Pyx_GIVEREF(__pyx_v_pos1Range);
        __pyx_t_1 = PyObject_Call(__pyx_builtin_max, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
        __pyx_v_pos1_maxin = __pyx_t_1;
        __pyx_t_1 = 0;

     98:             self.pos1_max = pos1_maxin * EPS32

        /* "splitBBoxLUT.pyx":98
     *             self.pos1_min = min(pos1Range)
     *             pos1_maxin = max(pos1Range)
     *             self.pos1_max = pos1_maxin * EPS32             # <<<<<<<<<<<<<<
     *         else:
     *             self.check_pos1 = False
     */
        __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__EPS32); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_2 = PyNumber_Multiply(__pyx_v_pos1_maxin, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__pos1_max, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        goto __pyx_L5;
      }
      /*else*/ {

     99:         else:

     100:             self.check_pos1 = False

        /* "splitBBoxLUT.pyx":100
     *             self.pos1_max = pos1_maxin * EPS32
     *         else:
     *             self.check_pos1 = False             # <<<<<<<<<<<<<<
     *             self.cpos1_min = None
     *             self.pos1_max = None
     */
        __pyx_t_2 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__check_pos1, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

     101:             self.cpos1_min = None

        /* "splitBBoxLUT.pyx":101
     *         else:
     *             self.check_pos1 = False
     *             self.cpos1_min = None             # <<<<<<<<<<<<<<
     *             self.pos1_max = None
     *
     */
        if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__cpos1_min, Py_None) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

     102:             self.pos1_max = None

        /* "splitBBoxLUT.pyx":102
     *             self.check_pos1 = False
     *             self.cpos1_min = None
     *             self.pos1_max = None             # <<<<<<<<<<<<<<
     *
     *         if  mask is not None:
     */
        if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__pos1_max, Py_None) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_L5:;

     103:

     104:         if  mask is not None:

      /* "splitBBoxLUT.pyx":104
     *             self.pos1_max = None
     *
     *         if  mask is not None:             # <<<<<<<<<<<<<<
     *             assert mask.size == self.size
     *             self.check_mask = True
     */
      __pyx_t_9 = (__pyx_v_mask != Py_None);
      if (__pyx_t_9) {

     105:             assert mask.size == self.size

        /* "splitBBoxLUT.pyx":105
     *
     *         if  mask is not None:
     *             assert mask.size == self.size             # <<<<<<<<<<<<<<
     *             self.check_mask = True
     *             self.cmask = numpy.ascontiguousarray(mask.ravel(), dtype=numpy.int8)
     */
        #ifndef CYTHON_WITHOUT_ASSERTIONS
        __pyx_t_2 = PyObject_GetAttr(__pyx_v_mask, __pyx_n_s__size); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__size); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_6 = PyObject_RichCompare(__pyx_t_2, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (unlikely(!__pyx_t_9)) {
          PyErr_SetNone(PyExc_AssertionError);
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        #endif

     106:             self.check_mask = True

        /* "splitBBoxLUT.pyx":106
     *         if  mask is not None:
     *             assert mask.size == self.size
     *             self.check_mask = True             # <<<<<<<<<<<<<<
     *             self.cmask = numpy.ascontiguousarray(mask.ravel(), dtype=numpy.int8)
     *             if mask_checksum:
     */
        __pyx_t_6 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_6);
        if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__check_mask, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

     107:             self.cmask = numpy.ascontiguousarray(mask.ravel(), dtype=numpy.int8)

        /* "splitBBoxLUT.pyx":107
     *             assert mask.size == self.size
     *             self.check_mask = True
     *             self.cmask = numpy.ascontiguousarray(mask.ravel(), dtype=numpy.int8)             # <<<<<<<<<<<<<<
     *             if mask_checksum:
     *                 self.mask_checksum = mask_checksum
     */
        __pyx_t_6 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_1 = PyObject_GetAttr(__pyx_t_6, __pyx_n_s__ascontiguousarray); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_6 = PyObject_GetAttr(__pyx_v_mask, __pyx_n_s__ravel); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_2 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_6);
        PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2);
        __Pyx_GIVEREF(__pyx_t_2);
        __pyx_t_2 = 0;
        __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(((PyObject *)__pyx_t_2));
        __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_3 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__int8); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__dtype), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_6), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
        __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
        if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__cmask, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

     108:             if mask_checksum:

        /* "splitBBoxLUT.pyx":108
     *             self.check_mask = True
     *             self.cmask = numpy.ascontiguousarray(mask.ravel(), dtype=numpy.int8)
     *             if mask_checksum:             # <<<<<<<<<<<<<<
     *                 self.mask_checksum = mask_checksum
     *             else:
     */
        __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_v_mask_checksum); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        if (__pyx_t_9) {

     109:                 self.mask_checksum = mask_checksum

          /* "splitBBoxLUT.pyx":109
     *             self.cmask = numpy.ascontiguousarray(mask.ravel(), dtype=numpy.int8)
     *             if mask_checksum:
     *                 self.mask_checksum = mask_checksum             # <<<<<<<<<<<<<<
     *             else:
     *                 self.mask_checksum = crc32(mask)
     */
          if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__mask_checksum, __pyx_v_mask_checksum) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          goto __pyx_L7;
        }
        /*else*/ {

     110:             else:

     111:                 self.mask_checksum = crc32(mask)

          /* "splitBBoxLUT.pyx":111
     *                 self.mask_checksum = mask_checksum
     *             else:
     *                 self.mask_checksum = crc32(mask)             # <<<<<<<<<<<<<<
     *         else:
     *             self.check_mask = False
     */
          __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__crc32); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_3);
          __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_INCREF(__pyx_v_mask);
          PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_mask);
          __Pyx_GIVEREF(__pyx_v_mask);
          __pyx_t_6 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
          if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__mask_checksum, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        }
        __pyx_L7:;
        goto __pyx_L6;
      }
      /*else*/ {

     112:         else:

     113:             self.check_mask = False

        /* "splitBBoxLUT.pyx":113
     *                 self.mask_checksum = crc32(mask)
     *         else:
     *             self.check_mask = False             # <<<<<<<<<<<<<<
     *             self.mask_checksum = None
     *         self.delta = (self.pos0_max - self.pos0_min) / bins
     */
        __pyx_t_6 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_6);
        if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__check_mask, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

     114:             self.mask_checksum = None

        /* "splitBBoxLUT.pyx":114
     *         else:
     *             self.check_mask = False
     *             self.mask_checksum = None             # <<<<<<<<<<<<<<
     *         self.delta = (self.pos0_max - self.pos0_min) / bins
     *         self.lut_max_idx = self.calc_lut()
     */
        if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__mask_checksum, Py_None) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_L6:;

     115:         self.delta = (self.pos0_max - self.pos0_min) / bins

      /* "splitBBoxLUT.pyx":115
     *             self.check_mask = False
     *             self.mask_checksum = None
     *         self.delta = (self.pos0_max - self.pos0_min) / bins             # <<<<<<<<<<<<<<
     *         self.lut_max_idx = self.calc_lut()
     *         self.outPos = numpy.linspace(self.pos0_min+0.5*self.delta, pos0_maxin-0.5*self.delta, self.bins)
     */
      __pyx_t_6 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__pos0_max); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__pos0_min); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = PyNumber_Subtract(__pyx_t_6, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = PyInt_FromLong(__pyx_v_bins); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_6 = __Pyx_PyNumber_Divide(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__delta, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

     116:         self.lut_max_idx = self.calc_lut()

      /* "splitBBoxLUT.pyx":116
     *             self.mask_checksum = None
     *         self.delta = (self.pos0_max - self.pos0_min) / bins
     *         self.lut_max_idx = self.calc_lut()             # <<<<<<<<<<<<<<
     *         self.outPos = numpy.linspace(self.pos0_min+0.5*self.delta, pos0_maxin-0.5*self.delta, self.bins)
     *         self.lut_checksum = crc32(self.lut)
     */
      __pyx_t_6 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__calc_lut); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_2 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__lut_max_idx, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

     117:         self.outPos = numpy.linspace(self.pos0_min+0.5*self.delta, pos0_maxin-0.5*self.delta, self.bins)

      /* "splitBBoxLUT.pyx":117
     *         self.delta = (self.pos0_max - self.pos0_min) / bins
     *         self.lut_max_idx = self.calc_lut()
     *         self.outPos = numpy.linspace(self.pos0_min+0.5*self.delta, pos0_maxin-0.5*self.delta, self.bins)             # <<<<<<<<<<<<<<
     *         self.lut_checksum = crc32(self.lut)
     *         self.unit=unit
     */
      __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_6 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__linspace); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__pos0_min); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = PyFloat_FromDouble(0.5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__delta); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_5 = PyNumber_Multiply(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyNumber_Add(__pyx_t_2, __pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = PyFloat_FromDouble(0.5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__delta); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = PyNumber_Multiply(__pyx_t_5, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = PyNumber_Subtract(__pyx_v_pos0_maxin, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__bins); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      __pyx_t_1 = 0;
      __pyx_t_2 = 0;
      __pyx_t_3 = 0;
      __pyx_t_3 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
      if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__outPos, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

     118:         self.lut_checksum = crc32(self.lut)

      /* "splitBBoxLUT.pyx":118
     *         self.lut_max_idx = self.calc_lut()
     *         self.outPos = numpy.linspace(self.pos0_min+0.5*self.delta, pos0_maxin-0.5*self.delta, self.bins)
     *         self.lut_checksum = crc32(self.lut)             # <<<<<<<<<<<<<<
     *         self.unit=unit
     *
     */
      __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__crc32); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_5 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__lut); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_5);
      __pyx_t_5 = 0;
      __pyx_t_5 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
      if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__lut_checksum, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

     119:         self.unit=unit

      /* "splitBBoxLUT.pyx":119
     *         self.outPos = numpy.linspace(self.pos0_min+0.5*self.delta, pos0_maxin-0.5*self.delta, self.bins)
     *         self.lut_checksum = crc32(self.lut)
     *         self.unit=unit             # <<<<<<<<<<<<<<
     *
     *     @cython.cdivision(True)
     */
      if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__unit, __pyx_v_unit) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

      __pyx_r = Py_None; __Pyx_INCREF(Py_None);
      goto __pyx_L0;
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_6);
      __Pyx_AddTraceback("splitBBoxLUT.HistoBBox1d.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __Pyx_XDECREF(__pyx_v_pos0_maxin);
      __Pyx_XDECREF(__pyx_v_pos1_maxin);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    /* Python wrapper */
    static PyObject *__pyx_pw_12splitBBoxLUT_11HistoBBox1d_3calc_lut(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
    static char __pyx_doc_12splitBBoxLUT_11HistoBBox1d_2calc_lut[] = "calculate the max number of elements in the LUT and populate it";
    static PyMethodDef __pyx_mdef_12splitBBoxLUT_11HistoBBox1d_3calc_lut = {__Pyx_NAMESTR("calc_lut"), (PyCFunction)__pyx_pw_12splitBBoxLUT_11HistoBBox1d_3calc_lut, METH_O, __Pyx_DOCSTR(__pyx_doc_12splitBBoxLUT_11HistoBBox1d_2calc_lut)};
    static PyObject *__pyx_pw_12splitBBoxLUT_11HistoBBox1d_3calc_lut(PyObject *__pyx_self, PyObject *__pyx_v_self) {
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("calc_lut (wrapper)", 0);
      __pyx_r = __pyx_pf_12splitBBoxLUT_11HistoBBox1d_2calc_lut(__pyx_self, ((PyObject *)__pyx_v_self));
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

     120:

     121:     @cython.cdivision(True)

     122:     @cython.boundscheck(False)

     123:     @cython.wraparound(False)

     124:     def calc_lut(self):

    /* "splitBBoxLUT.pyx":124
     *     @cython.boundscheck(False)
     *     @cython.wraparound(False)
     *     def calc_lut(self):             # <<<<<<<<<<<<<<
     *         'calculate the max number of elements in the LUT and populate it'
     *         cdef float delta=self.delta, pos0_min=self.pos0_min, pos1_min, pos1_max, min0, max0, fbin0_min, fbin0_max, deltaL, deltaR, deltaA
     */

    static PyObject *__pyx_pf_12splitBBoxLUT_11HistoBBox1d_2calc_lut(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
      float __pyx_v_delta;
      float __pyx_v_pos0_min;
      float __pyx_v_pos1_min;
      float __pyx_v_pos1_max;
      float __pyx_v_min0;
      float __pyx_v_max0;
      float __pyx_v_fbin0_min;
      float __pyx_v_fbin0_max;
      float __pyx_v_deltaL;
      float __pyx_v_deltaR;
      float __pyx_v_deltaA;
      int __pyx_v_bin0_min;
      int __pyx_v_bin0_max;
      int __pyx_v_bins;
      int __pyx_v_lut_size;
      int __pyx_v_i;
      int __pyx_v_size;
      __pyx_t_5numpy_int32_t __pyx_v_k;
      __pyx_t_5numpy_int32_t __pyx_v_idx;
      int __pyx_v_check_mask;
      int __pyx_v_check_pos1;
      PyArrayObject *__pyx_v_outMax = 0;
      __Pyx_memviewslice __pyx_v_cpos0_sup = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_cpos0_inf = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_cpos1_min = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_cpos1_max = { 0, 0, { 0 }, { 0 }, { 0 } };
      PyArrayObject *__pyx_v_lut = 0;
      __Pyx_memviewslice __pyx_v_cmask = { 0, 0, { 0 }, { 0 }, { 0 } };
      size_t __pyx_v_lut_nbytes;
      PyObject *__pyx_v_memsize = NULL;
      __Pyx_LocalBuf_ND __pyx_pybuffernd_lut;
      __Pyx_Buffer __pyx_pybuffer_lut;
      __Pyx_LocalBuf_ND __pyx_pybuffernd_outMax;
      __Pyx_Buffer __pyx_pybuffer_outMax;
      PyObject *__pyx_r = NULL;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("calc_lut", 0);
      __pyx_pybuffer_outMax.pybuffer.buf = NULL;
      __pyx_pybuffer_outMax.refcount = 0;
      __pyx_pybuffernd_outMax.data = NULL;
      __pyx_pybuffernd_outMax.rcbuffer = &__pyx_pybuffer_outMax;
      __pyx_pybuffer_lut.pybuffer.buf = NULL;
      __pyx_pybuffer_lut.refcount = 0;
      __pyx_pybuffernd_lut.data = NULL;
      __pyx_pybuffernd_lut.rcbuffer = &__pyx_pybuffer_lut;

      /* "splitBBoxLUT.pyx":124
     *     @cython.boundscheck(False)
     *     @cython.wraparound(False)
     *     def calc_lut(self):             # <<<<<<<<<<<<<<
     *         'calculate the max number of elements in the LUT and populate it'
     *         cdef float delta=self.delta, pos0_min=self.pos0_min, pos1_min, pos1_max, min0, max0, fbin0_min, fbin0_max, deltaL, deltaR, deltaA
     */
      __pyx_k_tuple_58 = PyTuple_Pack(31, ((PyObject *)__pyx_n_s__self), ((PyObject *)__pyx_n_s__delta), ((PyObject *)__pyx_n_s__pos0_min), ((PyObject *)__pyx_n_s__pos1_min), ((PyObject *)__pyx_n_s__pos1_max), ((PyObject *)__pyx_n_s__min0), ((PyObject *)__pyx_n_s__max0), ((PyObject *)__pyx_n_s__fbin0_min), ((PyObject *)__pyx_n_s__fbin0_max), ((PyObject *)__pyx_n_s__deltaL), ((PyObject *)__pyx_n_s__deltaR), ((PyObject *)__pyx_n_s__deltaA), ((PyObject *)__pyx_n_s__bin0_min), ((PyObject *)__pyx_n_s__bin0_max), ((PyObject *)__pyx_n_s__bins), ((PyObject *)__pyx_n_s__lut_size), ((PyObject *)__pyx_n_s__i), ((PyObject *)__pyx_n_s__size), ((PyObject *)__pyx_n_s__k), ((PyObject *)__pyx_n_s__idx), ((PyObject *)__pyx_n_s__check_mask), ((PyObject *)__pyx_n_s__check_pos1), ((PyObject *)__pyx_n_s__outMax), ((PyObject *)__pyx_n_s__cpos0_sup), ((PyObject *)__pyx_n_s__cpos0_inf), ((PyObject *)__pyx_n_s__cpos1_min), ((PyObject *)__pyx_n_s__cpos1_max), ((PyObject *)__pyx_n_s__lut), ((PyObject *)__pyx_n_s__cmask), ((PyObject *)__pyx_n_s__lut_nbytes), ((PyObject *)__pyx_n_s__memsize)); if (unlikely(!__pyx_k_tuple_58)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_k_tuple_58);
      __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_58));

      /* "splitBBoxLUT.pyx":124
     *     @cython.boundscheck(False)
     *     @cython.wraparound(False)
     *     def calc_lut(self):             # <<<<<<<<<<<<<<
     *         'calculate the max number of elements in the LUT and populate it'
     *         cdef float delta=self.delta, pos0_min=self.pos0_min, pos1_min, pos1_max, min0, max0, fbin0_min, fbin0_max, deltaL, deltaR, deltaA
     */
      __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_12splitBBoxLUT_11HistoBBox1d_3calc_lut, 0, __pyx_n_s_60, NULL, __pyx_n_s__splitBBoxLUT, ((PyObject *)__pyx_k_codeobj_59)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      if (PyObject_SetItem(__pyx_t_8, __pyx_n_s__calc_lut, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_k_codeobj_59 = (PyObject*)__Pyx_PyCode_New(1, 0, 31, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_58, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_56, __pyx_n_s__calc_lut, 124, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_59)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

     125:         'calculate the max number of elements in the LUT and populate it'

     126:         cdef float delta=self.delta, pos0_min=self.pos0_min, pos1_min, pos1_max, min0, max0, fbin0_min, fbin0_max, deltaL, deltaR, deltaA

      /* "splitBBoxLUT.pyx":126
     *     def calc_lut(self):
     *         'calculate the max number of elements in the LUT and populate it'
     *         cdef float delta=self.delta, pos0_min=self.pos0_min, pos1_min, pos1_max, min0, max0, fbin0_min, fbin0_max, deltaL, deltaR, deltaA             # <<<<<<<<<<<<<<
     *         cdef int bin0_min, bin0_max, bins = self.bins, lut_size, i, size
     *         cdef numpy.int32_t k,idx #same as numpy.int32
     */
      __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__delta); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_2 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v_delta = __pyx_t_2;
      __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__pos0_min); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_2 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v_pos0_min = __pyx_t_2;

     127:         cdef int bin0_min, bin0_max, bins = self.bins, lut_size, i, size

      /* "splitBBoxLUT.pyx":127
     *         'calculate the max number of elements in the LUT and populate it'
     *         cdef float delta=self.delta, pos0_min=self.pos0_min, pos1_min, pos1_max, min0, max0, fbin0_min, fbin0_max, deltaL, deltaR, deltaA
     *         cdef int bin0_min, bin0_max, bins = self.bins, lut_size, i, size             # <<<<<<<<<<<<<<
     *         cdef numpy.int32_t k,idx #same as numpy.int32
     *         cdef bint check_mask, check_pos1
     */
      __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__bins); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = __Pyx_PyInt_AsInt(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v_bins = __pyx_t_3;

     128:         cdef numpy.int32_t k,idx #same as numpy.int32

     129:         cdef bint check_mask, check_pos1

     130:         cdef numpy.ndarray[numpy.int32_t, ndim = 1] outMax = numpy.zeros(bins, dtype=numpy.int32)

      /* "splitBBoxLUT.pyx":130
     *         cdef numpy.int32_t k,idx #same as numpy.int32
     *         cdef bint check_mask, check_pos1
     *         cdef numpy.ndarray[numpy.int32_t, ndim = 1] outMax = numpy.zeros(bins, dtype=numpy.int32)             # <<<<<<<<<<<<<<
     *         cdef float[:] cpos0_sup = self.cpos0_sup
     *         cdef float[:] cpos0_inf = self.cpos0_inf
     */
      __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_4 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__zeros); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyInt_FromLong(__pyx_v_bins); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_1));
      __pyx_t_6 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = PyObject_GetAttr(__pyx_t_6, __pyx_n_s__int32); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__dtype), __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_5), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
      if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_8 = ((PyArrayObject *)__pyx_t_7);
      {
        __Pyx_BufFmt_StackElem __pyx_stack[1];
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_outMax.rcbuffer->pybuffer, (PyObject*)__pyx_t_8, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
          __pyx_v_outMax = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_outMax.rcbuffer->pybuffer.buf = NULL;
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        } else {__pyx_pybuffernd_outMax.diminfo[0].strides = __pyx_pybuffernd_outMax.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_outMax.diminfo[0].shape = __pyx_pybuffernd_outMax.rcbuffer->pybuffer.shape[0];
        }
      }
      __pyx_t_8 = 0;
      __pyx_v_outMax = ((PyArrayObject *)__pyx_t_7);
      __pyx_t_7 = 0;

     131:         cdef float[:] cpos0_sup = self.cpos0_sup

      /* "splitBBoxLUT.pyx":131
     *         cdef bint check_mask, check_pos1
     *         cdef numpy.ndarray[numpy.int32_t, ndim = 1] outMax = numpy.zeros(bins, dtype=numpy.int32)
     *         cdef float[:] cpos0_sup = self.cpos0_sup             # <<<<<<<<<<<<<<
     *         cdef float[:] cpos0_inf = self.cpos0_inf
     *         cdef float[:] cpos1_min, cpos1_max
     */
      __pyx_t_7 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__cpos0_sup); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_9 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(__pyx_t_7);
      if (unlikely(!__pyx_t_9.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_v_cpos0_sup = __pyx_t_9;
      __pyx_t_9.memview = NULL;
      __pyx_t_9.data = NULL;

     132:         cdef float[:] cpos0_inf = self.cpos0_inf

      /* "splitBBoxLUT.pyx":132
     *         cdef numpy.ndarray[numpy.int32_t, ndim = 1] outMax = numpy.zeros(bins, dtype=numpy.int32)
     *         cdef float[:] cpos0_sup = self.cpos0_sup
     *         cdef float[:] cpos0_inf = self.cpos0_inf             # <<<<<<<<<<<<<<
     *         cdef float[:] cpos1_min, cpos1_max
     *         cdef numpy.ndarray[lut_point, ndim = 2] lut
     */
      __pyx_t_7 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__cpos0_inf); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_10 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(__pyx_t_7);
      if (unlikely(!__pyx_t_10.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_v_cpos0_inf = __pyx_t_10;
      __pyx_t_10.memview = NULL;
      __pyx_t_10.data = NULL;

     133:         cdef float[:] cpos1_min, cpos1_max

     134:         cdef numpy.ndarray[lut_point, ndim = 2] lut

     135:         cdef numpy.int8_t[:] cmask

     136:         size = self.size

      /* "splitBBoxLUT.pyx":136
     *         cdef numpy.ndarray[lut_point, ndim = 2] lut
     *         cdef numpy.int8_t[:] cmask
     *         size = self.size             # <<<<<<<<<<<<<<
     *         if self.check_mask:
     *             cmask = self.cmask
     */
      __pyx_t_7 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__size); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_3 = __Pyx_PyInt_AsInt(__pyx_t_7); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_v_size = __pyx_t_3;

     137:         if self.check_mask:

      /* "splitBBoxLUT.pyx":137
     *         cdef numpy.int8_t[:] cmask
     *         size = self.size
     *         if self.check_mask:             # <<<<<<<<<<<<<<
     *             cmask = self.cmask
     *             check_mask = True
     */
      __pyx_t_7 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__check_mask); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (__pyx_t_11) {

     138:             cmask = self.cmask

        /* "splitBBoxLUT.pyx":138
     *         size = self.size
     *         if self.check_mask:
     *             cmask = self.cmask             # <<<<<<<<<<<<<<
     *             check_mask = True
     *         else:
     */
        __pyx_t_7 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__cmask); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int8_t(__pyx_t_7);
        if (unlikely(!__pyx_t_12.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_v_cmask = __pyx_t_12;
        __pyx_t_12.memview = NULL;
        __pyx_t_12.data = NULL;

     139:             check_mask = True

        /* "splitBBoxLUT.pyx":139
     *         if self.check_mask:
     *             cmask = self.cmask
     *             check_mask = True             # <<<<<<<<<<<<<<
     *         else:
     *             check_mask = False
     */
        __pyx_v_check_mask = 1;
        goto __pyx_L3;
      }
      /*else*/ {

     140:         else:

     141:             check_mask = False

        /* "splitBBoxLUT.pyx":141
     *             check_mask = True
     *         else:
     *             check_mask = False             # <<<<<<<<<<<<<<
     *
     *         if self.check_pos1:
     */
        __pyx_v_check_mask = 0;
      }
      __pyx_L3:;

     142:

     143:         if self.check_pos1:

      /* "splitBBoxLUT.pyx":143
     *             check_mask = False
     *
     *         if self.check_pos1:             # <<<<<<<<<<<<<<
     *             check_pos1 = True
     *             cpos1_min = self.cpos1_min
     */
      __pyx_t_7 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__check_pos1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (__pyx_t_11) {

     144:             check_pos1 = True

        /* "splitBBoxLUT.pyx":144
     *
     *         if self.check_pos1:
     *             check_pos1 = True             # <<<<<<<<<<<<<<
     *             cpos1_min = self.cpos1_min
     *             cpos1_max = self.cpos1_max
     */
        __pyx_v_check_pos1 = 1;

     145:             cpos1_min = self.cpos1_min

        /* "splitBBoxLUT.pyx":145
     *         if self.check_pos1:
     *             check_pos1 = True
     *             cpos1_min = self.cpos1_min             # <<<<<<<<<<<<<<
     *             cpos1_max = self.cpos1_max
     *             pos1_max = self.pos1_max
     */
        __pyx_t_7 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__cpos1_min); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_13 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(__pyx_t_7);
        if (unlikely(!__pyx_t_13.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_v_cpos1_min = __pyx_t_13;
        __pyx_t_13.memview = NULL;
        __pyx_t_13.data = NULL;

     146:             cpos1_max = self.cpos1_max

        /* "splitBBoxLUT.pyx":146
     *             check_pos1 = True
     *             cpos1_min = self.cpos1_min
     *             cpos1_max = self.cpos1_max             # <<<<<<<<<<<<<<
     *             pos1_max = self.pos1_max
     *             pos1_min = self.pos1_min
     */
        __pyx_t_7 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__cpos1_max); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_13 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(__pyx_t_7);
        if (unlikely(!__pyx_t_13.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_v_cpos1_max = __pyx_t_13;
        __pyx_t_13.memview = NULL;
        __pyx_t_13.data = NULL;

     147:             pos1_max = self.pos1_max

        /* "splitBBoxLUT.pyx":147
     *             cpos1_min = self.cpos1_min
     *             cpos1_max = self.cpos1_max
     *             pos1_max = self.pos1_max             # <<<<<<<<<<<<<<
     *             pos1_min = self.pos1_min
     *         else:
     */
        __pyx_t_7 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__pos1_max); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_2 = __pyx_PyFloat_AsFloat(__pyx_t_7); if (unlikely((__pyx_t_2 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_v_pos1_max = __pyx_t_2;

     148:             pos1_min = self.pos1_min

        /* "splitBBoxLUT.pyx":148
     *             cpos1_max = self.cpos1_max
     *             pos1_max = self.pos1_max
     *             pos1_min = self.pos1_min             # <<<<<<<<<<<<<<
     *         else:
     *             check_pos1 = False
     */
        __pyx_t_7 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__pos1_min); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_2 = __pyx_PyFloat_AsFloat(__pyx_t_7); if (unlikely((__pyx_t_2 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_v_pos1_min = __pyx_t_2;
        goto __pyx_L4;
      }
      /*else*/ {

     149:         else:

     150:             check_pos1 = False

        /* "splitBBoxLUT.pyx":150
     *             pos1_min = self.pos1_min
     *         else:
     *             check_pos1 = False             # <<<<<<<<<<<<<<
     * #NOGIL
     *         with nogil:
     */
        __pyx_v_check_pos1 = 0;
      }
      __pyx_L4:;

     151: #NOGIL

     152:         with nogil:

      /* "splitBBoxLUT.pyx":152
     *             check_pos1 = False
     * #NOGIL
     *         with nogil:             # <<<<<<<<<<<<<<
     *             for idx in range(size):
     *                 if (check_mask) and (cmask[idx]):
     */
      {
          #ifdef WITH_THREAD
          PyThreadState *_save = NULL;
          #endif
          Py_UNBLOCK_THREADS
          /*try:*/ {

          /* "splitBBoxLUT.pyx":152
     *             check_pos1 = False
     * #NOGIL
     *         with nogil:             # <<<<<<<<<<<<<<
     *             for idx in range(size):
     *                 if (check_mask) and (cmask[idx]):
     */
          /*finally:*/ {
            int __pyx_why;
            __pyx_why = 0; goto __pyx_L7;
            __pyx_L6: __pyx_why = 4; goto __pyx_L7;
            __pyx_L7:;
            Py_BLOCK_THREADS
            switch (__pyx_why) {
              case 4: goto __pyx_L1_error;
            }
          }
      }

     153:             for idx in range(size):

            /* "splitBBoxLUT.pyx":153
     * #NOGIL
     *         with nogil:
     *             for idx in range(size):             # <<<<<<<<<<<<<<
     *                 if (check_mask) and (cmask[idx]):
     *                     continue
     */
            __pyx_t_3 = __pyx_v_size;
            for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_3; __pyx_t_14+=1) {
              __pyx_v_idx = __pyx_t_14;

     154:                 if (check_mask) and (cmask[idx]):

              /* "splitBBoxLUT.pyx":154
     *         with nogil:
     *             for idx in range(size):
     *                 if (check_mask) and (cmask[idx]):             # <<<<<<<<<<<<<<
     *                     continue
     *
     */
              __pyx_t_11 = __pyx_v_check_mask;
              if (__pyx_t_11) {
                if (unlikely(!__pyx_v_cmask.memview)) { __Pyx_RaiseUnboundMemoryviewSliceNogil("cmask"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L6;} }
                __pyx_t_15 = __pyx_v_idx;
                __pyx_t_16 = (*((__pyx_t_5numpy_int8_t *) ( /* dim=0 */ (__pyx_v_cmask.data + __pyx_t_15 * __pyx_v_cmask.strides[0]) )));
              } else {
                __pyx_t_16 = __pyx_t_11;
              }
              if (__pyx_t_16) {

     155:                     continue

                /* "splitBBoxLUT.pyx":155
     *             for idx in range(size):
     *                 if (check_mask) and (cmask[idx]):
     *                     continue             # <<<<<<<<<<<<<<
     *
     *                 min0 = cpos0_inf[idx]
     */
                goto __pyx_L8_continue;
                goto __pyx_L10;
              }
              __pyx_L10:;

     156:

     157:                 min0 = cpos0_inf[idx]

              /* "splitBBoxLUT.pyx":157
     *                     continue
     *
     *                 min0 = cpos0_inf[idx]             # <<<<<<<<<<<<<<
     *                 max0 = cpos0_sup[idx]
     *
     */
              __pyx_t_17 = __pyx_v_idx;
              __pyx_v_min0 = (*((float *) ( /* dim=0 */ (__pyx_v_cpos0_inf.data + __pyx_t_17 * __pyx_v_cpos0_inf.strides[0]) )));

     158:                 max0 = cpos0_sup[idx]

              /* "splitBBoxLUT.pyx":158
     *
     *                 min0 = cpos0_inf[idx]
     *                 max0 = cpos0_sup[idx]             # <<<<<<<<<<<<<<
     *
     *                 if check_pos1 and ((cpos1_max[idx] < pos1_min) or (cpos1_min[idx] > pos1_max)):
     */
              __pyx_t_18 = __pyx_v_idx;
              __pyx_v_max0 = (*((float *) ( /* dim=0 */ (__pyx_v_cpos0_sup.data + __pyx_t_18 * __pyx_v_cpos0_sup.strides[0]) )));

     159:

     160:                 if check_pos1 and ((cpos1_max[idx] < pos1_min) or (cpos1_min[idx] > pos1_max)):

              /* "splitBBoxLUT.pyx":160
     *                 max0 = cpos0_sup[idx]
     *
     *                 if check_pos1 and ((cpos1_max[idx] < pos1_min) or (cpos1_min[idx] > pos1_max)):             # <<<<<<<<<<<<<<
     *                     continue
     *
     */
              if (__pyx_v_check_pos1) {
                if (unlikely(!__pyx_v_cpos1_max.memview)) { __Pyx_RaiseUnboundMemoryviewSliceNogil("cpos1_max"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L6;} }
                __pyx_t_19 = __pyx_v_idx;
                __pyx_t_16 = ((*((float *) ( /* dim=0 */ (__pyx_v_cpos1_max.data + __pyx_t_19 * __pyx_v_cpos1_max.strides[0]) ))) < __pyx_v_pos1_min);
                if (!__pyx_t_16) {
                  if (unlikely(!__pyx_v_cpos1_min.memview)) { __Pyx_RaiseUnboundMemoryviewSliceNogil("cpos1_min"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L6;} }
                  __pyx_t_20 = __pyx_v_idx;
                  __pyx_t_11 = ((*((float *) ( /* dim=0 */ (__pyx_v_cpos1_min.data + __pyx_t_20 * __pyx_v_cpos1_min.strides[0]) ))) > __pyx_v_pos1_max);
                  __pyx_t_21 = __pyx_t_11;
                } else {
                  __pyx_t_21 = __pyx_t_16;
                }
                __pyx_t_16 = __pyx_t_21;
              } else {
                __pyx_t_16 = __pyx_v_check_pos1;
              }
              if (__pyx_t_16) {

     161:                     continue

                /* "splitBBoxLUT.pyx":161
     *
     *                 if check_pos1 and ((cpos1_max[idx] < pos1_min) or (cpos1_min[idx] > pos1_max)):
     *                     continue             # <<<<<<<<<<<<<<
     *
     *                 fbin0_min = getBinNr(min0, pos0_min, delta)
     */
                goto __pyx_L8_continue;
                goto __pyx_L11;
              }
              __pyx_L11:;

     162:

     163:                 fbin0_min = getBinNr(min0, pos0_min, delta)

              /* "splitBBoxLUT.pyx":163
     *                     continue
     *
     *                 fbin0_min = getBinNr(min0, pos0_min, delta)             # <<<<<<<<<<<<<<
     *                 fbin0_max = getBinNr(max0, pos0_min, delta)
     *                 bin0_min = < int > fbin0_min
     */
              __pyx_v_fbin0_min = __pyx_f_12splitBBoxLUT_getBinNr(__pyx_v_min0, __pyx_v_pos0_min, __pyx_v_delta);

     164:                 fbin0_max = getBinNr(max0, pos0_min, delta)

              /* "splitBBoxLUT.pyx":164
     *
     *                 fbin0_min = getBinNr(min0, pos0_min, delta)
     *                 fbin0_max = getBinNr(max0, pos0_min, delta)             # <<<<<<<<<<<<<<
     *                 bin0_min = < int > fbin0_min
     *                 bin0_max = < int > fbin0_max
     */
              __pyx_v_fbin0_max = __pyx_f_12splitBBoxLUT_getBinNr(__pyx_v_max0, __pyx_v_pos0_min, __pyx_v_delta);

     165:                 bin0_min = < int > fbin0_min

              /* "splitBBoxLUT.pyx":165
     *                 fbin0_min = getBinNr(min0, pos0_min, delta)
     *                 fbin0_max = getBinNr(max0, pos0_min, delta)
     *                 bin0_min = < int > fbin0_min             # <<<<<<<<<<<<<<
     *                 bin0_max = < int > fbin0_max
     *
     */
              __pyx_v_bin0_min = ((int)__pyx_v_fbin0_min);

     166:                 bin0_max = < int > fbin0_max

              /* "splitBBoxLUT.pyx":166
     *                 fbin0_max = getBinNr(max0, pos0_min, delta)
     *                 bin0_min = < int > fbin0_min
     *                 bin0_max = < int > fbin0_max             # <<<<<<<<<<<<<<
     *
     *                 if (bin0_max < 0) or (bin0_min >= bins):
     */
              __pyx_v_bin0_max = ((int)__pyx_v_fbin0_max);

     167:

     168:                 if (bin0_max < 0) or (bin0_min >= bins):

              /* "splitBBoxLUT.pyx":168
     *                 bin0_max = < int > fbin0_max
     *
     *                 if (bin0_max < 0) or (bin0_min >= bins):             # <<<<<<<<<<<<<<
     *                     continue
     *                 if bin0_max >= bins :
     */
              __pyx_t_16 = (__pyx_v_bin0_max < 0);
              if (!__pyx_t_16) {
                __pyx_t_21 = (__pyx_v_bin0_min >= __pyx_v_bins);
                __pyx_t_11 = __pyx_t_21;
              } else {
                __pyx_t_11 = __pyx_t_16;
              }
              if (__pyx_t_11) {

     169:                     continue

                /* "splitBBoxLUT.pyx":169
     *
     *                 if (bin0_max < 0) or (bin0_min >= bins):
     *                     continue             # <<<<<<<<<<<<<<
     *                 if bin0_max >= bins :
     *                     bin0_max = bins - 1
     */
                goto __pyx_L8_continue;
                goto __pyx_L12;
              }
              __pyx_L12:;

     170:                 if bin0_max >= bins :

              /* "splitBBoxLUT.pyx":170
     *                 if (bin0_max < 0) or (bin0_min >= bins):
     *                     continue
     *                 if bin0_max >= bins :             # <<<<<<<<<<<<<<
     *                     bin0_max = bins - 1
     *                 if  bin0_min < 0:
     */
              __pyx_t_11 = (__pyx_v_bin0_max >= __pyx_v_bins);
              if (__pyx_t_11) {

     171:                     bin0_max = bins - 1

                /* "splitBBoxLUT.pyx":171
     *                     continue
     *                 if bin0_max >= bins :
     *                     bin0_max = bins - 1             # <<<<<<<<<<<<<<
     *                 if  bin0_min < 0:
     *                     bin0_min = 0
     */
                __pyx_v_bin0_max = (__pyx_v_bins - 1);
                goto __pyx_L13;
              }
              __pyx_L13:;

     172:                 if  bin0_min < 0:

              /* "splitBBoxLUT.pyx":172
     *                 if bin0_max >= bins :
     *                     bin0_max = bins - 1
     *                 if  bin0_min < 0:             # <<<<<<<<<<<<<<
     *                     bin0_min = 0
     *
     */
              __pyx_t_11 = (__pyx_v_bin0_min < 0);
              if (__pyx_t_11) {

     173:                     bin0_min = 0

                /* "splitBBoxLUT.pyx":173
     *                     bin0_max = bins - 1
     *                 if  bin0_min < 0:
     *                     bin0_min = 0             # <<<<<<<<<<<<<<
     *
     *                 if bin0_min == bin0_max:
     */
                __pyx_v_bin0_min = 0;
                goto __pyx_L14;
              }
              __pyx_L14:;

     174:

     175:                 if bin0_min == bin0_max:

              /* "splitBBoxLUT.pyx":175
     *                     bin0_min = 0
     *
     *                 if bin0_min == bin0_max:             # <<<<<<<<<<<<<<
     *                     #All pixel is within a single bin
     *                     outMax[bin0_min] += 1
     */
              __pyx_t_11 = (__pyx_v_bin0_min == __pyx_v_bin0_max);
              if (__pyx_t_11) {

     176:                     #All pixel is within a single bin

     177:                     outMax[bin0_min] += 1

                /* "splitBBoxLUT.pyx":177
     *                 if bin0_min == bin0_max:
     *                     #All pixel is within a single bin
     *                     outMax[bin0_min] += 1             # <<<<<<<<<<<<<<
     *
     *                 else: #we have pixel spliting.
     */
                __pyx_t_22 = __pyx_v_bin0_min;
                *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_outMax.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_outMax.diminfo[0].strides) += 1;
                goto __pyx_L15;
              }
              /*else*/ {

     178:

     179:                 else: #we have pixel spliting.

     180:                     for i in range(bin0_min, bin0_max + 1):

                /* "splitBBoxLUT.pyx":180
     *
     *                 else: #we have pixel spliting.
     *                     for i in range(bin0_min, bin0_max + 1):             # <<<<<<<<<<<<<<
     *                         outMax[i] += 1
     *
     */
                __pyx_t_23 = (__pyx_v_bin0_max + 1);
                for (__pyx_t_24 = __pyx_v_bin0_min; __pyx_t_24 < __pyx_t_23; __pyx_t_24+=1) {
                  __pyx_v_i = __pyx_t_24;

     181:                         outMax[i] += 1

                  /* "splitBBoxLUT.pyx":181
     *                 else: #we have pixel spliting.
     *                     for i in range(bin0_min, bin0_max + 1):
     *                         outMax[i] += 1             # <<<<<<<<<<<<<<
     *
     *         lut_size = outMax.max()
     */
                  __pyx_t_25 = __pyx_v_i;
                  *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_outMax.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_outMax.diminfo[0].strides) += 1;
                }
              }
              __pyx_L15:;
              __pyx_L8_continue:;
            }
          }

     182:

     183:         lut_size = outMax.max()

      /* "splitBBoxLUT.pyx":183
     *                         outMax[i] += 1
     *
     *         lut_size = outMax.max()             # <<<<<<<<<<<<<<
     *         #just recycle the outMax array
     *         #outMax = numpy.zeros((bins0,bins1), dtype=numpy.int32)
     */
      __pyx_t_7 = PyObject_GetAttr(((PyObject *)__pyx_v_outMax), __pyx_n_s__max); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_1 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_3 = __Pyx_PyInt_AsInt(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v_lut_size = __pyx_t_3;

     184:         #just recycle the outMax array

     185:         #outMax = numpy.zeros((bins0,bins1), dtype=numpy.int32)

     186:         memset(&outMax[0], 0, bins * sizeof(numpy.int32_t))

      /* "splitBBoxLUT.pyx":186
     *         #just recycle the outMax array
     *         #outMax = numpy.zeros((bins0,bins1), dtype=numpy.int32)
     *         memset(&outMax[0], 0, bins * sizeof(numpy.int32_t))             # <<<<<<<<<<<<<<
     *
     *         self.lut_size = lut_size
     */
      __pyx_t_23 = 0;
      memset((&(*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_outMax.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_outMax.diminfo[0].strides))), 0, (__pyx_v_bins * (sizeof(__pyx_t_5numpy_int32_t))));

     187:

     188:         self.lut_size = lut_size

      /* "splitBBoxLUT.pyx":188
     *         memset(&outMax[0], 0, bins * sizeof(numpy.int32_t))
     *
     *         self.lut_size = lut_size             # <<<<<<<<<<<<<<
     *
     *         lut_nbytes = bins*lut_size*sizeof(lut_point)
     */
      __pyx_t_1 = PyInt_FromLong(__pyx_v_lut_size); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__lut_size, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

     189:

     190:         lut_nbytes = bins*lut_size*sizeof(lut_point)

      /* "splitBBoxLUT.pyx":190
     *         self.lut_size = lut_size
     *
     *         lut_nbytes = bins*lut_size*sizeof(lut_point)             # <<<<<<<<<<<<<<
     *         if (os.name == "posix") and ("SC_PAGE_SIZE" in os.sysconf_names) and ("SC_PHYS_PAGES" in os.sysconf_names):
     *             memsize =  os.sysconf("SC_PAGE_SIZE")*os.sysconf("SC_PHYS_PAGES")
     */
      __pyx_v_lut_nbytes = ((__pyx_v_bins * __pyx_v_lut_size) * (sizeof(struct __pyx_t_12splitBBoxLUT_lut_point)));

     191:         if (os.name == "posix") and ("SC_PAGE_SIZE" in os.sysconf_names) and ("SC_PHYS_PAGES" in os.sysconf_names):

      /* "splitBBoxLUT.pyx":191
     *
     *         lut_nbytes = bins*lut_size*sizeof(lut_point)
     *         if (os.name == "posix") and ("SC_PAGE_SIZE" in os.sysconf_names) and ("SC_PHYS_PAGES" in os.sysconf_names):             # <<<<<<<<<<<<<<
     *             memsize =  os.sysconf("SC_PAGE_SIZE")*os.sysconf("SC_PHYS_PAGES")
     *             if memsize <  lut_nbytes:
     */
      __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__os); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_7 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__name); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyObject_RichCompare(__pyx_t_7, ((PyObject *)__pyx_n_s__posix), Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (__pyx_t_11) {
        __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__os); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_7 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__sysconf_names); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_t_16 = (__Pyx_PySequence_Contains(((PyObject *)__pyx_n_s__SC_PAGE_SIZE), __pyx_t_7, Py_EQ)); if (unlikely(__pyx_t_16 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        if (__pyx_t_16) {
          __pyx_t_7 = __Pyx_GetName(__pyx_m, __pyx_n_s__os); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_7);
          __pyx_t_1 = PyObject_GetAttr(__pyx_t_7, __pyx_n_s__sysconf_names); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __pyx_t_21 = (__Pyx_PySequence_Contains(((PyObject *)__pyx_n_s__SC_PHYS_PAGES), __pyx_t_1, Py_EQ)); if (unlikely(__pyx_t_21 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __pyx_t_26 = __pyx_t_21;
        } else {
          __pyx_t_26 = __pyx_t_16;
        }
        __pyx_t_16 = __pyx_t_26;
      } else {
        __pyx_t_16 = __pyx_t_11;
      }
      if (__pyx_t_16) {

     192:             memsize =  os.sysconf("SC_PAGE_SIZE")*os.sysconf("SC_PHYS_PAGES")

        /* "splitBBoxLUT.pyx":192
     *         lut_nbytes = bins*lut_size*sizeof(lut_point)
     *         if (os.name == "posix") and ("SC_PAGE_SIZE" in os.sysconf_names) and ("SC_PHYS_PAGES" in os.sysconf_names):
     *             memsize =  os.sysconf("SC_PAGE_SIZE")*os.sysconf("SC_PHYS_PAGES")             # <<<<<<<<<<<<<<
     *             if memsize <  lut_nbytes:
     *                 raise MemoryError("Lookup-table (%i, %i) is %.3fGB whereas the memory of the system is only %s"%(bins,lut_size,lut_nbytes,memsize))
     */
        __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__os); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_7 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__sysconf); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_t_1 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_k_tuple_1), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = __Pyx_GetName(__pyx_m, __pyx_n_s__os); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_5 = PyObject_GetAttr(__pyx_t_7, __pyx_n_s__sysconf); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

      /* "splitBBoxLUT.pyx":192
     *         lut_nbytes = bins*lut_size*sizeof(lut_point)
     *         if (os.name == "posix") and ("SC_PAGE_SIZE" in os.sysconf_names) and ("SC_PHYS_PAGES" in os.sysconf_names):
     *             memsize =  os.sysconf("SC_PAGE_SIZE")*os.sysconf("SC_PHYS_PAGES")             # <<<<<<<<<<<<<<
     *             if memsize <  lut_nbytes:
     *                 raise MemoryError("Lookup-table (%i, %i) is %.3fGB whereas the memory of the system is only %s"%(bins,lut_size,lut_nbytes,memsize))
     */
      __pyx_k_tuple_1 = PyTuple_Pack(1, ((PyObject *)__pyx_n_s__SC_PAGE_SIZE)); if (unlikely(!__pyx_k_tuple_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_k_tuple_1);
      __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_1));
        __pyx_t_7 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_k_tuple_2), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = PyNumber_Multiply(__pyx_t_1, __pyx_t_7); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_v_memsize = __pyx_t_5;
        __pyx_t_5 = 0;
      __pyx_k_tuple_2 = PyTuple_Pack(1, ((PyObject *)__pyx_n_s__SC_PHYS_PAGES)); if (unlikely(!__pyx_k_tuple_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_k_tuple_2);
      __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_2));

     193:             if memsize <  lut_nbytes:

        /* "splitBBoxLUT.pyx":193
     *         if (os.name == "posix") and ("SC_PAGE_SIZE" in os.sysconf_names) and ("SC_PHYS_PAGES" in os.sysconf_names):
     *             memsize =  os.sysconf("SC_PAGE_SIZE")*os.sysconf("SC_PHYS_PAGES")
     *             if memsize <  lut_nbytes:             # <<<<<<<<<<<<<<
     *                 raise MemoryError("Lookup-table (%i, %i) is %.3fGB whereas the memory of the system is only %s"%(bins,lut_size,lut_nbytes,memsize))
     *         #else hope we have enough memory
     */
        __pyx_t_5 = __Pyx_PyInt_FromSize_t(__pyx_v_lut_nbytes); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_7 = PyObject_RichCompare(__pyx_v_memsize, __pyx_t_5, Py_LT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_16 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_16 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        if (__pyx_t_16) {

     194:                 raise MemoryError("Lookup-table (%i, %i) is %.3fGB whereas the memory of the system is only %s"%(bins,lut_size,lut_nbytes,memsize))

          /* "splitBBoxLUT.pyx":194
     *             memsize =  os.sysconf("SC_PAGE_SIZE")*os.sysconf("SC_PHYS_PAGES")
     *             if memsize <  lut_nbytes:
     *                 raise MemoryError("Lookup-table (%i, %i) is %.3fGB whereas the memory of the system is only %s"%(bins,lut_size,lut_nbytes,memsize))             # <<<<<<<<<<<<<<
     *         #else hope we have enough memory
     *         lut = numpy.recarray(shape=(bins, lut_size),dtype=[("idx",numpy.int32),("coef",numpy.float32)])
     */
          __pyx_t_7 = PyInt_FromLong(__pyx_v_bins); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_7);
          __pyx_t_5 = PyInt_FromLong(__pyx_v_lut_size); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_5);
          __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_lut_nbytes); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_4 = PyTuple_New(4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_4);
          PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_7);
          __Pyx_GIVEREF(__pyx_t_7);
          PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_5);
          PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_1);
          __Pyx_GIVEREF(__pyx_t_1);
          __Pyx_INCREF(__pyx_v_memsize);
          PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_v_memsize);
          __Pyx_GIVEREF(__pyx_v_memsize);
          __pyx_t_7 = 0;
          __pyx_t_5 = 0;
          __pyx_t_1 = 0;
          __pyx_t_1 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_3), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(((PyObject *)__pyx_t_1));
          __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
          __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_4);
          PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_t_1));
          __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
          __pyx_t_1 = 0;
          __pyx_t_1 = PyObject_Call(__pyx_builtin_MemoryError, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
          __Pyx_Raise(__pyx_t_1, 0, 0, 0);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          goto __pyx_L20;
        }
        __pyx_L20:;
        goto __pyx_L19;
      }
      __pyx_L19:;

     195:         #else hope we have enough memory

     196:         lut = numpy.recarray(shape=(bins, lut_size),dtype=[("idx",numpy.int32),("coef",numpy.float32)])

      /* "splitBBoxLUT.pyx":196
     *                 raise MemoryError("Lookup-table (%i, %i) is %.3fGB whereas the memory of the system is only %s"%(bins,lut_size,lut_nbytes,memsize))
     *         #else hope we have enough memory
     *         lut = numpy.recarray(shape=(bins, lut_size),dtype=[("idx",numpy.int32),("coef",numpy.float32)])             # <<<<<<<<<<<<<<
     *         memset(&lut[0,0], 0, bins*lut_size*sizeof(lut_point))
     *         #NOGIL
     */
      __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_4 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__recarray); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_1));
      __pyx_t_5 = PyInt_FromLong(__pyx_v_bins); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_7 = PyInt_FromLong(__pyx_v_lut_size); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_7);
      __pyx_t_5 = 0;
      __pyx_t_7 = 0;
      if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__shape), ((PyObject *)__pyx_t_6)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
      __pyx_t_6 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = PyObject_GetAttr(__pyx_t_6, __pyx_n_s__int32); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_INCREF(((PyObject *)__pyx_n_s__idx));
      PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_n_s__idx));
      __Pyx_GIVEREF(((PyObject *)__pyx_n_s__idx));
      PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_7);
      __pyx_t_7 = 0;
      __pyx_t_7 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_5 = PyObject_GetAttr(__pyx_t_7, __pyx_n_s__float32); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_INCREF(((PyObject *)__pyx_n_s__coef));
      PyTuple_SET_ITEM(__pyx_t_7, 0, ((PyObject *)__pyx_n_s__coef));
      __Pyx_GIVEREF(((PyObject *)__pyx_n_s__coef));
      PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_5);
      __pyx_t_5 = 0;
      __pyx_t_5 = PyList_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      PyList_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_t_6));
      __Pyx_GIVEREF(((PyObject *)__pyx_t_6));
      PyList_SET_ITEM(__pyx_t_5, 1, ((PyObject *)__pyx_t_7));
      __Pyx_GIVEREF(((PyObject *)__pyx_t_7));
      __pyx_t_6 = 0;
      __pyx_t_7 = 0;
      if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__dtype), ((PyObject *)__pyx_t_5)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
      __pyx_t_5 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
      if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_27 = ((PyArrayObject *)__pyx_t_5);
      {
        __Pyx_BufFmt_StackElem __pyx_stack[2];
        __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lut.rcbuffer->pybuffer);
        __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_lut.rcbuffer->pybuffer, (PyObject*)__pyx_t_27, &__Pyx_TypeInfo_nn_struct___pyx_t_12splitBBoxLUT_lut_point, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack);
        if (unlikely(__pyx_t_3 < 0)) {
          PyErr_Fetch(&__pyx_t_28, &__pyx_t_29, &__pyx_t_30);
          if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_lut.rcbuffer->pybuffer, (PyObject*)__pyx_v_lut, &__Pyx_TypeInfo_nn_struct___pyx_t_12splitBBoxLUT_lut_point, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
            Py_XDECREF(__pyx_t_28); Py_XDECREF(__pyx_t_29); Py_XDECREF(__pyx_t_30);
            __Pyx_RaiseBufferFallbackError();
          } else {
            PyErr_Restore(__pyx_t_28, __pyx_t_29, __pyx_t_30);
          }
        }
        __pyx_pybuffernd_lut.diminfo[0].strides = __pyx_pybuffernd_lut.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_lut.diminfo[0].shape = __pyx_pybuffernd_lut.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_lut.diminfo[1].strides = __pyx_pybuffernd_lut.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_lut.diminfo[1].shape = __pyx_pybuffernd_lut.rcbuffer->pybuffer.shape[1];
        if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_27 = 0;
      __pyx_v_lut = ((PyArrayObject *)__pyx_t_5);
      __pyx_t_5 = 0;

     197:         memset(&lut[0,0], 0, bins*lut_size*sizeof(lut_point))

      /* "splitBBoxLUT.pyx":197
     *         #else hope we have enough memory
     *         lut = numpy.recarray(shape=(bins, lut_size),dtype=[("idx",numpy.int32),("coef",numpy.float32)])
     *         memset(&lut[0,0], 0, bins*lut_size*sizeof(lut_point))             # <<<<<<<<<<<<<<
     *         #NOGIL
     *         with nogil:
     */
      __pyx_t_31 = 0;
      __pyx_t_32 = 0;
      memset((&(*__Pyx_BufPtrStrided2d(struct __pyx_t_12splitBBoxLUT_lut_point *, __pyx_pybuffernd_lut.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_lut.diminfo[0].strides, __pyx_t_32, __pyx_pybuffernd_lut.diminfo[1].strides))), 0, ((__pyx_v_bins * __pyx_v_lut_size) * (sizeof(struct __pyx_t_12splitBBoxLUT_lut_point))));

     198:         #NOGIL

     199:         with nogil:

      /* "splitBBoxLUT.pyx":199
     *         memset(&lut[0,0], 0, bins*lut_size*sizeof(lut_point))
     *         #NOGIL
     *         with nogil:             # <<<<<<<<<<<<<<
     *             for idx in range(size):
     *                 if (check_mask) and (cmask[idx]):
     */
      {
          #ifdef WITH_THREAD
          PyThreadState *_save = NULL;
          #endif
          Py_UNBLOCK_THREADS
          /*try:*/ {

          /* "splitBBoxLUT.pyx":199
     *         memset(&lut[0,0], 0, bins*lut_size*sizeof(lut_point))
     *         #NOGIL
     *         with nogil:             # <<<<<<<<<<<<<<
     *             for idx in range(size):
     *                 if (check_mask) and (cmask[idx]):
     */
          /*finally:*/ {
            int __pyx_why;
            __pyx_why = 0; goto __pyx_L23;
            __pyx_L22: __pyx_why = 4; goto __pyx_L23;
            __pyx_L23:;
            Py_BLOCK_THREADS
            switch (__pyx_why) {
              case 4: goto __pyx_L1_error;
            }
          }
      }

     200:             for idx in range(size):

            /* "splitBBoxLUT.pyx":200
     *         #NOGIL
     *         with nogil:
     *             for idx in range(size):             # <<<<<<<<<<<<<<
     *                 if (check_mask) and (cmask[idx]):
     *                     continue
     */
            __pyx_t_3 = __pyx_v_size;
            for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_3; __pyx_t_14+=1) {
              __pyx_v_idx = __pyx_t_14;

     201:                 if (check_mask) and (cmask[idx]):

              /* "splitBBoxLUT.pyx":201
     *         with nogil:
     *             for idx in range(size):
     *                 if (check_mask) and (cmask[idx]):             # <<<<<<<<<<<<<<
     *                     continue
     *
     */
              __pyx_t_16 = __pyx_v_check_mask;
              if (__pyx_t_16) {
                if (unlikely(!__pyx_v_cmask.memview)) { __Pyx_RaiseUnboundMemoryviewSliceNogil("cmask"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L22;} }
                __pyx_t_33 = __pyx_v_idx;
                __pyx_t_11 = (*((__pyx_t_5numpy_int8_t *) ( /* dim=0 */ (__pyx_v_cmask.data + __pyx_t_33 * __pyx_v_cmask.strides[0]) )));
              } else {
                __pyx_t_11 = __pyx_t_16;
              }
              if (__pyx_t_11) {

     202:                     continue

                /* "splitBBoxLUT.pyx":202
     *             for idx in range(size):
     *                 if (check_mask) and (cmask[idx]):
     *                     continue             # <<<<<<<<<<<<<<
     *
     *                 min0 = cpos0_inf[idx]
     */
                goto __pyx_L24_continue;
                goto __pyx_L26;
              }
              __pyx_L26:;

     203:

     204:                 min0 = cpos0_inf[idx]

              /* "splitBBoxLUT.pyx":204
     *                     continue
     *
     *                 min0 = cpos0_inf[idx]             # <<<<<<<<<<<<<<
     *                 max0 = cpos0_sup[idx]
     *
     */
              __pyx_t_34 = __pyx_v_idx;
              __pyx_v_min0 = (*((float *) ( /* dim=0 */ (__pyx_v_cpos0_inf.data + __pyx_t_34 * __pyx_v_cpos0_inf.strides[0]) )));

     205:                 max0 = cpos0_sup[idx]

              /* "splitBBoxLUT.pyx":205
     *
     *                 min0 = cpos0_inf[idx]
     *                 max0 = cpos0_sup[idx]             # <<<<<<<<<<<<<<
     *
     *                 if check_pos1 and ((cpos1_max[idx] < pos1_min) or (cpos1_min[idx] > pos1_max)):
     */
              __pyx_t_35 = __pyx_v_idx;
              __pyx_v_max0 = (*((float *) ( /* dim=0 */ (__pyx_v_cpos0_sup.data + __pyx_t_35 * __pyx_v_cpos0_sup.strides[0]) )));

     206:

     207:                 if check_pos1 and ((cpos1_max[idx] < pos1_min) or (cpos1_min[idx] > pos1_max)):

              /* "splitBBoxLUT.pyx":207
     *                 max0 = cpos0_sup[idx]
     *
     *                 if check_pos1 and ((cpos1_max[idx] < pos1_min) or (cpos1_min[idx] > pos1_max)):             # <<<<<<<<<<<<<<
     *                         continue
     *
     */
              if (__pyx_v_check_pos1) {
                if (unlikely(!__pyx_v_cpos1_max.memview)) { __Pyx_RaiseUnboundMemoryviewSliceNogil("cpos1_max"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L22;} }
                __pyx_t_36 = __pyx_v_idx;
                __pyx_t_11 = ((*((float *) ( /* dim=0 */ (__pyx_v_cpos1_max.data + __pyx_t_36 * __pyx_v_cpos1_max.strides[0]) ))) < __pyx_v_pos1_min);
                if (!__pyx_t_11) {
                  if (unlikely(!__pyx_v_cpos1_min.memview)) { __Pyx_RaiseUnboundMemoryviewSliceNogil("cpos1_min"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L22;} }
                  __pyx_t_37 = __pyx_v_idx;
                  __pyx_t_16 = ((*((float *) ( /* dim=0 */ (__pyx_v_cpos1_min.data + __pyx_t_37 * __pyx_v_cpos1_min.strides[0]) ))) > __pyx_v_pos1_max);
                  __pyx_t_26 = __pyx_t_16;
                } else {
                  __pyx_t_26 = __pyx_t_11;
                }
                __pyx_t_11 = __pyx_t_26;
              } else {
                __pyx_t_11 = __pyx_v_check_pos1;
              }
              if (__pyx_t_11) {

     208:                         continue

                /* "splitBBoxLUT.pyx":208
     *
     *                 if check_pos1 and ((cpos1_max[idx] < pos1_min) or (cpos1_min[idx] > pos1_max)):
     *                         continue             # <<<<<<<<<<<<<<
     *
     *                 fbin0_min = getBinNr(min0, pos0_min, delta)
     */
                goto __pyx_L24_continue;
                goto __pyx_L27;
              }
              __pyx_L27:;

     209:

     210:                 fbin0_min = getBinNr(min0, pos0_min, delta)

              /* "splitBBoxLUT.pyx":210
     *                         continue
     *
     *                 fbin0_min = getBinNr(min0, pos0_min, delta)             # <<<<<<<<<<<<<<
     *                 fbin0_max = getBinNr(max0, pos0_min, delta)
     *                 bin0_min = < int > fbin0_min
     */
              __pyx_v_fbin0_min = __pyx_f_12splitBBoxLUT_getBinNr(__pyx_v_min0, __pyx_v_pos0_min, __pyx_v_delta);

     211:                 fbin0_max = getBinNr(max0, pos0_min, delta)

              /* "splitBBoxLUT.pyx":211
     *
     *                 fbin0_min = getBinNr(min0, pos0_min, delta)
     *                 fbin0_max = getBinNr(max0, pos0_min, delta)             # <<<<<<<<<<<<<<
     *                 bin0_min = < int > fbin0_min
     *                 bin0_max = < int > fbin0_max
     */
              __pyx_v_fbin0_max = __pyx_f_12splitBBoxLUT_getBinNr(__pyx_v_max0, __pyx_v_pos0_min, __pyx_v_delta);

     212:                 bin0_min = < int > fbin0_min

              /* "splitBBoxLUT.pyx":212
     *                 fbin0_min = getBinNr(min0, pos0_min, delta)
     *                 fbin0_max = getBinNr(max0, pos0_min, delta)
     *                 bin0_min = < int > fbin0_min             # <<<<<<<<<<<<<<
     *                 bin0_max = < int > fbin0_max
     *
     */
              __pyx_v_bin0_min = ((int)__pyx_v_fbin0_min);

     213:                 bin0_max = < int > fbin0_max

              /* "splitBBoxLUT.pyx":213
     *                 fbin0_max = getBinNr(max0, pos0_min, delta)
     *                 bin0_min = < int > fbin0_min
     *                 bin0_max = < int > fbin0_max             # <<<<<<<<<<<<<<
     *
     *                 if (bin0_max < 0) or (bin0_min >= bins):
     */
              __pyx_v_bin0_max = ((int)__pyx_v_fbin0_max);

     214:

     215:                 if (bin0_max < 0) or (bin0_min >= bins):

              /* "splitBBoxLUT.pyx":215
     *                 bin0_max = < int > fbin0_max
     *
     *                 if (bin0_max < 0) or (bin0_min >= bins):             # <<<<<<<<<<<<<<
     *                     continue
     *                 if bin0_max >= bins :
     */
              __pyx_t_11 = (__pyx_v_bin0_max < 0);
              if (!__pyx_t_11) {
                __pyx_t_26 = (__pyx_v_bin0_min >= __pyx_v_bins);
                __pyx_t_16 = __pyx_t_26;
              } else {
                __pyx_t_16 = __pyx_t_11;
              }
              if (__pyx_t_16) {

     216:                     continue

                /* "splitBBoxLUT.pyx":216
     *
     *                 if (bin0_max < 0) or (bin0_min >= bins):
     *                     continue             # <<<<<<<<<<<<<<
     *                 if bin0_max >= bins :
     *                     bin0_max = bins - 1
     */
                goto __pyx_L24_continue;
                goto __pyx_L28;
              }
              __pyx_L28:;

     217:                 if bin0_max >= bins :

              /* "splitBBoxLUT.pyx":217
     *                 if (bin0_max < 0) or (bin0_min >= bins):
     *                     continue
     *                 if bin0_max >= bins :             # <<<<<<<<<<<<<<
     *                     bin0_max = bins - 1
     *                 if  bin0_min < 0:
     */
              __pyx_t_16 = (__pyx_v_bin0_max >= __pyx_v_bins);
              if (__pyx_t_16) {

     218:                     bin0_max = bins - 1

                /* "splitBBoxLUT.pyx":218
     *                     continue
     *                 if bin0_max >= bins :
     *                     bin0_max = bins - 1             # <<<<<<<<<<<<<<
     *                 if  bin0_min < 0:
     *                     bin0_min = 0
     */
                __pyx_v_bin0_max = (__pyx_v_bins - 1);
                goto __pyx_L29;
              }
              __pyx_L29:;

     219:                 if  bin0_min < 0:

              /* "splitBBoxLUT.pyx":219
     *                 if bin0_max >= bins :
     *                     bin0_max = bins - 1
     *                 if  bin0_min < 0:             # <<<<<<<<<<<<<<
     *                     bin0_min = 0
     *
     */
              __pyx_t_16 = (__pyx_v_bin0_min < 0);
              if (__pyx_t_16) {

     220:                     bin0_min = 0

                /* "splitBBoxLUT.pyx":220
     *                     bin0_max = bins - 1
     *                 if  bin0_min < 0:
     *                     bin0_min = 0             # <<<<<<<<<<<<<<
     *
     *                 if bin0_min == bin0_max:
     */
                __pyx_v_bin0_min = 0;
                goto __pyx_L30;
              }
              __pyx_L30:;

     221:

     222:                 if bin0_min == bin0_max:

              /* "splitBBoxLUT.pyx":222
     *                     bin0_min = 0
     *
     *                 if bin0_min == bin0_max:             # <<<<<<<<<<<<<<
     *                     #All pixel is within a single bin
     *                     k = outMax[bin0_min]
     */
              __pyx_t_16 = (__pyx_v_bin0_min == __pyx_v_bin0_max);
              if (__pyx_t_16) {

     223:                     #All pixel is within a single bin

     224:                     k = outMax[bin0_min]

                /* "splitBBoxLUT.pyx":224
     *                 if bin0_min == bin0_max:
     *                     #All pixel is within a single bin
     *                     k = outMax[bin0_min]             # <<<<<<<<<<<<<<
     *                     lut[bin0_min, k].idx = idx
     *                     lut[bin0_min, k].coef = 1.0
     */
                __pyx_t_24 = __pyx_v_bin0_min;
                __pyx_v_k = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_outMax.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_outMax.diminfo[0].strides));

     225:                     lut[bin0_min, k].idx = idx

                /* "splitBBoxLUT.pyx":225
     *                     #All pixel is within a single bin
     *                     k = outMax[bin0_min]
     *                     lut[bin0_min, k].idx = idx             # <<<<<<<<<<<<<<
     *                     lut[bin0_min, k].coef = 1.0
     *                     outMax[bin0_min] = k + 1
     */
                __pyx_t_38 = __pyx_v_bin0_min;
                __pyx_t_39 = __pyx_v_k;
                (*__Pyx_BufPtrStrided2d(struct __pyx_t_12splitBBoxLUT_lut_point *, __pyx_pybuffernd_lut.rcbuffer->pybuffer.buf, __pyx_t_38, __pyx_pybuffernd_lut.diminfo[0].strides, __pyx_t_39, __pyx_pybuffernd_lut.diminfo[1].strides)).idx = __pyx_v_idx;

     226:                     lut[bin0_min, k].coef = 1.0

                /* "splitBBoxLUT.pyx":226
     *                     k = outMax[bin0_min]
     *                     lut[bin0_min, k].idx = idx
     *                     lut[bin0_min, k].coef = 1.0             # <<<<<<<<<<<<<<
     *                     outMax[bin0_min] = k + 1
     *                 else: #we have pixel splitting.
     */
                __pyx_t_40 = __pyx_v_bin0_min;
                __pyx_t_41 = __pyx_v_k;
                (*__Pyx_BufPtrStrided2d(struct __pyx_t_12splitBBoxLUT_lut_point *, __pyx_pybuffernd_lut.rcbuffer->pybuffer.buf, __pyx_t_40, __pyx_pybuffernd_lut.diminfo[0].strides, __pyx_t_41, __pyx_pybuffernd_lut.diminfo[1].strides)).coef = 1.0;

     227:                     outMax[bin0_min] = k + 1

                /* "splitBBoxLUT.pyx":227
     *                     lut[bin0_min, k].idx = idx
     *                     lut[bin0_min, k].coef = 1.0
     *                     outMax[bin0_min] = k + 1             # <<<<<<<<<<<<<<
     *                 else: #we have pixel splitting.
     *                     deltaA = 1.0 / (fbin0_max - fbin0_min)
     */
                __pyx_t_42 = __pyx_v_bin0_min;
                *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_outMax.rcbuffer->pybuffer.buf, __pyx_t_42, __pyx_pybuffernd_outMax.diminfo[0].strides) = (__pyx_v_k + 1);
                goto __pyx_L31;
              }
              /*else*/ {

     228:                 else: #we have pixel splitting.

     229:                     deltaA = 1.0 / (fbin0_max - fbin0_min)

                /* "splitBBoxLUT.pyx":229
     *                     outMax[bin0_min] = k + 1
     *                 else: #we have pixel splitting.
     *                     deltaA = 1.0 / (fbin0_max - fbin0_min)             # <<<<<<<<<<<<<<
     *
     *                     deltaL = (bin0_min + 1) - fbin0_min
     */
                __pyx_v_deltaA = (1.0 / (__pyx_v_fbin0_max - __pyx_v_fbin0_min));

     230:

     231:                     deltaL = (bin0_min + 1) - fbin0_min

                /* "splitBBoxLUT.pyx":231
     *                     deltaA = 1.0 / (fbin0_max - fbin0_min)
     *
     *                     deltaL = (bin0_min + 1) - fbin0_min             # <<<<<<<<<<<<<<
     *                     deltaR = fbin0_max - (bin0_max)
     *
     */
                __pyx_v_deltaL = ((__pyx_v_bin0_min + 1) - __pyx_v_fbin0_min);

     232:                     deltaR = fbin0_max - (bin0_max)

                /* "splitBBoxLUT.pyx":232
     *
     *                     deltaL = (bin0_min + 1) - fbin0_min
     *                     deltaR = fbin0_max - (bin0_max)             # <<<<<<<<<<<<<<
     *
     *                     k = outMax[bin0_min]
     */
                __pyx_v_deltaR = (__pyx_v_fbin0_max - __pyx_v_bin0_max);

     233:

     234:                     k = outMax[bin0_min]

                /* "splitBBoxLUT.pyx":234
     *                     deltaR = fbin0_max - (bin0_max)
     *
     *                     k = outMax[bin0_min]             # <<<<<<<<<<<<<<
     *                     lut[bin0_min, k].idx = idx
     *                     lut[bin0_min, k].coef = (deltaA * deltaL)
     */
                __pyx_t_43 = __pyx_v_bin0_min;
                __pyx_v_k = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_outMax.rcbuffer->pybuffer.buf, __pyx_t_43, __pyx_pybuffernd_outMax.diminfo[0].strides));

     235:                     lut[bin0_min, k].idx = idx

                /* "splitBBoxLUT.pyx":235
     *
     *                     k = outMax[bin0_min]
     *                     lut[bin0_min, k].idx = idx             # <<<<<<<<<<<<<<
     *                     lut[bin0_min, k].coef = (deltaA * deltaL)
     *                     outMax[bin0_min] = k + 1
     */
                __pyx_t_44 = __pyx_v_bin0_min;
                __pyx_t_45 = __pyx_v_k;
                (*__Pyx_BufPtrStrided2d(struct __pyx_t_12splitBBoxLUT_lut_point *, __pyx_pybuffernd_lut.rcbuffer->pybuffer.buf, __pyx_t_44, __pyx_pybuffernd_lut.diminfo[0].strides, __pyx_t_45, __pyx_pybuffernd_lut.diminfo[1].strides)).idx = __pyx_v_idx;

     236:                     lut[bin0_min, k].coef = (deltaA * deltaL)

                /* "splitBBoxLUT.pyx":236
     *                     k = outMax[bin0_min]
     *                     lut[bin0_min, k].idx = idx
     *                     lut[bin0_min, k].coef = (deltaA * deltaL)             # <<<<<<<<<<<<<<
     *                     outMax[bin0_min] = k + 1
     *
     */
                __pyx_t_46 = __pyx_v_bin0_min;
                __pyx_t_47 = __pyx_v_k;
                (*__Pyx_BufPtrStrided2d(struct __pyx_t_12splitBBoxLUT_lut_point *, __pyx_pybuffernd_lut.rcbuffer->pybuffer.buf, __pyx_t_46, __pyx_pybuffernd_lut.diminfo[0].strides, __pyx_t_47, __pyx_pybuffernd_lut.diminfo[1].strides)).coef = (__pyx_v_deltaA * __pyx_v_deltaL);

     237:                     outMax[bin0_min] = k + 1

                /* "splitBBoxLUT.pyx":237
     *                     lut[bin0_min, k].idx = idx
     *                     lut[bin0_min, k].coef = (deltaA * deltaL)
     *                     outMax[bin0_min] = k + 1             # <<<<<<<<<<<<<<
     *
     *                     k = outMax[bin0_max]
     */
                __pyx_t_48 = __pyx_v_bin0_min;
                *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_outMax.rcbuffer->pybuffer.buf, __pyx_t_48, __pyx_pybuffernd_outMax.diminfo[0].strides) = (__pyx_v_k + 1);

     238:

     239:                     k = outMax[bin0_max]

                /* "splitBBoxLUT.pyx":239
     *                     outMax[bin0_min] = k + 1
     *
     *                     k = outMax[bin0_max]             # <<<<<<<<<<<<<<
     *                     lut[bin0_max, k].idx = idx
     *                     lut[bin0_max, k].coef = (deltaA * deltaR)
     */
                __pyx_t_49 = __pyx_v_bin0_max;
                __pyx_v_k = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_outMax.rcbuffer->pybuffer.buf, __pyx_t_49, __pyx_pybuffernd_outMax.diminfo[0].strides));

     240:                     lut[bin0_max, k].idx = idx

                /* "splitBBoxLUT.pyx":240
     *
     *                     k = outMax[bin0_max]
     *                     lut[bin0_max, k].idx = idx             # <<<<<<<<<<<<<<
     *                     lut[bin0_max, k].coef = (deltaA * deltaR)
     *                     outMax[bin0_max] = k + 1
     */
                __pyx_t_50 = __pyx_v_bin0_max;
                __pyx_t_51 = __pyx_v_k;
                (*__Pyx_BufPtrStrided2d(struct __pyx_t_12splitBBoxLUT_lut_point *, __pyx_pybuffernd_lut.rcbuffer->pybuffer.buf, __pyx_t_50, __pyx_pybuffernd_lut.diminfo[0].strides, __pyx_t_51, __pyx_pybuffernd_lut.diminfo[1].strides)).idx = __pyx_v_idx;

     241:                     lut[bin0_max, k].coef = (deltaA * deltaR)

                /* "splitBBoxLUT.pyx":241
     *                     k = outMax[bin0_max]
     *                     lut[bin0_max, k].idx = idx
     *                     lut[bin0_max, k].coef = (deltaA * deltaR)             # <<<<<<<<<<<<<<
     *                     outMax[bin0_max] = k + 1
     *
     */
                __pyx_t_52 = __pyx_v_bin0_max;
                __pyx_t_53 = __pyx_v_k;
                (*__Pyx_BufPtrStrided2d(struct __pyx_t_12splitBBoxLUT_lut_point *, __pyx_pybuffernd_lut.rcbuffer->pybuffer.buf, __pyx_t_52, __pyx_pybuffernd_lut.diminfo[0].strides, __pyx_t_53, __pyx_pybuffernd_lut.diminfo[1].strides)).coef = (__pyx_v_deltaA * __pyx_v_deltaR);

     242:                     outMax[bin0_max] = k + 1

                /* "splitBBoxLUT.pyx":242
     *                     lut[bin0_max, k].idx = idx
     *                     lut[bin0_max, k].coef = (deltaA * deltaR)
     *                     outMax[bin0_max] = k + 1             # <<<<<<<<<<<<<<
     *
     *                     if bin0_min + 1 < bin0_max:
     */
                __pyx_t_54 = __pyx_v_bin0_max;
                *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_outMax.rcbuffer->pybuffer.buf, __pyx_t_54, __pyx_pybuffernd_outMax.diminfo[0].strides) = (__pyx_v_k + 1);

     243:

     244:                     if bin0_min + 1 < bin0_max:

                /* "splitBBoxLUT.pyx":244
     *                     outMax[bin0_max] = k + 1
     *
     *                     if bin0_min + 1 < bin0_max:             # <<<<<<<<<<<<<<
     *                         for i in range(bin0_min + 1, bin0_max):
     *                             k = outMax[i]
     */
                __pyx_t_16 = ((__pyx_v_bin0_min + 1) < __pyx_v_bin0_max);
                if (__pyx_t_16) {

     245:                         for i in range(bin0_min + 1, bin0_max):

                  /* "splitBBoxLUT.pyx":245
     *
     *                     if bin0_min + 1 < bin0_max:
     *                         for i in range(bin0_min + 1, bin0_max):             # <<<<<<<<<<<<<<
     *                             k = outMax[i]
     *                             lut[i, k].idx = idx
     */
                  __pyx_t_55 = __pyx_v_bin0_max;
                  for (__pyx_t_56 = (__pyx_v_bin0_min + 1); __pyx_t_56 < __pyx_t_55; __pyx_t_56+=1) {
                    __pyx_v_i = __pyx_t_56;

     246:                             k = outMax[i]

                    /* "splitBBoxLUT.pyx":246
     *                     if bin0_min + 1 < bin0_max:
     *                         for i in range(bin0_min + 1, bin0_max):
     *                             k = outMax[i]             # <<<<<<<<<<<<<<
     *                             lut[i, k].idx = idx
     *                             lut[i, k].coef = (deltaA)
     */
                    __pyx_t_57 = __pyx_v_i;
                    __pyx_v_k = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_outMax.rcbuffer->pybuffer.buf, __pyx_t_57, __pyx_pybuffernd_outMax.diminfo[0].strides));

     247:                             lut[i, k].idx = idx

                    /* "splitBBoxLUT.pyx":247
     *                         for i in range(bin0_min + 1, bin0_max):
     *                             k = outMax[i]
     *                             lut[i, k].idx = idx             # <<<<<<<<<<<<<<
     *                             lut[i, k].coef = (deltaA)
     *                             outMax[i] = k + 1
     */
                    __pyx_t_58 = __pyx_v_i;
                    __pyx_t_59 = __pyx_v_k;
                    (*__Pyx_BufPtrStrided2d(struct __pyx_t_12splitBBoxLUT_lut_point *, __pyx_pybuffernd_lut.rcbuffer->pybuffer.buf, __pyx_t_58, __pyx_pybuffernd_lut.diminfo[0].strides, __pyx_t_59, __pyx_pybuffernd_lut.diminfo[1].strides)).idx = __pyx_v_idx;

     248:                             lut[i, k].coef = (deltaA)

                    /* "splitBBoxLUT.pyx":248
     *                             k = outMax[i]
     *                             lut[i, k].idx = idx
     *                             lut[i, k].coef = (deltaA)             # <<<<<<<<<<<<<<
     *                             outMax[i] = k + 1
     *         self.lut = lut
     */
                    __pyx_t_60 = __pyx_v_i;
                    __pyx_t_61 = __pyx_v_k;
                    (*__Pyx_BufPtrStrided2d(struct __pyx_t_12splitBBoxLUT_lut_point *, __pyx_pybuffernd_lut.rcbuffer->pybuffer.buf, __pyx_t_60, __pyx_pybuffernd_lut.diminfo[0].strides, __pyx_t_61, __pyx_pybuffernd_lut.diminfo[1].strides)).coef = __pyx_v_deltaA;

     249:                             outMax[i] = k + 1

                    /* "splitBBoxLUT.pyx":249
     *                             lut[i, k].idx = idx
     *                             lut[i, k].coef = (deltaA)
     *                             outMax[i] = k + 1             # <<<<<<<<<<<<<<
     *         self.lut = lut
     *         return outMax
     */
                    __pyx_t_62 = __pyx_v_i;
                    *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_outMax.rcbuffer->pybuffer.buf, __pyx_t_62, __pyx_pybuffernd_outMax.diminfo[0].strides) = (__pyx_v_k + 1);
                  }
                  goto __pyx_L32;
                }
                __pyx_L32:;
              }
              __pyx_L31:;
              __pyx_L24_continue:;
            }
          }

     250:         self.lut = lut

      /* "splitBBoxLUT.pyx":250
     *                             lut[i, k].coef = (deltaA)
     *                             outMax[i] = k + 1
     *         self.lut = lut             # <<<<<<<<<<<<<<
     *         return outMax
     *
     */
      if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__lut, ((PyObject *)__pyx_v_lut)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

     251:         return outMax

      /* "splitBBoxLUT.pyx":251
     *                             outMax[i] = k + 1
     *         self.lut = lut
     *         return outMax             # <<<<<<<<<<<<<<
     *
     *
     */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(((PyObject *)__pyx_v_outMax));
      __pyx_r = ((PyObject *)__pyx_v_outMax);
      goto __pyx_L0;

      __pyx_r = Py_None; __Pyx_INCREF(Py_None);
      goto __pyx_L0;
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_6);
      __Pyx_XDECREF(__pyx_t_7);
      __PYX_XDEC_MEMVIEW(&__pyx_t_9, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_10, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_12, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_13, 1);
      { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
        __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
        __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lut.rcbuffer->pybuffer);
        __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_outMax.rcbuffer->pybuffer);
      __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
      __Pyx_AddTraceback("splitBBoxLUT.HistoBBox1d.calc_lut", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      goto __pyx_L2;
      __pyx_L0:;
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lut.rcbuffer->pybuffer);
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_outMax.rcbuffer->pybuffer);
      __pyx_L2:;
      __Pyx_XDECREF((PyObject *)__pyx_v_outMax);
      __PYX_XDEC_MEMVIEW(&__pyx_v_cpos0_sup, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_cpos0_inf, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_cpos1_min, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_cpos1_max, 1);
      __Pyx_XDECREF((PyObject *)__pyx_v_lut);
      __PYX_XDEC_MEMVIEW(&__pyx_v_cmask, 1);
      __Pyx_XDECREF(__pyx_v_memsize);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    /* Python wrapper */
    static PyObject *__pyx_pw_12splitBBoxLUT_11HistoBBox1d_5integrate(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
    static char __pyx_doc_12splitBBoxLUT_11HistoBBox1d_4integrate[] = "\n        Actually perform the integration which in this case looks more like a matrix-vector product\n        \n        @param weights: input image \n        @type weights: ndarray\n        @param dummy: value for dead pixels (optional)\n        @type dummy: float\n        @param delta_dummy: precision for dead-pixel value in dynamic masking\n        @type delta_dummy: float\n        @param dark: array with the dark-current value to be subtracted (if any)\n        @type dark: ndarray\n        @param flat: array with the dark-current value to be divided by (if any)\n        @type flat: ndarray\n        @param solidAngle: array with the solid angle of each pixel to be divided by (if any)\n        @type solidAngle: ndarray\n        @param polarization: array with the polarization correction values to be divided by (if any)\n        @type polarization: ndarray\n        @return : positions, pattern, weighted_histogram and unweighted_histogram\n        @rtype: 4-tuple of ndarrays\n        \n        ";
    static PyMethodDef __pyx_mdef_12splitBBoxLUT_11HistoBBox1d_5integrate = {__Pyx_NAMESTR("integrate"), (PyCFunction)__pyx_pw_12splitBBoxLUT_11HistoBBox1d_5integrate, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_12splitBBoxLUT_11HistoBBox1d_4integrate)};
    static PyObject *__pyx_pw_12splitBBoxLUT_11HistoBBox1d_5integrate(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
      PyObject *__pyx_v_self = 0;
      PyObject *__pyx_v_weights = 0;
      PyObject *__pyx_v_dummy = 0;
      PyObject *__pyx_v_delta_dummy = 0;
      PyObject *__pyx_v_dark = 0;
      PyObject *__pyx_v_flat = 0;
      PyObject *__pyx_v_solidAngle = 0;
      PyObject *__pyx_v_polarization = 0;
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("integrate (wrapper)", 0);
      {
        static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__self,&__pyx_n_s__weights,&__pyx_n_s__dummy,&__pyx_n_s__delta_dummy,&__pyx_n_s__dark,&__pyx_n_s__flat,&__pyx_n_s__solidAngle,&__pyx_n_s__polarization,0};
        PyObject* values[8] = {0,0,0,0,0,0,0,0};

     252:

     253:

     254:     @cython.cdivision(True)

     255:     @cython.boundscheck(False)

     256:     @cython.wraparound(False)

     257:     def integrate(self, weights, dummy=None, delta_dummy=None, dark=None, flat=None, solidAngle=None, polarization=None):

        /* "splitBBoxLUT.pyx":257
     *     @cython.boundscheck(False)
     *     @cython.wraparound(False)
     *     def integrate(self, weights, dummy=None, delta_dummy=None, dark=None, flat=None, solidAngle=None, polarization=None):             # <<<<<<<<<<<<<<
     *         """
     *         Actually perform the integration which in this case looks more like a matrix-vector product
     */
        values[2] = ((PyObject *)((PyObject *)Py_None));
        values[3] = ((PyObject *)((PyObject *)Py_None));
        values[4] = ((PyObject *)((PyObject *)Py_None));
        values[5] = ((PyObject *)((PyObject *)Py_None));
        values[6] = ((PyObject *)((PyObject *)Py_None));
        values[7] = ((PyObject *)((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  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__self)) != 0)) kw_args--;
            else goto __pyx_L5_argtuple_error;
            case  1:
            if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__weights)) != 0)) kw_args--;
            else {
              __Pyx_RaiseArgtupleInvalid("integrate", 0, 2, 8, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
            }
            case  2:
            if (kw_args > 0) {
              PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__dummy);
              if (value) { values[2] = value; kw_args--; }
            }
            case  3:
            if (kw_args > 0) {
              PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__delta_dummy);
              if (value) { values[3] = value; kw_args--; }
            }
            case  4:
            if (kw_args > 0) {
              PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__dark);
              if (value) { values[4] = value; kw_args--; }
            }
            case  5:
            if (kw_args > 0) {
              PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__flat);
              if (value) { values[5] = value; kw_args--; }
            }
            case  6:
            if (kw_args > 0) {
              PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__solidAngle);
              if (value) { values[6] = value; kw_args--; }
            }
            case  7:
            if (kw_args > 0) {
              PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__polarization);
              if (value) { values[7] = value; kw_args--; }
            }
          }
          if (unlikely(kw_args > 0)) {
            if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "integrate") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
          }
        } else {
          switch (PyTuple_GET_SIZE(__pyx_args)) {
            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_self = values[0];
        __pyx_v_weights = values[1];
        __pyx_v_dummy = values[2];
        __pyx_v_delta_dummy = values[3];
        __pyx_v_dark = values[4];
        __pyx_v_flat = values[5];
        __pyx_v_solidAngle = values[6];
        __pyx_v_polarization = values[7];
      }
      goto __pyx_L4_argument_unpacking_done;
      __pyx_L5_argtuple_error:;
      __Pyx_RaiseArgtupleInvalid("integrate", 0, 2, 8, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      __pyx_L3_error:;
      __Pyx_AddTraceback("splitBBoxLUT.HistoBBox1d.integrate", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __Pyx_RefNannyFinishContext();
      return NULL;
      __pyx_L4_argument_unpacking_done:;
      __pyx_r = __pyx_pf_12splitBBoxLUT_11HistoBBox1d_4integrate(__pyx_self, __pyx_v_self, __pyx_v_weights, __pyx_v_dummy, __pyx_v_delta_dummy, __pyx_v_dark, __pyx_v_flat, __pyx_v_solidAngle, __pyx_v_polarization);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_12splitBBoxLUT_11HistoBBox1d_4integrate(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_weights, PyObject *__pyx_v_dummy, PyObject *__pyx_v_delta_dummy, PyObject *__pyx_v_dark, PyObject *__pyx_v_flat, PyObject *__pyx_v_solidAngle, PyObject *__pyx_v_polarization) {
      int __pyx_v_i;
      int __pyx_v_j;
      int __pyx_v_idx;
      CYTHON_UNUSED int __pyx_v_bins;
      int __pyx_v_lut_size;
      int __pyx_v_size;
      double __pyx_v_sum_data;
      double __pyx_v_sum_count;
      double __pyx_v_epsilon;
      float __pyx_v_data;
      float __pyx_v_coef;
      float __pyx_v_cdummy;
      float __pyx_v_cddummy;
      int __pyx_v_do_dummy;
      int __pyx_v_do_dark;
      int __pyx_v_do_flat;
      int __pyx_v_do_polarization;
      int __pyx_v_do_solidAngle;
      PyArrayObject *__pyx_v_outData = 0;
      PyArrayObject *__pyx_v_outCount = 0;
      PyArrayObject *__pyx_v_outMerge = 0;
      __Pyx_memviewslice __pyx_v_lut = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_cdata = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_tdata = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_cflat = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_cdark = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_csolidAngle = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_cpolarization = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_LocalBuf_ND __pyx_pybuffernd_outCount;
      __Pyx_Buffer __pyx_pybuffer_outCount;
      __Pyx_LocalBuf_ND __pyx_pybuffernd_outData;
      __Pyx_Buffer __pyx_pybuffer_outData;
      __Pyx_LocalBuf_ND __pyx_pybuffernd_outMerge;
      __Pyx_Buffer __pyx_pybuffer_outMerge;
      PyObject *__pyx_r = NULL;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("integrate", 0);
      __pyx_pybuffer_outData.pybuffer.buf = NULL;
      __pyx_pybuffer_outData.refcount = 0;
      __pyx_pybuffernd_outData.data = NULL;
      __pyx_pybuffernd_outData.rcbuffer = &__pyx_pybuffer_outData;
      __pyx_pybuffer_outCount.pybuffer.buf = NULL;
      __pyx_pybuffer_outCount.refcount = 0;
      __pyx_pybuffernd_outCount.data = NULL;
      __pyx_pybuffernd_outCount.rcbuffer = &__pyx_pybuffer_outCount;
      __pyx_pybuffer_outMerge.pybuffer.buf = NULL;
      __pyx_pybuffer_outMerge.refcount = 0;
      __pyx_pybuffernd_outMerge.data = NULL;
      __pyx_pybuffernd_outMerge.rcbuffer = &__pyx_pybuffer_outMerge;

      /* "splitBBoxLUT.pyx":257
     *     @cython.boundscheck(False)
     *     @cython.wraparound(False)
     *     def integrate(self, weights, dummy=None, delta_dummy=None, dark=None, flat=None, solidAngle=None, polarization=None):             # <<<<<<<<<<<<<<
     *         """
     *         Actually perform the integration which in this case looks more like a matrix-vector product
     */
      __pyx_k_tuple_61 = PyTuple_Pack(36, ((PyObject *)__pyx_n_s__self), ((PyObject *)__pyx_n_s__weights), ((PyObject *)__pyx_n_s__dummy), ((PyObject *)__pyx_n_s__delta_dummy), ((PyObject *)__pyx_n_s__dark), ((PyObject *)__pyx_n_s__flat), ((PyObject *)__pyx_n_s__solidAngle), ((PyObject *)__pyx_n_s__polarization), ((PyObject *)__pyx_n_s__i), ((PyObject *)__pyx_n_s__j), ((PyObject *)__pyx_n_s__idx), ((PyObject *)__pyx_n_s__bins), ((PyObject *)__pyx_n_s__lut_size), ((PyObject *)__pyx_n_s__size), ((PyObject *)__pyx_n_s__sum_data), ((PyObject *)__pyx_n_s__sum_count), ((PyObject *)__pyx_n_s__epsilon), ((PyObject *)__pyx_n_s__data), ((PyObject *)__pyx_n_s__coef), ((PyObject *)__pyx_n_s__cdummy), ((PyObject *)__pyx_n_s__cddummy), ((PyObject *)__pyx_n_s__do_dummy), ((PyObject *)__pyx_n_s__do_dark), ((PyObject *)__pyx_n_s__do_flat), ((PyObject *)__pyx_n_s__do_polarization), ((PyObject *)__pyx_n_s__do_solidAngle), ((PyObject *)__pyx_n_s__outData), ((PyObject *)__pyx_n_s__outCount), ((PyObject *)__pyx_n_s__outMerge), ((PyObject *)__pyx_n_s__lut), ((PyObject *)__pyx_n_s__cdata), ((PyObject *)__pyx_n_s__tdata), ((PyObject *)__pyx_n_s__cflat), ((PyObject *)__pyx_n_s__cdark), ((PyObject *)__pyx_n_s__csolidAngle), ((PyObject *)__pyx_n_s__cpolarization)); if (unlikely(!__pyx_k_tuple_61)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_k_tuple_61);
      __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_61));
      __pyx_k_codeobj_62 = (PyObject*)__Pyx_PyCode_New(8, 0, 36, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_61, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_56, __pyx_n_s__integrate, 257, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_62)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

      /* "splitBBoxLUT.pyx":257
     *     @cython.boundscheck(False)
     *     @cython.wraparound(False)
     *     def integrate(self, weights, dummy=None, delta_dummy=None, dark=None, flat=None, solidAngle=None, polarization=None):             # <<<<<<<<<<<<<<
     *         """
     *         Actually perform the integration which in this case looks more like a matrix-vector product
     */
      __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_12splitBBoxLUT_11HistoBBox1d_5integrate, 0, __pyx_n_s_64, NULL, __pyx_n_s__splitBBoxLUT, ((PyObject *)__pyx_k_codeobj_62)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_1, ((PyObject *)__pyx_k_tuple_63));
      if (PyObject_SetItem(__pyx_t_8, __pyx_n_s__integrate, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_k_tuple_63 = PyTuple_Pack(6, ((PyObject *)Py_None), ((PyObject *)Py_None), ((PyObject *)Py_None), ((PyObject *)Py_None), ((PyObject *)Py_None), ((PyObject *)Py_None)); if (unlikely(!__pyx_k_tuple_63)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_k_tuple_63);
      __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_63));

     258:         """

     259:         Actually perform the integration which in this case looks more like a matrix-vector product

     260:

     261:         @param weights: input image

     262:         @type weights: ndarray

     263:         @param dummy: value for dead pixels (optional)

     264:         @type dummy: float

     265:         @param delta_dummy: precision for dead-pixel value in dynamic masking

     266:         @type delta_dummy: float

     267:         @param dark: array with the dark-current value to be subtracted (if any)

     268:         @type dark: ndarray

     269:         @param flat: array with the dark-current value to be divided by (if any)

     270:         @type flat: ndarray

     271:         @param solidAngle: array with the solid angle of each pixel to be divided by (if any)

     272:         @type solidAngle: ndarray

     273:         @param polarization: array with the polarization correction values to be divided by (if any)

     274:         @type polarization: ndarray

     275:         @return : positions, pattern, weighted_histogram and unweighted_histogram

     276:         @rtype: 4-tuple of ndarrays

     277:

     278:         """

     279:         cdef int i=0, j=0, idx=0, bins=self.bins, lut_size=self.lut_size, size=self.size

      /* "splitBBoxLUT.pyx":279
     *
     *         """
     *         cdef int i=0, j=0, idx=0, bins=self.bins, lut_size=self.lut_size, size=self.size             # <<<<<<<<<<<<<<
     *         cdef double sum_data=0, sum_count=0, epsilon=1e-10
     *         cdef float data=0, coef=0, cdummy=0, cddummy=0
     */
      __pyx_v_i = 0;
      __pyx_v_j = 0;
      __pyx_v_idx = 0;
      __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__bins); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyInt_AsInt(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v_bins = __pyx_t_2;
      __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__lut_size); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyInt_AsInt(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v_lut_size = __pyx_t_2;
      __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__size); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyInt_AsInt(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v_size = __pyx_t_2;

     280:         cdef double sum_data=0, sum_count=0, epsilon=1e-10

      /* "splitBBoxLUT.pyx":280
     *         """
     *         cdef int i=0, j=0, idx=0, bins=self.bins, lut_size=self.lut_size, size=self.size
     *         cdef double sum_data=0, sum_count=0, epsilon=1e-10             # <<<<<<<<<<<<<<
     *         cdef float data=0, coef=0, cdummy=0, cddummy=0
     *         cdef bint do_dummy=False, do_dark=False, do_flat=False, do_polarization=False, do_solidAngle=False
     */
      __pyx_v_sum_data = 0.0;
      __pyx_v_sum_count = 0.0;
      __pyx_v_epsilon = 1e-10;

     281:         cdef float data=0, coef=0, cdummy=0, cddummy=0

      /* "splitBBoxLUT.pyx":281
     *         cdef int i=0, j=0, idx=0, bins=self.bins, lut_size=self.lut_size, size=self.size
     *         cdef double sum_data=0, sum_count=0, epsilon=1e-10
     *         cdef float data=0, coef=0, cdummy=0, cddummy=0             # <<<<<<<<<<<<<<
     *         cdef bint do_dummy=False, do_dark=False, do_flat=False, do_polarization=False, do_solidAngle=False
     *         cdef numpy.ndarray[numpy.float64_t, ndim = 1] outData = numpy.zeros(self.bins, dtype=numpy.float64)
     */
      __pyx_v_data = 0.0;
      __pyx_v_coef = 0.0;
      __pyx_v_cdummy = 0.0;
      __pyx_v_cddummy = 0.0;

     282:         cdef bint do_dummy=False, do_dark=False, do_flat=False, do_polarization=False, do_solidAngle=False

      /* "splitBBoxLUT.pyx":282
     *         cdef double sum_data=0, sum_count=0, epsilon=1e-10
     *         cdef float data=0, coef=0, cdummy=0, cddummy=0
     *         cdef bint do_dummy=False, do_dark=False, do_flat=False, do_polarization=False, do_solidAngle=False             # <<<<<<<<<<<<<<
     *         cdef numpy.ndarray[numpy.float64_t, ndim = 1] outData = numpy.zeros(self.bins, dtype=numpy.float64)
     *         cdef numpy.ndarray[numpy.float64_t, ndim = 1] outCount = numpy.zeros(self.bins, dtype=numpy.float64)
     */
      __pyx_v_do_dummy = 0;
      __pyx_v_do_dark = 0;
      __pyx_v_do_flat = 0;
      __pyx_v_do_polarization = 0;
      __pyx_v_do_solidAngle = 0;

     283:         cdef numpy.ndarray[numpy.float64_t, ndim = 1] outData = numpy.zeros(self.bins, dtype=numpy.float64)

      /* "splitBBoxLUT.pyx":283
     *         cdef float data=0, coef=0, cdummy=0, cddummy=0
     *         cdef bint do_dummy=False, do_dark=False, do_flat=False, do_polarization=False, do_solidAngle=False
     *         cdef numpy.ndarray[numpy.float64_t, ndim = 1] outData = numpy.zeros(self.bins, dtype=numpy.float64)             # <<<<<<<<<<<<<<
     *         cdef numpy.ndarray[numpy.float64_t, ndim = 1] outCount = numpy.zeros(self.bins, dtype=numpy.float64)
     *         cdef numpy.ndarray[numpy.float32_t, ndim = 1] outMerge = numpy.zeros(self.bins, dtype=numpy.float32)
     */
      __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__zeros); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__bins); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_1));
      __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__float64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__dtype), __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
      if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_7 = ((PyArrayObject *)__pyx_t_6);
      {
        __Pyx_BufFmt_StackElem __pyx_stack[1];
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_outData.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
          __pyx_v_outData = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_outData.rcbuffer->pybuffer.buf = NULL;
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        } else {__pyx_pybuffernd_outData.diminfo[0].strides = __pyx_pybuffernd_outData.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_outData.diminfo[0].shape = __pyx_pybuffernd_outData.rcbuffer->pybuffer.shape[0];
        }
      }
      __pyx_t_7 = 0;
      __pyx_v_outData = ((PyArrayObject *)__pyx_t_6);
      __pyx_t_6 = 0;

     284:         cdef numpy.ndarray[numpy.float64_t, ndim = 1] outCount = numpy.zeros(self.bins, dtype=numpy.float64)

      /* "splitBBoxLUT.pyx":284
     *         cdef bint do_dummy=False, do_dark=False, do_flat=False, do_polarization=False, do_solidAngle=False
     *         cdef numpy.ndarray[numpy.float64_t, ndim = 1] outData = numpy.zeros(self.bins, dtype=numpy.float64)
     *         cdef numpy.ndarray[numpy.float64_t, ndim = 1] outCount = numpy.zeros(self.bins, dtype=numpy.float64)             # <<<<<<<<<<<<<<
     *         cdef numpy.ndarray[numpy.float32_t, ndim = 1] outMerge = numpy.zeros(self.bins, dtype=numpy.float32)
     *         cdef lut_point[:,:] lut = self.lut
     */
      __pyx_t_6 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 284; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_1 = PyObject_GetAttr(__pyx_t_6, __pyx_n_s__zeros); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 284; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__bins); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 284; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 284; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_6);
      __pyx_t_6 = 0;
      __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 284; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_6));
      __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 284; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_5 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__float64); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 284; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (PyDict_SetItem(__pyx_t_6, ((PyObject *)__pyx_n_s__dtype), __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 284; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_6)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 284; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
      if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 284; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_8 = ((PyArrayObject *)__pyx_t_5);
      {
        __Pyx_BufFmt_StackElem __pyx_stack[1];
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_outCount.rcbuffer->pybuffer, (PyObject*)__pyx_t_8, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
          __pyx_v_outCount = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_outCount.rcbuffer->pybuffer.buf = NULL;
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 284; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        } else {__pyx_pybuffernd_outCount.diminfo[0].strides = __pyx_pybuffernd_outCount.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_outCount.diminfo[0].shape = __pyx_pybuffernd_outCount.rcbuffer->pybuffer.shape[0];
        }
      }
      __pyx_t_8 = 0;
      __pyx_v_outCount = ((PyArrayObject *)__pyx_t_5);
      __pyx_t_5 = 0;

     285:         cdef numpy.ndarray[numpy.float32_t, ndim = 1] outMerge = numpy.zeros(self.bins, dtype=numpy.float32)

      /* "splitBBoxLUT.pyx":285
     *         cdef numpy.ndarray[numpy.float64_t, ndim = 1] outData = numpy.zeros(self.bins, dtype=numpy.float64)
     *         cdef numpy.ndarray[numpy.float64_t, ndim = 1] outCount = numpy.zeros(self.bins, dtype=numpy.float64)
     *         cdef numpy.ndarray[numpy.float32_t, ndim = 1] outMerge = numpy.zeros(self.bins, dtype=numpy.float32)             # <<<<<<<<<<<<<<
     *         cdef lut_point[:,:] lut = self.lut
     *         cdef float[:] cdata, tdata, cflat, cdark, csolidAngle, cpolarization
     */
      __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__zeros); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__bins); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_5);
      __pyx_t_5 = 0;
      __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_5));
      __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__float32); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (PyDict_SetItem(__pyx_t_5, ((PyObject *)__pyx_n_s__dtype), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
      if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_9 = ((PyArrayObject *)__pyx_t_3);
      {
        __Pyx_BufFmt_StackElem __pyx_stack[1];
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_outMerge.rcbuffer->pybuffer, (PyObject*)__pyx_t_9, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
          __pyx_v_outMerge = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_outMerge.rcbuffer->pybuffer.buf = NULL;
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        } else {__pyx_pybuffernd_outMerge.diminfo[0].strides = __pyx_pybuffernd_outMerge.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_outMerge.diminfo[0].shape = __pyx_pybuffernd_outMerge.rcbuffer->pybuffer.shape[0];
        }
      }
      __pyx_t_9 = 0;
      __pyx_v_outMerge = ((PyArrayObject *)__pyx_t_3);
      __pyx_t_3 = 0;

     286:         cdef lut_point[:,:] lut = self.lut

      /* "splitBBoxLUT.pyx":286
     *         cdef numpy.ndarray[numpy.float64_t, ndim = 1] outCount = numpy.zeros(self.bins, dtype=numpy.float64)
     *         cdef numpy.ndarray[numpy.float32_t, ndim = 1] outMerge = numpy.zeros(self.bins, dtype=numpy.float32)
     *         cdef lut_point[:,:] lut = self.lut             # <<<<<<<<<<<<<<
     *         cdef float[:] cdata, tdata, cflat, cdark, csolidAngle, cpolarization
     *
     */
      __pyx_t_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__lut); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 286; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_10 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn_struct___pyx_t_12splitBBoxLUT_lut_point(__pyx_t_3);
      if (unlikely(!__pyx_t_10.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 286; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_v_lut = __pyx_t_10;
      __pyx_t_10.memview = NULL;
      __pyx_t_10.data = NULL;

     287:         cdef float[:] cdata, tdata, cflat, cdark, csolidAngle, cpolarization

     288:

     289:         assert size == weights.size

      /* "splitBBoxLUT.pyx":289
     *         cdef float[:] cdata, tdata, cflat, cdark, csolidAngle, cpolarization
     *
     *         assert size == weights.size             # <<<<<<<<<<<<<<
     *
     *         if dummy is not None:
     */
      #ifndef CYTHON_WITHOUT_ASSERTIONS
      __pyx_t_3 = PyInt_FromLong(__pyx_v_size); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 289; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_5 = PyObject_GetAttr(__pyx_v_weights, __pyx_n_s__size); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 289; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 289; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 289; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_11)) {
        PyErr_SetNone(PyExc_AssertionError);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 289; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      #endif

     290:

     291:         if dummy is not None:

      /* "splitBBoxLUT.pyx":291
     *         assert size == weights.size
     *
     *         if dummy is not None:             # <<<<<<<<<<<<<<
     *             do_dummy = True
     *             cdummy =  <float>float(dummy)
     */
      __pyx_t_11 = (__pyx_v_dummy != Py_None);
      if (__pyx_t_11) {

     292:             do_dummy = True

        /* "splitBBoxLUT.pyx":292
     *
     *         if dummy is not None:
     *             do_dummy = True             # <<<<<<<<<<<<<<
     *             cdummy =  <float>float(dummy)
     *             if delta_dummy is None:
     */
        __pyx_v_do_dummy = 1;

     293:             cdummy =  <float>float(dummy)

        /* "splitBBoxLUT.pyx":293
     *         if dummy is not None:
     *             do_dummy = True
     *             cdummy =  <float>float(dummy)             # <<<<<<<<<<<<<<
     *             if delta_dummy is None:
     *                 cddummy = <float>0.0
     */
        __pyx_t_12 = __Pyx_PyObject_AsDouble(__pyx_v_dummy); if (unlikely(__pyx_t_12 == ((double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_v_cdummy = ((float)__pyx_t_12);

     294:             if delta_dummy is None:

        /* "splitBBoxLUT.pyx":294
     *             do_dummy = True
     *             cdummy =  <float>float(dummy)
     *             if delta_dummy is None:             # <<<<<<<<<<<<<<
     *                 cddummy = <float>0.0
     *             else:
     */
        __pyx_t_11 = (__pyx_v_delta_dummy == Py_None);
        if (__pyx_t_11) {

     295:                 cddummy = <float>0.0

          /* "splitBBoxLUT.pyx":295
     *             cdummy =  <float>float(dummy)
     *             if delta_dummy is None:
     *                 cddummy = <float>0.0             # <<<<<<<<<<<<<<
     *             else:
     *                 cddummy = <float>float(delta_dummy)
     */
          __pyx_v_cddummy = ((float)0.0);
          goto __pyx_L4;
        }
        /*else*/ {

     296:             else:

     297:                 cddummy = <float>float(delta_dummy)

          /* "splitBBoxLUT.pyx":297
     *                 cddummy = <float>0.0
     *             else:
     *                 cddummy = <float>float(delta_dummy)             # <<<<<<<<<<<<<<
     *
     *         if flat is not None:
     */
          __pyx_t_12 = __Pyx_PyObject_AsDouble(__pyx_v_delta_dummy); if (unlikely(__pyx_t_12 == ((double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __pyx_v_cddummy = ((float)__pyx_t_12);
        }
        __pyx_L4:;
        goto __pyx_L3;
      }
      __pyx_L3:;

     298:

     299:         if flat is not None:

      /* "splitBBoxLUT.pyx":299
     *                 cddummy = <float>float(delta_dummy)
     *
     *         if flat is not None:             # <<<<<<<<<<<<<<
     *             do_flat = True
     *             assert flat.size == size
     */
      __pyx_t_11 = (__pyx_v_flat != Py_None);
      if (__pyx_t_11) {

     300:             do_flat = True

        /* "splitBBoxLUT.pyx":300
     *
     *         if flat is not None:
     *             do_flat = True             # <<<<<<<<<<<<<<
     *             assert flat.size == size
     *             cflat = numpy.ascontiguousarray(flat.ravel(), dtype=numpy.float32)
     */
        __pyx_v_do_flat = 1;

     301:             assert flat.size == size

        /* "splitBBoxLUT.pyx":301
     *         if flat is not None:
     *             do_flat = True
     *             assert flat.size == size             # <<<<<<<<<<<<<<
     *             cflat = numpy.ascontiguousarray(flat.ravel(), dtype=numpy.float32)
     *         if dark is not None:
     */
        #ifndef CYTHON_WITHOUT_ASSERTIONS
        __pyx_t_4 = PyObject_GetAttr(__pyx_v_flat, __pyx_n_s__size); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_5 = PyInt_FromLong(__pyx_v_size); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_3 = PyObject_RichCompare(__pyx_t_4, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (unlikely(!__pyx_t_11)) {
          PyErr_SetNone(PyExc_AssertionError);
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        #endif

     302:             cflat = numpy.ascontiguousarray(flat.ravel(), dtype=numpy.float32)

        /* "splitBBoxLUT.pyx":302
     *             do_flat = True
     *             assert flat.size == size
     *             cflat = numpy.ascontiguousarray(flat.ravel(), dtype=numpy.float32)             # <<<<<<<<<<<<<<
     *         if dark is not None:
     *             do_dark = True
     */
        __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_5 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__ascontiguousarray); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_3 = PyObject_GetAttr(__pyx_v_flat, __pyx_n_s__ravel); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
        __Pyx_GIVEREF(__pyx_t_4);
        __pyx_t_4 = 0;
        __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(((PyObject *)__pyx_t_4));
        __pyx_t_6 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_1 = PyObject_GetAttr(__pyx_t_6, __pyx_n_s__float32); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (PyDict_SetItem(__pyx_t_4, ((PyObject *)__pyx_n_s__dtype), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_t_1 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_3), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
        __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
        __pyx_t_13 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(__pyx_t_1);
        if (unlikely(!__pyx_t_13.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_v_cflat = __pyx_t_13;
        __pyx_t_13.memview = NULL;
        __pyx_t_13.data = NULL;
        goto __pyx_L5;
      }
      __pyx_L5:;

     303:         if dark is not None:

      /* "splitBBoxLUT.pyx":303
     *             assert flat.size == size
     *             cflat = numpy.ascontiguousarray(flat.ravel(), dtype=numpy.float32)
     *         if dark is not None:             # <<<<<<<<<<<<<<
     *             do_dark = True
     *             assert dark.size == size
     */
      __pyx_t_11 = (__pyx_v_dark != Py_None);
      if (__pyx_t_11) {

     304:             do_dark = True

        /* "splitBBoxLUT.pyx":304
     *             cflat = numpy.ascontiguousarray(flat.ravel(), dtype=numpy.float32)
     *         if dark is not None:
     *             do_dark = True             # <<<<<<<<<<<<<<
     *             assert dark.size == size
     *             cdark = numpy.ascontiguousarray(dark.ravel(), dtype=numpy.float32)
     */
        __pyx_v_do_dark = 1;

     305:             assert dark.size == size

        /* "splitBBoxLUT.pyx":305
     *         if dark is not None:
     *             do_dark = True
     *             assert dark.size == size             # <<<<<<<<<<<<<<
     *             cdark = numpy.ascontiguousarray(dark.ravel(), dtype=numpy.float32)
     *         if solidAngle is not None:
     */
        #ifndef CYTHON_WITHOUT_ASSERTIONS
        __pyx_t_1 = PyObject_GetAttr(__pyx_v_dark, __pyx_n_s__size); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_4 = PyInt_FromLong(__pyx_v_size); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (unlikely(!__pyx_t_11)) {
          PyErr_SetNone(PyExc_AssertionError);
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        #endif

     306:             cdark = numpy.ascontiguousarray(dark.ravel(), dtype=numpy.float32)

        /* "splitBBoxLUT.pyx":306
     *             do_dark = True
     *             assert dark.size == size
     *             cdark = numpy.ascontiguousarray(dark.ravel(), dtype=numpy.float32)             # <<<<<<<<<<<<<<
     *         if solidAngle is not None:
     *             do_solidAngle = True
     */
        __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_4 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__ascontiguousarray); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_3 = PyObject_GetAttr(__pyx_v_dark, __pyx_n_s__ravel); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_1 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
        __Pyx_GIVEREF(__pyx_t_1);
        __pyx_t_1 = 0;
        __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(((PyObject *)__pyx_t_1));
        __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_6 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__float32); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__dtype), __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_6 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_3), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
        __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
        __pyx_t_13 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(__pyx_t_6);
        if (unlikely(!__pyx_t_13.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_v_cdark = __pyx_t_13;
        __pyx_t_13.memview = NULL;
        __pyx_t_13.data = NULL;
        goto __pyx_L6;
      }
      __pyx_L6:;

     307:         if solidAngle is not None:

      /* "splitBBoxLUT.pyx":307
     *             assert dark.size == size
     *             cdark = numpy.ascontiguousarray(dark.ravel(), dtype=numpy.float32)
     *         if solidAngle is not None:             # <<<<<<<<<<<<<<
     *             do_solidAngle = True
     *             assert solidAngle.size == size
     */
      __pyx_t_11 = (__pyx_v_solidAngle != Py_None);
      if (__pyx_t_11) {

     308:             do_solidAngle = True

        /* "splitBBoxLUT.pyx":308
     *             cdark = numpy.ascontiguousarray(dark.ravel(), dtype=numpy.float32)
     *         if solidAngle is not None:
     *             do_solidAngle = True             # <<<<<<<<<<<<<<
     *             assert solidAngle.size == size
     *             csolidAngle = numpy.ascontiguousarray(solidAngle.ravel(), dtype=numpy.float32)
     */
        __pyx_v_do_solidAngle = 1;

     309:             assert solidAngle.size == size

        /* "splitBBoxLUT.pyx":309
     *         if solidAngle is not None:
     *             do_solidAngle = True
     *             assert solidAngle.size == size             # <<<<<<<<<<<<<<
     *             csolidAngle = numpy.ascontiguousarray(solidAngle.ravel(), dtype=numpy.float32)
     *         if polarization is not None:
     */
        #ifndef CYTHON_WITHOUT_ASSERTIONS
        __pyx_t_6 = PyObject_GetAttr(__pyx_v_solidAngle, __pyx_n_s__size); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_1 = PyInt_FromLong(__pyx_v_size); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_3 = PyObject_RichCompare(__pyx_t_6, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (unlikely(!__pyx_t_11)) {
          PyErr_SetNone(PyExc_AssertionError);
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        #endif

     310:             csolidAngle = numpy.ascontiguousarray(solidAngle.ravel(), dtype=numpy.float32)

        /* "splitBBoxLUT.pyx":310
     *             do_solidAngle = True
     *             assert solidAngle.size == size
     *             csolidAngle = numpy.ascontiguousarray(solidAngle.ravel(), dtype=numpy.float32)             # <<<<<<<<<<<<<<
     *         if polarization is not None:
     *             do_polarization = True
     */
        __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 310; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_1 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__ascontiguousarray); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 310; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_3 = PyObject_GetAttr(__pyx_v_solidAngle, __pyx_n_s__ravel); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 310; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_6 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 310; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 310; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6);
        __Pyx_GIVEREF(__pyx_t_6);
        __pyx_t_6 = 0;
        __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 310; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(((PyObject *)__pyx_t_6));
        __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 310; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_5 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__float32); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 310; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (PyDict_SetItem(__pyx_t_6, ((PyObject *)__pyx_n_s__dtype), __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 310; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), ((PyObject *)__pyx_t_6)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 310; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
        __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
        __pyx_t_13 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(__pyx_t_5);
        if (unlikely(!__pyx_t_13.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 310; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_v_csolidAngle = __pyx_t_13;
        __pyx_t_13.memview = NULL;
        __pyx_t_13.data = NULL;
        goto __pyx_L7;
      }
      __pyx_L7:;

     311:         if polarization is not None:

      /* "splitBBoxLUT.pyx":311
     *             assert solidAngle.size == size
     *             csolidAngle = numpy.ascontiguousarray(solidAngle.ravel(), dtype=numpy.float32)
     *         if polarization is not None:             # <<<<<<<<<<<<<<
     *             do_polarization = True
     *             assert polarization.size == size
     */
      __pyx_t_11 = (__pyx_v_polarization != Py_None);
      if (__pyx_t_11) {

     312:             do_polarization = True

        /* "splitBBoxLUT.pyx":312
     *             csolidAngle = numpy.ascontiguousarray(solidAngle.ravel(), dtype=numpy.float32)
     *         if polarization is not None:
     *             do_polarization = True             # <<<<<<<<<<<<<<
     *             assert polarization.size == size
     *             cpolarization = numpy.ascontiguousarray(polarization.ravel(), dtype=numpy.float32)
     */
        __pyx_v_do_polarization = 1;

     313:             assert polarization.size == size

        /* "splitBBoxLUT.pyx":313
     *         if polarization is not None:
     *             do_polarization = True
     *             assert polarization.size == size             # <<<<<<<<<<<<<<
     *             cpolarization = numpy.ascontiguousarray(polarization.ravel(), dtype=numpy.float32)
     *
     */
        #ifndef CYTHON_WITHOUT_ASSERTIONS
        __pyx_t_5 = PyObject_GetAttr(__pyx_v_polarization, __pyx_n_s__size); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_6 = PyInt_FromLong(__pyx_v_size); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_3 = PyObject_RichCompare(__pyx_t_5, __pyx_t_6, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (unlikely(!__pyx_t_11)) {
          PyErr_SetNone(PyExc_AssertionError);
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        #endif

     314:             cpolarization = numpy.ascontiguousarray(polarization.ravel(), dtype=numpy.float32)

        /* "splitBBoxLUT.pyx":314
     *             do_polarization = True
     *             assert polarization.size == size
     *             cpolarization = numpy.ascontiguousarray(polarization.ravel(), dtype=numpy.float32)             # <<<<<<<<<<<<<<
     *
     *         if (do_dark + do_flat + do_polarization + do_solidAngle):
     */
        __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_6 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__ascontiguousarray); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_3 = PyObject_GetAttr(__pyx_v_polarization, __pyx_n_s__ravel); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_5 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5);
        __Pyx_GIVEREF(__pyx_t_5);
        __pyx_t_5 = 0;
        __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(((PyObject *)__pyx_t_5));
        __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_4 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__float32); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        if (PyDict_SetItem(__pyx_t_5, ((PyObject *)__pyx_n_s__dtype), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_4 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_t_3), ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
        __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
        __pyx_t_13 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(__pyx_t_4);
        if (unlikely(!__pyx_t_13.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_v_cpolarization = __pyx_t_13;
        __pyx_t_13.memview = NULL;
        __pyx_t_13.data = NULL;
        goto __pyx_L8;
      }
      __pyx_L8:;

     315:

     316:         if (do_dark + do_flat + do_polarization + do_solidAngle):

      /* "splitBBoxLUT.pyx":316
     *             cpolarization = numpy.ascontiguousarray(polarization.ravel(), dtype=numpy.float32)
     *
     *         if (do_dark + do_flat + do_polarization + do_solidAngle):             # <<<<<<<<<<<<<<
     *             tdata = numpy.ascontiguousarray(weights.ravel(), dtype=numpy.float32)
     *             cdata = numpy.zeros(size,dtype=numpy.float32)
     */
      __pyx_t_2 = (((__pyx_v_do_dark + __pyx_v_do_flat) + __pyx_v_do_polarization) + __pyx_v_do_solidAngle);
      if (__pyx_t_2) {

     317:             tdata = numpy.ascontiguousarray(weights.ravel(), dtype=numpy.float32)

        /* "splitBBoxLUT.pyx":317
     *
     *         if (do_dark + do_flat + do_polarization + do_solidAngle):
     *             tdata = numpy.ascontiguousarray(weights.ravel(), dtype=numpy.float32)             # <<<<<<<<<<<<<<
     *             cdata = numpy.zeros(size,dtype=numpy.float32)
     *             if do_dummy:
     */
        __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_5 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__ascontiguousarray); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_4 = PyObject_GetAttr(__pyx_v_weights, __pyx_n_s__ravel); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_3 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
        __Pyx_GIVEREF(__pyx_t_3);
        __pyx_t_3 = 0;
        __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(((PyObject *)__pyx_t_3));
        __pyx_t_6 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_1 = PyObject_GetAttr(__pyx_t_6, __pyx_n_s__float32); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__dtype), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_t_1 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
        __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
        __pyx_t_13 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(__pyx_t_1);
        if (unlikely(!__pyx_t_13.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_v_tdata = __pyx_t_13;
        __pyx_t_13.memview = NULL;
        __pyx_t_13.data = NULL;

     318:             cdata = numpy.zeros(size,dtype=numpy.float32)

        /* "splitBBoxLUT.pyx":318
     *         if (do_dark + do_flat + do_polarization + do_solidAngle):
     *             tdata = numpy.ascontiguousarray(weights.ravel(), dtype=numpy.float32)
     *             cdata = numpy.zeros(size,dtype=numpy.float32)             # <<<<<<<<<<<<<<
     *             if do_dummy:
     *                 for i in prange(size, nogil=True, schedule="static"):
     */
        __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_3 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__zeros); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_t_1 = PyInt_FromLong(__pyx_v_size); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
        __Pyx_GIVEREF(__pyx_t_1);
        __pyx_t_1 = 0;
        __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(((PyObject *)__pyx_t_1));
        __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_6 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__float32); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__dtype), __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_6 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
        __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
        __pyx_t_13 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(__pyx_t_6);
        if (unlikely(!__pyx_t_13.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_v_cdata = __pyx_t_13;
        __pyx_t_13.memview = NULL;
        __pyx_t_13.data = NULL;

     319:             if do_dummy:

        /* "splitBBoxLUT.pyx":319
     *             tdata = numpy.ascontiguousarray(weights.ravel(), dtype=numpy.float32)
     *             cdata = numpy.zeros(size,dtype=numpy.float32)
     *             if do_dummy:             # <<<<<<<<<<<<<<
     *                 for i in prange(size, nogil=True, schedule="static"):
     *                     data = tdata[i]
     */
        if (__pyx_v_do_dummy) {

     320:                 for i in prange(size, nogil=True, schedule="static"):

          /* "splitBBoxLUT.pyx":320
     *             cdata = numpy.zeros(size,dtype=numpy.float32)
     *             if do_dummy:
     *                 for i in prange(size, nogil=True, schedule="static"):             # <<<<<<<<<<<<<<
     *                     data = tdata[i]
     *                     if ((cddummy!=0) and (fabs(data-cdummy) > cddummy)) or ((cddummy==0) and (data!=cdummy)):
     */
          {
              #ifdef WITH_THREAD
              PyThreadState *_save = NULL;
              #endif
              Py_UNBLOCK_THREADS
              /*try:*/ {
                __pyx_t_2 = __pyx_v_size;
                if (1 == 0) abort();
                {
                    #if ((defined(__APPLE__) || defined(__OSX__)) && (defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))))
                        #undef likely
                        #undef unlikely
                        #define likely(x)   (x)
                        #define unlikely(x) (x)
                    #endif
                    __pyx_t_15 = (__pyx_t_2 - 0) / 1;
                    if (__pyx_t_15 > 0)
                    {
                        #ifdef _OPENMP
                        #pragma omp parallel
                        #endif /* _OPENMP */
                        {
                            #ifdef _OPENMP
                            #pragma omp for lastprivate(__pyx_v_data) firstprivate(__pyx_v_i) lastprivate(__pyx_v_i) schedule(static)
                            #endif /* _OPENMP */
                            for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_15; __pyx_t_14++){
                                {
                                    __pyx_v_i = 0 + 1 * __pyx_t_14;
                                    /* Initialize private variables to invalid values */
                                    __pyx_v_data = ((float)__PYX_NAN);

              /* "splitBBoxLUT.pyx":320
     *             cdata = numpy.zeros(size,dtype=numpy.float32)
     *             if do_dummy:
     *                 for i in prange(size, nogil=True, schedule="static"):             # <<<<<<<<<<<<<<
     *                     data = tdata[i]
     *                     if ((cddummy!=0) and (fabs(data-cdummy) > cddummy)) or ((cddummy==0) and (data!=cdummy)):
     */
              /*finally:*/ {
                int __pyx_why;
                __pyx_why = 0; goto __pyx_L13;
                __pyx_L11: __pyx_why = 3; goto __pyx_L13;
                __pyx_L12: __pyx_why = 4; goto __pyx_L13;
                __pyx_L13:;
                Py_BLOCK_THREADS
                switch (__pyx_why) {
                  case 3: goto __pyx_L0;
                  case 4: goto __pyx_L1_error;
                }
              }
          }
          goto __pyx_L10;
        }
        /*else*/ {

     321:                     data = tdata[i]

                                    /* "splitBBoxLUT.pyx":321
     *             if do_dummy:
     *                 for i in prange(size, nogil=True, schedule="static"):
     *                     data = tdata[i]             # <<<<<<<<<<<<<<
     *                     if ((cddummy!=0) and (fabs(data-cdummy) > cddummy)) or ((cddummy==0) and (data!=cdummy)):
     *                         #Nota: -= and /= operatore are seen as reduction in cython parallel.
     */
                                    __pyx_t_16 = __pyx_v_i;
                                    __pyx_v_data = (*((float *) ( /* dim=0 */ (__pyx_v_tdata.data + __pyx_t_16 * __pyx_v_tdata.strides[0]) )));

     322:                     if ((cddummy!=0) and (fabs(data-cdummy) > cddummy)) or ((cddummy==0) and (data!=cdummy)):

                                    /* "splitBBoxLUT.pyx":322
     *                 for i in prange(size, nogil=True, schedule="static"):
     *                     data = tdata[i]
     *                     if ((cddummy!=0) and (fabs(data-cdummy) > cddummy)) or ((cddummy==0) and (data!=cdummy)):             # <<<<<<<<<<<<<<
     *                         #Nota: -= and /= operatore are seen as reduction in cython parallel.
     *                         if do_dark:
     */
                                    __pyx_t_11 = (__pyx_v_cddummy != 0.0);
                                    if (__pyx_t_11) {
                                      __pyx_t_17 = (fabs((__pyx_v_data - __pyx_v_cdummy)) > __pyx_v_cddummy);
                                      __pyx_t_18 = __pyx_t_17;
                                    } else {
                                      __pyx_t_18 = __pyx_t_11;
                                    }
                                    if (!__pyx_t_18) {
                                      __pyx_t_11 = (__pyx_v_cddummy == 0.0);
                                      if (__pyx_t_11) {
                                        __pyx_t_17 = (__pyx_v_data != __pyx_v_cdummy);
                                        __pyx_t_19 = __pyx_t_17;
                                      } else {
                                        __pyx_t_19 = __pyx_t_11;
                                      }
                                      __pyx_t_11 = __pyx_t_19;
                                    } else {
                                      __pyx_t_11 = __pyx_t_18;
                                    }
                                    if (__pyx_t_11) {

     323:                         #Nota: -= and /= operatore are seen as reduction in cython parallel.

     324:                         if do_dark:

                                      /* "splitBBoxLUT.pyx":324
     *                     if ((cddummy!=0) and (fabs(data-cdummy) > cddummy)) or ((cddummy==0) and (data!=cdummy)):
     *                         #Nota: -= and /= operatore are seen as reduction in cython parallel.
     *                         if do_dark:             # <<<<<<<<<<<<<<
     *                             data = data - cdark[i]
     *                         if do_flat:
     */
                                      if (__pyx_v_do_dark) {

     325:                             data = data - cdark[i]

                                        /* "splitBBoxLUT.pyx":325
     *                         #Nota: -= and /= operatore are seen as reduction in cython parallel.
     *                         if do_dark:
     *                             data = data - cdark[i]             # <<<<<<<<<<<<<<
     *                         if do_flat:
     *                             data = data / cflat[i]
     */
                                        if (unlikely(!__pyx_v_cdark.memview)) { __Pyx_RaiseUnboundMemoryviewSliceNogil("cdark"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L16_error;} }
                                        __pyx_t_20 = __pyx_v_i;
                                        __pyx_v_data = (__pyx_v_data - (*((float *) ( /* dim=0 */ (__pyx_v_cdark.data + __pyx_t_20 * __pyx_v_cdark.strides[0]) ))));
                                        goto __pyx_L19;
                                      }
                                      __pyx_L19:;

     326:                         if do_flat:

                                      /* "splitBBoxLUT.pyx":326
     *                         if do_dark:
     *                             data = data - cdark[i]
     *                         if do_flat:             # <<<<<<<<<<<<<<
     *                             data = data / cflat[i]
     *                         if do_polarization:
     */
                                      if (__pyx_v_do_flat) {

     327:                             data = data / cflat[i]

                                        /* "splitBBoxLUT.pyx":327
     *                             data = data - cdark[i]
     *                         if do_flat:
     *                             data = data / cflat[i]             # <<<<<<<<<<<<<<
     *                         if do_polarization:
     *                             data = data / cpolarization[i]
     */
                                        if (unlikely(!__pyx_v_cflat.memview)) { __Pyx_RaiseUnboundMemoryviewSliceNogil("cflat"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L16_error;} }
                                        __pyx_t_21 = __pyx_v_i;
                                        __pyx_v_data = (__pyx_v_data / (*((float *) ( /* dim=0 */ (__pyx_v_cflat.data + __pyx_t_21 * __pyx_v_cflat.strides[0]) ))));
                                        goto __pyx_L20;
                                      }
                                      __pyx_L20:;

     328:                         if do_polarization:

                                      /* "splitBBoxLUT.pyx":328
     *                         if do_flat:
     *                             data = data / cflat[i]
     *                         if do_polarization:             # <<<<<<<<<<<<<<
     *                             data = data / cpolarization[i]
     *                         if do_solidAngle:
     */
                                      if (__pyx_v_do_polarization) {

     329:                             data = data / cpolarization[i]

                                        /* "splitBBoxLUT.pyx":329
     *                             data = data / cflat[i]
     *                         if do_polarization:
     *                             data = data / cpolarization[i]             # <<<<<<<<<<<<<<
     *                         if do_solidAngle:
     *                             data = data / csolidAngle[i]
     */
                                        if (unlikely(!__pyx_v_cpolarization.memview)) { __Pyx_RaiseUnboundMemoryviewSliceNogil("cpolarization"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L16_error;} }
                                        __pyx_t_22 = __pyx_v_i;
                                        __pyx_v_data = (__pyx_v_data / (*((float *) ( /* dim=0 */ (__pyx_v_cpolarization.data + __pyx_t_22 * __pyx_v_cpolarization.strides[0]) ))));
                                        goto __pyx_L21;
                                      }
                                      __pyx_L21:;

     330:                         if do_solidAngle:

                                      /* "splitBBoxLUT.pyx":330
     *                         if do_polarization:
     *                             data = data / cpolarization[i]
     *                         if do_solidAngle:             # <<<<<<<<<<<<<<
     *                             data = data / csolidAngle[i]
     *                         cdata[i]+=data
     */
                                      if (__pyx_v_do_solidAngle) {

     331:                             data = data / csolidAngle[i]

                                        /* "splitBBoxLUT.pyx":331
     *                             data = data / cpolarization[i]
     *                         if do_solidAngle:
     *                             data = data / csolidAngle[i]             # <<<<<<<<<<<<<<
     *                         cdata[i]+=data
     *                     else: #set all dummy_like values to cdummy. simplifies further processing
     */
                                        if (unlikely(!__pyx_v_csolidAngle.memview)) { __Pyx_RaiseUnboundMemoryviewSliceNogil("csolidAngle"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L16_error;} }
                                        __pyx_t_23 = __pyx_v_i;
                                        __pyx_v_data = (__pyx_v_data / (*((float *) ( /* dim=0 */ (__pyx_v_csolidAngle.data + __pyx_t_23 * __pyx_v_csolidAngle.strides[0]) ))));
                                        goto __pyx_L22;
                                      }
                                      __pyx_L22:;

     332:                         cdata[i]+=data

                                      /* "splitBBoxLUT.pyx":332
     *                         if do_solidAngle:
     *                             data = data / csolidAngle[i]
     *                         cdata[i]+=data             # <<<<<<<<<<<<<<
     *                     else: #set all dummy_like values to cdummy. simplifies further processing
     *                         cdata[i]+=cdummy
     */
                                      __pyx_t_24 = __pyx_v_i;
                                      *((float *) ( /* dim=0 */ (__pyx_v_cdata.data + __pyx_t_24 * __pyx_v_cdata.strides[0]) )) += __pyx_v_data;
                                      goto __pyx_L18;
                                    }
                                    /*else*/ {

     333:                     else: #set all dummy_like values to cdummy. simplifies further processing

     334:                         cdata[i]+=cdummy

                                      /* "splitBBoxLUT.pyx":334
     *                         cdata[i]+=data
     *                     else: #set all dummy_like values to cdummy. simplifies further processing
     *                         cdata[i]+=cdummy             # <<<<<<<<<<<<<<
     *             else:
     *                 for i in prange(size, nogil=True, schedule="static"):
     */
                                      __pyx_t_25 = __pyx_v_i;
                                      *((float *) ( /* dim=0 */ (__pyx_v_cdata.data + __pyx_t_25 * __pyx_v_cdata.strides[0]) )) += __pyx_v_cdummy;
                                    }
                                    __pyx_L18:;
                                    goto __pyx_L24;
                                    __pyx_L16_error:;
                                    {
                                        #ifdef WITH_THREAD
                                        PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
                                        #endif
                                        #ifdef _OPENMP
                                        #pragma omp flush(__pyx_parallel_exc_type)
                                        #endif /* _OPENMP */
                                        if (!__pyx_parallel_exc_type) {
                                          __Pyx_ErrFetch(&__pyx_parallel_exc_type, &__pyx_parallel_exc_value, &__pyx_parallel_exc_tb);
                                          __pyx_parallel_filename = __pyx_filename; __pyx_parallel_lineno = __pyx_lineno; __pyx_parallel_clineno = __pyx_clineno;
                                          __Pyx_GOTREF(__pyx_parallel_exc_type);
                                        }
                                        #ifdef WITH_THREAD
                                        PyGILState_Release(__pyx_gilstate_save);
                                        #endif
                                    }
                                    __pyx_parallel_why = 4;
                                    goto __pyx_L23;
                                    __pyx_L23:;
                                    #ifdef _OPENMP
                                    #pragma omp critical(__pyx_parallel_lastprivates0)
                                    #endif /* _OPENMP */
                                    {
                                        __pyx_parallel_temp0 = __pyx_v_data;
                                        __pyx_parallel_temp1 = __pyx_v_i;
                                    }
                                    __pyx_L24:;
                                    #ifdef _OPENMP
                                    #pragma omp flush(__pyx_parallel_why)
                                    #endif /* _OPENMP */
                                }
                            }
                            #ifdef _OPENMP
                            Py_END_ALLOW_THREADS
                            #else
    {
    #ifdef WITH_THREAD
                            PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
                            #endif
                            #endif /* _OPENMP */
                            /* Clean up any temporaries */
                            #ifdef WITH_THREAD
                            PyGILState_Release(__pyx_gilstate_save);
                            #endif
                            #ifndef _OPENMP
    }
    #endif /* _OPENMP */
                        }
                    }
                    if (__pyx_parallel_exc_type) {
                      /* This may have been overridden by a continue, break or return in another thread. Prefer the error. */
                      __pyx_parallel_why = 4;
                    }
                    if (__pyx_parallel_why) {
                      __pyx_v_data = __pyx_parallel_temp0;
                      __pyx_v_i = __pyx_parallel_temp1;
                      switch (__pyx_parallel_why) {
                            case 3: goto __pyx_L11;
                            case 4:
                        {
                            #ifdef WITH_THREAD
                            PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
                            #endif
                            __Pyx_ErrRestore(__pyx_parallel_exc_type, __pyx_parallel_exc_value, __pyx_parallel_exc_tb);
                            __pyx_filename = __pyx_parallel_filename; __pyx_lineno = __pyx_parallel_lineno; __pyx_clineno = __pyx_parallel_clineno;
                            __Pyx_GIVEREF(__pyx_parallel_exc_type);
                            #ifdef WITH_THREAD
                            PyGILState_Release(__pyx_gilstate_save);
                            #endif
                        }
                        goto __pyx_L12;
                      }
                    }
                }
                #if ((defined(__APPLE__) || defined(__OSX__)) && (defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))))
                    #undef likely
                    #undef unlikely
                    #define likely(x)   __builtin_expect(!!(x), 1)
                    #define unlikely(x) __builtin_expect(!!(x), 0)
                #endif
              }

     335:             else:

     336:                 for i in prange(size, nogil=True, schedule="static"):

          /* "splitBBoxLUT.pyx":336
     *                         cdata[i]+=cdummy
     *             else:
     *                 for i in prange(size, nogil=True, schedule="static"):             # <<<<<<<<<<<<<<
     *                     data = tdata[i]
     *                     if do_dark:
     */
          {
              #ifdef WITH_THREAD
              PyThreadState *_save = NULL;
              #endif
              Py_UNBLOCK_THREADS
              /*try:*/ {
                __pyx_t_15 = __pyx_v_size;
                if (1 == 0) abort();
                {
                    #if ((defined(__APPLE__) || defined(__OSX__)) && (defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))))
                        #undef likely
                        #undef unlikely
                        #define likely(x)   (x)
                        #define unlikely(x) (x)
                    #endif
                    __pyx_t_2 = (__pyx_t_15 - 0) / 1;
                    if (__pyx_t_2 > 0)
                    {
                        #ifdef _OPENMP
                        #pragma omp parallel
                        #endif /* _OPENMP */
                        {
                            #ifdef _OPENMP
                            #pragma omp for lastprivate(__pyx_v_data) firstprivate(__pyx_v_i) lastprivate(__pyx_v_i) schedule(static)
                            #endif /* _OPENMP */
                            for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_2; __pyx_t_14++){
                                {
                                    __pyx_v_i = 0 + 1 * __pyx_t_14;
                                    /* Initialize private variables to invalid values */
                                    __pyx_v_data = ((float)__PYX_NAN);

              /* "splitBBoxLUT.pyx":336
     *                         cdata[i]+=cdummy
     *             else:
     *                 for i in prange(size, nogil=True, schedule="static"):             # <<<<<<<<<<<<<<
     *                     data = tdata[i]
     *                     if do_dark:
     */
              /*finally:*/ {
                int __pyx_why;
                __pyx_why = 0; goto __pyx_L28;
                __pyx_L26: __pyx_why = 3; goto __pyx_L28;
                __pyx_L27: __pyx_why = 4; goto __pyx_L28;
                __pyx_L28:;
                Py_BLOCK_THREADS
                switch (__pyx_why) {
                  case 3: goto __pyx_L0;
                  case 4: goto __pyx_L1_error;
                }
              }
          }
        }
        __pyx_L10:;
        goto __pyx_L9;
      }
      /*else*/ {

     337:                     data = tdata[i]

                                    /* "splitBBoxLUT.pyx":337
     *             else:
     *                 for i in prange(size, nogil=True, schedule="static"):
     *                     data = tdata[i]             # <<<<<<<<<<<<<<
     *                     if do_dark:
     *                         data = data - cdark[i]
     */
                                    __pyx_t_26 = __pyx_v_i;
                                    __pyx_v_data = (*((float *) ( /* dim=0 */ (__pyx_v_tdata.data + __pyx_t_26 * __pyx_v_tdata.strides[0]) )));

     338:                     if do_dark:

                                    /* "splitBBoxLUT.pyx":338
     *                 for i in prange(size, nogil=True, schedule="static"):
     *                     data = tdata[i]
     *                     if do_dark:             # <<<<<<<<<<<<<<
     *                         data = data - cdark[i]
     *                     if do_flat:
     */
                                    if (__pyx_v_do_dark) {

     339:                         data = data - cdark[i]

                                      /* "splitBBoxLUT.pyx":339
     *                     data = tdata[i]
     *                     if do_dark:
     *                         data = data - cdark[i]             # <<<<<<<<<<<<<<
     *                     if do_flat:
     *                         data = data / cflat[i]
     */
                                      if (unlikely(!__pyx_v_cdark.memview)) { __Pyx_RaiseUnboundMemoryviewSliceNogil("cdark"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 339; __pyx_clineno = __LINE__; goto __pyx_L31_error;} }
                                      __pyx_t_27 = __pyx_v_i;
                                      __pyx_v_data = (__pyx_v_data - (*((float *) ( /* dim=0 */ (__pyx_v_cdark.data + __pyx_t_27 * __pyx_v_cdark.strides[0]) ))));
                                      goto __pyx_L33;
                                    }
                                    __pyx_L33:;

     340:                     if do_flat:

                                    /* "splitBBoxLUT.pyx":340
     *                     if do_dark:
     *                         data = data - cdark[i]
     *                     if do_flat:             # <<<<<<<<<<<<<<
     *                         data = data / cflat[i]
     *                     if do_polarization:
     */
                                    if (__pyx_v_do_flat) {

     341:                         data = data / cflat[i]

                                      /* "splitBBoxLUT.pyx":341
     *                         data = data - cdark[i]
     *                     if do_flat:
     *                         data = data / cflat[i]             # <<<<<<<<<<<<<<
     *                     if do_polarization:
     *                         data = data / cpolarization[i]
     */
                                      if (unlikely(!__pyx_v_cflat.memview)) { __Pyx_RaiseUnboundMemoryviewSliceNogil("cflat"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 341; __pyx_clineno = __LINE__; goto __pyx_L31_error;} }
                                      __pyx_t_28 = __pyx_v_i;
                                      __pyx_v_data = (__pyx_v_data / (*((float *) ( /* dim=0 */ (__pyx_v_cflat.data + __pyx_t_28 * __pyx_v_cflat.strides[0]) ))));
                                      goto __pyx_L34;
                                    }
                                    __pyx_L34:;

     342:                     if do_polarization:

                                    /* "splitBBoxLUT.pyx":342
     *                     if do_flat:
     *                         data = data / cflat[i]
     *                     if do_polarization:             # <<<<<<<<<<<<<<
     *                         data = data / cpolarization[i]
     *                     if do_solidAngle:
     */
                                    if (__pyx_v_do_polarization) {

     343:                         data = data / cpolarization[i]

                                      /* "splitBBoxLUT.pyx":343
     *                         data = data / cflat[i]
     *                     if do_polarization:
     *                         data = data / cpolarization[i]             # <<<<<<<<<<<<<<
     *                     if do_solidAngle:
     *                         data = data / csolidAngle[i]
     */
                                      if (unlikely(!__pyx_v_cpolarization.memview)) { __Pyx_RaiseUnboundMemoryviewSliceNogil("cpolarization"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L31_error;} }
                                      __pyx_t_29 = __pyx_v_i;
                                      __pyx_v_data = (__pyx_v_data / (*((float *) ( /* dim=0 */ (__pyx_v_cpolarization.data + __pyx_t_29 * __pyx_v_cpolarization.strides[0]) ))));
                                      goto __pyx_L35;
                                    }
                                    __pyx_L35:;

     344:                     if do_solidAngle:

                                    /* "splitBBoxLUT.pyx":344
     *                     if do_polarization:
     *                         data = data / cpolarization[i]
     *                     if do_solidAngle:             # <<<<<<<<<<<<<<
     *                         data = data / csolidAngle[i]
     *                     cdata[i]+=data
     */
                                    if (__pyx_v_do_solidAngle) {

     345:                         data = data / csolidAngle[i]

                                      /* "splitBBoxLUT.pyx":345
     *                         data = data / cpolarization[i]
     *                     if do_solidAngle:
     *                         data = data / csolidAngle[i]             # <<<<<<<<<<<<<<
     *                     cdata[i]+=data
     *         else:
     */
                                      if (unlikely(!__pyx_v_csolidAngle.memview)) { __Pyx_RaiseUnboundMemoryviewSliceNogil("csolidAngle"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 345; __pyx_clineno = __LINE__; goto __pyx_L31_error;} }
                                      __pyx_t_30 = __pyx_v_i;
                                      __pyx_v_data = (__pyx_v_data / (*((float *) ( /* dim=0 */ (__pyx_v_csolidAngle.data + __pyx_t_30 * __pyx_v_csolidAngle.strides[0]) ))));
                                      goto __pyx_L36;
                                    }
                                    __pyx_L36:;

     346:                     cdata[i]+=data

                                    /* "splitBBoxLUT.pyx":346
     *                     if do_solidAngle:
     *                         data = data / csolidAngle[i]
     *                     cdata[i]+=data             # <<<<<<<<<<<<<<
     *         else:
     *             if do_dummy:
     */
                                    __pyx_t_31 = __pyx_v_i;
                                    *((float *) ( /* dim=0 */ (__pyx_v_cdata.data + __pyx_t_31 * __pyx_v_cdata.strides[0]) )) += __pyx_v_data;
                                    goto __pyx_L38;
                                    __pyx_L31_error:;
                                    {
                                        #ifdef WITH_THREAD
                                        PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
                                        #endif
                                        #ifdef _OPENMP
                                        #pragma omp flush(__pyx_parallel_exc_type)
                                        #endif /* _OPENMP */
                                        if (!__pyx_parallel_exc_type) {
                                          __Pyx_ErrFetch(&__pyx_parallel_exc_type, &__pyx_parallel_exc_value, &__pyx_parallel_exc_tb);
                                          __pyx_parallel_filename = __pyx_filename; __pyx_parallel_lineno = __pyx_lineno; __pyx_parallel_clineno = __pyx_clineno;
                                          __Pyx_GOTREF(__pyx_parallel_exc_type);
                                        }
                                        #ifdef WITH_THREAD
                                        PyGILState_Release(__pyx_gilstate_save);
                                        #endif
                                    }
                                    __pyx_parallel_why = 4;
                                    goto __pyx_L37;
                                    __pyx_L37:;
                                    #ifdef _OPENMP
                                    #pragma omp critical(__pyx_parallel_lastprivates1)
                                    #endif /* _OPENMP */
                                    {
                                        __pyx_parallel_temp0 = __pyx_v_data;
                                        __pyx_parallel_temp1 = __pyx_v_i;
                                    }
                                    __pyx_L38:;
                                    #ifdef _OPENMP
                                    #pragma omp flush(__pyx_parallel_why)
                                    #endif /* _OPENMP */
                                }
                            }
                            #ifdef _OPENMP
                            Py_END_ALLOW_THREADS
                            #else
    {
    #ifdef WITH_THREAD
                            PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
                            #endif
                            #endif /* _OPENMP */
                            /* Clean up any temporaries */
                            #ifdef WITH_THREAD
                            PyGILState_Release(__pyx_gilstate_save);
                            #endif
                            #ifndef _OPENMP
    }
    #endif /* _OPENMP */
                        }
                    }
                    if (__pyx_parallel_exc_type) {
                      /* This may have been overridden by a continue, break or return in another thread. Prefer the error. */
                      __pyx_parallel_why = 4;
                    }
                    if (__pyx_parallel_why) {
                      __pyx_v_data = __pyx_parallel_temp0;
                      __pyx_v_i = __pyx_parallel_temp1;
                      switch (__pyx_parallel_why) {
                            case 3: goto __pyx_L26;
                            case 4:
                        {
                            #ifdef WITH_THREAD
                            PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
                            #endif
                            __Pyx_ErrRestore(__pyx_parallel_exc_type, __pyx_parallel_exc_value, __pyx_parallel_exc_tb);
                            __pyx_filename = __pyx_parallel_filename; __pyx_lineno = __pyx_parallel_lineno; __pyx_clineno = __pyx_parallel_clineno;
                            __Pyx_GIVEREF(__pyx_parallel_exc_type);
                            #ifdef WITH_THREAD
                            PyGILState_Release(__pyx_gilstate_save);
                            #endif
                        }
                        goto __pyx_L27;
                      }
                    }
                }
                #if ((defined(__APPLE__) || defined(__OSX__)) && (defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))))
                    #undef likely
                    #undef unlikely
                    #define likely(x)   __builtin_expect(!!(x), 1)
                    #define unlikely(x) __builtin_expect(!!(x), 0)
                #endif
              }

     347:         else:

     348:             if do_dummy:

        /* "splitBBoxLUT.pyx":348
     *                     cdata[i]+=data
     *         else:
     *             if do_dummy:             # <<<<<<<<<<<<<<
     *                 tdata = numpy.ascontiguousarray(weights.ravel(), dtype=numpy.float32)
     *                 cdata = numpy.zeros(size,dtype=numpy.float32)
     */
        if (__pyx_v_do_dummy) {

     349:                 tdata = numpy.ascontiguousarray(weights.ravel(), dtype=numpy.float32)

          /* "splitBBoxLUT.pyx":349
     *         else:
     *             if do_dummy:
     *                 tdata = numpy.ascontiguousarray(weights.ravel(), dtype=numpy.float32)             # <<<<<<<<<<<<<<
     *                 cdata = numpy.zeros(size,dtype=numpy.float32)
     *                 for i in prange(size, nogil=True, schedule="static"):
     */
          __pyx_t_6 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_6);
          __pyx_t_1 = PyObject_GetAttr(__pyx_t_6, __pyx_n_s__ascontiguousarray); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          __pyx_t_6 = PyObject_GetAttr(__pyx_v_weights, __pyx_n_s__ravel); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_6);
          __pyx_t_4 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_6);
          PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4);
          __Pyx_GIVEREF(__pyx_t_4);
          __pyx_t_4 = 0;
          __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(((PyObject *)__pyx_t_4));
          __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_3);
          __pyx_t_5 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__float32); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          if (PyDict_SetItem(__pyx_t_4, ((PyObject *)__pyx_n_s__dtype), __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __pyx_t_5 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_6), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
          __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
          __pyx_t_13 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(__pyx_t_5);
          if (unlikely(!__pyx_t_13.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __pyx_v_tdata = __pyx_t_13;
          __pyx_t_13.memview = NULL;
          __pyx_t_13.data = NULL;

     350:                 cdata = numpy.zeros(size,dtype=numpy.float32)

          /* "splitBBoxLUT.pyx":350
     *             if do_dummy:
     *                 tdata = numpy.ascontiguousarray(weights.ravel(), dtype=numpy.float32)
     *                 cdata = numpy.zeros(size,dtype=numpy.float32)             # <<<<<<<<<<<<<<
     *                 for i in prange(size, nogil=True, schedule="static"):
     *                     data = tdata[i]
     */
          __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_5);
          __pyx_t_4 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__zeros); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __pyx_t_5 = PyInt_FromLong(__pyx_v_size); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_5);
          __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_6);
          PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_5);
          __pyx_t_5 = 0;
          __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(((PyObject *)__pyx_t_5));
          __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_3 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__float32); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          if (PyDict_SetItem(__pyx_t_5, ((PyObject *)__pyx_n_s__dtype), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __pyx_t_3 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_6), ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
          __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
          __pyx_t_13 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(__pyx_t_3);
          if (unlikely(!__pyx_t_13.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __pyx_v_cdata = __pyx_t_13;
          __pyx_t_13.memview = NULL;
          __pyx_t_13.data = NULL;

     351:                 for i in prange(size, nogil=True, schedule="static"):

          /* "splitBBoxLUT.pyx":351
     *                 tdata = numpy.ascontiguousarray(weights.ravel(), dtype=numpy.float32)
     *                 cdata = numpy.zeros(size,dtype=numpy.float32)
     *                 for i in prange(size, nogil=True, schedule="static"):             # <<<<<<<<<<<<<<
     *                     data = tdata[i]
     *                     if ((cddummy!=0) and (fabs(data-cdummy) > cddummy)) or ((cddummy==0) and (data!=cdummy)):
     */
          {
              #ifdef WITH_THREAD
              PyThreadState *_save = NULL;
              #endif
              Py_UNBLOCK_THREADS
              /*try:*/ {
                __pyx_t_2 = __pyx_v_size;
                if (1 == 0) abort();
                {
                    #if ((defined(__APPLE__) || defined(__OSX__)) && (defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))))
                        #undef likely
                        #undef unlikely
                        #define likely(x)   (x)
                        #define unlikely(x) (x)
                    #endif
                    __pyx_t_15 = (__pyx_t_2 - 0) / 1;
                    if (__pyx_t_15 > 0)
                    {
                        #ifdef _OPENMP
                        #pragma omp parallel
                        #endif /* _OPENMP */
                        {
                            #ifdef _OPENMP
                            #pragma omp for lastprivate(__pyx_v_data) firstprivate(__pyx_v_i) lastprivate(__pyx_v_i) schedule(static)
                            #endif /* _OPENMP */
                            for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_15; __pyx_t_14++){
                                {
                                    __pyx_v_i = 0 + 1 * __pyx_t_14;
                                    /* Initialize private variables to invalid values */
                                    __pyx_v_data = ((float)__PYX_NAN);

              /* "splitBBoxLUT.pyx":351
     *                 tdata = numpy.ascontiguousarray(weights.ravel(), dtype=numpy.float32)
     *                 cdata = numpy.zeros(size,dtype=numpy.float32)
     *                 for i in prange(size, nogil=True, schedule="static"):             # <<<<<<<<<<<<<<
     *                     data = tdata[i]
     *                     if ((cddummy!=0) and (fabs(data-cdummy) > cddummy)) or ((cddummy==0) and (data!=cdummy)):
     */
              /*finally:*/ {
                Py_BLOCK_THREADS
              }
          }
          goto __pyx_L40;
        }
        /*else*/ {

     352:                     data = tdata[i]

                                    /* "splitBBoxLUT.pyx":352
     *                 cdata = numpy.zeros(size,dtype=numpy.float32)
     *                 for i in prange(size, nogil=True, schedule="static"):
     *                     data = tdata[i]             # <<<<<<<<<<<<<<
     *                     if ((cddummy!=0) and (fabs(data-cdummy) > cddummy)) or ((cddummy==0) and (data!=cdummy)):
     *                         cdata[i]+=data
     */
                                    __pyx_t_32 = __pyx_v_i;
                                    __pyx_v_data = (*((float *) ( /* dim=0 */ (__pyx_v_tdata.data + __pyx_t_32 * __pyx_v_tdata.strides[0]) )));

     353:                     if ((cddummy!=0) and (fabs(data-cdummy) > cddummy)) or ((cddummy==0) and (data!=cdummy)):

                                    /* "splitBBoxLUT.pyx":353
     *                 for i in prange(size, nogil=True, schedule="static"):
     *                     data = tdata[i]
     *                     if ((cddummy!=0) and (fabs(data-cdummy) > cddummy)) or ((cddummy==0) and (data!=cdummy)):             # <<<<<<<<<<<<<<
     *                         cdata[i]+=data
     *                     else:
     */
                                    __pyx_t_11 = (__pyx_v_cddummy != 0.0);
                                    if (__pyx_t_11) {
                                      __pyx_t_18 = (fabs((__pyx_v_data - __pyx_v_cdummy)) > __pyx_v_cddummy);
                                      __pyx_t_19 = __pyx_t_18;
                                    } else {
                                      __pyx_t_19 = __pyx_t_11;
                                    }
                                    if (!__pyx_t_19) {
                                      __pyx_t_11 = (__pyx_v_cddummy == 0.0);
                                      if (__pyx_t_11) {
                                        __pyx_t_18 = (__pyx_v_data != __pyx_v_cdummy);
                                        __pyx_t_17 = __pyx_t_18;
                                      } else {
                                        __pyx_t_17 = __pyx_t_11;
                                      }
                                      __pyx_t_11 = __pyx_t_17;
                                    } else {
                                      __pyx_t_11 = __pyx_t_19;
                                    }
                                    if (__pyx_t_11) {

     354:                         cdata[i]+=data

                                      /* "splitBBoxLUT.pyx":354
     *                     data = tdata[i]
     *                     if ((cddummy!=0) and (fabs(data-cdummy) > cddummy)) or ((cddummy==0) and (data!=cdummy)):
     *                         cdata[i]+=data             # <<<<<<<<<<<<<<
     *                     else:
     *                         cdata[i]+=cdummy
     */
                                      __pyx_t_33 = __pyx_v_i;
                                      *((float *) ( /* dim=0 */ (__pyx_v_cdata.data + __pyx_t_33 * __pyx_v_cdata.strides[0]) )) += __pyx_v_data;
                                      goto __pyx_L48;
                                    }
                                    /*else*/ {

     355:                     else:

     356:                         cdata[i]+=cdummy

                                      /* "splitBBoxLUT.pyx":356
     *                         cdata[i]+=data
     *                     else:
     *                         cdata[i]+=cdummy             # <<<<<<<<<<<<<<
     *             else:
     *                 cdata = numpy.ascontiguousarray(weights.ravel(), dtype=numpy.float32)
     */
                                      __pyx_t_34 = __pyx_v_i;
                                      *((float *) ( /* dim=0 */ (__pyx_v_cdata.data + __pyx_t_34 * __pyx_v_cdata.strides[0]) )) += __pyx_v_cdummy;
                                    }
                                    __pyx_L48:;
                                }
                            }
                        }
                    }
                }
                #if ((defined(__APPLE__) || defined(__OSX__)) && (defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))))
                    #undef likely
                    #undef unlikely
                    #define likely(x)   __builtin_expect(!!(x), 1)
                    #define unlikely(x) __builtin_expect(!!(x), 0)
                #endif
              }

     357:             else:

     358:                 cdata = numpy.ascontiguousarray(weights.ravel(), dtype=numpy.float32)

          /* "splitBBoxLUT.pyx":358
     *                         cdata[i]+=cdummy
     *             else:
     *                 cdata = numpy.ascontiguousarray(weights.ravel(), dtype=numpy.float32)             # <<<<<<<<<<<<<<
     *
     *         for i in prange(bins, nogil=True, schedule="guided"):
     */
          __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 358; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_3);
          __pyx_t_5 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__ascontiguousarray); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 358; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __pyx_t_3 = PyObject_GetAttr(__pyx_v_weights, __pyx_n_s__ravel); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 358; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_3);
          __pyx_t_6 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 358; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 358; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_3);
          PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6);
          __Pyx_GIVEREF(__pyx_t_6);
          __pyx_t_6 = 0;
          __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 358; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(((PyObject *)__pyx_t_6));
          __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 358; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_4);
          __pyx_t_1 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__float32); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 358; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (PyDict_SetItem(__pyx_t_6, ((PyObject *)__pyx_n_s__dtype), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 358; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __pyx_t_1 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_3), ((PyObject *)__pyx_t_6)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 358; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
          __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
          __pyx_t_13 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(__pyx_t_1);
          if (unlikely(!__pyx_t_13.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 358; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __pyx_v_cdata = __pyx_t_13;
          __pyx_t_13.memview = NULL;
          __pyx_t_13.data = NULL;
        }
        __pyx_L40:;
      }
      __pyx_L9:;

     359:

     360:         for i in prange(bins, nogil=True, schedule="guided"):

      /* "splitBBoxLUT.pyx":360
     *                 cdata = numpy.ascontiguousarray(weights.ravel(), dtype=numpy.float32)
     *
     *         for i in prange(bins, nogil=True, schedule="guided"):             # <<<<<<<<<<<<<<
     *             sum_data = 0.0
     *             sum_count = 0.0
     */
      {
          #ifdef WITH_THREAD
          PyThreadState *_save = NULL;
          #endif
          Py_UNBLOCK_THREADS
          /*try:*/ {
            __pyx_t_15 = __pyx_v_bins;
            if (1 == 0) abort();
            {
                #if ((defined(__APPLE__) || defined(__OSX__)) && (defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))))
                    #undef likely
                    #undef unlikely
                    #define likely(x)   (x)
                    #define unlikely(x) (x)
                #endif
                __pyx_t_2 = (__pyx_t_15 - 0) / 1;
                if (__pyx_t_2 > 0)
                {
                    #ifdef _OPENMP
                    #pragma omp parallel
                    #endif /* _OPENMP */
                    {
                        #ifdef _OPENMP
                        #pragma omp for lastprivate(__pyx_v_sum_count) firstprivate(__pyx_v_i) lastprivate(__pyx_v_i) lastprivate(__pyx_v_j) lastprivate(__pyx_v_coef) lastprivate(__pyx_v_idx) lastprivate(__pyx_v_data) lastprivate(__pyx_v_sum_data) schedule(guided)
                        #endif /* _OPENMP */
                        for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_2; __pyx_t_14++){
                            {
                                __pyx_v_i = 0 + 1 * __pyx_t_14;
                                /* Initialize private variables to invalid values */
                                __pyx_v_sum_count = ((double)__PYX_NAN);
                                __pyx_v_j = ((int)0xbad0bad0);
                                __pyx_v_coef = ((float)__PYX_NAN);
                                __pyx_v_idx = ((int)0xbad0bad0);
                                __pyx_v_data = ((float)__PYX_NAN);
                                __pyx_v_sum_data = ((double)__PYX_NAN);

          /* "splitBBoxLUT.pyx":360
     *                 cdata = numpy.ascontiguousarray(weights.ravel(), dtype=numpy.float32)
     *
     *         for i in prange(bins, nogil=True, schedule="guided"):             # <<<<<<<<<<<<<<
     *             sum_data = 0.0
     *             sum_count = 0.0
     */
          /*finally:*/ {
            Py_BLOCK_THREADS
          }
      }

     361:             sum_data = 0.0

                                /* "splitBBoxLUT.pyx":361
     *
     *         for i in prange(bins, nogil=True, schedule="guided"):
     *             sum_data = 0.0             # <<<<<<<<<<<<<<
     *             sum_count = 0.0
     *             for j in range(lut_size):
     */
                                __pyx_v_sum_data = 0.0;

     362:             sum_count = 0.0

                                /* "splitBBoxLUT.pyx":362
     *         for i in prange(bins, nogil=True, schedule="guided"):
     *             sum_data = 0.0
     *             sum_count = 0.0             # <<<<<<<<<<<<<<
     *             for j in range(lut_size):
     *                 idx = lut[i, j].idx
     */
                                __pyx_v_sum_count = 0.0;

     363:             for j in range(lut_size):

                                /* "splitBBoxLUT.pyx":363
     *             sum_data = 0.0
     *             sum_count = 0.0
     *             for j in range(lut_size):             # <<<<<<<<<<<<<<
     *                 idx = lut[i, j].idx
     *                 coef = lut[i, j].coef
     */
                                __pyx_t_35 = __pyx_v_lut_size;
                                for (__pyx_t_36 = 0; __pyx_t_36 < __pyx_t_35; __pyx_t_36+=1) {
                                  __pyx_v_j = __pyx_t_36;

     364:                 idx = lut[i, j].idx

                                  /* "splitBBoxLUT.pyx":364
     *             sum_count = 0.0
     *             for j in range(lut_size):
     *                 idx = lut[i, j].idx             # <<<<<<<<<<<<<<
     *                 coef = lut[i, j].coef
     *                 if idx <= 0 and coef <= 0.0:
     */
                                  __pyx_t_37 = __pyx_v_i;
                                  __pyx_t_38 = __pyx_v_j;
                                  __pyx_t_39 = (*((struct __pyx_t_12splitBBoxLUT_lut_point *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_lut.data + __pyx_t_37 * __pyx_v_lut.strides[0]) ) + __pyx_t_38 * __pyx_v_lut.strides[1]) ))).idx;
                                  __pyx_v_idx = __pyx_t_39;

     365:                 coef = lut[i, j].coef

                                  /* "splitBBoxLUT.pyx":365
     *             for j in range(lut_size):
     *                 idx = lut[i, j].idx
     *                 coef = lut[i, j].coef             # <<<<<<<<<<<<<<
     *                 if idx <= 0 and coef <= 0.0:
     *                     break
     */
                                  __pyx_t_40 = __pyx_v_i;
                                  __pyx_t_41 = __pyx_v_j;
                                  __pyx_t_42 = (*((struct __pyx_t_12splitBBoxLUT_lut_point *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_lut.data + __pyx_t_40 * __pyx_v_lut.strides[0]) ) + __pyx_t_41 * __pyx_v_lut.strides[1]) ))).coef;
                                  __pyx_v_coef = __pyx_t_42;

     366:                 if idx <= 0 and coef <= 0.0:

                                  /* "splitBBoxLUT.pyx":366
     *                 idx = lut[i, j].idx
     *                 coef = lut[i, j].coef
     *                 if idx <= 0 and coef <= 0.0:             # <<<<<<<<<<<<<<
     *                     break
     *                 data = cdata[idx]
     */
                                  __pyx_t_11 = (__pyx_v_idx <= 0);
                                  if (__pyx_t_11) {
                                    __pyx_t_19 = (__pyx_v_coef <= 0.0);
                                    __pyx_t_17 = __pyx_t_19;
                                  } else {
                                    __pyx_t_17 = __pyx_t_11;
                                  }
                                  if (__pyx_t_17) {

     367:                     break

                                    /* "splitBBoxLUT.pyx":367
     *                 coef = lut[i, j].coef
     *                 if idx <= 0 and coef <= 0.0:
     *                     break             # <<<<<<<<<<<<<<
     *                 data = cdata[idx]
     *                 if do_dummy and data==cdummy:
     */
                                    goto __pyx_L59_break;
                                    goto __pyx_L60;
                                  }
                                  __pyx_L60:;

     368:                 data = cdata[idx]

                                  /* "splitBBoxLUT.pyx":368
     *                 if idx <= 0 and coef <= 0.0:
     *                     break
     *                 data = cdata[idx]             # <<<<<<<<<<<<<<
     *                 if do_dummy and data==cdummy:
     *                     continue
     */
                                  __pyx_t_43 = __pyx_v_idx;
                                  __pyx_v_data = (*((float *) ( /* dim=0 */ (__pyx_v_cdata.data + __pyx_t_43 * __pyx_v_cdata.strides[0]) )));

     369:                 if do_dummy and data==cdummy:

                                  /* "splitBBoxLUT.pyx":369
     *                     break
     *                 data = cdata[idx]
     *                 if do_dummy and data==cdummy:             # <<<<<<<<<<<<<<
     *                     continue
     *
     */
                                  if (__pyx_v_do_dummy) {
                                    __pyx_t_17 = (__pyx_v_data == __pyx_v_cdummy);
                                    __pyx_t_11 = __pyx_t_17;
                                  } else {
                                    __pyx_t_11 = __pyx_v_do_dummy;
                                  }
                                  if (__pyx_t_11) {

     370:                     continue

                                    /* "splitBBoxLUT.pyx":370
     *                 data = cdata[idx]
     *                 if do_dummy and data==cdummy:
     *                     continue             # <<<<<<<<<<<<<<
     *
     *                 sum_data = sum_data + coef * data
     */
                                    goto __pyx_L58_continue;
                                    goto __pyx_L61;
                                  }
                                  __pyx_L61:;

     371:

     372:                 sum_data = sum_data + coef * data

                                  /* "splitBBoxLUT.pyx":372
     *                     continue
     *
     *                 sum_data = sum_data + coef * data             # <<<<<<<<<<<<<<
     *                 sum_count = sum_count + coef
     *             outData[i] += sum_data
     */
                                  __pyx_v_sum_data = (__pyx_v_sum_data + (__pyx_v_coef * __pyx_v_data));

     373:                 sum_count = sum_count + coef

                                  /* "splitBBoxLUT.pyx":373
     *
     *                 sum_data = sum_data + coef * data
     *                 sum_count = sum_count + coef             # <<<<<<<<<<<<<<
     *             outData[i] += sum_data
     *             outCount[i] += sum_count
     */
                                  __pyx_v_sum_count = (__pyx_v_sum_count + __pyx_v_coef);
                                  __pyx_L58_continue:;
                                }
                                __pyx_L59_break:;

     374:             outData[i] += sum_data

                                /* "splitBBoxLUT.pyx":374
     *                 sum_data = sum_data + coef * data
     *                 sum_count = sum_count + coef
     *             outData[i] += sum_data             # <<<<<<<<<<<<<<
     *             outCount[i] += sum_count
     *             if sum_count > epsilon:
     */
                                __pyx_t_35 = __pyx_v_i;
                                *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_outData.rcbuffer->pybuffer.buf, __pyx_t_35, __pyx_pybuffernd_outData.diminfo[0].strides) += __pyx_v_sum_data;

     375:             outCount[i] += sum_count

                                /* "splitBBoxLUT.pyx":375
     *                 sum_count = sum_count + coef
     *             outData[i] += sum_data
     *             outCount[i] += sum_count             # <<<<<<<<<<<<<<
     *             if sum_count > epsilon:
     *                 outMerge[i] += sum_data / sum_count
     */
                                __pyx_t_36 = __pyx_v_i;
                                *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_outCount.rcbuffer->pybuffer.buf, __pyx_t_36, __pyx_pybuffernd_outCount.diminfo[0].strides) += __pyx_v_sum_count;

     376:             if sum_count > epsilon:

                                /* "splitBBoxLUT.pyx":376
     *             outData[i] += sum_data
     *             outCount[i] += sum_count
     *             if sum_count > epsilon:             # <<<<<<<<<<<<<<
     *                 outMerge[i] += sum_data / sum_count
     *             else:
     */
                                __pyx_t_11 = (__pyx_v_sum_count > __pyx_v_epsilon);
                                if (__pyx_t_11) {

     377:                 outMerge[i] += sum_data / sum_count

                                  /* "splitBBoxLUT.pyx":377
     *             outCount[i] += sum_count
     *             if sum_count > epsilon:
     *                 outMerge[i] += sum_data / sum_count             # <<<<<<<<<<<<<<
     *             else:
     *                 outMerge[i] += cdummy
     */
                                  __pyx_t_44 = __pyx_v_i;
                                  *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_outMerge.rcbuffer->pybuffer.buf, __pyx_t_44, __pyx_pybuffernd_outMerge.diminfo[0].strides) += (__pyx_v_sum_data / __pyx_v_sum_count);
                                  goto __pyx_L62;
                                }
                                /*else*/ {

     378:             else:

     379:                 outMerge[i] += cdummy

                                  /* "splitBBoxLUT.pyx":379
     *                 outMerge[i] += sum_data / sum_count
     *             else:
     *                 outMerge[i] += cdummy             # <<<<<<<<<<<<<<
     *         return  self.outPos, outMerge, outData, outCount
     *
     */
                                  __pyx_t_45 = __pyx_v_i;
                                  *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_outMerge.rcbuffer->pybuffer.buf, __pyx_t_45, __pyx_pybuffernd_outMerge.diminfo[0].strides) += __pyx_v_cdummy;
                                }
                                __pyx_L62:;
                            }
                        }
                    }
                }
            }
            #if ((defined(__APPLE__) || defined(__OSX__)) && (defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))))
                #undef likely
                #undef unlikely
                #define likely(x)   __builtin_expect(!!(x), 1)
                #define unlikely(x) __builtin_expect(!!(x), 0)
            #endif
          }

     380:         return  self.outPos, outMerge, outData, outCount

      /* "splitBBoxLUT.pyx":380
     *             else:
     *                 outMerge[i] += cdummy
     *         return  self.outPos, outMerge, outData, outCount             # <<<<<<<<<<<<<<
     *
     *
     */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__outPos); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 380; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_6 = PyTuple_New(4); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 380; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_1);
      __Pyx_INCREF(((PyObject *)__pyx_v_outMerge));
      PyTuple_SET_ITEM(__pyx_t_6, 1, ((PyObject *)__pyx_v_outMerge));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_outMerge));
      __Pyx_INCREF(((PyObject *)__pyx_v_outData));
      PyTuple_SET_ITEM(__pyx_t_6, 2, ((PyObject *)__pyx_v_outData));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_outData));
      __Pyx_INCREF(((PyObject *)__pyx_v_outCount));
      PyTuple_SET_ITEM(__pyx_t_6, 3, ((PyObject *)__pyx_v_outCount));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_outCount));
      __pyx_t_1 = 0;
      __pyx_r = ((PyObject *)__pyx_t_6);
      __pyx_t_6 = 0;
      goto __pyx_L0;

      __pyx_r = Py_None; __Pyx_INCREF(Py_None);
      goto __pyx_L0;
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_6);
      __PYX_XDEC_MEMVIEW(&__pyx_t_10, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_13, 1);
      { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
        __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
        __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_outCount.rcbuffer->pybuffer);
        __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_outData.rcbuffer->pybuffer);
        __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_outMerge.rcbuffer->pybuffer);
      __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
      __Pyx_AddTraceback("splitBBoxLUT.HistoBBox1d.integrate", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      goto __pyx_L2;
      __pyx_L0:;
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_outCount.rcbuffer->pybuffer);
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_outData.rcbuffer->pybuffer);
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_outMerge.rcbuffer->pybuffer);
      __pyx_L2:;
      __Pyx_XDECREF((PyObject *)__pyx_v_outData);
      __Pyx_XDECREF((PyObject *)__pyx_v_outCount);
      __Pyx_XDECREF((PyObject *)__pyx_v_outMerge);
      __PYX_XDEC_MEMVIEW(&__pyx_v_lut, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_cdata, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_tdata, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_cflat, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_cdark, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_csolidAngle, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_cpolarization, 1);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

     381:

     382:

     383:

     384: ################################################################################

     385: # Bidimensionnal regrouping

     386: ################################################################################

     387:

     388: class HistoBBox2d(object):

      /* "splitBBoxLUT.pyx":388
     * ################################################################################
     *
     * class HistoBBox2d(object):             # <<<<<<<<<<<<<<
     *     @cython.boundscheck(False)
     *     def __init__(self,
     */
      __pyx_t_8 = PyDict_New(); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 388; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_8));

      /* "splitBBoxLUT.pyx":388
     * ################################################################################
     *
     * class HistoBBox2d(object):             # <<<<<<<<<<<<<<
     *     @cython.boundscheck(False)
     *     def __init__(self,
     */
      __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 388; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_INCREF(__pyx_builtin_object);
      PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_builtin_object);
      __Pyx_GIVEREF(__pyx_builtin_object);
      __pyx_t_1 = __Pyx_CreateClass(((PyObject *)__pyx_t_6), ((PyObject *)__pyx_t_8), __pyx_n_s__HistoBBox2d, __pyx_n_s__HistoBBox2d, __pyx_n_s__splitBBoxLUT); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 388; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
      if (PyObject_SetAttr(__pyx_m, __pyx_n_s__HistoBBox2d, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 388; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;

     389:     @cython.boundscheck(False)

     390:     def __init__(self,

    /* "splitBBoxLUT.pyx":390
     * class HistoBBox2d(object):
     *     @cython.boundscheck(False)
     *     def __init__(self,             # <<<<<<<<<<<<<<
     *                  pos0,
     *                  delta_pos0,
     */

    static PyObject *__pyx_pf_12splitBBoxLUT_11HistoBBox2d_6__defaults__(CYTHON_UNUSED PyObject *__pyx_self) {
      PyObject *__pyx_r = NULL;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__defaults__", 0);
      __Pyx_XDECREF(__pyx_r);

      /* "splitBBoxLUT.pyx":399
     *                  pos1Range=None,
     *                  mask=None,
     *                  mask_checksum=None,             # <<<<<<<<<<<<<<
     *                  allow_pos0_neg=False,
     *                  unit="undefined"):
     */
      __pyx_t_1 = PyTuple_New(7); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 390; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_INCREF(((PyObject *)((PyObject*)__pyx_k_tuple_4)));
      PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)((PyObject*)__pyx_k_tuple_4)));
      __Pyx_GIVEREF(((PyObject *)((PyObject*)__pyx_k_tuple_4)));
      __Pyx_INCREF(((PyObject *)Py_None));
      PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)Py_None));
      __Pyx_GIVEREF(((PyObject *)Py_None));
      __Pyx_INCREF(((PyObject *)Py_None));
      PyTuple_SET_ITEM(__pyx_t_1, 2, ((PyObject *)Py_None));
      __Pyx_GIVEREF(((PyObject *)Py_None));
      __Pyx_INCREF(((PyObject *)Py_None));
      PyTuple_SET_ITEM(__pyx_t_1, 3, ((PyObject *)Py_None));
      __Pyx_GIVEREF(((PyObject *)Py_None));
      __Pyx_INCREF(((PyObject *)Py_None));
      PyTuple_SET_ITEM(__pyx_t_1, 4, ((PyObject *)Py_None));
      __Pyx_GIVEREF(((PyObject *)Py_None));
      __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_self)->__pyx_arg_allow_pos0_neg);
      PyTuple_SET_ITEM(__pyx_t_1, 5, __Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_self)->__pyx_arg_allow_pos0_neg);
      __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_self)->__pyx_arg_allow_pos0_neg);
      __Pyx_INCREF(((PyObject *)((PyObject*)__pyx_n_s__undefined)));
      PyTuple_SET_ITEM(__pyx_t_1, 6, ((PyObject *)((PyObject*)__pyx_n_s__undefined)));
      __Pyx_GIVEREF(((PyObject *)((PyObject*)__pyx_n_s__undefined)));
      __pyx_r = ((PyObject *)__pyx_t_1);
      __pyx_t_1 = 0;
      goto __pyx_L0;

      __pyx_r = Py_None; __Pyx_INCREF(Py_None);
      goto __pyx_L0;
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_AddTraceback("splitBBoxLUT.HistoBBox2d.__defaults__", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    /* Python wrapper */
    static PyObject *__pyx_pw_12splitBBoxLUT_11HistoBBox2d_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
    static PyMethodDef __pyx_mdef_12splitBBoxLUT_11HistoBBox2d_1__init__ = {__Pyx_NAMESTR("__init__"), (PyCFunction)__pyx_pw_12splitBBoxLUT_11HistoBBox2d_1__init__, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
    static PyObject *__pyx_pw_12splitBBoxLUT_11HistoBBox2d_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
      PyObject *__pyx_v_self = 0;
      PyObject *__pyx_v_pos0 = 0;
      PyObject *__pyx_v_delta_pos0 = 0;
      PyObject *__pyx_v_pos1 = 0;
      PyObject *__pyx_v_delta_pos1 = 0;
      PyObject *__pyx_v_bins = 0;
      PyObject *__pyx_v_pos0Range = 0;
      PyObject *__pyx_v_pos1Range = 0;
      PyObject *__pyx_v_mask = 0;
      PyObject *__pyx_v_mask_checksum = 0;
      PyObject *__pyx_v_allow_pos0_neg = 0;
      PyObject *__pyx_v_unit = 0;
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
      {
        static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__self,&__pyx_n_s__pos0,&__pyx_n_s__delta_pos0,&__pyx_n_s__pos1,&__pyx_n_s__delta_pos1,&__pyx_n_s__bins,&__pyx_n_s__pos0Range,&__pyx_n_s__pos1Range,&__pyx_n_s__mask,&__pyx_n_s__mask_checksum,&__pyx_n_s__allow_pos0_neg,&__pyx_n_s__unit,0};
        PyObject* values[12] = {0,0,0,0,0,0,0,0,0,0,0,0};
        __pyx_defaults1 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_self);
        values[5] = ((PyObject *)((PyObject*)__pyx_k_tuple_4));
        values[6] = ((PyObject *)((PyObject *)Py_None));
        values[7] = ((PyObject *)((PyObject *)Py_None));
        values[8] = ((PyObject *)((PyObject *)Py_None));
        values[9] = ((PyObject *)((PyObject *)Py_None));
        values[10] = __pyx_dynamic_args->__pyx_arg_allow_pos0_neg;
        values[11] = ((PyObject *)((PyObject*)__pyx_n_s__undefined));
        if (unlikely(__pyx_kwds)) {
          Py_ssize_t kw_args;
          const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
          switch (pos_args) {
            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__self)) != 0)) kw_args--;
            else goto __pyx_L5_argtuple_error;
            case  1:
            if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__pos0)) != 0)) kw_args--;
            else {
              __Pyx_RaiseArgtupleInvalid("__init__", 0, 5, 12, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 390; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
            }
            case  2:
            if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__delta_pos0)) != 0)) kw_args--;
            else {
              __Pyx_RaiseArgtupleInvalid("__init__", 0, 5, 12, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 390; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
            }
            case  3:
            if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__pos1)) != 0)) kw_args--;
            else {
              __Pyx_RaiseArgtupleInvalid("__init__", 0, 5, 12, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 390; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
            }
            case  4:
            if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__delta_pos1)) != 0)) kw_args--;
            else {
              __Pyx_RaiseArgtupleInvalid("__init__", 0, 5, 12, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 390; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
            }
            case  5:
            if (kw_args > 0) {
              PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__bins);
              if (value) { values[5] = value; kw_args--; }
            }
            case  6:
            if (kw_args > 0) {
              PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__pos0Range);
              if (value) { values[6] = value; kw_args--; }
            }
            case  7:
            if (kw_args > 0) {
              PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__pos1Range);
              if (value) { values[7] = value; kw_args--; }
            }
            case  8:
            if (kw_args > 0) {
              PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__mask);
              if (value) { values[8] = value; kw_args--; }
            }
            case  9:
            if (kw_args > 0) {
              PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__mask_checksum);
              if (value) { values[9] = value; kw_args--; }
            }
            case 10:
            if (kw_args > 0) {
              PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__allow_pos0_neg);
              if (value) { values[10] = value; kw_args--; }
            }
            case 11:
            if (kw_args > 0) {
              PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__unit);
              if (value) { values[11] = value; kw_args--; }
            }
          }
          if (unlikely(kw_args > 0)) {
            if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 390; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
          }
        } else {
          switch (PyTuple_GET_SIZE(__pyx_args)) {
            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);
            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_self = values[0];
        __pyx_v_pos0 = values[1];
        __pyx_v_delta_pos0 = values[2];
        __pyx_v_pos1 = values[3];
        __pyx_v_delta_pos1 = values[4];
        __pyx_v_bins = values[5];
        __pyx_v_pos0Range = values[6];
        __pyx_v_pos1Range = values[7];
        __pyx_v_mask = values[8];
        __pyx_v_mask_checksum = values[9];
        __pyx_v_allow_pos0_neg = values[10];
        __pyx_v_unit = values[11];
      }
      goto __pyx_L4_argument_unpacking_done;
      __pyx_L5_argtuple_error:;
      __Pyx_RaiseArgtupleInvalid("__init__", 0, 5, 12, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 390; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      __pyx_L3_error:;
      __Pyx_AddTraceback("splitBBoxLUT.HistoBBox2d.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __Pyx_RefNannyFinishContext();
      return NULL;
      __pyx_L4_argument_unpacking_done:;
      __pyx_r = __pyx_pf_12splitBBoxLUT_11HistoBBox2d___init__(__pyx_self, __pyx_v_self, __pyx_v_pos0, __pyx_v_delta_pos0, __pyx_v_pos1, __pyx_v_delta_pos1, __pyx_v_bins, __pyx_v_pos0Range, __pyx_v_pos1Range, __pyx_v_mask, __pyx_v_mask_checksum, __pyx_v_allow_pos0_neg, __pyx_v_unit);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    /* "splitBBoxLUT.pyx":390
     * class HistoBBox2d(object):
     *     @cython.boundscheck(False)
     *     def __init__(self,             # <<<<<<<<<<<<<<
     *                  pos0,
     *                  delta_pos0,
     */

    static PyObject *__pyx_pf_12splitBBoxLUT_11HistoBBox2d___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_pos0, PyObject *__pyx_v_delta_pos0, PyObject *__pyx_v_pos1, PyObject *__pyx_v_delta_pos1, PyObject *__pyx_v_bins, PyObject *__pyx_v_pos0Range, PyObject *__pyx_v_pos1Range, PyObject *__pyx_v_mask, PyObject *__pyx_v_mask_checksum, PyObject *__pyx_v_allow_pos0_neg, PyObject *__pyx_v_unit) {
      PyObject *__pyx_v_bins0 = NULL;
      PyObject *__pyx_v_bins1 = NULL;
      PyObject *__pyx_v_pos0_maxin = NULL;
      PyObject *__pyx_v_pos1_maxin = NULL;
      PyObject *__pyx_r = NULL;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__init__", 0);

      /* "splitBBoxLUT.pyx":390
     * class HistoBBox2d(object):
     *     @cython.boundscheck(False)
     *     def __init__(self,             # <<<<<<<<<<<<<<
     *                  pos0,
     *                  delta_pos0,
     */
      __pyx_k_tuple_65 = PyTuple_Pack(20, ((PyObject *)__pyx_n_s__self), ((PyObject *)__pyx_n_s__pos0), ((PyObject *)__pyx_n_s__delta_pos0), ((PyObject *)__pyx_n_s__pos1), ((PyObject *)__pyx_n_s__delta_pos1), ((PyObject *)__pyx_n_s__bins), ((PyObject *)__pyx_n_s__pos0Range), ((PyObject *)__pyx_n_s__pos1Range), ((PyObject *)__pyx_n_s__mask), ((PyObject *)__pyx_n_s__mask_checksum), ((PyObject *)__pyx_n_s__allow_pos0_neg), ((PyObject *)__pyx_n_s__unit), ((PyObject *)__pyx_n_s__i), ((PyObject *)__pyx_n_s__size), ((PyObject *)__pyx_n_s__bin0), ((PyObject *)__pyx_n_s__bin1), ((PyObject *)__pyx_n_s__bins0), ((PyObject *)__pyx_n_s__bins1), ((PyObject *)__pyx_n_s__pos0_maxin), ((PyObject *)__pyx_n_s__pos1_maxin)); if (unlikely(!__pyx_k_tuple_65)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 390; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_k_tuple_65);
      __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_65));

      /* "splitBBoxLUT.pyx":390
     * class HistoBBox2d(object):
     *     @cython.boundscheck(False)
     *     def __init__(self,             # <<<<<<<<<<<<<<
     *                  pos0,
     *                  delta_pos0,
     */
      __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_12splitBBoxLUT_11HistoBBox2d_1__init__, 0, __pyx_n_s_67, NULL, __pyx_n_s__splitBBoxLUT, ((PyObject *)__pyx_k_codeobj_66)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 390; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      if (!__Pyx_CyFunction_InitDefaults(__pyx_t_6, sizeof(__pyx_defaults1), 1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 390; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_k_codeobj_66 = (PyObject*)__Pyx_PyCode_New(12, 0, 20, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_65, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_56, __pyx_n_s____init__, 390, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_66)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 390; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

     391:                  pos0,

     392:                  delta_pos0,

     393:                  pos1,

     394:                  delta_pos1,

     395:                  bins=(100,36),

      /* "splitBBoxLUT.pyx":395
     *                  pos1,
     *                  delta_pos1,
     *                  bins=(100,36),             # <<<<<<<<<<<<<<
     *                  pos0Range=None,
     *                  pos1Range=None,
     */
      __pyx_k_tuple_4 = PyTuple_Pack(2, __pyx_int_100, __pyx_int_36); if (unlikely(!__pyx_k_tuple_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_k_tuple_4);
      __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_4));

     396:                  pos0Range=None,

     397:                  pos1Range=None,

     398:                  mask=None,

     399:                  mask_checksum=None,

     400:                  allow_pos0_neg=False,

      /* "splitBBoxLUT.pyx":400
     *                  mask=None,
     *                  mask_checksum=None,
     *                  allow_pos0_neg=False,             # <<<<<<<<<<<<<<
     *                  unit="undefined"):
     *
     */
      __pyx_t_1 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 400; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_t_6)->__pyx_arg_allow_pos0_neg = __pyx_t_1;
      __Pyx_GIVEREF(__pyx_t_1);
      __pyx_t_1 = 0;
      __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_6, __pyx_pf_12splitBBoxLUT_11HistoBBox2d_6__defaults__);
      if (PyObject_SetItem(__pyx_t_8, __pyx_n_s____init__, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 390; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

     401:                  unit="undefined"):

     402:

     403:         cdef int i, size, bin0, bin1

     404:         self.size = pos0.size

      /* "splitBBoxLUT.pyx":404
     *
     *         cdef int i, size, bin0, bin1
     *         self.size = pos0.size             # <<<<<<<<<<<<<<
     *         assert delta_pos0.size == self.size
     *         assert pos1.size == self.size
     */
      __pyx_t_1 = PyObject_GetAttr(__pyx_v_pos0, __pyx_n_s__size); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 404; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__size, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 404; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

     405:         assert delta_pos0.size == self.size

      /* "splitBBoxLUT.pyx":405
     *         cdef int i, size, bin0, bin1
     *         self.size = pos0.size
     *         assert delta_pos0.size == self.size             # <<<<<<<<<<<<<<
     *         assert pos1.size == self.size
     *         assert delta_pos1.size == self.size
     */
      #ifndef CYTHON_WITHOUT_ASSERTIONS
      __pyx_t_1 = PyObject_GetAttr(__pyx_v_delta_pos0, __pyx_n_s__size); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 405; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__size); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 405; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 405; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 405; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_4)) {
        PyErr_SetNone(PyExc_AssertionError);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 405; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      #endif

     406:         assert pos1.size == self.size

      /* "splitBBoxLUT.pyx":406
     *         self.size = pos0.size
     *         assert delta_pos0.size == self.size
     *         assert pos1.size == self.size             # <<<<<<<<<<<<<<
     *         assert delta_pos1.size == self.size
     *
     */
      #ifndef CYTHON_WITHOUT_ASSERTIONS
      __pyx_t_3 = PyObject_GetAttr(__pyx_v_pos1, __pyx_n_s__size); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__size); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_1 = PyObject_RichCompare(__pyx_t_3, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (unlikely(!__pyx_t_4)) {
        PyErr_SetNone(PyExc_AssertionError);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      #endif

     407:         assert delta_pos1.size == self.size

      /* "splitBBoxLUT.pyx":407
     *         assert delta_pos0.size == self.size
     *         assert pos1.size == self.size
     *         assert delta_pos1.size == self.size             # <<<<<<<<<<<<<<
     *
     *         try:
     */
      #ifndef CYTHON_WITHOUT_ASSERTIONS
      __pyx_t_1 = PyObject_GetAttr(__pyx_v_delta_pos1, __pyx_n_s__size); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__size); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_4)) {
        PyErr_SetNone(PyExc_AssertionError);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      #endif

     408:

     409:         try:

      /* "splitBBoxLUT.pyx":409
     *         assert delta_pos1.size == self.size
     *
     *         try:             # <<<<<<<<<<<<<<
     *             bins0, bins1 = tuple(bins)
     *         except:
     */
      {
        __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7);
        __Pyx_XGOTREF(__pyx_t_5);
        __Pyx_XGOTREF(__pyx_t_6);
        __Pyx_XGOTREF(__pyx_t_7);
        /*try:*/ {

     410:             bins0, bins1 = tuple(bins)

          /* "splitBBoxLUT.pyx":410
     *
     *         try:
     *             bins0, bins1 = tuple(bins)             # <<<<<<<<<<<<<<
     *         except:
     *             bins0 = bins1 = bins
     */
          __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 410; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_INCREF(__pyx_v_bins);
          PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_bins);
          __Pyx_GIVEREF(__pyx_v_bins);
          __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)(&PyTuple_Type))), ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 410; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
          if (1) {
            PyObject* sequence = __pyx_t_2;
            #if CYTHON_COMPILING_IN_CPYTHON
            Py_ssize_t size = Py_SIZE(sequence);
            #else
            Py_ssize_t size = PySequence_Size(sequence);
            #endif
            if (unlikely(size != 2)) {
              if (size > 2) __Pyx_RaiseTooManyValuesError(2);
              else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
              {__pyx_filename = __pyx_f[0]; __pyx_lineno = 410; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
            }
            #if CYTHON_COMPILING_IN_CPYTHON
            __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
            __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1);
            __Pyx_INCREF(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_1);
            #else
            __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 410; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
            __Pyx_GOTREF(__pyx_t_3);
            __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 410; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
            __Pyx_GOTREF(__pyx_t_1);
            #endif
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          } else if (1) {
            __Pyx_RaiseNoneNotIterableError(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 410; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
          } else
          {
            Py_ssize_t index = -1;
            __pyx_t_8 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 410; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
            __Pyx_GOTREF(__pyx_t_8);
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            __pyx_t_9 = Py_TYPE(__pyx_t_8)->tp_iternext;
            index = 0; __pyx_t_3 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_3)) goto __pyx_L11_unpacking_failed;
            __Pyx_GOTREF(__pyx_t_3);
            index = 1; __pyx_t_1 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_1)) goto __pyx_L11_unpacking_failed;
            __Pyx_GOTREF(__pyx_t_1);
            if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 410; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
            __pyx_t_9 = NULL;
            __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
            goto __pyx_L12_unpacking_done;
            __pyx_L11_unpacking_failed:;
            __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
            __pyx_t_9 = NULL;
            if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 410; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
            __pyx_L12_unpacking_done:;
          }
          __pyx_v_bins0 = __pyx_t_3;
          __pyx_t_3 = 0;
          __pyx_v_bins1 = __pyx_t_1;
          __pyx_t_1 = 0;
        }
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        goto __pyx_L10_try_end;
        __pyx_L3_error:;
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;

     411:         except:

        /* "splitBBoxLUT.pyx":411
     *         try:
     *             bins0, bins1 = tuple(bins)
     *         except:             # <<<<<<<<<<<<<<
     *             bins0 = bins1 = bins
     *         if bins0 <= 0:
     */
        /*except:*/ {
          __Pyx_AddTraceback("splitBBoxLUT.HistoBBox2d.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_1, &__pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_GOTREF(__pyx_t_3);

     412:             bins0 = bins1 = bins

          /* "splitBBoxLUT.pyx":412
     *             bins0, bins1 = tuple(bins)
     *         except:
     *             bins0 = bins1 = bins             # <<<<<<<<<<<<<<
     *         if bins0 <= 0:
     *             bins0 = 1
     */
          __Pyx_INCREF(__pyx_v_bins);
          __Pyx_XDECREF(__pyx_v_bins0);
          __pyx_v_bins0 = __pyx_v_bins;
          __Pyx_INCREF(__pyx_v_bins);
          __Pyx_XDECREF(__pyx_v_bins1);
          __pyx_v_bins1 = __pyx_v_bins;
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          goto __pyx_L4_exception_handled;
        }
        __pyx_L5_except_error:;
        __Pyx_XGIVEREF(__pyx_t_5);
        __Pyx_XGIVEREF(__pyx_t_6);
        __Pyx_XGIVEREF(__pyx_t_7);
        __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7);
        goto __pyx_L1_error;
        __pyx_L4_exception_handled:;
        __Pyx_XGIVEREF(__pyx_t_5);
        __Pyx_XGIVEREF(__pyx_t_6);
        __Pyx_XGIVEREF(__pyx_t_7);
        __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7);
        __pyx_L10_try_end:;
      }

     413:         if bins0 <= 0:

      /* "splitBBoxLUT.pyx":413
     *         except:
     *             bins0 = bins1 = bins
     *         if bins0 <= 0:             # <<<<<<<<<<<<<<
     *             bins0 = 1
     *         if bins1 <= 0:
     */
      __pyx_t_3 = PyObject_RichCompare(__pyx_v_bins0, __pyx_int_0, Py_LE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 413; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 413; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__pyx_t_4) {

     414:             bins0 = 1

        /* "splitBBoxLUT.pyx":414
     *             bins0 = bins1 = bins
     *         if bins0 <= 0:
     *             bins0 = 1             # <<<<<<<<<<<<<<
     *         if bins1 <= 0:
     *             bins1 = 1
     */
        __Pyx_INCREF(__pyx_int_1);
        __Pyx_DECREF(__pyx_v_bins0);
        __pyx_v_bins0 = __pyx_int_1;
        goto __pyx_L15;
      }
      __pyx_L15:;

     415:         if bins1 <= 0:

      /* "splitBBoxLUT.pyx":415
     *         if bins0 <= 0:
     *             bins0 = 1
     *         if bins1 <= 0:             # <<<<<<<<<<<<<<
     *             bins1 = 1
     *         self.bins = (int(bins0),int(bins1))
     */
      __pyx_t_3 = PyObject_RichCompare(__pyx_v_bins1, __pyx_int_0, Py_LE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__pyx_t_4) {

     416:             bins1 = 1

        /* "splitBBoxLUT.pyx":416
     *             bins0 = 1
     *         if bins1 <= 0:
     *             bins1 = 1             # <<<<<<<<<<<<<<
     *         self.bins = (int(bins0),int(bins1))
     *         self.lut_size = 0
     */
        __Pyx_INCREF(__pyx_int_1);
        __Pyx_DECREF(__pyx_v_bins1);
        __pyx_v_bins1 = __pyx_int_1;
        goto __pyx_L16;
      }
      __pyx_L16:;

     417:         self.bins = (int(bins0),int(bins1))

      /* "splitBBoxLUT.pyx":417
     *         if bins1 <= 0:
     *             bins1 = 1
     *         self.bins = (int(bins0),int(bins1))             # <<<<<<<<<<<<<<
     *         self.lut_size = 0
     *         self.cpos0 = numpy.ascontiguousarray(pos0.ravel(), dtype=numpy.float32)
     */
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 417; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_INCREF(__pyx_v_bins0);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_bins0);
      __Pyx_GIVEREF(__pyx_v_bins0);
      __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)(&PyInt_Type))), ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 417; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 417; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_INCREF(__pyx_v_bins1);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_bins1);
      __Pyx_GIVEREF(__pyx_v_bins1);
      __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)(&PyInt_Type))), ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 417; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
      __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 417; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_2);
      __pyx_t_1 = 0;
      __pyx_t_2 = 0;
      if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__bins, ((PyObject *)__pyx_t_3)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 417; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;

     418:         self.lut_size = 0

      /* "splitBBoxLUT.pyx":418
     *             bins1 = 1
     *         self.bins = (int(bins0),int(bins1))
     *         self.lut_size = 0             # <<<<<<<<<<<<<<
     *         self.cpos0 = numpy.ascontiguousarray(pos0.ravel(), dtype=numpy.float32)
     *         self.dpos0 = numpy.ascontiguousarray(delta_pos0.ravel(), dtype=numpy.float32)
     */
      if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__lut_size, __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

     419:         self.cpos0 = numpy.ascontiguousarray(pos0.ravel(), dtype=numpy.float32)

      /* "splitBBoxLUT.pyx":419
     *         self.bins = (int(bins0),int(bins1))
     *         self.lut_size = 0
     *         self.cpos0 = numpy.ascontiguousarray(pos0.ravel(), dtype=numpy.float32)             # <<<<<<<<<<<<<<
     *         self.dpos0 = numpy.ascontiguousarray(delta_pos0.ravel(), dtype=numpy.float32)
     *         self.cpos0_sup = self.cpos0 + self.dpos0
     */
      __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 419; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_2 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__ascontiguousarray); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 419; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = PyObject_GetAttr(__pyx_v_pos0, __pyx_n_s__ravel); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 419; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_1 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 419; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 419; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 419; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_1));
      __pyx_t_8 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 419; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_10 = PyObject_GetAttr(__pyx_t_8, __pyx_n_s__float32); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 419; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__dtype), __pyx_t_10) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 419; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_10 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_3), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 419; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
      if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__cpos0, __pyx_t_10) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 419; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

     420:         self.dpos0 = numpy.ascontiguousarray(delta_pos0.ravel(), dtype=numpy.float32)

      /* "splitBBoxLUT.pyx":420
     *         self.lut_size = 0
     *         self.cpos0 = numpy.ascontiguousarray(pos0.ravel(), dtype=numpy.float32)
     *         self.dpos0 = numpy.ascontiguousarray(delta_pos0.ravel(), dtype=numpy.float32)             # <<<<<<<<<<<<<<
     *         self.cpos0_sup = self.cpos0 + self.dpos0
     *         self.cpos0_inf = self.cpos0 - self.dpos0
     */
      __pyx_t_10 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 420; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_1 = PyObject_GetAttr(__pyx_t_10, __pyx_n_s__ascontiguousarray); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 420; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_10 = PyObject_GetAttr(__pyx_v_delta_pos0, __pyx_n_s__ravel); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 420; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_3 = PyObject_Call(__pyx_t_10, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 420; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 420; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_10);
      PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      __pyx_t_3 = 0;
      __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 420; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_3));
      __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 420; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_8 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__float32); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 420; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__dtype), __pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 420; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_8 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_10), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 420; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
      if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__dpos0, __pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 420; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

     421:         self.cpos0_sup = self.cpos0 + self.dpos0

      /* "splitBBoxLUT.pyx":421
     *         self.cpos0 = numpy.ascontiguousarray(pos0.ravel(), dtype=numpy.float32)
     *         self.dpos0 = numpy.ascontiguousarray(delta_pos0.ravel(), dtype=numpy.float32)
     *         self.cpos0_sup = self.cpos0 + self.dpos0             # <<<<<<<<<<<<<<
     *         self.cpos0_inf = self.cpos0 - self.dpos0
     *         self.pos0Range = pos0Range
     */
      __pyx_t_8 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__cpos0); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 421; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__dpos0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 421; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_10 = PyNumber_Add(__pyx_t_8, __pyx_t_3); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 421; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__cpos0_sup, __pyx_t_10) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 421; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

     422:         self.cpos0_inf = self.cpos0 - self.dpos0

      /* "splitBBoxLUT.pyx":422
     *         self.dpos0 = numpy.ascontiguousarray(delta_pos0.ravel(), dtype=numpy.float32)
     *         self.cpos0_sup = self.cpos0 + self.dpos0
     *         self.cpos0_inf = self.cpos0 - self.dpos0             # <<<<<<<<<<<<<<
     *         self.pos0Range = pos0Range
     *         self.pos1Range = pos1Range
     */
      __pyx_t_10 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__cpos0); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 422; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__dpos0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 422; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_8 = PyNumber_Subtract(__pyx_t_10, __pyx_t_3); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 422; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__cpos0_inf, __pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 422; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

     423:         self.pos0Range = pos0Range

      /* "splitBBoxLUT.pyx":423
     *         self.cpos0_sup = self.cpos0 + self.dpos0
     *         self.cpos0_inf = self.cpos0 - self.dpos0
     *         self.pos0Range = pos0Range             # <<<<<<<<<<<<<<
     *         self.pos1Range = pos1Range
     *         if pos0Range is not None and len(pos0Range) > 1:
     */
      if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__pos0Range, __pyx_v_pos0Range) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 423; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

     424:         self.pos1Range = pos1Range

      /* "splitBBoxLUT.pyx":424
     *         self.cpos0_inf = self.cpos0 - self.dpos0
     *         self.pos0Range = pos0Range
     *         self.pos1Range = pos1Range             # <<<<<<<<<<<<<<
     *         if pos0Range is not None and len(pos0Range) > 1:
     *             self.pos0_min = min(pos0Range)
     */
      if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__pos1Range, __pyx_v_pos1Range) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 424; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

     425:         if pos0Range is not None and len(pos0Range) > 1:

      /* "splitBBoxLUT.pyx":425
     *         self.pos0Range = pos0Range
     *         self.pos1Range = pos1Range
     *         if pos0Range is not None and len(pos0Range) > 1:             # <<<<<<<<<<<<<<
     *             self.pos0_min = min(pos0Range)
     *             pos0_maxin = max(pos0Range)
     */
      __pyx_t_4 = (__pyx_v_pos0Range != Py_None);
      if (__pyx_t_4) {
        __pyx_t_11 = PyObject_Length(__pyx_v_pos0Range); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 425; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_t_12 = (__pyx_t_11 > 1);
        __pyx_t_13 = __pyx_t_12;
      } else {
        __pyx_t_13 = __pyx_t_4;
      }
      if (__pyx_t_13) {

     426:             self.pos0_min = min(pos0Range)

        /* "splitBBoxLUT.pyx":426
     *         self.pos1Range = pos1Range
     *         if pos0Range is not None and len(pos0Range) > 1:
     *             self.pos0_min = min(pos0Range)             # <<<<<<<<<<<<<<
     *             pos0_maxin = max(pos0Range)
     *         else:
     */
        __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 426; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_INCREF(__pyx_v_pos0Range);
        PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_pos0Range);
        __Pyx_GIVEREF(__pyx_v_pos0Range);
        __pyx_t_3 = PyObject_Call(__pyx_builtin_min, ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 426; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;
        if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__pos0_min, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 426; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

     427:             pos0_maxin = max(pos0Range)

        /* "splitBBoxLUT.pyx":427
     *         if pos0Range is not None and len(pos0Range) > 1:
     *             self.pos0_min = min(pos0Range)
     *             pos0_maxin = max(pos0Range)             # <<<<<<<<<<<<<<
     *         else:
     *             self.pos0_min = (self.cpos0_inf).min()
     */
        __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 427; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_INCREF(__pyx_v_pos0Range);
        PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_pos0Range);
        __Pyx_GIVEREF(__pyx_v_pos0Range);
        __pyx_t_8 = PyObject_Call(__pyx_builtin_max, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 427; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
        __pyx_v_pos0_maxin = __pyx_t_8;
        __pyx_t_8 = 0;
        goto __pyx_L17;
      }
      /*else*/ {

     428:         else:

     429:             self.pos0_min = (self.cpos0_inf).min()

        /* "splitBBoxLUT.pyx":429
     *             pos0_maxin = max(pos0Range)
     *         else:
     *             self.pos0_min = (self.cpos0_inf).min()             # <<<<<<<<<<<<<<
     *             pos0_maxin = (self.cpos0_sup).max()
     *         if (not allow_pos0_neg) and self.pos0_min < 0:
     */
        __pyx_t_8 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__cpos0_inf); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 429; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_3 = PyObject_GetAttr(__pyx_t_8, __pyx_n_s__min); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 429; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_t_8 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 429; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__pos0_min, __pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 429; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

     430:             pos0_maxin = (self.cpos0_sup).max()

        /* "splitBBoxLUT.pyx":430
     *         else:
     *             self.pos0_min = (self.cpos0_inf).min()
     *             pos0_maxin = (self.cpos0_sup).max()             # <<<<<<<<<<<<<<
     *         if (not allow_pos0_neg) and self.pos0_min < 0:
     *             self.pos0_min = 0
     */
        __pyx_t_8 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__cpos0_sup); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 430; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_3 = PyObject_GetAttr(__pyx_t_8, __pyx_n_s__max); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 430; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_t_8 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 430; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_v_pos0_maxin = __pyx_t_8;
        __pyx_t_8 = 0;
      }
      __pyx_L17:;

     431:         if (not allow_pos0_neg) and self.pos0_min < 0:

      /* "splitBBoxLUT.pyx":431
     *             self.pos0_min = (self.cpos0_inf).min()
     *             pos0_maxin = (self.cpos0_sup).max()
     *         if (not allow_pos0_neg) and self.pos0_min < 0:             # <<<<<<<<<<<<<<
     *             self.pos0_min = 0
     *         self.pos0_max = pos0_maxin * EPS32
     */
      __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_v_allow_pos0_neg); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 431; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_4 = (!__pyx_t_13);
      if (__pyx_t_4) {
        __pyx_t_8 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__pos0_min); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 431; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_3 = PyObject_RichCompare(__pyx_t_8, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 431; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 431; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_12 = __pyx_t_13;
      } else {
        __pyx_t_12 = __pyx_t_4;
      }
      if (__pyx_t_12) {

     432:             self.pos0_min = 0

        /* "splitBBoxLUT.pyx":432
     *             pos0_maxin = (self.cpos0_sup).max()
     *         if (not allow_pos0_neg) and self.pos0_min < 0:
     *             self.pos0_min = 0             # <<<<<<<<<<<<<<
     *         self.pos0_max = pos0_maxin * EPS32
     *
     */
        if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__pos0_min, __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        goto __pyx_L18;
      }
      __pyx_L18:;

     433:         self.pos0_max = pos0_maxin * EPS32

      /* "splitBBoxLUT.pyx":433
     *         if (not allow_pos0_neg) and self.pos0_min < 0:
     *             self.pos0_min = 0
     *         self.pos0_max = pos0_maxin * EPS32             # <<<<<<<<<<<<<<
     *
     *
     */
      __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__EPS32); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 433; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_8 = PyNumber_Multiply(__pyx_v_pos0_maxin, __pyx_t_3); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 433; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__pos0_max, __pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 433; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

     434:

     435:

     436:         self.cpos1_inf = numpy.ascontiguousarray((pos1-delta_pos1).ravel(), dtype=numpy.float32)

      /* "splitBBoxLUT.pyx":436
     *
     *
     *         self.cpos1_inf = numpy.ascontiguousarray((pos1-delta_pos1).ravel(), dtype=numpy.float32)             # <<<<<<<<<<<<<<
     *         self.cpos1_sup = numpy.ascontiguousarray((pos1+delta_pos1).ravel(), dtype=numpy.float32)
     *
     */
      __pyx_t_8 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 436; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_3 = PyObject_GetAttr(__pyx_t_8, __pyx_n_s__ascontiguousarray); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 436; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_8 = PyNumber_Subtract(__pyx_v_pos1, __pyx_v_delta_pos1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 436; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_10 = PyObject_GetAttr(__pyx_t_8, __pyx_n_s__ravel); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 436; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_8 = PyObject_Call(__pyx_t_10, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 436; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 436; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_10);
      PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_8);
      __Pyx_GIVEREF(__pyx_t_8);
      __pyx_t_8 = 0;
      __pyx_t_8 = PyDict_New(); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 436; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_8));
      __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 436; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__float32); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 436; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (PyDict_SetItem(__pyx_t_8, ((PyObject *)__pyx_n_s__dtype), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 436; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_10), ((PyObject *)__pyx_t_8)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 436; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;
      if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__cpos1_inf, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 436; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

     437:         self.cpos1_sup = numpy.ascontiguousarray((pos1+delta_pos1).ravel(), dtype=numpy.float32)

      /* "splitBBoxLUT.pyx":437
     *
     *         self.cpos1_inf = numpy.ascontiguousarray((pos1-delta_pos1).ravel(), dtype=numpy.float32)
     *         self.cpos1_sup = numpy.ascontiguousarray((pos1+delta_pos1).ravel(), dtype=numpy.float32)             # <<<<<<<<<<<<<<
     *
     *         if pos1Range is not None and len(pos1Range) > 1:
     */
      __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_8 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__ascontiguousarray); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = PyNumber_Add(__pyx_v_pos1, __pyx_v_delta_pos1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_10 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__ravel); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = PyObject_Call(__pyx_t_10, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_10);
      PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_2);
      __pyx_t_2 = 0;
      __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_2));
      __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_1 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__float32); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__dtype), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_t_10), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
      if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__cpos1_sup, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

     438:

     439:         if pos1Range is not None and len(pos1Range) > 1:

      /* "splitBBoxLUT.pyx":439
     *         self.cpos1_sup = numpy.ascontiguousarray((pos1+delta_pos1).ravel(), dtype=numpy.float32)
     *
     *         if pos1Range is not None and len(pos1Range) > 1:             # <<<<<<<<<<<<<<
     *             self.pos1_min = min(pos1Range)
     *             pos1_maxin = max(pos1Range)
     */
      __pyx_t_12 = (__pyx_v_pos1Range != Py_None);
      if (__pyx_t_12) {
        __pyx_t_11 = PyObject_Length(__pyx_v_pos1Range); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 439; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_t_4 = (__pyx_t_11 > 1);
        __pyx_t_13 = __pyx_t_4;
      } else {
        __pyx_t_13 = __pyx_t_12;
      }
      if (__pyx_t_13) {

     440:             self.pos1_min = min(pos1Range)

        /* "splitBBoxLUT.pyx":440
     *
     *         if pos1Range is not None and len(pos1Range) > 1:
     *             self.pos1_min = min(pos1Range)             # <<<<<<<<<<<<<<
     *             pos1_maxin = max(pos1Range)
     *         else:
     */
        __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 440; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_INCREF(__pyx_v_pos1Range);
        PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_pos1Range);
        __Pyx_GIVEREF(__pyx_v_pos1Range);
        __pyx_t_2 = PyObject_Call(__pyx_builtin_min, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 440; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
        if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__pos1_min, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 440; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

     441:             pos1_maxin = max(pos1Range)

        /* "splitBBoxLUT.pyx":441
     *         if pos1Range is not None and len(pos1Range) > 1:
     *             self.pos1_min = min(pos1Range)
     *             pos1_maxin = max(pos1Range)             # <<<<<<<<<<<<<<
     *         else:
     *             self.pos1_min = pos1.min()
     */
        __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_INCREF(__pyx_v_pos1Range);
        PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_pos1Range);
        __Pyx_GIVEREF(__pyx_v_pos1Range);
        __pyx_t_1 = PyObject_Call(__pyx_builtin_max, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
        __pyx_v_pos1_maxin = __pyx_t_1;
        __pyx_t_1 = 0;
        goto __pyx_L19;
      }
      /*else*/ {

     442:         else:

     443:             self.pos1_min = pos1.min()

        /* "splitBBoxLUT.pyx":443
     *             pos1_maxin = max(pos1Range)
     *         else:
     *             self.pos1_min = pos1.min()             # <<<<<<<<<<<<<<
     *             pos1_maxin = pos1.max()
     *         self.pos1_max = pos1_maxin * EPS32
     */
        __pyx_t_1 = PyObject_GetAttr(__pyx_v_pos1, __pyx_n_s__min); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__pos1_min, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

     444:             pos1_maxin = pos1.max()

        /* "splitBBoxLUT.pyx":444
     *         else:
     *             self.pos1_min = pos1.min()
     *             pos1_maxin = pos1.max()             # <<<<<<<<<<<<<<
     *         self.pos1_max = pos1_maxin * EPS32
     *
     */
        __pyx_t_2 = PyObject_GetAttr(__pyx_v_pos1, __pyx_n_s__max); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_v_pos1_maxin = __pyx_t_1;
        __pyx_t_1 = 0;
      }
      __pyx_L19:;

     445:         self.pos1_max = pos1_maxin * EPS32

      /* "splitBBoxLUT.pyx":445
     *             self.pos1_min = pos1.min()
     *             pos1_maxin = pos1.max()
     *         self.pos1_max = pos1_maxin * EPS32             # <<<<<<<<<<<<<<
     *
     *         if  mask is not None:
     */
      __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__EPS32); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = PyNumber_Multiply(__pyx_v_pos1_maxin, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__pos1_max, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

     446:

     447:         if  mask is not None:

      /* "splitBBoxLUT.pyx":447
     *         self.pos1_max = pos1_maxin * EPS32
     *
     *         if  mask is not None:             # <<<<<<<<<<<<<<
     *             assert mask.size == self.size
     *             self.check_mask = True
     */
      __pyx_t_13 = (__pyx_v_mask != Py_None);
      if (__pyx_t_13) {

     448:             assert mask.size == self.size

        /* "splitBBoxLUT.pyx":448
     *
     *         if  mask is not None:
     *             assert mask.size == self.size             # <<<<<<<<<<<<<<
     *             self.check_mask = True
     *             self.cmask = numpy.ascontiguousarray(mask.ravel(), dtype=numpy.int8)
     */
        #ifndef CYTHON_WITHOUT_ASSERTIONS
        __pyx_t_2 = PyObject_GetAttr(__pyx_v_mask, __pyx_n_s__size); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 448; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__size); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 448; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_10 = PyObject_RichCompare(__pyx_t_2, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 448; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 448; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        if (unlikely(!__pyx_t_13)) {
          PyErr_SetNone(PyExc_AssertionError);
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 448; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        #endif

     449:             self.check_mask = True

        /* "splitBBoxLUT.pyx":449
     *         if  mask is not None:
     *             assert mask.size == self.size
     *             self.check_mask = True             # <<<<<<<<<<<<<<
     *             self.cmask = numpy.ascontiguousarray(mask.ravel(), dtype=numpy.int8)
     *             if mask_checksum:
     */
        __pyx_t_10 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_10);
        if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__check_mask, __pyx_t_10) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

     450:             self.cmask = numpy.ascontiguousarray(mask.ravel(), dtype=numpy.int8)

        /* "splitBBoxLUT.pyx":450
     *             assert mask.size == self.size
     *             self.check_mask = True
     *             self.cmask = numpy.ascontiguousarray(mask.ravel(), dtype=numpy.int8)             # <<<<<<<<<<<<<<
     *             if mask_checksum:
     *                 self.mask_checksum = mask_checksum
     */
        __pyx_t_10 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_10);
        __pyx_t_1 = PyObject_GetAttr(__pyx_t_10, __pyx_n_s__ascontiguousarray); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __pyx_t_10 = PyObject_GetAttr(__pyx_v_mask, __pyx_n_s__ravel); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_10);
        __pyx_t_2 = PyObject_Call(__pyx_t_10, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_10);
        PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_2);
        __Pyx_GIVEREF(__pyx_t_2);
        __pyx_t_2 = 0;
        __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(((PyObject *)__pyx_t_2));
        __pyx_t_8 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_3 = PyObject_GetAttr(__pyx_t_8, __pyx_n_s__int8); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__dtype), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_10), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
        __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
        if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__cmask, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

     451:             if mask_checksum:

        /* "splitBBoxLUT.pyx":451
     *             self.check_mask = True
     *             self.cmask = numpy.ascontiguousarray(mask.ravel(), dtype=numpy.int8)
     *             if mask_checksum:             # <<<<<<<<<<<<<<
     *                 self.mask_checksum = mask_checksum
     *             else:
     */
        __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_v_mask_checksum); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        if (__pyx_t_13) {

     452:                 self.mask_checksum = mask_checksum

          /* "splitBBoxLUT.pyx":452
     *             self.cmask = numpy.ascontiguousarray(mask.ravel(), dtype=numpy.int8)
     *             if mask_checksum:
     *                 self.mask_checksum = mask_checksum             # <<<<<<<<<<<<<<
     *             else:
     *                 self.mask_checksum = crc32(mask)
     */
          if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__mask_checksum, __pyx_v_mask_checksum) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          goto __pyx_L21;
        }
        /*else*/ {

     453:             else:

     454:                 self.mask_checksum = crc32(mask)

          /* "splitBBoxLUT.pyx":454
     *                 self.mask_checksum = mask_checksum
     *             else:
     *                 self.mask_checksum = crc32(mask)             # <<<<<<<<<<<<<<
     *         else:
     *             self.check_mask = False
     */
          __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__crc32); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 454; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_3);
          __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 454; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_INCREF(__pyx_v_mask);
          PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_mask);
          __Pyx_GIVEREF(__pyx_v_mask);
          __pyx_t_10 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 454; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
          if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__mask_checksum, __pyx_t_10) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 454; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        }
        __pyx_L21:;
        goto __pyx_L20;
      }
      /*else*/ {

     455:         else:

     456:             self.check_mask = False

        /* "splitBBoxLUT.pyx":456
     *                 self.mask_checksum = crc32(mask)
     *         else:
     *             self.check_mask = False             # <<<<<<<<<<<<<<
     *             self.mask_checksum = None
     *         self.delta0 = (self.pos0_max - self.pos0_min) / float(bins0)
     */
        __pyx_t_10 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_10);
        if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__check_mask, __pyx_t_10) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

     457:             self.mask_checksum = None

        /* "splitBBoxLUT.pyx":457
     *         else:
     *             self.check_mask = False
     *             self.mask_checksum = None             # <<<<<<<<<<<<<<
     *         self.delta0 = (self.pos0_max - self.pos0_min) / float(bins0)
     *         self.delta1 = (self.pos1_max - self.pos1_min) / float(bins1)
     */
        if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__mask_checksum, Py_None) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 457; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_L20:;

     458:         self.delta0 = (self.pos0_max - self.pos0_min) / float(bins0)

      /* "splitBBoxLUT.pyx":458
     *             self.check_mask = False
     *             self.mask_checksum = None
     *         self.delta0 = (self.pos0_max - self.pos0_min) / float(bins0)             # <<<<<<<<<<<<<<
     *         self.delta1 = (self.pos1_max - self.pos1_min) / float(bins1)
     *         self.lut_max_idx = self.calc_lut()
     */
      __pyx_t_10 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__pos0_max); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__pos0_min); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = PyNumber_Subtract(__pyx_t_10, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_14 = __Pyx_PyObject_AsDouble(__pyx_v_bins0); if (unlikely(__pyx_t_14 == ((double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_2 = PyFloat_FromDouble(__pyx_t_14); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_10 = __Pyx_PyNumber_Divide(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__delta0, __pyx_t_10) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

     459:         self.delta1 = (self.pos1_max - self.pos1_min) / float(bins1)

      /* "splitBBoxLUT.pyx":459
     *             self.mask_checksum = None
     *         self.delta0 = (self.pos0_max - self.pos0_min) / float(bins0)
     *         self.delta1 = (self.pos1_max - self.pos1_min) / float(bins1)             # <<<<<<<<<<<<<<
     *         self.lut_max_idx = self.calc_lut()
     *         self.outPos0 = numpy.linspace(self.pos0_min+0.5*self.delta0, pos0_maxin-0.5*self.delta0, bins0)
     */
      __pyx_t_10 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__pos1_max); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__pos1_min); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = PyNumber_Subtract(__pyx_t_10, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_14 = __Pyx_PyObject_AsDouble(__pyx_v_bins1); if (unlikely(__pyx_t_14 == ((double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_2 = PyFloat_FromDouble(__pyx_t_14); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_10 = __Pyx_PyNumber_Divide(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__delta1, __pyx_t_10) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

     460:         self.lut_max_idx = self.calc_lut()

      /* "splitBBoxLUT.pyx":460
     *         self.delta0 = (self.pos0_max - self.pos0_min) / float(bins0)
     *         self.delta1 = (self.pos1_max - self.pos1_min) / float(bins1)
     *         self.lut_max_idx = self.calc_lut()             # <<<<<<<<<<<<<<
     *         self.outPos0 = numpy.linspace(self.pos0_min+0.5*self.delta0, pos0_maxin-0.5*self.delta0, bins0)
     *         self.outPos1 = numpy.linspace(self.pos1_min+0.5*self.delta1, pos1_maxin-0.5*self.delta1, bins1)
     */
      __pyx_t_10 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__calc_lut); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_2 = PyObject_Call(__pyx_t_10, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__lut_max_idx, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

     461:         self.outPos0 = numpy.linspace(self.pos0_min+0.5*self.delta0, pos0_maxin-0.5*self.delta0, bins0)

      /* "splitBBoxLUT.pyx":461
     *         self.delta1 = (self.pos1_max - self.pos1_min) / float(bins1)
     *         self.lut_max_idx = self.calc_lut()
     *         self.outPos0 = numpy.linspace(self.pos0_min+0.5*self.delta0, pos0_maxin-0.5*self.delta0, bins0)             # <<<<<<<<<<<<<<
     *         self.outPos1 = numpy.linspace(self.pos1_min+0.5*self.delta1, pos1_maxin-0.5*self.delta1, bins1)
     *         self.unit=unit
     */
      __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 461; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_10 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__linspace); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 461; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__pos0_min); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 461; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = PyFloat_FromDouble(0.5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 461; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__delta0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 461; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_8 = PyNumber_Multiply(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 461; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyNumber_Add(__pyx_t_2, __pyx_t_8); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 461; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_8 = PyFloat_FromDouble(0.5); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 461; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__delta0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 461; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = PyNumber_Multiply(__pyx_t_8, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 461; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = PyNumber_Subtract(__pyx_v_pos0_maxin, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 461; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 461; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_v_bins0);
      PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_bins0);
      __Pyx_GIVEREF(__pyx_v_bins0);
      __pyx_t_1 = 0;
      __pyx_t_2 = 0;
      __pyx_t_2 = PyObject_Call(__pyx_t_10, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 461; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
      if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__outPos0, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 461; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

     462:         self.outPos1 = numpy.linspace(self.pos1_min+0.5*self.delta1, pos1_maxin-0.5*self.delta1, bins1)

      /* "splitBBoxLUT.pyx":462
     *         self.lut_max_idx = self.calc_lut()
     *         self.outPos0 = numpy.linspace(self.pos0_min+0.5*self.delta0, pos0_maxin-0.5*self.delta0, bins0)
     *         self.outPos1 = numpy.linspace(self.pos1_min+0.5*self.delta1, pos1_maxin-0.5*self.delta1, bins1)             # <<<<<<<<<<<<<<
     *         self.unit=unit
     *         self.lut.shape = -1, self.lut_size #this makes integration look like a 1D integration
     */
      __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__linspace); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__pos1_min); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_10 = PyFloat_FromDouble(0.5); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__delta1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_8 = PyNumber_Multiply(__pyx_t_10, __pyx_t_1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyNumber_Add(__pyx_t_2, __pyx_t_8); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_8 = PyFloat_FromDouble(0.5); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__delta1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_10 = PyNumber_Multiply(__pyx_t_8, __pyx_t_2); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = PyNumber_Subtract(__pyx_v_pos1_maxin, __pyx_t_10); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_10 = PyTuple_New(3); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_10);
      PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_v_bins1);
      PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_v_bins1);
      __Pyx_GIVEREF(__pyx_v_bins1);
      __pyx_t_1 = 0;
      __pyx_t_2 = 0;
      __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_10), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
      if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__outPos1, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

     463:         self.unit=unit

      /* "splitBBoxLUT.pyx":463
     *         self.outPos0 = numpy.linspace(self.pos0_min+0.5*self.delta0, pos0_maxin-0.5*self.delta0, bins0)
     *         self.outPos1 = numpy.linspace(self.pos1_min+0.5*self.delta1, pos1_maxin-0.5*self.delta1, bins1)
     *         self.unit=unit             # <<<<<<<<<<<<<<
     *         self.lut.shape = -1, self.lut_size #this makes integration look like a 1D integration
     *         self.lut_checksum = crc32(self.lut)
     */
      if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__unit, __pyx_v_unit) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 463; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

     464:         self.lut.shape = -1, self.lut_size #this makes integration look like a 1D integration

      /* "splitBBoxLUT.pyx":464
     *         self.outPos1 = numpy.linspace(self.pos1_min+0.5*self.delta1, pos1_maxin-0.5*self.delta1, bins1)
     *         self.unit=unit
     *         self.lut.shape = -1, self.lut_size #this makes integration look like a 1D integration             # <<<<<<<<<<<<<<
     *         self.lut_checksum = crc32(self.lut)
     *
     */
      __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__lut_size); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 464; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 464; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_INCREF(__pyx_int_neg_1);
      PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_int_neg_1);
      __Pyx_GIVEREF(__pyx_int_neg_1);
      PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_2);
      __pyx_t_2 = 0;
      __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__lut); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 464; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      if (PyObject_SetAttr(__pyx_t_2, __pyx_n_s__shape, ((PyObject *)__pyx_t_10)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 464; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

     465:         self.lut_checksum = crc32(self.lut)

      /* "splitBBoxLUT.pyx":465
     *         self.unit=unit
     *         self.lut.shape = -1, self.lut_size #this makes integration look like a 1D integration
     *         self.lut_checksum = crc32(self.lut)             # <<<<<<<<<<<<<<
     *
     *     @cython.boundscheck(False)
     */
      __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__crc32); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 465; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_10 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__lut); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 465; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 465; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_10);
      __Pyx_GIVEREF(__pyx_t_10);
      __pyx_t_10 = 0;
      __pyx_t_10 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 465; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
      if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__lut_checksum, __pyx_t_10) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 465; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

      __pyx_r = Py_None; __Pyx_INCREF(Py_None);
      goto __pyx_L0;
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_8);
      __Pyx_XDECREF(__pyx_t_10);
      __Pyx_AddTraceback("splitBBoxLUT.HistoBBox2d.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __Pyx_XDECREF(__pyx_v_bins0);
      __Pyx_XDECREF(__pyx_v_bins1);
      __Pyx_XDECREF(__pyx_v_pos0_maxin);
      __Pyx_XDECREF(__pyx_v_pos1_maxin);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    /* Python wrapper */
    static PyObject *__pyx_pw_12splitBBoxLUT_11HistoBBox2d_3calc_lut(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
    static char __pyx_doc_12splitBBoxLUT_11HistoBBox2d_2calc_lut[] = "calculate the max number of elements in the LUT and populate it";
    static PyMethodDef __pyx_mdef_12splitBBoxLUT_11HistoBBox2d_3calc_lut = {__Pyx_NAMESTR("calc_lut"), (PyCFunction)__pyx_pw_12splitBBoxLUT_11HistoBBox2d_3calc_lut, METH_O, __Pyx_DOCSTR(__pyx_doc_12splitBBoxLUT_11HistoBBox2d_2calc_lut)};
    static PyObject *__pyx_pw_12splitBBoxLUT_11HistoBBox2d_3calc_lut(PyObject *__pyx_self, PyObject *__pyx_v_self) {
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("calc_lut (wrapper)", 0);
      __pyx_r = __pyx_pf_12splitBBoxLUT_11HistoBBox2d_2calc_lut(__pyx_self, ((PyObject *)__pyx_v_self));
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

     466:

     467:     @cython.boundscheck(False)

     468:     @cython.wraparound(False)

     469:     @cython.cdivision(True)

     470:     def calc_lut(self):

    /* "splitBBoxLUT.pyx":470
     *     @cython.wraparound(False)
     *     @cython.cdivision(True)
     *     def calc_lut(self):             # <<<<<<<<<<<<<<
     *         'calculate the max number of elements in the LUT and populate it'
     *         cdef float delta0=self.delta0, pos0_min=self.pos0_min, min0, max0, fbin0_min, fbin0_max
     */

    static PyObject *__pyx_pf_12splitBBoxLUT_11HistoBBox2d_2calc_lut(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
      float __pyx_v_delta0;
      float __pyx_v_pos0_min;
      float __pyx_v_min0;
      float __pyx_v_max0;
      float __pyx_v_fbin0_min;
      float __pyx_v_fbin0_max;
      float __pyx_v_delta1;
      float __pyx_v_pos1_min;
      float __pyx_v_min1;
      float __pyx_v_max1;
      float __pyx_v_fbin1_min;
      float __pyx_v_fbin1_max;
      int __pyx_v_bin0_min;
      int __pyx_v_bin0_max;
      int __pyx_v_bins0;
      int __pyx_v_bin1_min;
      int __pyx_v_bin1_max;
      int __pyx_v_bins1;
      __pyx_t_5numpy_int32_t __pyx_v_k;
      __pyx_t_5numpy_int32_t __pyx_v_idx;
      __pyx_t_5numpy_int32_t __pyx_v_lut_size;
      __pyx_t_5numpy_int32_t __pyx_v_i;
      __pyx_t_5numpy_int32_t __pyx_v_j;
      __pyx_t_5numpy_int32_t __pyx_v_size;
      int __pyx_v_check_mask;
      __Pyx_memviewslice __pyx_v_cpos0_sup = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_cpos0_inf = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_cpos1_inf = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_cpos1_sup = { 0, 0, { 0 }, { 0 }, { 0 } };
      PyArrayObject *__pyx_v_outMax = 0;
      PyArrayObject *__pyx_v_lut = 0;
      __Pyx_memviewslice __pyx_v_cmask = { 0, 0, { 0 }, { 0 }, { 0 } };
      size_t __pyx_v_lut_nbytes;
      PyObject *__pyx_v_memsize = NULL;
      double __pyx_v_deltaD;
      double __pyx_v_deltaU;
      double __pyx_v_deltaA;
      double __pyx_v_deltaL;
      double __pyx_v_deltaR;
      __Pyx_LocalBuf_ND __pyx_pybuffernd_lut;
      __Pyx_Buffer __pyx_pybuffer_lut;
      __Pyx_LocalBuf_ND __pyx_pybuffernd_outMax;
      __Pyx_Buffer __pyx_pybuffer_outMax;
      PyObject *__pyx_r = NULL;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("calc_lut", 0);
      __pyx_pybuffer_outMax.pybuffer.buf = NULL;
      __pyx_pybuffer_outMax.refcount = 0;
      __pyx_pybuffernd_outMax.data = NULL;
      __pyx_pybuffernd_outMax.rcbuffer = &__pyx_pybuffer_outMax;
      __pyx_pybuffer_lut.pybuffer.buf = NULL;
      __pyx_pybuffer_lut.refcount = 0;
      __pyx_pybuffernd_lut.data = NULL;
      __pyx_pybuffernd_lut.rcbuffer = &__pyx_pybuffer_lut;

      /* "splitBBoxLUT.pyx":470
     *     @cython.wraparound(False)
     *     @cython.cdivision(True)
     *     def calc_lut(self):             # <<<<<<<<<<<<<<
     *         'calculate the max number of elements in the LUT and populate it'
     *         cdef float delta0=self.delta0, pos0_min=self.pos0_min, min0, max0, fbin0_min, fbin0_max
     */
      __pyx_k_tuple_68 = PyTuple_Pack(40, ((PyObject *)__pyx_n_s__self), ((PyObject *)__pyx_n_s__delta0), ((PyObject *)__pyx_n_s__pos0_min), ((PyObject *)__pyx_n_s__min0), ((PyObject *)__pyx_n_s__max0), ((PyObject *)__pyx_n_s__fbin0_min), ((PyObject *)__pyx_n_s__fbin0_max), ((PyObject *)__pyx_n_s__delta1), ((PyObject *)__pyx_n_s__pos1_min), ((PyObject *)__pyx_n_s__min1), ((PyObject *)__pyx_n_s__max1), ((PyObject *)__pyx_n_s__fbin1_min), ((PyObject *)__pyx_n_s__fbin1_max), ((PyObject *)__pyx_n_s__bin0_min), ((PyObject *)__pyx_n_s__bin0_max), ((PyObject *)__pyx_n_s__bins0), ((PyObject *)__pyx_n_s__bin1_min), ((PyObject *)__pyx_n_s__bin1_max), ((PyObject *)__pyx_n_s__bins1), ((PyObject *)__pyx_n_s__k), ((PyObject *)__pyx_n_s__idx), ((PyObject *)__pyx_n_s__lut_size), ((PyObject *)__pyx_n_s__i), ((PyObject *)__pyx_n_s__j), ((PyObject *)__pyx_n_s__size), ((PyObject *)__pyx_n_s__check_mask), ((PyObject *)__pyx_n_s__cpos0_sup), ((PyObject *)__pyx_n_s__cpos0_inf), ((PyObject *)__pyx_n_s__cpos1_inf), ((PyObject *)__pyx_n_s__cpos1_sup), ((PyObject *)__pyx_n_s__outMax), ((PyObject *)__pyx_n_s__lut), ((PyObject *)__pyx_n_s__cmask), ((PyObject *)__pyx_n_s__lut_nbytes), ((PyObject *)__pyx_n_s__memsize), ((PyObject *)__pyx_n_s__deltaD), ((PyObject *)__pyx_n_s__deltaU), ((PyObject *)__pyx_n_s__deltaA), ((PyObject *)__pyx_n_s__deltaL), ((PyObject *)__pyx_n_s__deltaR)); if (unlikely(!__pyx_k_tuple_68)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 470; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_k_tuple_68);
      __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_68));

      /* "splitBBoxLUT.pyx":470
     *     @cython.wraparound(False)
     *     @cython.cdivision(True)
     *     def calc_lut(self):             # <<<<<<<<<<<<<<
     *         'calculate the max number of elements in the LUT and populate it'
     *         cdef float delta0=self.delta0, pos0_min=self.pos0_min, min0, max0, fbin0_min, fbin0_max
     */
      __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_12splitBBoxLUT_11HistoBBox2d_3calc_lut, 0, __pyx_n_s_70, NULL, __pyx_n_s__splitBBoxLUT, ((PyObject *)__pyx_k_codeobj_69)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 470; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      if (PyObject_SetItem(__pyx_t_8, __pyx_n_s__calc_lut, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 470; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_k_codeobj_69 = (PyObject*)__Pyx_PyCode_New(1, 0, 40, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_68, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_56, __pyx_n_s__calc_lut, 470, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_69)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 470; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

     471:         'calculate the max number of elements in the LUT and populate it'

     472:         cdef float delta0=self.delta0, pos0_min=self.pos0_min, min0, max0, fbin0_min, fbin0_max

      /* "splitBBoxLUT.pyx":472
     *     def calc_lut(self):
     *         'calculate the max number of elements in the LUT and populate it'
     *         cdef float delta0=self.delta0, pos0_min=self.pos0_min, min0, max0, fbin0_min, fbin0_max             # <<<<<<<<<<<<<<
     *         cdef float delta1=self.delta1, pos1_min=self.pos1_min, min1, max1, fbin1_min, fbin1_max
     *         cdef int bin0_min, bin0_max, bins0 = self.bins[0]
     */
      __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__delta0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 472; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_2 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 472; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v_delta0 = __pyx_t_2;
      __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__pos0_min); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 472; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_2 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 472; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v_pos0_min = __pyx_t_2;

     473:         cdef float delta1=self.delta1, pos1_min=self.pos1_min, min1, max1, fbin1_min, fbin1_max

      /* "splitBBoxLUT.pyx":473
     *         'calculate the max number of elements in the LUT and populate it'
     *         cdef float delta0=self.delta0, pos0_min=self.pos0_min, min0, max0, fbin0_min, fbin0_max
     *         cdef float delta1=self.delta1, pos1_min=self.pos1_min, min1, max1, fbin1_min, fbin1_max             # <<<<<<<<<<<<<<
     *         cdef int bin0_min, bin0_max, bins0 = self.bins[0]
     *         cdef int bin1_min, bin1_max, bins1 = self.bins[1]
     */
      __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__delta1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 473; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_2 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 473; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v_delta1 = __pyx_t_2;
      __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__pos1_min); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 473; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_2 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 473; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v_pos1_min = __pyx_t_2;

     474:         cdef int bin0_min, bin0_max, bins0 = self.bins[0]

      /* "splitBBoxLUT.pyx":474
     *         cdef float delta0=self.delta0, pos0_min=self.pos0_min, min0, max0, fbin0_min, fbin0_max
     *         cdef float delta1=self.delta1, pos1_min=self.pos1_min, min1, max1, fbin1_min, fbin1_max
     *         cdef int bin0_min, bin0_max, bins0 = self.bins[0]             # <<<<<<<<<<<<<<
     *         cdef int bin1_min, bin1_max, bins1 = self.bins[1]
     *         cdef numpy.int32_t k, idx, lut_size, i, j, size=self.size
     */
      __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__bins); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_1, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_4 = __Pyx_PyInt_AsInt(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_v_bins0 = __pyx_t_4;

     475:         cdef int bin1_min, bin1_max, bins1 = self.bins[1]

      /* "splitBBoxLUT.pyx":475
     *         cdef float delta1=self.delta1, pos1_min=self.pos1_min, min1, max1, fbin1_min, fbin1_max
     *         cdef int bin0_min, bin0_max, bins0 = self.bins[0]
     *         cdef int bin1_min, bin1_max, bins1 = self.bins[1]             # <<<<<<<<<<<<<<
     *         cdef numpy.int32_t k, idx, lut_size, i, j, size=self.size
     *         cdef bint check_mask
     */
      __pyx_t_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__bins); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_3, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_4 = __Pyx_PyInt_AsInt(__pyx_t_1); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v_bins1 = __pyx_t_4;

     476:         cdef numpy.int32_t k, idx, lut_size, i, j, size=self.size

      /* "splitBBoxLUT.pyx":476
     *         cdef int bin0_min, bin0_max, bins0 = self.bins[0]
     *         cdef int bin1_min, bin1_max, bins1 = self.bins[1]
     *         cdef numpy.int32_t k, idx, lut_size, i, j, size=self.size             # <<<<<<<<<<<<<<
     *         cdef bint check_mask
     *         cdef float[:] cpos0_sup = self.cpos0_sup
     */
      __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__size); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 476; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_5 = __Pyx_PyInt_from_py_npy_int32(__pyx_t_1); if (unlikely((__pyx_t_5 == (npy_int32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 476; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v_size = __pyx_t_5;

     477:         cdef bint check_mask

     478:         cdef float[:] cpos0_sup = self.cpos0_sup

      /* "splitBBoxLUT.pyx":478
     *         cdef numpy.int32_t k, idx, lut_size, i, j, size=self.size
     *         cdef bint check_mask
     *         cdef float[:] cpos0_sup = self.cpos0_sup             # <<<<<<<<<<<<<<
     *         cdef float[:] cpos0_inf = self.cpos0_inf
     *         cdef float[:] cpos1_inf = self.cpos1_inf
     */
      __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__cpos0_sup); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(__pyx_t_1);
      if (unlikely(!__pyx_t_6.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v_cpos0_sup = __pyx_t_6;
      __pyx_t_6.memview = NULL;
      __pyx_t_6.data = NULL;

     479:         cdef float[:] cpos0_inf = self.cpos0_inf

      /* "splitBBoxLUT.pyx":479
     *         cdef bint check_mask
     *         cdef float[:] cpos0_sup = self.cpos0_sup
     *         cdef float[:] cpos0_inf = self.cpos0_inf             # <<<<<<<<<<<<<<
     *         cdef float[:] cpos1_inf = self.cpos1_inf
     *         cdef float[:] cpos1_sup = self.cpos1_sup
     */
      __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__cpos0_inf); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 479; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(__pyx_t_1);
      if (unlikely(!__pyx_t_7.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 479; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v_cpos0_inf = __pyx_t_7;
      __pyx_t_7.memview = NULL;
      __pyx_t_7.data = NULL;

     480:         cdef float[:] cpos1_inf = self.cpos1_inf

      /* "splitBBoxLUT.pyx":480
     *         cdef float[:] cpos0_sup = self.cpos0_sup
     *         cdef float[:] cpos0_inf = self.cpos0_inf
     *         cdef float[:] cpos1_inf = self.cpos1_inf             # <<<<<<<<<<<<<<
     *         cdef float[:] cpos1_sup = self.cpos1_sup
     *         cdef numpy.ndarray[numpy.int32_t, ndim = 2] outMax = numpy.zeros((bins0,bins1), dtype=numpy.int32)
     */
      __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__cpos1_inf); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(__pyx_t_1);
      if (unlikely(!__pyx_t_8.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v_cpos1_inf = __pyx_t_8;
      __pyx_t_8.memview = NULL;
      __pyx_t_8.data = NULL;

     481:         cdef float[:] cpos1_sup = self.cpos1_sup

      /* "splitBBoxLUT.pyx":481
     *         cdef float[:] cpos0_inf = self.cpos0_inf
     *         cdef float[:] cpos1_inf = self.cpos1_inf
     *         cdef float[:] cpos1_sup = self.cpos1_sup             # <<<<<<<<<<<<<<
     *         cdef numpy.ndarray[numpy.int32_t, ndim = 2] outMax = numpy.zeros((bins0,bins1), dtype=numpy.int32)
     *         cdef numpy.ndarray[lut_point, ndim = 3] lut
     */
      __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__cpos1_sup); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 481; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_9 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(__pyx_t_1);
      if (unlikely(!__pyx_t_9.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 481; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v_cpos1_sup = __pyx_t_9;
      __pyx_t_9.memview = NULL;
      __pyx_t_9.data = NULL;

     482:         cdef numpy.ndarray[numpy.int32_t, ndim = 2] outMax = numpy.zeros((bins0,bins1), dtype=numpy.int32)

      /* "splitBBoxLUT.pyx":482
     *         cdef float[:] cpos1_inf = self.cpos1_inf
     *         cdef float[:] cpos1_sup = self.cpos1_sup
     *         cdef numpy.ndarray[numpy.int32_t, ndim = 2] outMax = numpy.zeros((bins0,bins1), dtype=numpy.int32)             # <<<<<<<<<<<<<<
     *         cdef numpy.ndarray[lut_point, ndim = 3] lut
     *         cdef numpy.int8_t[:] cmask
     */
      __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__zeros); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyInt_FromLong(__pyx_v_bins0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_10 = PyInt_FromLong(__pyx_v_bins1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_11);
      PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_10);
      __Pyx_GIVEREF(__pyx_t_10);
      __pyx_t_1 = 0;
      __pyx_t_10 = 0;
      __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_10);
      PyTuple_SET_ITEM(__pyx_t_10, 0, ((PyObject *)__pyx_t_11));
      __Pyx_GIVEREF(((PyObject *)__pyx_t_11));
      __pyx_t_11 = 0;
      __pyx_t_11 = PyDict_New(); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_11));
      __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_12 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__int32); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (PyDict_SetItem(__pyx_t_11, ((PyObject *)__pyx_n_s__dtype), __pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __pyx_t_12 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_10), ((PyObject *)__pyx_t_11)); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_11)); __pyx_t_11 = 0;
      if (!(likely(((__pyx_t_12) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_12, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_13 = ((PyArrayObject *)__pyx_t_12);
      {
        __Pyx_BufFmt_StackElem __pyx_stack[1];
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_outMax.rcbuffer->pybuffer, (PyObject*)__pyx_t_13, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {
          __pyx_v_outMax = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_outMax.rcbuffer->pybuffer.buf = NULL;
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        } else {__pyx_pybuffernd_outMax.diminfo[0].strides = __pyx_pybuffernd_outMax.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_outMax.diminfo[0].shape = __pyx_pybuffernd_outMax.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_outMax.diminfo[1].strides = __pyx_pybuffernd_outMax.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_outMax.diminfo[1].shape = __pyx_pybuffernd_outMax.rcbuffer->pybuffer.shape[1];
        }
      }
      __pyx_t_13 = 0;
      __pyx_v_outMax = ((PyArrayObject *)__pyx_t_12);
      __pyx_t_12 = 0;

     483:         cdef numpy.ndarray[lut_point, ndim = 3] lut

     484:         cdef numpy.int8_t[:] cmask

     485:         if self.check_mask:

      /* "splitBBoxLUT.pyx":485
     *         cdef numpy.ndarray[lut_point, ndim = 3] lut
     *         cdef numpy.int8_t[:] cmask
     *         if self.check_mask:             # <<<<<<<<<<<<<<
     *             cmask = self.cmask
     *             check_mask = True
     */
      __pyx_t_12 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__check_mask); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_12);
      __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_12); if (unlikely(__pyx_t_14 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      if (__pyx_t_14) {

     486:             cmask = self.cmask

        /* "splitBBoxLUT.pyx":486
     *         cdef numpy.int8_t[:] cmask
     *         if self.check_mask:
     *             cmask = self.cmask             # <<<<<<<<<<<<<<
     *             check_mask = True
     *         else:
     */
        __pyx_t_12 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__cmask); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 486; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_15 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int8_t(__pyx_t_12);
        if (unlikely(!__pyx_t_15.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 486; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_v_cmask = __pyx_t_15;
        __pyx_t_15.memview = NULL;
        __pyx_t_15.data = NULL;

     487:             check_mask = True

        /* "splitBBoxLUT.pyx":487
     *         if self.check_mask:
     *             cmask = self.cmask
     *             check_mask = True             # <<<<<<<<<<<<<<
     *         else:
     *             check_mask = False
     */
        __pyx_v_check_mask = 1;
        goto __pyx_L3;
      }
      /*else*/ {

     488:         else:

     489:             check_mask = False

        /* "splitBBoxLUT.pyx":489
     *             check_mask = True
     *         else:
     *             check_mask = False             # <<<<<<<<<<<<<<
     *
     * #NOGIL
     */
        __pyx_v_check_mask = 0;
      }
      __pyx_L3:;

     490:

     491: #NOGIL

     492:         with nogil:

      /* "splitBBoxLUT.pyx":492
     *
     * #NOGIL
     *         with nogil:             # <<<<<<<<<<<<<<
     *             for idx in range(size):
     *                 if (check_mask) and (cmask[idx]):
     */
      {
          #ifdef WITH_THREAD
          PyThreadState *_save = NULL;
          #endif
          Py_UNBLOCK_THREADS
          /*try:*/ {

          /* "splitBBoxLUT.pyx":492
     *
     * #NOGIL
     *         with nogil:             # <<<<<<<<<<<<<<
     *             for idx in range(size):
     *                 if (check_mask) and (cmask[idx]):
     */
          /*finally:*/ {
            int __pyx_why;
            __pyx_why = 0; goto __pyx_L6;
            __pyx_L5: __pyx_why = 4; goto __pyx_L6;
            __pyx_L6:;
            Py_BLOCK_THREADS
            switch (__pyx_why) {
              case 4: goto __pyx_L1_error;
            }
          }
      }

     493:             for idx in range(size):

            /* "splitBBoxLUT.pyx":493
     * #NOGIL
     *         with nogil:
     *             for idx in range(size):             # <<<<<<<<<<<<<<
     *                 if (check_mask) and (cmask[idx]):
     *                     continue
     */
            __pyx_t_5 = __pyx_v_size;
            for (__pyx_t_16 = 0; __pyx_t_16 < __pyx_t_5; __pyx_t_16+=1) {
              __pyx_v_idx = __pyx_t_16;

     494:                 if (check_mask) and (cmask[idx]):

              /* "splitBBoxLUT.pyx":494
     *         with nogil:
     *             for idx in range(size):
     *                 if (check_mask) and (cmask[idx]):             # <<<<<<<<<<<<<<
     *                     continue
     *
     */
              __pyx_t_14 = __pyx_v_check_mask;
              if (__pyx_t_14) {
                if (unlikely(!__pyx_v_cmask.memview)) { __Pyx_RaiseUnboundMemoryviewSliceNogil("cmask"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 494; __pyx_clineno = __LINE__; goto __pyx_L5;} }
                __pyx_t_17 = __pyx_v_idx;
                __pyx_t_18 = (*((__pyx_t_5numpy_int8_t *) ( /* dim=0 */ (__pyx_v_cmask.data + __pyx_t_17 * __pyx_v_cmask.strides[0]) )));
              } else {
                __pyx_t_18 = __pyx_t_14;
              }
              if (__pyx_t_18) {

     495:                     continue

                /* "splitBBoxLUT.pyx":495
     *             for idx in range(size):
     *                 if (check_mask) and (cmask[idx]):
     *                     continue             # <<<<<<<<<<<<<<
     *
     *                 min0 = cpos0_inf[idx]
     */
                goto __pyx_L7_continue;
                goto __pyx_L9;
              }
              __pyx_L9:;

     496:

     497:                 min0 = cpos0_inf[idx]

              /* "splitBBoxLUT.pyx":497
     *                     continue
     *
     *                 min0 = cpos0_inf[idx]             # <<<<<<<<<<<<<<
     *                 max0 = cpos0_sup[idx]
     *                 min1 = cpos1_inf[idx]
     */
              __pyx_t_19 = __pyx_v_idx;
              __pyx_v_min0 = (*((float *) ( /* dim=0 */ (__pyx_v_cpos0_inf.data + __pyx_t_19 * __pyx_v_cpos0_inf.strides[0]) )));

     498:                 max0 = cpos0_sup[idx]

              /* "splitBBoxLUT.pyx":498
     *
     *                 min0 = cpos0_inf[idx]
     *                 max0 = cpos0_sup[idx]             # <<<<<<<<<<<<<<
     *                 min1 = cpos1_inf[idx]
     *                 max1 = cpos1_sup[idx]
     */
              __pyx_t_20 = __pyx_v_idx;
              __pyx_v_max0 = (*((float *) ( /* dim=0 */ (__pyx_v_cpos0_sup.data + __pyx_t_20 * __pyx_v_cpos0_sup.strides[0]) )));

     499:                 min1 = cpos1_inf[idx]

              /* "splitBBoxLUT.pyx":499
     *                 min0 = cpos0_inf[idx]
     *                 max0 = cpos0_sup[idx]
     *                 min1 = cpos1_inf[idx]             # <<<<<<<<<<<<<<
     *                 max1 = cpos1_sup[idx]
     *
     */
              __pyx_t_21 = __pyx_v_idx;
              __pyx_v_min1 = (*((float *) ( /* dim=0 */ (__pyx_v_cpos1_inf.data + __pyx_t_21 * __pyx_v_cpos1_inf.strides[0]) )));

     500:                 max1 = cpos1_sup[idx]

              /* "splitBBoxLUT.pyx":500
     *                 max0 = cpos0_sup[idx]
     *                 min1 = cpos1_inf[idx]
     *                 max1 = cpos1_sup[idx]             # <<<<<<<<<<<<<<
     *
     *                 bin0_min = < int > getBinNr(min0, pos0_min, delta0)
     */
              __pyx_t_22 = __pyx_v_idx;
              __pyx_v_max1 = (*((float *) ( /* dim=0 */ (__pyx_v_cpos1_sup.data + __pyx_t_22 * __pyx_v_cpos1_sup.strides[0]) )));

     501:

     502:                 bin0_min = < int > getBinNr(min0, pos0_min, delta0)

              /* "splitBBoxLUT.pyx":502
     *                 max1 = cpos1_sup[idx]
     *
     *                 bin0_min = < int > getBinNr(min0, pos0_min, delta0)             # <<<<<<<<<<<<<<
     *                 bin0_max = < int > getBinNr(max0, pos0_min, delta0)
     *
     */
              __pyx_v_bin0_min = ((int)__pyx_f_12splitBBoxLUT_getBinNr(__pyx_v_min0, __pyx_v_pos0_min, __pyx_v_delta0));

     503:                 bin0_max = < int > getBinNr(max0, pos0_min, delta0)

              /* "splitBBoxLUT.pyx":503
     *
     *                 bin0_min = < int > getBinNr(min0, pos0_min, delta0)
     *                 bin0_max = < int > getBinNr(max0, pos0_min, delta0)             # <<<<<<<<<<<<<<
     *
     *                 bin1_min = < int > getBinNr(min1, pos1_min, delta1)
     */
              __pyx_v_bin0_max = ((int)__pyx_f_12splitBBoxLUT_getBinNr(__pyx_v_max0, __pyx_v_pos0_min, __pyx_v_delta0));

     504:

     505:                 bin1_min = < int > getBinNr(min1, pos1_min, delta1)

              /* "splitBBoxLUT.pyx":505
     *                 bin0_max = < int > getBinNr(max0, pos0_min, delta0)
     *
     *                 bin1_min = < int > getBinNr(min1, pos1_min, delta1)             # <<<<<<<<<<<<<<
     *                 bin1_max = < int > getBinNr(max1, pos1_min, delta1)
     *
     */
              __pyx_v_bin1_min = ((int)__pyx_f_12splitBBoxLUT_getBinNr(__pyx_v_min1, __pyx_v_pos1_min, __pyx_v_delta1));

     506:                 bin1_max = < int > getBinNr(max1, pos1_min, delta1)

              /* "splitBBoxLUT.pyx":506
     *
     *                 bin1_min = < int > getBinNr(min1, pos1_min, delta1)
     *                 bin1_max = < int > getBinNr(max1, pos1_min, delta1)             # <<<<<<<<<<<<<<
     *
     *                 if (bin0_max < 0) or (bin0_min >= bins0) or (bin1_max < 0) or (bin1_min >= bins1):
     */
              __pyx_v_bin1_max = ((int)__pyx_f_12splitBBoxLUT_getBinNr(__pyx_v_max1, __pyx_v_pos1_min, __pyx_v_delta1));

     507:

     508:                 if (bin0_max < 0) or (bin0_min >= bins0) or (bin1_max < 0) or (bin1_min >= bins1):

              /* "splitBBoxLUT.pyx":508
     *                 bin1_max = < int > getBinNr(max1, pos1_min, delta1)
     *
     *                 if (bin0_max < 0) or (bin0_min >= bins0) or (bin1_max < 0) or (bin1_min >= bins1):             # <<<<<<<<<<<<<<
     *                     continue
     *
     */
              __pyx_t_18 = (__pyx_v_bin0_max < 0);
              if (!__pyx_t_18) {
                __pyx_t_14 = (__pyx_v_bin0_min >= __pyx_v_bins0);
                if (!__pyx_t_14) {
                  __pyx_t_23 = (__pyx_v_bin1_max < 0);
                  if (!__pyx_t_23) {
                    __pyx_t_24 = (__pyx_v_bin1_min >= __pyx_v_bins1);
                    __pyx_t_25 = __pyx_t_24;
                  } else {
                    __pyx_t_25 = __pyx_t_23;
                  }
                  __pyx_t_23 = __pyx_t_25;
                } else {
                  __pyx_t_23 = __pyx_t_14;
                }
                __pyx_t_14 = __pyx_t_23;
              } else {
                __pyx_t_14 = __pyx_t_18;
              }
              if (__pyx_t_14) {

     509:                     continue

                /* "splitBBoxLUT.pyx":509
     *
     *                 if (bin0_max < 0) or (bin0_min >= bins0) or (bin1_max < 0) or (bin1_min >= bins1):
     *                     continue             # <<<<<<<<<<<<<<
     *
     *                 if bin0_max >= bins0 :
     */
                goto __pyx_L7_continue;
                goto __pyx_L10;
              }
              __pyx_L10:;

     510:

     511:                 if bin0_max >= bins0 :

              /* "splitBBoxLUT.pyx":511
     *                     continue
     *
     *                 if bin0_max >= bins0 :             # <<<<<<<<<<<<<<
     *                     bin0_max = bins0 - 1
     *                 if  bin0_min < 0:
     */
              __pyx_t_14 = (__pyx_v_bin0_max >= __pyx_v_bins0);
              if (__pyx_t_14) {

     512:                     bin0_max = bins0 - 1

                /* "splitBBoxLUT.pyx":512
     *
     *                 if bin0_max >= bins0 :
     *                     bin0_max = bins0 - 1             # <<<<<<<<<<<<<<
     *                 if  bin0_min < 0:
     *                     bin0_min = 0
     */
                __pyx_v_bin0_max = (__pyx_v_bins0 - 1);
                goto __pyx_L11;
              }
              __pyx_L11:;

     513:                 if  bin0_min < 0:

              /* "splitBBoxLUT.pyx":513
     *                 if bin0_max >= bins0 :
     *                     bin0_max = bins0 - 1
     *                 if  bin0_min < 0:             # <<<<<<<<<<<<<<
     *                     bin0_min = 0
     *                 if bin1_max >= bins1 :
     */
              __pyx_t_14 = (__pyx_v_bin0_min < 0);
              if (__pyx_t_14) {

     514:                     bin0_min = 0

                /* "splitBBoxLUT.pyx":514
     *                     bin0_max = bins0 - 1
     *                 if  bin0_min < 0:
     *                     bin0_min = 0             # <<<<<<<<<<<<<<
     *                 if bin1_max >= bins1 :
     *                     bin1_max = bins1 - 1
     */
                __pyx_v_bin0_min = 0;
                goto __pyx_L12;
              }
              __pyx_L12:;

     515:                 if bin1_max >= bins1 :

              /* "splitBBoxLUT.pyx":515
     *                 if  bin0_min < 0:
     *                     bin0_min = 0
     *                 if bin1_max >= bins1 :             # <<<<<<<<<<<<<<
     *                     bin1_max = bins1 - 1
     *                 if  bin1_min < 0:
     */
              __pyx_t_14 = (__pyx_v_bin1_max >= __pyx_v_bins1);
              if (__pyx_t_14) {

     516:                     bin1_max = bins1 - 1

                /* "splitBBoxLUT.pyx":516
     *                     bin0_min = 0
     *                 if bin1_max >= bins1 :
     *                     bin1_max = bins1 - 1             # <<<<<<<<<<<<<<
     *                 if  bin1_min < 0:
     *                     bin1_min = 0
     */
                __pyx_v_bin1_max = (__pyx_v_bins1 - 1);
                goto __pyx_L13;
              }
              __pyx_L13:;

     517:                 if  bin1_min < 0:

              /* "splitBBoxLUT.pyx":517
     *                 if bin1_max >= bins1 :
     *                     bin1_max = bins1 - 1
     *                 if  bin1_min < 0:             # <<<<<<<<<<<<<<
     *                     bin1_min = 0
     *
     */
              __pyx_t_14 = (__pyx_v_bin1_min < 0);
              if (__pyx_t_14) {

     518:                     bin1_min = 0

                /* "splitBBoxLUT.pyx":518
     *                     bin1_max = bins1 - 1
     *                 if  bin1_min < 0:
     *                     bin1_min = 0             # <<<<<<<<<<<<<<
     *
     *                 for i in range(bin0_min, bin0_max+1):
     */
                __pyx_v_bin1_min = 0;
                goto __pyx_L14;
              }
              __pyx_L14:;

     519:

     520:                 for i in range(bin0_min, bin0_max+1):

              /* "splitBBoxLUT.pyx":520
     *                     bin1_min = 0
     *
     *                 for i in range(bin0_min, bin0_max+1):             # <<<<<<<<<<<<<<
     *                     for j in range(bin1_min , bin1_max+1):
     *                         outMax[i, j] +=  1
     */
              __pyx_t_26 = (__pyx_v_bin0_max + 1);
              for (__pyx_t_27 = __pyx_v_bin0_min; __pyx_t_27 < __pyx_t_26; __pyx_t_27+=1) {
                __pyx_v_i = __pyx_t_27;

     521:                     for j in range(bin1_min , bin1_max+1):

                /* "splitBBoxLUT.pyx":521
     *
     *                 for i in range(bin0_min, bin0_max+1):
     *                     for j in range(bin1_min , bin1_max+1):             # <<<<<<<<<<<<<<
     *                         outMax[i, j] +=  1
     *
     */
                __pyx_t_28 = (__pyx_v_bin1_max + 1);
                for (__pyx_t_29 = __pyx_v_bin1_min; __pyx_t_29 < __pyx_t_28; __pyx_t_29+=1) {
                  __pyx_v_j = __pyx_t_29;

     522:                         outMax[i, j] +=  1

                  /* "splitBBoxLUT.pyx":522
     *                 for i in range(bin0_min, bin0_max+1):
     *                     for j in range(bin1_min , bin1_max+1):
     *                         outMax[i, j] +=  1             # <<<<<<<<<<<<<<
     *
     *         self.lut_size = lut_size = outMax.max()
     */
                  __pyx_t_30 = __pyx_v_i;
                  __pyx_t_31 = __pyx_v_j;
                  *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_outMax.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_outMax.diminfo[0].strides, __pyx_t_31, __pyx_pybuffernd_outMax.diminfo[1].strides) += 1;
                }
              }
              __pyx_L7_continue:;
            }
          }

     523:

     524:         self.lut_size = lut_size = outMax.max()

      /* "splitBBoxLUT.pyx":524
     *                         outMax[i, j] +=  1
     *
     *         self.lut_size = lut_size = outMax.max()             # <<<<<<<<<<<<<<
     *         #just recycle the outMax array
     *         #outMax = numpy.zeros((bins0,bins1), dtype=numpy.int32)
     */
      __pyx_t_12 = PyObject_GetAttr(((PyObject *)__pyx_v_outMax), __pyx_n_s__max); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 524; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_12);
      __pyx_t_11 = PyObject_Call(__pyx_t_12, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 524; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_11);
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__lut_size, __pyx_t_11) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 524; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_5 = __Pyx_PyInt_from_py_npy_int32(__pyx_t_11); if (unlikely((__pyx_t_5 == (npy_int32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 524; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_v_lut_size = __pyx_t_5;
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

     525:         #just recycle the outMax array

     526:         #outMax = numpy.zeros((bins0,bins1), dtype=numpy.int32)

     527:         memset(&outMax[0,0], 0, bins0*bins1*sizeof(numpy.int32_t))

      /* "splitBBoxLUT.pyx":527
     *         #just recycle the outMax array
     *         #outMax = numpy.zeros((bins0,bins1), dtype=numpy.int32)
     *         memset(&outMax[0,0], 0, bins0*bins1*sizeof(numpy.int32_t))             # <<<<<<<<<<<<<<
     *
     *         lut_nbytes = bins0 * bins1 * lut_size * sizeof(lut_point)
     */
      __pyx_t_26 = 0;
      __pyx_t_28 = 0;
      memset((&(*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_outMax.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_outMax.diminfo[0].strides, __pyx_t_28, __pyx_pybuffernd_outMax.diminfo[1].strides))), 0, ((__pyx_v_bins0 * __pyx_v_bins1) * (sizeof(__pyx_t_5numpy_int32_t))));

     528:

     529:         lut_nbytes = bins0 * bins1 * lut_size * sizeof(lut_point)

      /* "splitBBoxLUT.pyx":529
     *         memset(&outMax[0,0], 0, bins0*bins1*sizeof(numpy.int32_t))
     *
     *         lut_nbytes = bins0 * bins1 * lut_size * sizeof(lut_point)             # <<<<<<<<<<<<<<
     *         if (os.name == "posix") and ("SC_PAGE_SIZE" in os.sysconf_names) and ("SC_PHYS_PAGES" in os.sysconf_names):
     *             memsize =  os.sysconf("SC_PAGE_SIZE")*os.sysconf("SC_PHYS_PAGES")
     */
      __pyx_v_lut_nbytes = (((__pyx_v_bins0 * __pyx_v_bins1) * __pyx_v_lut_size) * (sizeof(struct __pyx_t_12splitBBoxLUT_lut_point)));

     530:         if (os.name == "posix") and ("SC_PAGE_SIZE" in os.sysconf_names) and ("SC_PHYS_PAGES" in os.sysconf_names):

      /* "splitBBoxLUT.pyx":530
     *
     *         lut_nbytes = bins0 * bins1 * lut_size * sizeof(lut_point)
     *         if (os.name == "posix") and ("SC_PAGE_SIZE" in os.sysconf_names) and ("SC_PHYS_PAGES" in os.sysconf_names):             # <<<<<<<<<<<<<<
     *             memsize =  os.sysconf("SC_PAGE_SIZE")*os.sysconf("SC_PHYS_PAGES")
     *             if memsize <  lut_nbytes:
     */
      __pyx_t_11 = __Pyx_GetName(__pyx_m, __pyx_n_s__os); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 530; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_11);
      __pyx_t_12 = PyObject_GetAttr(__pyx_t_11, __pyx_n_s__name); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 530; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      __pyx_t_11 = PyObject_RichCompare(__pyx_t_12, ((PyObject *)__pyx_n_s__posix), Py_EQ); __Pyx_XGOTREF(__pyx_t_11); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 530; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely(__pyx_t_14 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 530; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      if (__pyx_t_14) {
        __pyx_t_11 = __Pyx_GetName(__pyx_m, __pyx_n_s__os); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 530; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_11);
        __pyx_t_12 = PyObject_GetAttr(__pyx_t_11, __pyx_n_s__sysconf_names); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 530; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __pyx_t_18 = (__Pyx_PySequence_Contains(((PyObject *)__pyx_n_s__SC_PAGE_SIZE), __pyx_t_12, Py_EQ)); if (unlikely(__pyx_t_18 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 530; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        if (__pyx_t_18) {
          __pyx_t_12 = __Pyx_GetName(__pyx_m, __pyx_n_s__os); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 530; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_12);
          __pyx_t_11 = PyObject_GetAttr(__pyx_t_12, __pyx_n_s__sysconf_names); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 530; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_11);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_23 = (__Pyx_PySequence_Contains(((PyObject *)__pyx_n_s__SC_PHYS_PAGES), __pyx_t_11, Py_EQ)); if (unlikely(__pyx_t_23 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 530; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          __pyx_t_25 = __pyx_t_23;
        } else {
          __pyx_t_25 = __pyx_t_18;
        }
        __pyx_t_18 = __pyx_t_25;
      } else {
        __pyx_t_18 = __pyx_t_14;
      }
      if (__pyx_t_18) {

     531:             memsize =  os.sysconf("SC_PAGE_SIZE")*os.sysconf("SC_PHYS_PAGES")

        /* "splitBBoxLUT.pyx":531
     *         lut_nbytes = bins0 * bins1 * lut_size * sizeof(lut_point)
     *         if (os.name == "posix") and ("SC_PAGE_SIZE" in os.sysconf_names) and ("SC_PHYS_PAGES" in os.sysconf_names):
     *             memsize =  os.sysconf("SC_PAGE_SIZE")*os.sysconf("SC_PHYS_PAGES")             # <<<<<<<<<<<<<<
     *             if memsize <  lut_nbytes:
     *                 raise MemoryError("Lookup-table (%i, %i, %i) is %.3fGB whereas the memory of the system is only %s"%(bins0, bins1, lut_size, lut_nbytes, memsize))
     */
        __pyx_t_11 = __Pyx_GetName(__pyx_m, __pyx_n_s__os); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 531; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_11);
        __pyx_t_12 = PyObject_GetAttr(__pyx_t_11, __pyx_n_s__sysconf); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 531; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __pyx_t_11 = PyObject_Call(__pyx_t_12, ((PyObject *)__pyx_k_tuple_5), NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 531; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_t_12 = __Pyx_GetName(__pyx_m, __pyx_n_s__os); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 531; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_10 = PyObject_GetAttr(__pyx_t_12, __pyx_n_s__sysconf); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 531; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_10);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;

      /* "splitBBoxLUT.pyx":531
     *         lut_nbytes = bins0 * bins1 * lut_size * sizeof(lut_point)
     *         if (os.name == "posix") and ("SC_PAGE_SIZE" in os.sysconf_names) and ("SC_PHYS_PAGES" in os.sysconf_names):
     *             memsize =  os.sysconf("SC_PAGE_SIZE")*os.sysconf("SC_PHYS_PAGES")             # <<<<<<<<<<<<<<
     *             if memsize <  lut_nbytes:
     *                 raise MemoryError("Lookup-table (%i, %i, %i) is %.3fGB whereas the memory of the system is only %s"%(bins0, bins1, lut_size, lut_nbytes, memsize))
     */
      __pyx_k_tuple_5 = PyTuple_Pack(1, ((PyObject *)__pyx_n_s__SC_PAGE_SIZE)); if (unlikely(!__pyx_k_tuple_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 531; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_k_tuple_5);
      __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_5));
        __pyx_t_12 = PyObject_Call(__pyx_t_10, ((PyObject *)__pyx_k_tuple_6), NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 531; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __pyx_t_10 = PyNumber_Multiply(__pyx_t_11, __pyx_t_12); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 531; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_10);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_v_memsize = __pyx_t_10;
        __pyx_t_10 = 0;
      __pyx_k_tuple_6 = PyTuple_Pack(1, ((PyObject *)__pyx_n_s__SC_PHYS_PAGES)); if (unlikely(!__pyx_k_tuple_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 531; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_k_tuple_6);
      __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_6));

     532:             if memsize <  lut_nbytes:

        /* "splitBBoxLUT.pyx":532
     *         if (os.name == "posix") and ("SC_PAGE_SIZE" in os.sysconf_names) and ("SC_PHYS_PAGES" in os.sysconf_names):
     *             memsize =  os.sysconf("SC_PAGE_SIZE")*os.sysconf("SC_PHYS_PAGES")
     *             if memsize <  lut_nbytes:             # <<<<<<<<<<<<<<
     *                 raise MemoryError("Lookup-table (%i, %i, %i) is %.3fGB whereas the memory of the system is only %s"%(bins0, bins1, lut_size, lut_nbytes, memsize))
     *         #else hope we have enough memory
     */
        __pyx_t_10 = __Pyx_PyInt_FromSize_t(__pyx_v_lut_nbytes); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 532; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_10);
        __pyx_t_12 = PyObject_RichCompare(__pyx_v_memsize, __pyx_t_10, Py_LT); __Pyx_XGOTREF(__pyx_t_12); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 532; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __pyx_t_18 = __Pyx_PyObject_IsTrue(__pyx_t_12); if (unlikely(__pyx_t_18 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 532; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        if (__pyx_t_18) {

     533:                 raise MemoryError("Lookup-table (%i, %i, %i) is %.3fGB whereas the memory of the system is only %s"%(bins0, bins1, lut_size, lut_nbytes, memsize))

          /* "splitBBoxLUT.pyx":533
     *             memsize =  os.sysconf("SC_PAGE_SIZE")*os.sysconf("SC_PHYS_PAGES")
     *             if memsize <  lut_nbytes:
     *                 raise MemoryError("Lookup-table (%i, %i, %i) is %.3fGB whereas the memory of the system is only %s"%(bins0, bins1, lut_size, lut_nbytes, memsize))             # <<<<<<<<<<<<<<
     *         #else hope we have enough memory
     *         lut = numpy.recarray(shape=(bins0, bins1, lut_size),dtype=[("idx",numpy.int32),("coef",numpy.float32)])
     */
          __pyx_t_12 = PyInt_FromLong(__pyx_v_bins0); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 533; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_12);
          __pyx_t_10 = PyInt_FromLong(__pyx_v_bins1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 533; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = __Pyx_PyInt_to_py_npy_int32(__pyx_v_lut_size); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 533; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_11);
          __pyx_t_3 = __Pyx_PyInt_FromSize_t(__pyx_v_lut_nbytes); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 533; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_3);
          __pyx_t_1 = PyTuple_New(5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 533; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_1);
          PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_12);
          __Pyx_GIVEREF(__pyx_t_12);
          PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_10);
          __Pyx_GIVEREF(__pyx_t_10);
          PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_11);
          __Pyx_GIVEREF(__pyx_t_11);
          PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_t_3);
          __Pyx_GIVEREF(__pyx_t_3);
          __Pyx_INCREF(__pyx_v_memsize);
          PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_v_memsize);
          __Pyx_GIVEREF(__pyx_v_memsize);
          __pyx_t_12 = 0;
          __pyx_t_10 = 0;
          __pyx_t_11 = 0;
          __pyx_t_3 = 0;
          __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_7), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 533; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(((PyObject *)__pyx_t_3));
          __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
          __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 533; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_1);
          PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_t_3));
          __Pyx_GIVEREF(((PyObject *)__pyx_t_3));
          __pyx_t_3 = 0;
          __pyx_t_3 = PyObject_Call(__pyx_builtin_MemoryError, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 533; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
          __Pyx_Raise(__pyx_t_3, 0, 0, 0);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 533; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          goto __pyx_L21;
        }
        __pyx_L21:;
        goto __pyx_L20;
      }
      __pyx_L20:;

     534:         #else hope we have enough memory

     535:         lut = numpy.recarray(shape=(bins0, bins1, lut_size),dtype=[("idx",numpy.int32),("coef",numpy.float32)])

      /* "splitBBoxLUT.pyx":535
     *                 raise MemoryError("Lookup-table (%i, %i, %i) is %.3fGB whereas the memory of the system is only %s"%(bins0, bins1, lut_size, lut_nbytes, memsize))
     *         #else hope we have enough memory
     *         lut = numpy.recarray(shape=(bins0, bins1, lut_size),dtype=[("idx",numpy.int32),("coef",numpy.float32)])             # <<<<<<<<<<<<<<
     *         memset(&lut[0,0,0], 0, lut_nbytes)
     *         with nogil:
     */
      __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 535; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_1 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__recarray); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 535; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 535; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_3));
      __pyx_t_11 = PyInt_FromLong(__pyx_v_bins0); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 535; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_11);
      __pyx_t_10 = PyInt_FromLong(__pyx_v_bins1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 535; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_12 = __Pyx_PyInt_to_py_npy_int32(__pyx_v_lut_size); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 535; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_12);
      __pyx_t_32 = PyTuple_New(3); if (unlikely(!__pyx_t_32)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 535; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_32);
      PyTuple_SET_ITEM(__pyx_t_32, 0, __pyx_t_11);
      __Pyx_GIVEREF(__pyx_t_11);
      PyTuple_SET_ITEM(__pyx_t_32, 1, __pyx_t_10);
      __Pyx_GIVEREF(__pyx_t_10);
      PyTuple_SET_ITEM(__pyx_t_32, 2, __pyx_t_12);
      __Pyx_GIVEREF(__pyx_t_12);
      __pyx_t_11 = 0;
      __pyx_t_10 = 0;
      __pyx_t_12 = 0;
      if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__shape), ((PyObject *)__pyx_t_32)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 535; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(((PyObject *)__pyx_t_32)); __pyx_t_32 = 0;
      __pyx_t_32 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_32)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 535; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_32);
      __pyx_t_12 = PyObject_GetAttr(__pyx_t_32, __pyx_n_s__int32); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 535; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_DECREF(__pyx_t_32); __pyx_t_32 = 0;
      __pyx_t_32 = PyTuple_New(2); if (unlikely(!__pyx_t_32)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 535; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_32);
      __Pyx_INCREF(((PyObject *)__pyx_n_s__idx));
      PyTuple_SET_ITEM(__pyx_t_32, 0, ((PyObject *)__pyx_n_s__idx));
      __Pyx_GIVEREF(((PyObject *)__pyx_n_s__idx));
      PyTuple_SET_ITEM(__pyx_t_32, 1, __pyx_t_12);
      __Pyx_GIVEREF(__pyx_t_12);
      __pyx_t_12 = 0;
      __pyx_t_12 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 535; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_12);
      __pyx_t_10 = PyObject_GetAttr(__pyx_t_12, __pyx_n_s__float32); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 535; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __pyx_t_12 = PyTuple_New(2); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 535; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_INCREF(((PyObject *)__pyx_n_s__coef));
      PyTuple_SET_ITEM(__pyx_t_12, 0, ((PyObject *)__pyx_n_s__coef));
      __Pyx_GIVEREF(((PyObject *)__pyx_n_s__coef));
      PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_10);
      __Pyx_GIVEREF(__pyx_t_10);
      __pyx_t_10 = 0;
      __pyx_t_10 = PyList_New(2); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 535; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_10);
      PyList_SET_ITEM(__pyx_t_10, 0, ((PyObject *)__pyx_t_32));
      __Pyx_GIVEREF(((PyObject *)__pyx_t_32));
      PyList_SET_ITEM(__pyx_t_10, 1, ((PyObject *)__pyx_t_12));
      __Pyx_GIVEREF(((PyObject *)__pyx_t_12));
      __pyx_t_32 = 0;
      __pyx_t_12 = 0;
      if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__dtype), ((PyObject *)__pyx_t_10)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 535; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
      __pyx_t_10 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 535; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_10) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_10, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 535; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_33 = ((PyArrayObject *)__pyx_t_10);
      {
        __Pyx_BufFmt_StackElem __pyx_stack[2];
        __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lut.rcbuffer->pybuffer);
        __pyx_t_4 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_lut.rcbuffer->pybuffer, (PyObject*)__pyx_t_33, &__Pyx_TypeInfo_nn_struct___pyx_t_12splitBBoxLUT_lut_point, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack);
        if (unlikely(__pyx_t_4 < 0)) {
          PyErr_Fetch(&__pyx_t_34, &__pyx_t_35, &__pyx_t_36);
          if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_lut.rcbuffer->pybuffer, (PyObject*)__pyx_v_lut, &__Pyx_TypeInfo_nn_struct___pyx_t_12splitBBoxLUT_lut_point, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) {
            Py_XDECREF(__pyx_t_34); Py_XDECREF(__pyx_t_35); Py_XDECREF(__pyx_t_36);
            __Pyx_RaiseBufferFallbackError();
          } else {
            PyErr_Restore(__pyx_t_34, __pyx_t_35, __pyx_t_36);
          }
        }
        __pyx_pybuffernd_lut.diminfo[0].strides = __pyx_pybuffernd_lut.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_lut.diminfo[0].shape = __pyx_pybuffernd_lut.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_lut.diminfo[1].strides = __pyx_pybuffernd_lut.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_lut.diminfo[1].shape = __pyx_pybuffernd_lut.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_lut.diminfo[2].strides = __pyx_pybuffernd_lut.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_lut.diminfo[2].shape = __pyx_pybuffernd_lut.rcbuffer->pybuffer.shape[2];
        if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 535; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_33 = 0;
      __pyx_v_lut = ((PyArrayObject *)__pyx_t_10);
      __pyx_t_10 = 0;

     536:         memset(&lut[0,0,0], 0, lut_nbytes)

      /* "splitBBoxLUT.pyx":536
     *         #else hope we have enough memory
     *         lut = numpy.recarray(shape=(bins0, bins1, lut_size),dtype=[("idx",numpy.int32),("coef",numpy.float32)])
     *         memset(&lut[0,0,0], 0, lut_nbytes)             # <<<<<<<<<<<<<<
     *         with nogil:
     *             for idx in range(size):
     */
      __pyx_t_37 = 0;
      __pyx_t_38 = 0;
      __pyx_t_39 = 0;
      memset((&(*__Pyx_BufPtrStrided3d(struct __pyx_t_12splitBBoxLUT_lut_point *, __pyx_pybuffernd_lut.rcbuffer->pybuffer.buf, __pyx_t_37, __pyx_pybuffernd_lut.diminfo[0].strides, __pyx_t_38, __pyx_pybuffernd_lut.diminfo[1].strides, __pyx_t_39, __pyx_pybuffernd_lut.diminfo[2].strides))), 0, __pyx_v_lut_nbytes);

     537:         with nogil:

      /* "splitBBoxLUT.pyx":537
     *         lut = numpy.recarray(shape=(bins0, bins1, lut_size),dtype=[("idx",numpy.int32),("coef",numpy.float32)])
     *         memset(&lut[0,0,0], 0, lut_nbytes)
     *         with nogil:             # <<<<<<<<<<<<<<
     *             for idx in range(size):
     *                 if (check_mask) and cmask[idx]:
     */
      {
          #ifdef WITH_THREAD
          PyThreadState *_save = NULL;
          #endif
          Py_UNBLOCK_THREADS
          /*try:*/ {

          /* "splitBBoxLUT.pyx":537
     *         lut = numpy.recarray(shape=(bins0, bins1, lut_size),dtype=[("idx",numpy.int32),("coef",numpy.float32)])
     *         memset(&lut[0,0,0], 0, lut_nbytes)
     *         with nogil:             # <<<<<<<<<<<<<<
     *             for idx in range(size):
     *                 if (check_mask) and cmask[idx]:
     */
          /*finally:*/ {
            int __pyx_why;
            __pyx_why = 0; goto __pyx_L24;
            __pyx_L23: __pyx_why = 4; goto __pyx_L24;
            __pyx_L24:;
            Py_BLOCK_THREADS
            switch (__pyx_why) {
              case 4: goto __pyx_L1_error;
            }
          }
      }

     538:             for idx in range(size):

            /* "splitBBoxLUT.pyx":538
     *         memset(&lut[0,0,0], 0, lut_nbytes)
     *         with nogil:
     *             for idx in range(size):             # <<<<<<<<<<<<<<
     *                 if (check_mask) and cmask[idx]:
     *                     continue
     */
            __pyx_t_5 = __pyx_v_size;
            for (__pyx_t_16 = 0; __pyx_t_16 < __pyx_t_5; __pyx_t_16+=1) {
              __pyx_v_idx = __pyx_t_16;

     539:                 if (check_mask) and cmask[idx]:

              /* "splitBBoxLUT.pyx":539
     *         with nogil:
     *             for idx in range(size):
     *                 if (check_mask) and cmask[idx]:             # <<<<<<<<<<<<<<
     *                     continue
     *
     */
              __pyx_t_18 = __pyx_v_check_mask;
              if (__pyx_t_18) {
                if (unlikely(!__pyx_v_cmask.memview)) { __Pyx_RaiseUnboundMemoryviewSliceNogil("cmask"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 539; __pyx_clineno = __LINE__; goto __pyx_L23;} }
                __pyx_t_27 = __pyx_v_idx;
                __pyx_t_14 = (*((__pyx_t_5numpy_int8_t *) ( /* dim=0 */ (__pyx_v_cmask.data + __pyx_t_27 * __pyx_v_cmask.strides[0]) )));
              } else {
                __pyx_t_14 = __pyx_t_18;
              }
              if (__pyx_t_14) {

     540:                     continue

                /* "splitBBoxLUT.pyx":540
     *             for idx in range(size):
     *                 if (check_mask) and cmask[idx]:
     *                     continue             # <<<<<<<<<<<<<<
     *
     *                 min0 = cpos0_inf[idx]
     */
                goto __pyx_L25_continue;
                goto __pyx_L27;
              }
              __pyx_L27:;

     541:

     542:                 min0 = cpos0_inf[idx]

              /* "splitBBoxLUT.pyx":542
     *                     continue
     *
     *                 min0 = cpos0_inf[idx]             # <<<<<<<<<<<<<<
     *                 max0 = cpos0_sup[idx]
     *                 min1 = cpos1_inf[idx]
     */
              __pyx_t_29 = __pyx_v_idx;
              __pyx_v_min0 = (*((float *) ( /* dim=0 */ (__pyx_v_cpos0_inf.data + __pyx_t_29 * __pyx_v_cpos0_inf.strides[0]) )));

     543:                 max0 = cpos0_sup[idx]

              /* "splitBBoxLUT.pyx":543
     *
     *                 min0 = cpos0_inf[idx]
     *                 max0 = cpos0_sup[idx]             # <<<<<<<<<<<<<<
     *                 min1 = cpos1_inf[idx]
     *                 max1 = cpos1_sup[idx]
     */
              __pyx_t_40 = __pyx_v_idx;
              __pyx_v_max0 = (*((float *) ( /* dim=0 */ (__pyx_v_cpos0_sup.data + __pyx_t_40 * __pyx_v_cpos0_sup.strides[0]) )));

     544:                 min1 = cpos1_inf[idx]

              /* "splitBBoxLUT.pyx":544
     *                 min0 = cpos0_inf[idx]
     *                 max0 = cpos0_sup[idx]
     *                 min1 = cpos1_inf[idx]             # <<<<<<<<<<<<<<
     *                 max1 = cpos1_sup[idx]
     *
     */
              __pyx_t_41 = __pyx_v_idx;
              __pyx_v_min1 = (*((float *) ( /* dim=0 */ (__pyx_v_cpos1_inf.data + __pyx_t_41 * __pyx_v_cpos1_inf.strides[0]) )));

     545:                 max1 = cpos1_sup[idx]

              /* "splitBBoxLUT.pyx":545
     *                 max0 = cpos0_sup[idx]
     *                 min1 = cpos1_inf[idx]
     *                 max1 = cpos1_sup[idx]             # <<<<<<<<<<<<<<
     *
     *                 fbin0_min = getBinNr(min0, pos0_min, delta0)
     */
              __pyx_t_42 = __pyx_v_idx;
              __pyx_v_max1 = (*((float *) ( /* dim=0 */ (__pyx_v_cpos1_sup.data + __pyx_t_42 * __pyx_v_cpos1_sup.strides[0]) )));

     546:

     547:                 fbin0_min = getBinNr(min0, pos0_min, delta0)

              /* "splitBBoxLUT.pyx":547
     *                 max1 = cpos1_sup[idx]
     *
     *                 fbin0_min = getBinNr(min0, pos0_min, delta0)             # <<<<<<<<<<<<<<
     *                 fbin0_max = getBinNr(max0, pos0_min, delta0)
     *                 fbin1_min = getBinNr(min1, pos1_min, delta1)
     */
              __pyx_v_fbin0_min = __pyx_f_12splitBBoxLUT_getBinNr(__pyx_v_min0, __pyx_v_pos0_min, __pyx_v_delta0);

     548:                 fbin0_max = getBinNr(max0, pos0_min, delta0)

              /* "splitBBoxLUT.pyx":548
     *
     *                 fbin0_min = getBinNr(min0, pos0_min, delta0)
     *                 fbin0_max = getBinNr(max0, pos0_min, delta0)             # <<<<<<<<<<<<<<
     *                 fbin1_min = getBinNr(min1, pos1_min, delta1)
     *                 fbin1_max = getBinNr(max1, pos1_min, delta1)
     */
              __pyx_v_fbin0_max = __pyx_f_12splitBBoxLUT_getBinNr(__pyx_v_max0, __pyx_v_pos0_min, __pyx_v_delta0);

     549:                 fbin1_min = getBinNr(min1, pos1_min, delta1)

              /* "splitBBoxLUT.pyx":549
     *                 fbin0_min = getBinNr(min0, pos0_min, delta0)
     *                 fbin0_max = getBinNr(max0, pos0_min, delta0)
     *                 fbin1_min = getBinNr(min1, pos1_min, delta1)             # <<<<<<<<<<<<<<
     *                 fbin1_max = getBinNr(max1, pos1_min, delta1)
     *
     */
              __pyx_v_fbin1_min = __pyx_f_12splitBBoxLUT_getBinNr(__pyx_v_min1, __pyx_v_pos1_min, __pyx_v_delta1);

     550:                 fbin1_max = getBinNr(max1, pos1_min, delta1)

              /* "splitBBoxLUT.pyx":550
     *                 fbin0_max = getBinNr(max0, pos0_min, delta0)
     *                 fbin1_min = getBinNr(min1, pos1_min, delta1)
     *                 fbin1_max = getBinNr(max1, pos1_min, delta1)             # <<<<<<<<<<<<<<
     *
     *                 bin0_min = <int> fbin0_min
     */
              __pyx_v_fbin1_max = __pyx_f_12splitBBoxLUT_getBinNr(__pyx_v_max1, __pyx_v_pos1_min, __pyx_v_delta1);

     551:

     552:                 bin0_min = <int> fbin0_min

              /* "splitBBoxLUT.pyx":552
     *                 fbin1_max = getBinNr(max1, pos1_min, delta1)
     *
     *                 bin0_min = <int> fbin0_min             # <<<<<<<<<<<<<<
     *                 bin0_max = <int> fbin0_max
     *                 bin1_min = <int> fbin1_min
     */
              __pyx_v_bin0_min = ((int)__pyx_v_fbin0_min);

     553:                 bin0_max = <int> fbin0_max

              /* "splitBBoxLUT.pyx":553
     *
     *                 bin0_min = <int> fbin0_min
     *                 bin0_max = <int> fbin0_max             # <<<<<<<<<<<<<<
     *                 bin1_min = <int> fbin1_min
     *                 bin1_max = <int> fbin1_max
     */
              __pyx_v_bin0_max = ((int)__pyx_v_fbin0_max);

     554:                 bin1_min = <int> fbin1_min

              /* "splitBBoxLUT.pyx":554
     *                 bin0_min = <int> fbin0_min
     *                 bin0_max = <int> fbin0_max
     *                 bin1_min = <int> fbin1_min             # <<<<<<<<<<<<<<
     *                 bin1_max = <int> fbin1_max
     *
     */
              __pyx_v_bin1_min = ((int)__pyx_v_fbin1_min);

     555:                 bin1_max = <int> fbin1_max

              /* "splitBBoxLUT.pyx":555
     *                 bin0_max = <int> fbin0_max
     *                 bin1_min = <int> fbin1_min
     *                 bin1_max = <int> fbin1_max             # <<<<<<<<<<<<<<
     *
     *                 if (bin0_max < 0) or (bin0_min >= bins0) or (bin1_max < 0) or (bin1_min >= bins1):
     */
              __pyx_v_bin1_max = ((int)__pyx_v_fbin1_max);

     556:

     557:                 if (bin0_max < 0) or (bin0_min >= bins0) or (bin1_max < 0) or (bin1_min >= bins1):

              /* "splitBBoxLUT.pyx":557
     *                 bin1_max = <int> fbin1_max
     *
     *                 if (bin0_max < 0) or (bin0_min >= bins0) or (bin1_max < 0) or (bin1_min >= bins1):             # <<<<<<<<<<<<<<
     *                     continue
     *
     */
              __pyx_t_14 = (__pyx_v_bin0_max < 0);
              if (!__pyx_t_14) {
                __pyx_t_18 = (__pyx_v_bin0_min >= __pyx_v_bins0);
                if (!__pyx_t_18) {
                  __pyx_t_25 = (__pyx_v_bin1_max < 0);
                  if (!__pyx_t_25) {
                    __pyx_t_23 = (__pyx_v_bin1_min >= __pyx_v_bins1);
                    __pyx_t_24 = __pyx_t_23;
                  } else {
                    __pyx_t_24 = __pyx_t_25;
                  }
                  __pyx_t_25 = __pyx_t_24;
                } else {
                  __pyx_t_25 = __pyx_t_18;
                }
                __pyx_t_18 = __pyx_t_25;
              } else {
                __pyx_t_18 = __pyx_t_14;
              }
              if (__pyx_t_18) {

     558:                     continue

                /* "splitBBoxLUT.pyx":558
     *
     *                 if (bin0_max < 0) or (bin0_min >= bins0) or (bin1_max < 0) or (bin1_min >= bins1):
     *                     continue             # <<<<<<<<<<<<<<
     *
     *                 if bin0_max >= bins0 :
     */
                goto __pyx_L25_continue;
                goto __pyx_L28;
              }
              __pyx_L28:;

     559:

     560:                 if bin0_max >= bins0 :

              /* "splitBBoxLUT.pyx":560
     *                     continue
     *
     *                 if bin0_max >= bins0 :             # <<<<<<<<<<<<<<
     *                     bin0_max = bins0 - 1
     *                 if  bin0_min < 0:
     */
              __pyx_t_18 = (__pyx_v_bin0_max >= __pyx_v_bins0);
              if (__pyx_t_18) {

     561:                     bin0_max = bins0 - 1

                /* "splitBBoxLUT.pyx":561
     *
     *                 if bin0_max >= bins0 :
     *                     bin0_max = bins0 - 1             # <<<<<<<<<<<<<<
     *                 if  bin0_min < 0:
     *                     bin0_min = 0
     */
                __pyx_v_bin0_max = (__pyx_v_bins0 - 1);
                goto __pyx_L29;
              }
              __pyx_L29:;

     562:                 if  bin0_min < 0:

              /* "splitBBoxLUT.pyx":562
     *                 if bin0_max >= bins0 :
     *                     bin0_max = bins0 - 1
     *                 if  bin0_min < 0:             # <<<<<<<<<<<<<<
     *                     bin0_min = 0
     *                 if bin1_max >= bins1 :
     */
              __pyx_t_18 = (__pyx_v_bin0_min < 0);
              if (__pyx_t_18) {

     563:                     bin0_min = 0

                /* "splitBBoxLUT.pyx":563
     *                     bin0_max = bins0 - 1
     *                 if  bin0_min < 0:
     *                     bin0_min = 0             # <<<<<<<<<<<<<<
     *                 if bin1_max >= bins1 :
     *                     bin1_max = bins1 - 1
     */
                __pyx_v_bin0_min = 0;
                goto __pyx_L30;
              }
              __pyx_L30:;

     564:                 if bin1_max >= bins1 :

              /* "splitBBoxLUT.pyx":564
     *                 if  bin0_min < 0:
     *                     bin0_min = 0
     *                 if bin1_max >= bins1 :             # <<<<<<<<<<<<<<
     *                     bin1_max = bins1 - 1
     *                 if  bin1_min < 0:
     */
              __pyx_t_18 = (__pyx_v_bin1_max >= __pyx_v_bins1);
              if (__pyx_t_18) {

     565:                     bin1_max = bins1 - 1

                /* "splitBBoxLUT.pyx":565
     *                     bin0_min = 0
     *                 if bin1_max >= bins1 :
     *                     bin1_max = bins1 - 1             # <<<<<<<<<<<<<<
     *                 if  bin1_min < 0:
     *                     bin1_min = 0
     */
                __pyx_v_bin1_max = (__pyx_v_bins1 - 1);
                goto __pyx_L31;
              }
              __pyx_L31:;

     566:                 if  bin1_min < 0:

              /* "splitBBoxLUT.pyx":566
     *                 if bin1_max >= bins1 :
     *                     bin1_max = bins1 - 1
     *                 if  bin1_min < 0:             # <<<<<<<<<<<<<<
     *                     bin1_min = 0
     *
     */
              __pyx_t_18 = (__pyx_v_bin1_min < 0);
              if (__pyx_t_18) {

     567:                     bin1_min = 0

                /* "splitBBoxLUT.pyx":567
     *                     bin1_max = bins1 - 1
     *                 if  bin1_min < 0:
     *                     bin1_min = 0             # <<<<<<<<<<<<<<
     *
     *                 if bin0_min == bin0_max:
     */
                __pyx_v_bin1_min = 0;
                goto __pyx_L32;
              }
              __pyx_L32:;

     568:

     569:                 if bin0_min == bin0_max:

              /* "splitBBoxLUT.pyx":569
     *                     bin1_min = 0
     *
     *                 if bin0_min == bin0_max:             # <<<<<<<<<<<<<<
     *                     if bin1_min == bin1_max:
     *                         #All pixel is within a single bin
     */
              __pyx_t_18 = (__pyx_v_bin0_min == __pyx_v_bin0_max);
              if (__pyx_t_18) {

     570:                     if bin1_min == bin1_max:

                /* "splitBBoxLUT.pyx":570
     *
     *                 if bin0_min == bin0_max:
     *                     if bin1_min == bin1_max:             # <<<<<<<<<<<<<<
     *                         #All pixel is within a single bin
     *                         k = outMax[bin0_min, bin1_min]
     */
                __pyx_t_18 = (__pyx_v_bin1_min == __pyx_v_bin1_max);
                if (__pyx_t_18) {

     571:                         #All pixel is within a single bin

     572:                         k = outMax[bin0_min, bin1_min]

                  /* "splitBBoxLUT.pyx":572
     *                     if bin1_min == bin1_max:
     *                         #All pixel is within a single bin
     *                         k = outMax[bin0_min, bin1_min]             # <<<<<<<<<<<<<<
     *                         lut[bin0_min, bin1_min, k].idx = idx
     *                         lut[bin0_min, bin1_min, k].coef = 1.0
     */
                  __pyx_t_4 = __pyx_v_bin0_min;
                  __pyx_t_43 = __pyx_v_bin1_min;
                  __pyx_v_k = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_outMax.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_outMax.diminfo[0].strides, __pyx_t_43, __pyx_pybuffernd_outMax.diminfo[1].strides));

     573:                         lut[bin0_min, bin1_min, k].idx = idx

                  /* "splitBBoxLUT.pyx":573
     *                         #All pixel is within a single bin
     *                         k = outMax[bin0_min, bin1_min]
     *                         lut[bin0_min, bin1_min, k].idx = idx             # <<<<<<<<<<<<<<
     *                         lut[bin0_min, bin1_min, k].coef = 1.0
     *                         outMax[bin0_min, bin1_min]= k+1
     */
                  __pyx_t_44 = __pyx_v_bin0_min;
                  __pyx_t_45 = __pyx_v_bin1_min;
                  __pyx_t_46 = __pyx_v_k;
                  (*__Pyx_BufPtrStrided3d(struct __pyx_t_12splitBBoxLUT_lut_point *, __pyx_pybuffernd_lut.rcbuffer->pybuffer.buf, __pyx_t_44, __pyx_pybuffernd_lut.diminfo[0].strides, __pyx_t_45, __pyx_pybuffernd_lut.diminfo[1].strides, __pyx_t_46, __pyx_pybuffernd_lut.diminfo[2].strides)).idx = __pyx_v_idx;

     574:                         lut[bin0_min, bin1_min, k].coef = 1.0

                  /* "splitBBoxLUT.pyx":574
     *                         k = outMax[bin0_min, bin1_min]
     *                         lut[bin0_min, bin1_min, k].idx = idx
     *                         lut[bin0_min, bin1_min, k].coef = 1.0             # <<<<<<<<<<<<<<
     *                         outMax[bin0_min, bin1_min]= k+1
     *
     */
                  __pyx_t_47 = __pyx_v_bin0_min;
                  __pyx_t_48 = __pyx_v_bin1_min;
                  __pyx_t_49 = __pyx_v_k;
                  (*__Pyx_BufPtrStrided3d(struct __pyx_t_12splitBBoxLUT_lut_point *, __pyx_pybuffernd_lut.rcbuffer->pybuffer.buf, __pyx_t_47, __pyx_pybuffernd_lut.diminfo[0].strides, __pyx_t_48, __pyx_pybuffernd_lut.diminfo[1].strides, __pyx_t_49, __pyx_pybuffernd_lut.diminfo[2].strides)).coef = 1.0;

     575:                         outMax[bin0_min, bin1_min]= k+1

                  /* "splitBBoxLUT.pyx":575
     *                         lut[bin0_min, bin1_min, k].idx = idx
     *                         lut[bin0_min, bin1_min, k].coef = 1.0
     *                         outMax[bin0_min, bin1_min]= k+1             # <<<<<<<<<<<<<<
     *
     *                     else:
     */
                  __pyx_t_50 = __pyx_v_bin0_min;
                  __pyx_t_51 = __pyx_v_bin1_min;
                  *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_outMax.rcbuffer->pybuffer.buf, __pyx_t_50, __pyx_pybuffernd_outMax.diminfo[0].strides, __pyx_t_51, __pyx_pybuffernd_outMax.diminfo[1].strides) = (__pyx_v_k + 1);
                  goto __pyx_L34;
                }
                /*else*/ {

     576:

     577:                     else:

     578:                         #spread on more than 2 bins

     579:                         deltaD = (< float > (bin1_min + 1)) - fbin1_min

                  /* "splitBBoxLUT.pyx":579
     *                     else:
     *                         #spread on more than 2 bins
     *                         deltaD = (< float > (bin1_min + 1)) - fbin1_min             # <<<<<<<<<<<<<<
     *                         deltaU = fbin1_max - ( bin1_max)
     *                         deltaA = 1.0 / (fbin1_max - fbin1_min)
     */
                  __pyx_v_deltaD = (((float)(__pyx_v_bin1_min + 1)) - __pyx_v_fbin1_min);

     580:                         deltaU = fbin1_max - ( bin1_max)

                  /* "splitBBoxLUT.pyx":580
     *                         #spread on more than 2 bins
     *                         deltaD = (< float > (bin1_min + 1)) - fbin1_min
     *                         deltaU = fbin1_max - ( bin1_max)             # <<<<<<<<<<<<<<
     *                         deltaA = 1.0 / (fbin1_max - fbin1_min)
     *
     */
                  __pyx_v_deltaU = (__pyx_v_fbin1_max - __pyx_v_bin1_max);

     581:                         deltaA = 1.0 / (fbin1_max - fbin1_min)

                  /* "splitBBoxLUT.pyx":581
     *                         deltaD = (< float > (bin1_min + 1)) - fbin1_min
     *                         deltaU = fbin1_max - ( bin1_max)
     *                         deltaA = 1.0 / (fbin1_max - fbin1_min)             # <<<<<<<<<<<<<<
     *
     *                         k = outMax[bin0_min, bin1_min]
     */
                  __pyx_v_deltaA = (1.0 / (__pyx_v_fbin1_max - __pyx_v_fbin1_min));

     582:

     583:                         k = outMax[bin0_min, bin1_min]

                  /* "splitBBoxLUT.pyx":583
     *                         deltaA = 1.0 / (fbin1_max - fbin1_min)
     *
     *                         k = outMax[bin0_min, bin1_min]             # <<<<<<<<<<<<<<
     *                         lut[bin0_min, bin1_min, k].idx = idx
     *                         lut[bin0_min, bin1_min, k].coef =  deltaA * deltaD
     */
                  __pyx_t_52 = __pyx_v_bin0_min;
                  __pyx_t_53 = __pyx_v_bin1_min;
                  __pyx_v_k = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_outMax.rcbuffer->pybuffer.buf, __pyx_t_52, __pyx_pybuffernd_outMax.diminfo[0].strides, __pyx_t_53, __pyx_pybuffernd_outMax.diminfo[1].strides));

     584:                         lut[bin0_min, bin1_min, k].idx = idx

                  /* "splitBBoxLUT.pyx":584
     *
     *                         k = outMax[bin0_min, bin1_min]
     *                         lut[bin0_min, bin1_min, k].idx = idx             # <<<<<<<<<<<<<<
     *                         lut[bin0_min, bin1_min, k].coef =  deltaA * deltaD
     *                         outMax[bin0_min, bin1_min] = k + 1
     */
                  __pyx_t_54 = __pyx_v_bin0_min;
                  __pyx_t_55 = __pyx_v_bin1_min;
                  __pyx_t_56 = __pyx_v_k;
                  (*__Pyx_BufPtrStrided3d(struct __pyx_t_12splitBBoxLUT_lut_point *, __pyx_pybuffernd_lut.rcbuffer->pybuffer.buf, __pyx_t_54, __pyx_pybuffernd_lut.diminfo[0].strides, __pyx_t_55, __pyx_pybuffernd_lut.diminfo[1].strides, __pyx_t_56, __pyx_pybuffernd_lut.diminfo[2].strides)).idx = __pyx_v_idx;

     585:                         lut[bin0_min, bin1_min, k].coef =  deltaA * deltaD

                  /* "splitBBoxLUT.pyx":585
     *                         k = outMax[bin0_min, bin1_min]
     *                         lut[bin0_min, bin1_min, k].idx = idx
     *                         lut[bin0_min, bin1_min, k].coef =  deltaA * deltaD             # <<<<<<<<<<<<<<
     *                         outMax[bin0_min, bin1_min] = k + 1
     *
     */
                  __pyx_t_57 = __pyx_v_bin0_min;
                  __pyx_t_58 = __pyx_v_bin1_min;
                  __pyx_t_59 = __pyx_v_k;
                  (*__Pyx_BufPtrStrided3d(struct __pyx_t_12splitBBoxLUT_lut_point *, __pyx_pybuffernd_lut.rcbuffer->pybuffer.buf, __pyx_t_57, __pyx_pybuffernd_lut.diminfo[0].strides, __pyx_t_58, __pyx_pybuffernd_lut.diminfo[1].strides, __pyx_t_59, __pyx_pybuffernd_lut.diminfo[2].strides)).coef = (__pyx_v_deltaA * __pyx_v_deltaD);

     586:                         outMax[bin0_min, bin1_min] = k + 1

                  /* "splitBBoxLUT.pyx":586
     *                         lut[bin0_min, bin1_min, k].idx = idx
     *                         lut[bin0_min, bin1_min, k].coef =  deltaA * deltaD
     *                         outMax[bin0_min, bin1_min] = k + 1             # <<<<<<<<<<<<<<
     *
     *                         k = outMax[bin0_min, bin1_max]
     */
                  __pyx_t_60 = __pyx_v_bin0_min;
                  __pyx_t_61 = __pyx_v_bin1_min;
                  *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_outMax.rcbuffer->pybuffer.buf, __pyx_t_60, __pyx_pybuffernd_outMax.diminfo[0].strides, __pyx_t_61, __pyx_pybuffernd_outMax.diminfo[1].strides) = (__pyx_v_k + 1);

     587:

     588:                         k = outMax[bin0_min, bin1_max]

                  /* "splitBBoxLUT.pyx":588
     *                         outMax[bin0_min, bin1_min] = k + 1
     *
     *                         k = outMax[bin0_min, bin1_max]             # <<<<<<<<<<<<<<
     *                         lut[bin0_min, bin1_max, k].idx = idx
     *                         lut[bin0_min, bin1_max, k].coef =  deltaA * deltaU
     */
                  __pyx_t_62 = __pyx_v_bin0_min;
                  __pyx_t_63 = __pyx_v_bin1_max;
                  __pyx_v_k = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_outMax.rcbuffer->pybuffer.buf, __pyx_t_62, __pyx_pybuffernd_outMax.diminfo[0].strides, __pyx_t_63, __pyx_pybuffernd_outMax.diminfo[1].strides));

     589:                         lut[bin0_min, bin1_max, k].idx = idx

                  /* "splitBBoxLUT.pyx":589
     *
     *                         k = outMax[bin0_min, bin1_max]
     *                         lut[bin0_min, bin1_max, k].idx = idx             # <<<<<<<<<<<<<<
     *                         lut[bin0_min, bin1_max, k].coef =  deltaA * deltaU
     *                         outMax[bin0_min, bin1_max] = k + 1
     */
                  __pyx_t_64 = __pyx_v_bin0_min;
                  __pyx_t_65 = __pyx_v_bin1_max;
                  __pyx_t_66 = __pyx_v_k;
                  (*__Pyx_BufPtrStrided3d(struct __pyx_t_12splitBBoxLUT_lut_point *, __pyx_pybuffernd_lut.rcbuffer->pybuffer.buf, __pyx_t_64, __pyx_pybuffernd_lut.diminfo[0].strides, __pyx_t_65, __pyx_pybuffernd_lut.diminfo[1].strides, __pyx_t_66, __pyx_pybuffernd_lut.diminfo[2].strides)).idx = __pyx_v_idx;

     590:                         lut[bin0_min, bin1_max, k].coef =  deltaA * deltaU

                  /* "splitBBoxLUT.pyx":590
     *                         k = outMax[bin0_min, bin1_max]
     *                         lut[bin0_min, bin1_max, k].idx = idx
     *                         lut[bin0_min, bin1_max, k].coef =  deltaA * deltaU             # <<<<<<<<<<<<<<
     *                         outMax[bin0_min, bin1_max] = k + 1
     *
     */
                  __pyx_t_67 = __pyx_v_bin0_min;
                  __pyx_t_68 = __pyx_v_bin1_max;
                  __pyx_t_69 = __pyx_v_k;
                  (*__Pyx_BufPtrStrided3d(struct __pyx_t_12splitBBoxLUT_lut_point *, __pyx_pybuffernd_lut.rcbuffer->pybuffer.buf, __pyx_t_67, __pyx_pybuffernd_lut.diminfo[0].strides, __pyx_t_68, __pyx_pybuffernd_lut.diminfo[1].strides, __pyx_t_69, __pyx_pybuffernd_lut.diminfo[2].strides)).coef = (__pyx_v_deltaA * __pyx_v_deltaU);

     591:                         outMax[bin0_min, bin1_max] = k + 1

                  /* "splitBBoxLUT.pyx":591
     *                         lut[bin0_min, bin1_max, k].idx = idx
     *                         lut[bin0_min, bin1_max, k].coef =  deltaA * deltaU
     *                         outMax[bin0_min, bin1_max] = k + 1             # <<<<<<<<<<<<<<
     *
     *                         for j in range(bin1_min + 1, bin1_max):
     */
                  __pyx_t_70 = __pyx_v_bin0_min;
                  __pyx_t_71 = __pyx_v_bin1_max;
                  *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_outMax.rcbuffer->pybuffer.buf, __pyx_t_70, __pyx_pybuffernd_outMax.diminfo[0].strides, __pyx_t_71, __pyx_pybuffernd_outMax.diminfo[1].strides) = (__pyx_v_k + 1);

     592:

     593:                         for j in range(bin1_min + 1, bin1_max):

                  /* "splitBBoxLUT.pyx":593
     *                         outMax[bin0_min, bin1_max] = k + 1
     *
     *                         for j in range(bin1_min + 1, bin1_max):             # <<<<<<<<<<<<<<
     *                             k = outMax[bin0_min, j]
     *                             lut[bin0_min, j, k].idx = idx
     */
                  __pyx_t_72 = __pyx_v_bin1_max;
                  for (__pyx_t_73 = (__pyx_v_bin1_min + 1); __pyx_t_73 < __pyx_t_72; __pyx_t_73+=1) {
                    __pyx_v_j = __pyx_t_73;

     594:                             k = outMax[bin0_min, j]

                    /* "splitBBoxLUT.pyx":594
     *
     *                         for j in range(bin1_min + 1, bin1_max):
     *                             k = outMax[bin0_min, j]             # <<<<<<<<<<<<<<
     *                             lut[bin0_min, j, k].idx = idx
     *                             lut[bin0_min, j, k].coef =  deltaA
     */
                    __pyx_t_74 = __pyx_v_bin0_min;
                    __pyx_t_75 = __pyx_v_j;
                    __pyx_v_k = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_outMax.rcbuffer->pybuffer.buf, __pyx_t_74, __pyx_pybuffernd_outMax.diminfo[0].strides, __pyx_t_75, __pyx_pybuffernd_outMax.diminfo[1].strides));

     595:                             lut[bin0_min, j, k].idx = idx

                    /* "splitBBoxLUT.pyx":595
     *                         for j in range(bin1_min + 1, bin1_max):
     *                             k = outMax[bin0_min, j]
     *                             lut[bin0_min, j, k].idx = idx             # <<<<<<<<<<<<<<
     *                             lut[bin0_min, j, k].coef =  deltaA
     *                             outMax[bin0_min, j] = k + 1
     */
                    __pyx_t_76 = __pyx_v_bin0_min;
                    __pyx_t_77 = __pyx_v_j;
                    __pyx_t_78 = __pyx_v_k;
                    (*__Pyx_BufPtrStrided3d(struct __pyx_t_12splitBBoxLUT_lut_point *, __pyx_pybuffernd_lut.rcbuffer->pybuffer.buf, __pyx_t_76, __pyx_pybuffernd_lut.diminfo[0].strides, __pyx_t_77, __pyx_pybuffernd_lut.diminfo[1].strides, __pyx_t_78, __pyx_pybuffernd_lut.diminfo[2].strides)).idx = __pyx_v_idx;

     596:                             lut[bin0_min, j, k].coef =  deltaA

                    /* "splitBBoxLUT.pyx":596
     *                             k = outMax[bin0_min, j]
     *                             lut[bin0_min, j, k].idx = idx
     *                             lut[bin0_min, j, k].coef =  deltaA             # <<<<<<<<<<<<<<
     *                             outMax[bin0_min, j] = k + 1
     *
     */
                    __pyx_t_79 = __pyx_v_bin0_min;
                    __pyx_t_80 = __pyx_v_j;
                    __pyx_t_81 = __pyx_v_k;
                    (*__Pyx_BufPtrStrided3d(struct __pyx_t_12splitBBoxLUT_lut_point *, __pyx_pybuffernd_lut.rcbuffer->pybuffer.buf, __pyx_t_79, __pyx_pybuffernd_lut.diminfo[0].strides, __pyx_t_80, __pyx_pybuffernd_lut.diminfo[1].strides, __pyx_t_81, __pyx_pybuffernd_lut.diminfo[2].strides)).coef = __pyx_v_deltaA;

     597:                             outMax[bin0_min, j] = k + 1

                    /* "splitBBoxLUT.pyx":597
     *                             lut[bin0_min, j, k].idx = idx
     *                             lut[bin0_min, j, k].coef =  deltaA
     *                             outMax[bin0_min, j] = k + 1             # <<<<<<<<<<<<<<
     *
     *                 else: #spread on more than 2 bins in dim 0
     */
                    __pyx_t_82 = __pyx_v_bin0_min;
                    __pyx_t_83 = __pyx_v_j;
                    *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_outMax.rcbuffer->pybuffer.buf, __pyx_t_82, __pyx_pybuffernd_outMax.diminfo[0].strides, __pyx_t_83, __pyx_pybuffernd_outMax.diminfo[1].strides) = (__pyx_v_k + 1);
                  }
                }
                __pyx_L34:;
                goto __pyx_L33;
              }
              /*else*/ {

     598:

     599:                 else: #spread on more than 2 bins in dim 0

     600:                     if bin1_min == bin1_max:

                /* "splitBBoxLUT.pyx":600
     *
     *                 else: #spread on more than 2 bins in dim 0
     *                     if bin1_min == bin1_max:             # <<<<<<<<<<<<<<
     *                         #All pixel fall on 1 bins in dim 1
     *                         deltaA = 1.0 / (fbin0_max - fbin0_min)
     */
                __pyx_t_18 = (__pyx_v_bin1_min == __pyx_v_bin1_max);
                if (__pyx_t_18) {

     601:                         #All pixel fall on 1 bins in dim 1

     602:                         deltaA = 1.0 / (fbin0_max - fbin0_min)

                  /* "splitBBoxLUT.pyx":602
     *                     if bin1_min == bin1_max:
     *                         #All pixel fall on 1 bins in dim 1
     *                         deltaA = 1.0 / (fbin0_max - fbin0_min)             # <<<<<<<<<<<<<<
     *                         deltaL = (< float > (bin0_min + 1)) - fbin0_min
     *
     */
                  __pyx_v_deltaA = (1.0 / (__pyx_v_fbin0_max - __pyx_v_fbin0_min));

     603:                         deltaL = (< float > (bin0_min + 1)) - fbin0_min

                  /* "splitBBoxLUT.pyx":603
     *                         #All pixel fall on 1 bins in dim 1
     *                         deltaA = 1.0 / (fbin0_max - fbin0_min)
     *                         deltaL = (< float > (bin0_min + 1)) - fbin0_min             # <<<<<<<<<<<<<<
     *
     *                         k = outMax[bin0_min, bin1_min]
     */
                  __pyx_v_deltaL = (((float)(__pyx_v_bin0_min + 1)) - __pyx_v_fbin0_min);

     604:

     605:                         k = outMax[bin0_min, bin1_min]

                  /* "splitBBoxLUT.pyx":605
     *                         deltaL = (< float > (bin0_min + 1)) - fbin0_min
     *
     *                         k = outMax[bin0_min, bin1_min]             # <<<<<<<<<<<<<<
     *                         lut[bin0_min, bin1_min, k].idx = idx
     *                         lut[bin0_min, bin1_min, k].coef =  deltaA * deltaL
     */
                  __pyx_t_72 = __pyx_v_bin0_min;
                  __pyx_t_84 = __pyx_v_bin1_min;
                  __pyx_v_k = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_outMax.rcbuffer->pybuffer.buf, __pyx_t_72, __pyx_pybuffernd_outMax.diminfo[0].strides, __pyx_t_84, __pyx_pybuffernd_outMax.diminfo[1].strides));

     606:                         lut[bin0_min, bin1_min, k].idx = idx

                  /* "splitBBoxLUT.pyx":606
     *
     *                         k = outMax[bin0_min, bin1_min]
     *                         lut[bin0_min, bin1_min, k].idx = idx             # <<<<<<<<<<<<<<
     *                         lut[bin0_min, bin1_min, k].coef =  deltaA * deltaL
     *                         outMax[bin0_min, bin1_min] = k+1
     */
                  __pyx_t_85 = __pyx_v_bin0_min;
                  __pyx_t_86 = __pyx_v_bin1_min;
                  __pyx_t_73 = __pyx_v_k;
                  (*__Pyx_BufPtrStrided3d(struct __pyx_t_12splitBBoxLUT_lut_point *, __pyx_pybuffernd_lut.rcbuffer->pybuffer.buf, __pyx_t_85, __pyx_pybuffernd_lut.diminfo[0].strides, __pyx_t_86, __pyx_pybuffernd_lut.diminfo[1].strides, __pyx_t_73, __pyx_pybuffernd_lut.diminfo[2].strides)).idx = __pyx_v_idx;

     607:                         lut[bin0_min, bin1_min, k].coef =  deltaA * deltaL

                  /* "splitBBoxLUT.pyx":607
     *                         k = outMax[bin0_min, bin1_min]
     *                         lut[bin0_min, bin1_min, k].idx = idx
     *                         lut[bin0_min, bin1_min, k].coef =  deltaA * deltaL             # <<<<<<<<<<<<<<
     *                         outMax[bin0_min, bin1_min] = k+1
     *
     */
                  __pyx_t_87 = __pyx_v_bin0_min;
                  __pyx_t_88 = __pyx_v_bin1_min;
                  __pyx_t_89 = __pyx_v_k;
                  (*__Pyx_BufPtrStrided3d(struct __pyx_t_12splitBBoxLUT_lut_point *, __pyx_pybuffernd_lut.rcbuffer->pybuffer.buf, __pyx_t_87, __pyx_pybuffernd_lut.diminfo[0].strides, __pyx_t_88, __pyx_pybuffernd_lut.diminfo[1].strides, __pyx_t_89, __pyx_pybuffernd_lut.diminfo[2].strides)).coef = (__pyx_v_deltaA * __pyx_v_deltaL);

     608:                         outMax[bin0_min, bin1_min] = k+1

                  /* "splitBBoxLUT.pyx":608
     *                         lut[bin0_min, bin1_min, k].idx = idx
     *                         lut[bin0_min, bin1_min, k].coef =  deltaA * deltaL
     *                         outMax[bin0_min, bin1_min] = k+1             # <<<<<<<<<<<<<<
     *
     *                         deltaR = fbin0_max - (< float > bin0_max)
     */
                  __pyx_t_90 = __pyx_v_bin0_min;
                  __pyx_t_91 = __pyx_v_bin1_min;
                  *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_outMax.rcbuffer->pybuffer.buf, __pyx_t_90, __pyx_pybuffernd_outMax.diminfo[0].strides, __pyx_t_91, __pyx_pybuffernd_outMax.diminfo[1].strides) = (__pyx_v_k + 1);

     609:

     610:                         deltaR = fbin0_max - (< float > bin0_max)

                  /* "splitBBoxLUT.pyx":610
     *                         outMax[bin0_min, bin1_min] = k+1
     *
     *                         deltaR = fbin0_max - (< float > bin0_max)             # <<<<<<<<<<<<<<
     *
     *                         k = outMax[bin0_max, bin1_min]
     */
                  __pyx_v_deltaR = (__pyx_v_fbin0_max - ((float)__pyx_v_bin0_max));

     611:

     612:                         k = outMax[bin0_max, bin1_min]

                  /* "splitBBoxLUT.pyx":612
     *                         deltaR = fbin0_max - (< float > bin0_max)
     *
     *                         k = outMax[bin0_max, bin1_min]             # <<<<<<<<<<<<<<
     *                         lut[bin0_max, bin1_min, k].idx = idx
     *                         lut[bin0_max, bin1_min, k].coef =  deltaA * deltaR
     */
                  __pyx_t_92 = __pyx_v_bin0_max;
                  __pyx_t_93 = __pyx_v_bin1_min;
                  __pyx_v_k = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_outMax.rcbuffer->pybuffer.buf, __pyx_t_92, __pyx_pybuffernd_outMax.diminfo[0].strides, __pyx_t_93, __pyx_pybuffernd_outMax.diminfo[1].strides));

     613:                         lut[bin0_max, bin1_min, k].idx = idx

                  /* "splitBBoxLUT.pyx":613
     *
     *                         k = outMax[bin0_max, bin1_min]
     *                         lut[bin0_max, bin1_min, k].idx = idx             # <<<<<<<<<<<<<<
     *                         lut[bin0_max, bin1_min, k].coef =  deltaA * deltaR
     *                         outMax[bin0_max, bin1_min] = k + 1
     */
                  __pyx_t_94 = __pyx_v_bin0_max;
                  __pyx_t_95 = __pyx_v_bin1_min;
                  __pyx_t_96 = __pyx_v_k;
                  (*__Pyx_BufPtrStrided3d(struct __pyx_t_12splitBBoxLUT_lut_point *, __pyx_pybuffernd_lut.rcbuffer->pybuffer.buf, __pyx_t_94, __pyx_pybuffernd_lut.diminfo[0].strides, __pyx_t_95, __pyx_pybuffernd_lut.diminfo[1].strides, __pyx_t_96, __pyx_pybuffernd_lut.diminfo[2].strides)).idx = __pyx_v_idx;

     614:                         lut[bin0_max, bin1_min, k].coef =  deltaA * deltaR

                  /* "splitBBoxLUT.pyx":614
     *                         k = outMax[bin0_max, bin1_min]
     *                         lut[bin0_max, bin1_min, k].idx = idx
     *                         lut[bin0_max, bin1_min, k].coef =  deltaA * deltaR             # <<<<<<<<<<<<<<
     *                         outMax[bin0_max, bin1_min] = k + 1
     *
     */
                  __pyx_t_97 = __pyx_v_bin0_max;
                  __pyx_t_98 = __pyx_v_bin1_min;
                  __pyx_t_99 = __pyx_v_k;
                  (*__Pyx_BufPtrStrided3d(struct __pyx_t_12splitBBoxLUT_lut_point *, __pyx_pybuffernd_lut.rcbuffer->pybuffer.buf, __pyx_t_97, __pyx_pybuffernd_lut.diminfo[0].strides, __pyx_t_98, __pyx_pybuffernd_lut.diminfo[1].strides, __pyx_t_99, __pyx_pybuffernd_lut.diminfo[2].strides)).coef = (__pyx_v_deltaA * __pyx_v_deltaR);

     615:                         outMax[bin0_max, bin1_min] = k + 1

                  /* "splitBBoxLUT.pyx":615
     *                         lut[bin0_max, bin1_min, k].idx = idx
     *                         lut[bin0_max, bin1_min, k].coef =  deltaA * deltaR
     *                         outMax[bin0_max, bin1_min] = k + 1             # <<<<<<<<<<<<<<
     *
     *                         for i in range(bin0_min + 1, bin0_max):
     */
                  __pyx_t_100 = __pyx_v_bin0_max;
                  __pyx_t_101 = __pyx_v_bin1_min;
                  *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_outMax.rcbuffer->pybuffer.buf, __pyx_t_100, __pyx_pybuffernd_outMax.diminfo[0].strides, __pyx_t_101, __pyx_pybuffernd_outMax.diminfo[1].strides) = (__pyx_v_k + 1);

     616:

     617:                         for i in range(bin0_min + 1, bin0_max):

                  /* "splitBBoxLUT.pyx":617
     *                         outMax[bin0_max, bin1_min] = k + 1
     *
     *                         for i in range(bin0_min + 1, bin0_max):             # <<<<<<<<<<<<<<
     *                             k = outMax[i, bin1_min]
     *                             lut[i, bin1_min ,k].idx = idx
     */
                  __pyx_t_102 = __pyx_v_bin0_max;
                  for (__pyx_t_103 = (__pyx_v_bin0_min + 1); __pyx_t_103 < __pyx_t_102; __pyx_t_103+=1) {
                    __pyx_v_i = __pyx_t_103;

     618:                             k = outMax[i, bin1_min]

                    /* "splitBBoxLUT.pyx":618
     *
     *                         for i in range(bin0_min + 1, bin0_max):
     *                             k = outMax[i, bin1_min]             # <<<<<<<<<<<<<<
     *                             lut[i, bin1_min ,k].idx = idx
     *                             lut[i, bin1_min, k].coef =  deltaA
     */
                    __pyx_t_104 = __pyx_v_i;
                    __pyx_t_105 = __pyx_v_bin1_min;
                    __pyx_v_k = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_outMax.rcbuffer->pybuffer.buf, __pyx_t_104, __pyx_pybuffernd_outMax.diminfo[0].strides, __pyx_t_105, __pyx_pybuffernd_outMax.diminfo[1].strides));

     619:                             lut[i, bin1_min ,k].idx = idx

                    /* "splitBBoxLUT.pyx":619
     *                         for i in range(bin0_min + 1, bin0_max):
     *                             k = outMax[i, bin1_min]
     *                             lut[i, bin1_min ,k].idx = idx             # <<<<<<<<<<<<<<
     *                             lut[i, bin1_min, k].coef =  deltaA
     *                             outMax[i, bin1_min] = k + 1
     */
                    __pyx_t_106 = __pyx_v_i;
                    __pyx_t_107 = __pyx_v_bin1_min;
                    __pyx_t_108 = __pyx_v_k;
                    (*__Pyx_BufPtrStrided3d(struct __pyx_t_12splitBBoxLUT_lut_point *, __pyx_pybuffernd_lut.rcbuffer->pybuffer.buf, __pyx_t_106, __pyx_pybuffernd_lut.diminfo[0].strides, __pyx_t_107, __pyx_pybuffernd_lut.diminfo[1].strides, __pyx_t_108, __pyx_pybuffernd_lut.diminfo[2].strides)).idx = __pyx_v_idx;

     620:                             lut[i, bin1_min, k].coef =  deltaA

                    /* "splitBBoxLUT.pyx":620
     *                             k = outMax[i, bin1_min]
     *                             lut[i, bin1_min ,k].idx = idx
     *                             lut[i, bin1_min, k].coef =  deltaA             # <<<<<<<<<<<<<<
     *                             outMax[i, bin1_min] = k + 1
     *
     */
                    __pyx_t_109 = __pyx_v_i;
                    __pyx_t_110 = __pyx_v_bin1_min;
                    __pyx_t_111 = __pyx_v_k;
                    (*__Pyx_BufPtrStrided3d(struct __pyx_t_12splitBBoxLUT_lut_point *, __pyx_pybuffernd_lut.rcbuffer->pybuffer.buf, __pyx_t_109, __pyx_pybuffernd_lut.diminfo[0].strides, __pyx_t_110, __pyx_pybuffernd_lut.diminfo[1].strides, __pyx_t_111, __pyx_pybuffernd_lut.diminfo[2].strides)).coef = __pyx_v_deltaA;

     621:                             outMax[i, bin1_min] = k + 1

                    /* "splitBBoxLUT.pyx":621
     *                             lut[i, bin1_min ,k].idx = idx
     *                             lut[i, bin1_min, k].coef =  deltaA
     *                             outMax[i, bin1_min] = k + 1             # <<<<<<<<<<<<<<
     *
     *                     else:
     */
                    __pyx_t_112 = __pyx_v_i;
                    __pyx_t_113 = __pyx_v_bin1_min;
                    *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_outMax.rcbuffer->pybuffer.buf, __pyx_t_112, __pyx_pybuffernd_outMax.diminfo[0].strides, __pyx_t_113, __pyx_pybuffernd_outMax.diminfo[1].strides) = (__pyx_v_k + 1);
                  }
                  goto __pyx_L37;
                }
                /*else*/ {

     622:

     623:                     else:

     624:                         #spread on n pix in dim0 and m pixel in dim1:

     625:                         deltaL = (< float > (bin0_min + 1)) - fbin0_min

                  /* "splitBBoxLUT.pyx":625
     *                     else:
     *                         #spread on n pix in dim0 and m pixel in dim1:
     *                         deltaL = (< float > (bin0_min + 1)) - fbin0_min             # <<<<<<<<<<<<<<
     *                         deltaR = fbin0_max - (< float > bin0_max)
     *                         deltaD = (< float > (bin1_min + 1)) - fbin1_min
     */
                  __pyx_v_deltaL = (((float)(__pyx_v_bin0_min + 1)) - __pyx_v_fbin0_min);

     626:                         deltaR = fbin0_max - (< float > bin0_max)

                  /* "splitBBoxLUT.pyx":626
     *                         #spread on n pix in dim0 and m pixel in dim1:
     *                         deltaL = (< float > (bin0_min + 1)) - fbin0_min
     *                         deltaR = fbin0_max - (< float > bin0_max)             # <<<<<<<<<<<<<<
     *                         deltaD = (< float > (bin1_min + 1)) - fbin1_min
     *                         deltaU = fbin1_max - (< float > bin1_max)
     */
                  __pyx_v_deltaR = (__pyx_v_fbin0_max - ((float)__pyx_v_bin0_max));

     627:                         deltaD = (< float > (bin1_min + 1)) - fbin1_min

                  /* "splitBBoxLUT.pyx":627
     *                         deltaL = (< float > (bin0_min + 1)) - fbin0_min
     *                         deltaR = fbin0_max - (< float > bin0_max)
     *                         deltaD = (< float > (bin1_min + 1)) - fbin1_min             # <<<<<<<<<<<<<<
     *                         deltaU = fbin1_max - (< float > bin1_max)
     *                         deltaA = 1.0 / ((fbin0_max - fbin0_min) * (fbin1_max - fbin1_min))
     */
                  __pyx_v_deltaD = (((float)(__pyx_v_bin1_min + 1)) - __pyx_v_fbin1_min);

     628:                         deltaU = fbin1_max - (< float > bin1_max)

                  /* "splitBBoxLUT.pyx":628
     *                         deltaR = fbin0_max - (< float > bin0_max)
     *                         deltaD = (< float > (bin1_min + 1)) - fbin1_min
     *                         deltaU = fbin1_max - (< float > bin1_max)             # <<<<<<<<<<<<<<
     *                         deltaA = 1.0 / ((fbin0_max - fbin0_min) * (fbin1_max - fbin1_min))
     *
     */
                  __pyx_v_deltaU = (__pyx_v_fbin1_max - ((float)__pyx_v_bin1_max));

     629:                         deltaA = 1.0 / ((fbin0_max - fbin0_min) * (fbin1_max - fbin1_min))

                  /* "splitBBoxLUT.pyx":629
     *                         deltaD = (< float > (bin1_min + 1)) - fbin1_min
     *                         deltaU = fbin1_max - (< float > bin1_max)
     *                         deltaA = 1.0 / ((fbin0_max - fbin0_min) * (fbin1_max - fbin1_min))             # <<<<<<<<<<<<<<
     *
     *                         k = outMax[bin0_min, bin1_min]
     */
                  __pyx_v_deltaA = (1.0 / ((__pyx_v_fbin0_max - __pyx_v_fbin0_min) * (__pyx_v_fbin1_max - __pyx_v_fbin1_min)));

     630:

     631:                         k = outMax[bin0_min, bin1_min]

                  /* "splitBBoxLUT.pyx":631
     *                         deltaA = 1.0 / ((fbin0_max - fbin0_min) * (fbin1_max - fbin1_min))
     *
     *                         k = outMax[bin0_min, bin1_min]             # <<<<<<<<<<<<<<
     *                         lut[bin0_min, bin1_min ,k].idx = idx
     *                         lut[bin0_min, bin1_min, k].coef =  deltaA * deltaL * deltaD
     */
                  __pyx_t_102 = __pyx_v_bin0_min;
                  __pyx_t_114 = __pyx_v_bin1_min;
                  __pyx_v_k = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_outMax.rcbuffer->pybuffer.buf, __pyx_t_102, __pyx_pybuffernd_outMax.diminfo[0].strides, __pyx_t_114, __pyx_pybuffernd_outMax.diminfo[1].strides));

     632:                         lut[bin0_min, bin1_min ,k].idx = idx

                  /* "splitBBoxLUT.pyx":632
     *
     *                         k = outMax[bin0_min, bin1_min]
     *                         lut[bin0_min, bin1_min ,k].idx = idx             # <<<<<<<<<<<<<<
     *                         lut[bin0_min, bin1_min, k].coef =  deltaA * deltaL * deltaD
     *                         outMax[bin0_min, bin1_min] = k + 1
     */
                  __pyx_t_115 = __pyx_v_bin0_min;
                  __pyx_t_116 = __pyx_v_bin1_min;
                  __pyx_t_103 = __pyx_v_k;
                  (*__Pyx_BufPtrStrided3d(struct __pyx_t_12splitBBoxLUT_lut_point *, __pyx_pybuffernd_lut.rcbuffer->pybuffer.buf, __pyx_t_115, __pyx_pybuffernd_lut.diminfo[0].strides, __pyx_t_116, __pyx_pybuffernd_lut.diminfo[1].strides, __pyx_t_103, __pyx_pybuffernd_lut.diminfo[2].strides)).idx = __pyx_v_idx;

     633:                         lut[bin0_min, bin1_min, k].coef =  deltaA * deltaL * deltaD

                  /* "splitBBoxLUT.pyx":633
     *                         k = outMax[bin0_min, bin1_min]
     *                         lut[bin0_min, bin1_min ,k].idx = idx
     *                         lut[bin0_min, bin1_min, k].coef =  deltaA * deltaL * deltaD             # <<<<<<<<<<<<<<
     *                         outMax[bin0_min, bin1_min] = k + 1
     *
     */
                  __pyx_t_117 = __pyx_v_bin0_min;
                  __pyx_t_118 = __pyx_v_bin1_min;
                  __pyx_t_119 = __pyx_v_k;
                  (*__Pyx_BufPtrStrided3d(struct __pyx_t_12splitBBoxLUT_lut_point *, __pyx_pybuffernd_lut.rcbuffer->pybuffer.buf, __pyx_t_117, __pyx_pybuffernd_lut.diminfo[0].strides, __pyx_t_118, __pyx_pybuffernd_lut.diminfo[1].strides, __pyx_t_119, __pyx_pybuffernd_lut.diminfo[2].strides)).coef = ((__pyx_v_deltaA * __pyx_v_deltaL) * __pyx_v_deltaD);

     634:                         outMax[bin0_min, bin1_min] = k + 1

                  /* "splitBBoxLUT.pyx":634
     *                         lut[bin0_min, bin1_min ,k].idx = idx
     *                         lut[bin0_min, bin1_min, k].coef =  deltaA * deltaL * deltaD
     *                         outMax[bin0_min, bin1_min] = k + 1             # <<<<<<<<<<<<<<
     *
     *                         k = outMax[bin0_min, bin1_max]
     */
                  __pyx_t_120 = __pyx_v_bin0_min;
                  __pyx_t_121 = __pyx_v_bin1_min;
                  *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_outMax.rcbuffer->pybuffer.buf, __pyx_t_120, __pyx_pybuffernd_outMax.diminfo[0].strides, __pyx_t_121, __pyx_pybuffernd_outMax.diminfo[1].strides) = (__pyx_v_k + 1);

     635:

     636:                         k = outMax[bin0_min, bin1_max]

                  /* "splitBBoxLUT.pyx":636
     *                         outMax[bin0_min, bin1_min] = k + 1
     *
     *                         k = outMax[bin0_min, bin1_max]             # <<<<<<<<<<<<<<
     *                         lut[bin0_min, bin1_max, k].idx = idx
     *                         lut[bin0_min, bin1_max, k].coef =  deltaA * deltaL * deltaU
     */
                  __pyx_t_122 = __pyx_v_bin0_min;
                  __pyx_t_123 = __pyx_v_bin1_max;
                  __pyx_v_k = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_outMax.rcbuffer->pybuffer.buf, __pyx_t_122, __pyx_pybuffernd_outMax.diminfo[0].strides, __pyx_t_123, __pyx_pybuffernd_outMax.diminfo[1].strides));

     637:                         lut[bin0_min, bin1_max, k].idx = idx

                  /* "splitBBoxLUT.pyx":637
     *
     *                         k = outMax[bin0_min, bin1_max]
     *                         lut[bin0_min, bin1_max, k].idx = idx             # <<<<<<<<<<<<<<
     *                         lut[bin0_min, bin1_max, k].coef =  deltaA * deltaL * deltaU
     *                         outMax[bin0_min, bin1_max] = k + 1
     */
                  __pyx_t_124 = __pyx_v_bin0_min;
                  __pyx_t_125 = __pyx_v_bin1_max;
                  __pyx_t_126 = __pyx_v_k;
                  (*__Pyx_BufPtrStrided3d(struct __pyx_t_12splitBBoxLUT_lut_point *, __pyx_pybuffernd_lut.rcbuffer->pybuffer.buf, __pyx_t_124, __pyx_pybuffernd_lut.diminfo[0].strides, __pyx_t_125, __pyx_pybuffernd_lut.diminfo[1].strides, __pyx_t_126, __pyx_pybuffernd_lut.diminfo[2].strides)).idx = __pyx_v_idx;

     638:                         lut[bin0_min, bin1_max, k].coef =  deltaA * deltaL * deltaU

                  /* "splitBBoxLUT.pyx":638
     *                         k = outMax[bin0_min, bin1_max]
     *                         lut[bin0_min, bin1_max, k].idx = idx
     *                         lut[bin0_min, bin1_max, k].coef =  deltaA * deltaL * deltaU             # <<<<<<<<<<<<<<
     *                         outMax[bin0_min, bin1_max] = k + 1
     *
     */
                  __pyx_t_127 = __pyx_v_bin0_min;
                  __pyx_t_128 = __pyx_v_bin1_max;
                  __pyx_t_129 = __pyx_v_k;
                  (*__Pyx_BufPtrStrided3d(struct __pyx_t_12splitBBoxLUT_lut_point *, __pyx_pybuffernd_lut.rcbuffer->pybuffer.buf, __pyx_t_127, __pyx_pybuffernd_lut.diminfo[0].strides, __pyx_t_128, __pyx_pybuffernd_lut.diminfo[1].strides, __pyx_t_129, __pyx_pybuffernd_lut.diminfo[2].strides)).coef = ((__pyx_v_deltaA * __pyx_v_deltaL) * __pyx_v_deltaU);

     639:                         outMax[bin0_min, bin1_max] = k + 1

                  /* "splitBBoxLUT.pyx":639
     *                         lut[bin0_min, bin1_max, k].idx = idx
     *                         lut[bin0_min, bin1_max, k].coef =  deltaA * deltaL * deltaU
     *                         outMax[bin0_min, bin1_max] = k + 1             # <<<<<<<<<<<<<<
     *
     *                         k = outMax[bin0_max, bin1_min]
     */
                  __pyx_t_130 = __pyx_v_bin0_min;
                  __pyx_t_131 = __pyx_v_bin1_max;
                  *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_outMax.rcbuffer->pybuffer.buf, __pyx_t_130, __pyx_pybuffernd_outMax.diminfo[0].strides, __pyx_t_131, __pyx_pybuffernd_outMax.diminfo[1].strides) = (__pyx_v_k + 1);

     640:

     641:                         k = outMax[bin0_max, bin1_min]

                  /* "splitBBoxLUT.pyx":641
     *                         outMax[bin0_min, bin1_max] = k + 1
     *
     *                         k = outMax[bin0_max, bin1_min]             # <<<<<<<<<<<<<<
     *                         lut[bin0_max, bin1_min, k].idx = idx
     *                         lut[bin0_max, bin1_min, k].coef =  deltaA * deltaR * deltaD
     */
                  __pyx_t_132 = __pyx_v_bin0_max;
                  __pyx_t_133 = __pyx_v_bin1_min;
                  __pyx_v_k = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_outMax.rcbuffer->pybuffer.buf, __pyx_t_132, __pyx_pybuffernd_outMax.diminfo[0].strides, __pyx_t_133, __pyx_pybuffernd_outMax.diminfo[1].strides));

     642:                         lut[bin0_max, bin1_min, k].idx = idx

                  /* "splitBBoxLUT.pyx":642
     *
     *                         k = outMax[bin0_max, bin1_min]
     *                         lut[bin0_max, bin1_min, k].idx = idx             # <<<<<<<<<<<<<<
     *                         lut[bin0_max, bin1_min, k].coef =  deltaA * deltaR * deltaD
     *                         outMax[bin0_max, bin1_min] = k + 1
     */
                  __pyx_t_134 = __pyx_v_bin0_max;
                  __pyx_t_135 = __pyx_v_bin1_min;
                  __pyx_t_136 = __pyx_v_k;
                  (*__Pyx_BufPtrStrided3d(struct __pyx_t_12splitBBoxLUT_lut_point *, __pyx_pybuffernd_lut.rcbuffer->pybuffer.buf, __pyx_t_134, __pyx_pybuffernd_lut.diminfo[0].strides, __pyx_t_135, __pyx_pybuffernd_lut.diminfo[1].strides, __pyx_t_136, __pyx_pybuffernd_lut.diminfo[2].strides)).idx = __pyx_v_idx;

     643:                         lut[bin0_max, bin1_min, k].coef =  deltaA * deltaR * deltaD

                  /* "splitBBoxLUT.pyx":643
     *                         k = outMax[bin0_max, bin1_min]
     *                         lut[bin0_max, bin1_min, k].idx = idx
     *                         lut[bin0_max, bin1_min, k].coef =  deltaA * deltaR * deltaD             # <<<<<<<<<<<<<<
     *                         outMax[bin0_max, bin1_min] = k + 1
     *
     */
                  __pyx_t_137 = __pyx_v_bin0_max;
                  __pyx_t_138 = __pyx_v_bin1_min;
                  __pyx_t_139 = __pyx_v_k;
                  (*__Pyx_BufPtrStrided3d(struct __pyx_t_12splitBBoxLUT_lut_point *, __pyx_pybuffernd_lut.rcbuffer->pybuffer.buf, __pyx_t_137, __pyx_pybuffernd_lut.diminfo[0].strides, __pyx_t_138, __pyx_pybuffernd_lut.diminfo[1].strides, __pyx_t_139, __pyx_pybuffernd_lut.diminfo[2].strides)).coef = ((__pyx_v_deltaA * __pyx_v_deltaR) * __pyx_v_deltaD);

     644:                         outMax[bin0_max, bin1_min] = k + 1

                  /* "splitBBoxLUT.pyx":644
     *                         lut[bin0_max, bin1_min, k].idx = idx
     *                         lut[bin0_max, bin1_min, k].coef =  deltaA * deltaR * deltaD
     *                         outMax[bin0_max, bin1_min] = k + 1             # <<<<<<<<<<<<<<
     *
     *                         k = outMax[bin0_max, bin1_max]
     */
                  __pyx_t_140 = __pyx_v_bin0_max;
                  __pyx_t_141 = __pyx_v_bin1_min;
                  *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_outMax.rcbuffer->pybuffer.buf, __pyx_t_140, __pyx_pybuffernd_outMax.diminfo[0].strides, __pyx_t_141, __pyx_pybuffernd_outMax.diminfo[1].strides) = (__pyx_v_k + 1);

     645:

     646:                         k = outMax[bin0_max, bin1_max]

                  /* "splitBBoxLUT.pyx":646
     *                         outMax[bin0_max, bin1_min] = k + 1
     *
     *                         k = outMax[bin0_max, bin1_max]             # <<<<<<<<<<<<<<
     *                         lut[bin0_max, bin1_max, k].idx = idx
     *                         lut[bin0_max, bin1_max, k].coef =  deltaA * deltaR * deltaU
     */
                  __pyx_t_142 = __pyx_v_bin0_max;
                  __pyx_t_143 = __pyx_v_bin1_max;
                  __pyx_v_k = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_outMax.rcbuffer->pybuffer.buf, __pyx_t_142, __pyx_pybuffernd_outMax.diminfo[0].strides, __pyx_t_143, __pyx_pybuffernd_outMax.diminfo[1].strides));

     647:                         lut[bin0_max, bin1_max, k].idx = idx

                  /* "splitBBoxLUT.pyx":647
     *
     *                         k = outMax[bin0_max, bin1_max]
     *                         lut[bin0_max, bin1_max, k].idx = idx             # <<<<<<<<<<<<<<
     *                         lut[bin0_max, bin1_max, k].coef =  deltaA * deltaR * deltaU
     *                         outMax[bin0_max, bin1_max] = k + 1
     */
                  __pyx_t_144 = __pyx_v_bin0_max;
                  __pyx_t_145 = __pyx_v_bin1_max;
                  __pyx_t_146 = __pyx_v_k;
                  (*__Pyx_BufPtrStrided3d(struct __pyx_t_12splitBBoxLUT_lut_point *, __pyx_pybuffernd_lut.rcbuffer->pybuffer.buf, __pyx_t_144, __pyx_pybuffernd_lut.diminfo[0].strides, __pyx_t_145, __pyx_pybuffernd_lut.diminfo[1].strides, __pyx_t_146, __pyx_pybuffernd_lut.diminfo[2].strides)).idx = __pyx_v_idx;

     648:                         lut[bin0_max, bin1_max, k].coef =  deltaA * deltaR * deltaU

                  /* "splitBBoxLUT.pyx":648
     *                         k = outMax[bin0_max, bin1_max]
     *                         lut[bin0_max, bin1_max, k].idx = idx
     *                         lut[bin0_max, bin1_max, k].coef =  deltaA * deltaR * deltaU             # <<<<<<<<<<<<<<
     *                         outMax[bin0_max, bin1_max] = k + 1
     *
     */
                  __pyx_t_147 = __pyx_v_bin0_max;
                  __pyx_t_148 = __pyx_v_bin1_max;
                  __pyx_t_149 = __pyx_v_k;
                  (*__Pyx_BufPtrStrided3d(struct __pyx_t_12splitBBoxLUT_lut_point *, __pyx_pybuffernd_lut.rcbuffer->pybuffer.buf, __pyx_t_147, __pyx_pybuffernd_lut.diminfo[0].strides, __pyx_t_148, __pyx_pybuffernd_lut.diminfo[1].strides, __pyx_t_149, __pyx_pybuffernd_lut.diminfo[2].strides)).coef = ((__pyx_v_deltaA * __pyx_v_deltaR) * __pyx_v_deltaU);

     649:                         outMax[bin0_max, bin1_max] = k + 1

                  /* "splitBBoxLUT.pyx":649
     *                         lut[bin0_max, bin1_max, k].idx = idx
     *                         lut[bin0_max, bin1_max, k].coef =  deltaA * deltaR * deltaU
     *                         outMax[bin0_max, bin1_max] = k + 1             # <<<<<<<<<<<<<<
     *
     *                         for i in range(bin0_min + 1, bin0_max):
     */
                  __pyx_t_150 = __pyx_v_bin0_max;
                  __pyx_t_151 = __pyx_v_bin1_max;
                  *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_outMax.rcbuffer->pybuffer.buf, __pyx_t_150, __pyx_pybuffernd_outMax.diminfo[0].strides, __pyx_t_151, __pyx_pybuffernd_outMax.diminfo[1].strides) = (__pyx_v_k + 1);

     650:

     651:                         for i in range(bin0_min + 1, bin0_max):

                  /* "splitBBoxLUT.pyx":651
     *                         outMax[bin0_max, bin1_max] = k + 1
     *
     *                         for i in range(bin0_min + 1, bin0_max):             # <<<<<<<<<<<<<<
     *                             k = outMax[i, bin1_min]
     *                             lut[i, bin1_min, k].idx = idx
     */
                  __pyx_t_152 = __pyx_v_bin0_max;
                  for (__pyx_t_153 = (__pyx_v_bin0_min + 1); __pyx_t_153 < __pyx_t_152; __pyx_t_153+=1) {
                    __pyx_v_i = __pyx_t_153;

     652:                             k = outMax[i, bin1_min]

                    /* "splitBBoxLUT.pyx":652
     *
     *                         for i in range(bin0_min + 1, bin0_max):
     *                             k = outMax[i, bin1_min]             # <<<<<<<<<<<<<<
     *                             lut[i, bin1_min, k].idx = idx
     *                             lut[i, bin1_min, k].coef =  deltaA * deltaD
     */
                    __pyx_t_154 = __pyx_v_i;
                    __pyx_t_155 = __pyx_v_bin1_min;
                    __pyx_v_k = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_outMax.rcbuffer->pybuffer.buf, __pyx_t_154, __pyx_pybuffernd_outMax.diminfo[0].strides, __pyx_t_155, __pyx_pybuffernd_outMax.diminfo[1].strides));

     653:                             lut[i, bin1_min, k].idx = idx

                    /* "splitBBoxLUT.pyx":653
     *                         for i in range(bin0_min + 1, bin0_max):
     *                             k = outMax[i, bin1_min]
     *                             lut[i, bin1_min, k].idx = idx             # <<<<<<<<<<<<<<
     *                             lut[i, bin1_min, k].coef =  deltaA * deltaD
     *                             outMax[i, bin1_min] = k + 1
     */
                    __pyx_t_156 = __pyx_v_i;
                    __pyx_t_157 = __pyx_v_bin1_min;
                    __pyx_t_158 = __pyx_v_k;
                    (*__Pyx_BufPtrStrided3d(struct __pyx_t_12splitBBoxLUT_lut_point *, __pyx_pybuffernd_lut.rcbuffer->pybuffer.buf, __pyx_t_156, __pyx_pybuffernd_lut.diminfo[0].strides, __pyx_t_157, __pyx_pybuffernd_lut.diminfo[1].strides, __pyx_t_158, __pyx_pybuffernd_lut.diminfo[2].strides)).idx = __pyx_v_idx;

     654:                             lut[i, bin1_min, k].coef =  deltaA * deltaD

                    /* "splitBBoxLUT.pyx":654
     *                             k = outMax[i, bin1_min]
     *                             lut[i, bin1_min, k].idx = idx
     *                             lut[i, bin1_min, k].coef =  deltaA * deltaD             # <<<<<<<<<<<<<<
     *                             outMax[i, bin1_min] = k + 1
     *
     */
                    __pyx_t_159 = __pyx_v_i;
                    __pyx_t_160 = __pyx_v_bin1_min;
                    __pyx_t_161 = __pyx_v_k;
                    (*__Pyx_BufPtrStrided3d(struct __pyx_t_12splitBBoxLUT_lut_point *, __pyx_pybuffernd_lut.rcbuffer->pybuffer.buf, __pyx_t_159, __pyx_pybuffernd_lut.diminfo[0].strides, __pyx_t_160, __pyx_pybuffernd_lut.diminfo[1].strides, __pyx_t_161, __pyx_pybuffernd_lut.diminfo[2].strides)).coef = (__pyx_v_deltaA * __pyx_v_deltaD);

     655:                             outMax[i, bin1_min] = k + 1

                    /* "splitBBoxLUT.pyx":655
     *                             lut[i, bin1_min, k].idx = idx
     *                             lut[i, bin1_min, k].coef =  deltaA * deltaD
     *                             outMax[i, bin1_min] = k + 1             # <<<<<<<<<<<<<<
     *
     *                             for j in range(bin1_min + 1, bin1_max):
     */
                    __pyx_t_162 = __pyx_v_i;
                    __pyx_t_163 = __pyx_v_bin1_min;
                    *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_outMax.rcbuffer->pybuffer.buf, __pyx_t_162, __pyx_pybuffernd_outMax.diminfo[0].strides, __pyx_t_163, __pyx_pybuffernd_outMax.diminfo[1].strides) = (__pyx_v_k + 1);

     656:

     657:                             for j in range(bin1_min + 1, bin1_max):

                    /* "splitBBoxLUT.pyx":657
     *                             outMax[i, bin1_min] = k + 1
     *
     *                             for j in range(bin1_min + 1, bin1_max):             # <<<<<<<<<<<<<<
     *                                 k = outMax[i, j]
     *                                 lut[i, j, k].idx = idx
     */
                    __pyx_t_164 = __pyx_v_bin1_max;
                    for (__pyx_t_165 = (__pyx_v_bin1_min + 1); __pyx_t_165 < __pyx_t_164; __pyx_t_165+=1) {
                      __pyx_v_j = __pyx_t_165;

     658:                                 k = outMax[i, j]

                      /* "splitBBoxLUT.pyx":658
     *
     *                             for j in range(bin1_min + 1, bin1_max):
     *                                 k = outMax[i, j]             # <<<<<<<<<<<<<<
     *                                 lut[i, j, k].idx = idx
     *                                 lut[i, j, k].coef =  deltaA
     */
                      __pyx_t_166 = __pyx_v_i;
                      __pyx_t_167 = __pyx_v_j;
                      __pyx_v_k = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_outMax.rcbuffer->pybuffer.buf, __pyx_t_166, __pyx_pybuffernd_outMax.diminfo[0].strides, __pyx_t_167, __pyx_pybuffernd_outMax.diminfo[1].strides));

     659:                                 lut[i, j, k].idx = idx

                      /* "splitBBoxLUT.pyx":659
     *                             for j in range(bin1_min + 1, bin1_max):
     *                                 k = outMax[i, j]
     *                                 lut[i, j, k].idx = idx             # <<<<<<<<<<<<<<
     *                                 lut[i, j, k].coef =  deltaA
     *                                 outMax[i, j] = k + 1
     */
                      __pyx_t_168 = __pyx_v_i;
                      __pyx_t_169 = __pyx_v_j;
                      __pyx_t_170 = __pyx_v_k;
                      (*__Pyx_BufPtrStrided3d(struct __pyx_t_12splitBBoxLUT_lut_point *, __pyx_pybuffernd_lut.rcbuffer->pybuffer.buf, __pyx_t_168, __pyx_pybuffernd_lut.diminfo[0].strides, __pyx_t_169, __pyx_pybuffernd_lut.diminfo[1].strides, __pyx_t_170, __pyx_pybuffernd_lut.diminfo[2].strides)).idx = __pyx_v_idx;

     660:                                 lut[i, j, k].coef =  deltaA

                      /* "splitBBoxLUT.pyx":660
     *                                 k = outMax[i, j]
     *                                 lut[i, j, k].idx = idx
     *                                 lut[i, j, k].coef =  deltaA             # <<<<<<<<<<<<<<
     *                                 outMax[i, j] = k + 1
     *
     */
                      __pyx_t_171 = __pyx_v_i;
                      __pyx_t_172 = __pyx_v_j;
                      __pyx_t_173 = __pyx_v_k;
                      (*__Pyx_BufPtrStrided3d(struct __pyx_t_12splitBBoxLUT_lut_point *, __pyx_pybuffernd_lut.rcbuffer->pybuffer.buf, __pyx_t_171, __pyx_pybuffernd_lut.diminfo[0].strides, __pyx_t_172, __pyx_pybuffernd_lut.diminfo[1].strides, __pyx_t_173, __pyx_pybuffernd_lut.diminfo[2].strides)).coef = __pyx_v_deltaA;

     661:                                 outMax[i, j] = k + 1

                      /* "splitBBoxLUT.pyx":661
     *                                 lut[i, j, k].idx = idx
     *                                 lut[i, j, k].coef =  deltaA
     *                                 outMax[i, j] = k + 1             # <<<<<<<<<<<<<<
     *
     *                             k = outMax[i, bin1_max]
     */
                      __pyx_t_174 = __pyx_v_i;
                      __pyx_t_175 = __pyx_v_j;
                      *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_outMax.rcbuffer->pybuffer.buf, __pyx_t_174, __pyx_pybuffernd_outMax.diminfo[0].strides, __pyx_t_175, __pyx_pybuffernd_outMax.diminfo[1].strides) = (__pyx_v_k + 1);
                    }

     662:

     663:                             k = outMax[i, bin1_max]

                    /* "splitBBoxLUT.pyx":663
     *                                 outMax[i, j] = k + 1
     *
     *                             k = outMax[i, bin1_max]             # <<<<<<<<<<<<<<
     *                             lut[i, bin1_max, k].idx = idx
     *                             lut[i, bin1_max, k].coef =  deltaA * deltaU
     */
                    __pyx_t_165 = __pyx_v_i;
                    __pyx_t_164 = __pyx_v_bin1_max;
                    __pyx_v_k = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_outMax.rcbuffer->pybuffer.buf, __pyx_t_165, __pyx_pybuffernd_outMax.diminfo[0].strides, __pyx_t_164, __pyx_pybuffernd_outMax.diminfo[1].strides));

     664:                             lut[i, bin1_max, k].idx = idx

                    /* "splitBBoxLUT.pyx":664
     *
     *                             k = outMax[i, bin1_max]
     *                             lut[i, bin1_max, k].idx = idx             # <<<<<<<<<<<<<<
     *                             lut[i, bin1_max, k].coef =  deltaA * deltaU
     *                             outMax[i, bin1_max] = k + 1
     */
                    __pyx_t_176 = __pyx_v_i;
                    __pyx_t_177 = __pyx_v_bin1_max;
                    __pyx_t_178 = __pyx_v_k;
                    (*__Pyx_BufPtrStrided3d(struct __pyx_t_12splitBBoxLUT_lut_point *, __pyx_pybuffernd_lut.rcbuffer->pybuffer.buf, __pyx_t_176, __pyx_pybuffernd_lut.diminfo[0].strides, __pyx_t_177, __pyx_pybuffernd_lut.diminfo[1].strides, __pyx_t_178, __pyx_pybuffernd_lut.diminfo[2].strides)).idx = __pyx_v_idx;

     665:                             lut[i, bin1_max, k].coef =  deltaA * deltaU

                    /* "splitBBoxLUT.pyx":665
     *                             k = outMax[i, bin1_max]
     *                             lut[i, bin1_max, k].idx = idx
     *                             lut[i, bin1_max, k].coef =  deltaA * deltaU             # <<<<<<<<<<<<<<
     *                             outMax[i, bin1_max] = k + 1
     *
     */
                    __pyx_t_179 = __pyx_v_i;
                    __pyx_t_180 = __pyx_v_bin1_max;
                    __pyx_t_181 = __pyx_v_k;
                    (*__Pyx_BufPtrStrided3d(struct __pyx_t_12splitBBoxLUT_lut_point *, __pyx_pybuffernd_lut.rcbuffer->pybuffer.buf, __pyx_t_179, __pyx_pybuffernd_lut.diminfo[0].strides, __pyx_t_180, __pyx_pybuffernd_lut.diminfo[1].strides, __pyx_t_181, __pyx_pybuffernd_lut.diminfo[2].strides)).coef = (__pyx_v_deltaA * __pyx_v_deltaU);

     666:                             outMax[i, bin1_max] = k + 1

                    /* "splitBBoxLUT.pyx":666
     *                             lut[i, bin1_max, k].idx = idx
     *                             lut[i, bin1_max, k].coef =  deltaA * deltaU
     *                             outMax[i, bin1_max] = k + 1             # <<<<<<<<<<<<<<
     *
     *                         for j in range(bin1_min + 1, bin1_max):
     */
                    __pyx_t_182 = __pyx_v_i;
                    __pyx_t_183 = __pyx_v_bin1_max;
                    *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_outMax.rcbuffer->pybuffer.buf, __pyx_t_182, __pyx_pybuffernd_outMax.diminfo[0].strides, __pyx_t_183, __pyx_pybuffernd_outMax.diminfo[1].strides) = (__pyx_v_k + 1);
                  }

     667:

     668:                         for j in range(bin1_min + 1, bin1_max):

                  /* "splitBBoxLUT.pyx":668
     *                             outMax[i, bin1_max] = k + 1
     *
     *                         for j in range(bin1_min + 1, bin1_max):             # <<<<<<<<<<<<<<
     *                             k = outMax[bin0_min, j]
     *                             lut[bin0_min, j, k].idx = idx
     */
                  __pyx_t_152 = __pyx_v_bin1_max;
                  for (__pyx_t_153 = (__pyx_v_bin1_min + 1); __pyx_t_153 < __pyx_t_152; __pyx_t_153+=1) {
                    __pyx_v_j = __pyx_t_153;

     669:                             k = outMax[bin0_min, j]

                    /* "splitBBoxLUT.pyx":669
     *
     *                         for j in range(bin1_min + 1, bin1_max):
     *                             k = outMax[bin0_min, j]             # <<<<<<<<<<<<<<
     *                             lut[bin0_min, j, k].idx = idx
     *                             lut[bin0_min, j, k].coef =  deltaA * deltaL
     */
                    __pyx_t_184 = __pyx_v_bin0_min;
                    __pyx_t_185 = __pyx_v_j;
                    __pyx_v_k = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_outMax.rcbuffer->pybuffer.buf, __pyx_t_184, __pyx_pybuffernd_outMax.diminfo[0].strides, __pyx_t_185, __pyx_pybuffernd_outMax.diminfo[1].strides));

     670:                             lut[bin0_min, j, k].idx = idx

                    /* "splitBBoxLUT.pyx":670
     *                         for j in range(bin1_min + 1, bin1_max):
     *                             k = outMax[bin0_min, j]
     *                             lut[bin0_min, j, k].idx = idx             # <<<<<<<<<<<<<<
     *                             lut[bin0_min, j, k].coef =  deltaA * deltaL
     *                             outMax[bin0_min, j] = k + 1
     */
                    __pyx_t_186 = __pyx_v_bin0_min;
                    __pyx_t_187 = __pyx_v_j;
                    __pyx_t_188 = __pyx_v_k;
                    (*__Pyx_BufPtrStrided3d(struct __pyx_t_12splitBBoxLUT_lut_point *, __pyx_pybuffernd_lut.rcbuffer->pybuffer.buf, __pyx_t_186, __pyx_pybuffernd_lut.diminfo[0].strides, __pyx_t_187, __pyx_pybuffernd_lut.diminfo[1].strides, __pyx_t_188, __pyx_pybuffernd_lut.diminfo[2].strides)).idx = __pyx_v_idx;

     671:                             lut[bin0_min, j, k].coef =  deltaA * deltaL

                    /* "splitBBoxLUT.pyx":671
     *                             k = outMax[bin0_min, j]
     *                             lut[bin0_min, j, k].idx = idx
     *                             lut[bin0_min, j, k].coef =  deltaA * deltaL             # <<<<<<<<<<<<<<
     *                             outMax[bin0_min, j] = k + 1
     *
     */
                    __pyx_t_189 = __pyx_v_bin0_min;
                    __pyx_t_190 = __pyx_v_j;
                    __pyx_t_191 = __pyx_v_k;
                    (*__Pyx_BufPtrStrided3d(struct __pyx_t_12splitBBoxLUT_lut_point *, __pyx_pybuffernd_lut.rcbuffer->pybuffer.buf, __pyx_t_189, __pyx_pybuffernd_lut.diminfo[0].strides, __pyx_t_190, __pyx_pybuffernd_lut.diminfo[1].strides, __pyx_t_191, __pyx_pybuffernd_lut.diminfo[2].strides)).coef = (__pyx_v_deltaA * __pyx_v_deltaL);

     672:                             outMax[bin0_min, j] = k + 1

                    /* "splitBBoxLUT.pyx":672
     *                             lut[bin0_min, j, k].idx = idx
     *                             lut[bin0_min, j, k].coef =  deltaA * deltaL
     *                             outMax[bin0_min, j] = k + 1             # <<<<<<<<<<<<<<
     *
     *                             k = outMax[bin0_max, j]
     */
                    __pyx_t_192 = __pyx_v_bin0_min;
                    __pyx_t_193 = __pyx_v_j;
                    *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_outMax.rcbuffer->pybuffer.buf, __pyx_t_192, __pyx_pybuffernd_outMax.diminfo[0].strides, __pyx_t_193, __pyx_pybuffernd_outMax.diminfo[1].strides) = (__pyx_v_k + 1);

     673:

     674:                             k = outMax[bin0_max, j]

                    /* "splitBBoxLUT.pyx":674
     *                             outMax[bin0_min, j] = k + 1
     *
     *                             k = outMax[bin0_max, j]             # <<<<<<<<<<<<<<
     *                             lut[bin0_max, j, k].idx = idx
     *                             lut[bin0_max, j, k].coef =  deltaA * deltaR
     */
                    __pyx_t_194 = __pyx_v_bin0_max;
                    __pyx_t_195 = __pyx_v_j;
                    __pyx_v_k = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_outMax.rcbuffer->pybuffer.buf, __pyx_t_194, __pyx_pybuffernd_outMax.diminfo[0].strides, __pyx_t_195, __pyx_pybuffernd_outMax.diminfo[1].strides));

     675:                             lut[bin0_max, j, k].idx = idx

                    /* "splitBBoxLUT.pyx":675
     *
     *                             k = outMax[bin0_max, j]
     *                             lut[bin0_max, j, k].idx = idx             # <<<<<<<<<<<<<<
     *                             lut[bin0_max, j, k].coef =  deltaA * deltaR
     *                             outMax[bin0_max, j] = k + 1
     */
                    __pyx_t_196 = __pyx_v_bin0_max;
                    __pyx_t_197 = __pyx_v_j;
                    __pyx_t_198 = __pyx_v_k;
                    (*__Pyx_BufPtrStrided3d(struct __pyx_t_12splitBBoxLUT_lut_point *, __pyx_pybuffernd_lut.rcbuffer->pybuffer.buf, __pyx_t_196, __pyx_pybuffernd_lut.diminfo[0].strides, __pyx_t_197, __pyx_pybuffernd_lut.diminfo[1].strides, __pyx_t_198, __pyx_pybuffernd_lut.diminfo[2].strides)).idx = __pyx_v_idx;

     676:                             lut[bin0_max, j, k].coef =  deltaA * deltaR

                    /* "splitBBoxLUT.pyx":676
     *                             k = outMax[bin0_max, j]
     *                             lut[bin0_max, j, k].idx = idx
     *                             lut[bin0_max, j, k].coef =  deltaA * deltaR             # <<<<<<<<<<<<<<
     *                             outMax[bin0_max, j] = k + 1
     *
     */
                    __pyx_t_199 = __pyx_v_bin0_max;
                    __pyx_t_200 = __pyx_v_j;
                    __pyx_t_201 = __pyx_v_k;
                    (*__Pyx_BufPtrStrided3d(struct __pyx_t_12splitBBoxLUT_lut_point *, __pyx_pybuffernd_lut.rcbuffer->pybuffer.buf, __pyx_t_199, __pyx_pybuffernd_lut.diminfo[0].strides, __pyx_t_200, __pyx_pybuffernd_lut.diminfo[1].strides, __pyx_t_201, __pyx_pybuffernd_lut.diminfo[2].strides)).coef = (__pyx_v_deltaA * __pyx_v_deltaR);

     677:                             outMax[bin0_max, j] = k + 1

                    /* "splitBBoxLUT.pyx":677
     *                             lut[bin0_max, j, k].idx = idx
     *                             lut[bin0_max, j, k].coef =  deltaA * deltaR
     *                             outMax[bin0_max, j] = k + 1             # <<<<<<<<<<<<<<
     *
     *         self.lut=lut
     */
                    __pyx_t_202 = __pyx_v_bin0_max;
                    __pyx_t_203 = __pyx_v_j;
                    *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_outMax.rcbuffer->pybuffer.buf, __pyx_t_202, __pyx_pybuffernd_outMax.diminfo[0].strides, __pyx_t_203, __pyx_pybuffernd_outMax.diminfo[1].strides) = (__pyx_v_k + 1);
                  }
                }
                __pyx_L37:;
              }
              __pyx_L33:;
              __pyx_L25_continue:;
            }
          }

     678:

     679:         self.lut=lut

      /* "splitBBoxLUT.pyx":679
     *                             outMax[bin0_max, j] = k + 1
     *
     *         self.lut=lut             # <<<<<<<<<<<<<<
     *         return outMax
     *
     */
      if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__lut, ((PyObject *)__pyx_v_lut)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 679; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

     680:         return outMax

      /* "splitBBoxLUT.pyx":680
     *
     *         self.lut=lut
     *         return outMax             # <<<<<<<<<<<<<<
     *
     *     @cython.cdivision(True)
     */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(((PyObject *)__pyx_v_outMax));
      __pyx_r = ((PyObject *)__pyx_v_outMax);
      goto __pyx_L0;

      __pyx_r = Py_None; __Pyx_INCREF(Py_None);
      goto __pyx_L0;
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_3);
      __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_7, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_9, 1);
      __Pyx_XDECREF(__pyx_t_10);
      __Pyx_XDECREF(__pyx_t_11);
      __Pyx_XDECREF(__pyx_t_12);
      __PYX_XDEC_MEMVIEW(&__pyx_t_15, 1);
      __Pyx_XDECREF(__pyx_t_32);
      { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
        __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
        __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lut.rcbuffer->pybuffer);
        __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_outMax.rcbuffer->pybuffer);
      __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
      __Pyx_AddTraceback("splitBBoxLUT.HistoBBox2d.calc_lut", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      goto __pyx_L2;
      __pyx_L0:;
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lut.rcbuffer->pybuffer);
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_outMax.rcbuffer->pybuffer);
      __pyx_L2:;
      __PYX_XDEC_MEMVIEW(&__pyx_v_cpos0_sup, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_cpos0_inf, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_cpos1_inf, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_cpos1_sup, 1);
      __Pyx_XDECREF((PyObject *)__pyx_v_outMax);
      __Pyx_XDECREF((PyObject *)__pyx_v_lut);
      __PYX_XDEC_MEMVIEW(&__pyx_v_cmask, 1);
      __Pyx_XDECREF(__pyx_v_memsize);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    /* Python wrapper */
    static PyObject *__pyx_pw_12splitBBoxLUT_11HistoBBox2d_5integrate(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
    static char __pyx_doc_12splitBBoxLUT_11HistoBBox2d_4integrate[] = "\n        Actually perform the 2D integration which in this case looks more like a matrix-vector product\n        \n        @param weights: input image \n        @type weights: ndarray\n        @param dummy: value for dead pixels (optional)\n        @type dummy: float\n        @param delta_dummy: precision for dead-pixel value in dynamic masking\n        @type delta_dummy: float\n        @param dark: array with the dark-current value to be subtracted (if any)\n        @type dark: ndarray\n        @param flat: array with the dark-current value to be divided by (if any)\n        @type flat: ndarray\n        @param solidAngle: array with the solid angle of each pixel to be divided by (if any)\n        @type solidAngle: ndarray\n        @param polarization: array with the polarization correction values to be divided by (if any)\n        @type polarization: ndarray\n        @return:  I(2d), edges0(1d), edges1(1d), weighted histogram(2d), unweighted histogram (2d)\n        @rtype: 5-tuple of ndarrays\n        \n        ";
    static PyMethodDef __pyx_mdef_12splitBBoxLUT_11HistoBBox2d_5integrate = {__Pyx_NAMESTR("integrate"), (PyCFunction)__pyx_pw_12splitBBoxLUT_11HistoBBox2d_5integrate, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_12splitBBoxLUT_11HistoBBox2d_4integrate)};
    static PyObject *__pyx_pw_12splitBBoxLUT_11HistoBBox2d_5integrate(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
      PyObject *__pyx_v_self = 0;
      PyObject *__pyx_v_weights = 0;
      PyObject *__pyx_v_dummy = 0;
      PyObject *__pyx_v_delta_dummy = 0;
      PyObject *__pyx_v_dark = 0;
      PyObject *__pyx_v_flat = 0;
      PyObject *__pyx_v_solidAngle = 0;
      PyObject *__pyx_v_polarization = 0;
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("integrate (wrapper)", 0);
      {
        static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__self,&__pyx_n_s__weights,&__pyx_n_s__dummy,&__pyx_n_s__delta_dummy,&__pyx_n_s__dark,&__pyx_n_s__flat,&__pyx_n_s__solidAngle,&__pyx_n_s__polarization,0};
        PyObject* values[8] = {0,0,0,0,0,0,0,0};

     681:

     682:     @cython.cdivision(True)

     683:     @cython.boundscheck(False)

     684:     @cython.wraparound(False)

     685:     def integrate(self, weights, dummy=None, delta_dummy=None, dark=None, flat=None, solidAngle=None, polarization=None):

        /* "splitBBoxLUT.pyx":685
     *     @cython.boundscheck(False)
     *     @cython.wraparound(False)
     *     def integrate(self, weights, dummy=None, delta_dummy=None, dark=None, flat=None, solidAngle=None, polarization=None):             # <<<<<<<<<<<<<<
     *         """
     *         Actually perform the 2D integration which in this case looks more like a matrix-vector product
     */
        values[2] = ((PyObject *)((PyObject *)Py_None));
        values[3] = ((PyObject *)((PyObject *)Py_None));
        values[4] = ((PyObject *)((PyObject *)Py_None));
        values[5] = ((PyObject *)((PyObject *)Py_None));
        values[6] = ((PyObject *)((PyObject *)Py_None));
        values[7] = ((PyObject *)((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  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__self)) != 0)) kw_args--;
            else goto __pyx_L5_argtuple_error;
            case  1:
            if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__weights)) != 0)) kw_args--;
            else {
              __Pyx_RaiseArgtupleInvalid("integrate", 0, 2, 8, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 685; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
            }
            case  2:
            if (kw_args > 0) {
              PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__dummy);
              if (value) { values[2] = value; kw_args--; }
            }
            case  3:
            if (kw_args > 0) {
              PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__delta_dummy);
              if (value) { values[3] = value; kw_args--; }
            }
            case  4:
            if (kw_args > 0) {
              PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__dark);
              if (value) { values[4] = value; kw_args--; }
            }
            case  5:
            if (kw_args > 0) {
              PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__flat);
              if (value) { values[5] = value; kw_args--; }
            }
            case  6:
            if (kw_args > 0) {
              PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__solidAngle);
              if (value) { values[6] = value; kw_args--; }
            }
            case  7:
            if (kw_args > 0) {
              PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__polarization);
              if (value) { values[7] = value; kw_args--; }
            }
          }
          if (unlikely(kw_args > 0)) {
            if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "integrate") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 685; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
          }
        } else {
          switch (PyTuple_GET_SIZE(__pyx_args)) {
            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_self = values[0];
        __pyx_v_weights = values[1];
        __pyx_v_dummy = values[2];
        __pyx_v_delta_dummy = values[3];
        __pyx_v_dark = values[4];
        __pyx_v_flat = values[5];
        __pyx_v_solidAngle = values[6];
        __pyx_v_polarization = values[7];
      }
      goto __pyx_L4_argument_unpacking_done;
      __pyx_L5_argtuple_error:;
      __Pyx_RaiseArgtupleInvalid("integrate", 0, 2, 8, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 685; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      __pyx_L3_error:;
      __Pyx_AddTraceback("splitBBoxLUT.HistoBBox2d.integrate", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __Pyx_RefNannyFinishContext();
      return NULL;
      __pyx_L4_argument_unpacking_done:;
      __pyx_r = __pyx_pf_12splitBBoxLUT_11HistoBBox2d_4integrate(__pyx_self, __pyx_v_self, __pyx_v_weights, __pyx_v_dummy, __pyx_v_delta_dummy, __pyx_v_dark, __pyx_v_flat, __pyx_v_solidAngle, __pyx_v_polarization);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_12splitBBoxLUT_11HistoBBox2d_4integrate(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_weights, PyObject *__pyx_v_dummy, PyObject *__pyx_v_delta_dummy, PyObject *__pyx_v_dark, PyObject *__pyx_v_flat, PyObject *__pyx_v_solidAngle, PyObject *__pyx_v_polarization) {
      int __pyx_v_i;
      int __pyx_v_j;
      int __pyx_v_idx;
      int __pyx_v_bins0;
      int __pyx_v_bins1;
      CYTHON_UNUSED int __pyx_v_bins;
      int __pyx_v_lut_size;
      int __pyx_v_size;
      double __pyx_v_sum_data;
      double __pyx_v_sum_count;
      double __pyx_v_epsilon;
      float __pyx_v_data;
      float __pyx_v_coef;
      float __pyx_v_cdummy;
      float __pyx_v_cddummy;
      int __pyx_v_do_dummy;
      int __pyx_v_do_dark;
      int __pyx_v_do_flat;
      int __pyx_v_do_polarization;
      int __pyx_v_do_solidAngle;
      PyArrayObject *__pyx_v_outData = 0;
      PyArrayObject *__pyx_v_outCount = 0;
      PyArrayObject *__pyx_v_outMerge = 0;
      PyArrayObject *__pyx_v_outData_1d = 0;
      PyArrayObject *__pyx_v_outCount_1d = 0;
      PyArrayObject *__pyx_v_outMerge_1d = 0;
      __Pyx_memviewslice __pyx_v_lut = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_cdata = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_tdata = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_cflat = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_cdark = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_csolidAngle = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_cpolarization = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_LocalBuf_ND __pyx_pybuffernd_outCount;
      __Pyx_Buffer __pyx_pybuffer_outCount;
      __Pyx_LocalBuf_ND __pyx_pybuffernd_outCount_1d;
      __Pyx_Buffer __pyx_pybuffer_outCount_1d;
      __Pyx_LocalBuf_ND __pyx_pybuffernd_outData;
      __Pyx_Buffer __pyx_pybuffer_outData;
      __Pyx_LocalBuf_ND __pyx_pybuffernd_outData_1d;
      __Pyx_Buffer __pyx_pybuffer_outData_1d;
      __Pyx_LocalBuf_ND __pyx_pybuffernd_outMerge;
      __Pyx_Buffer __pyx_pybuffer_outMerge;
      __Pyx_LocalBuf_ND __pyx_pybuffernd_outMerge_1d;
      __Pyx_Buffer __pyx_pybuffer_outMerge_1d;
      PyObject *__pyx_r = NULL;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("integrate", 0);
      __pyx_pybuffer_outData.pybuffer.buf = NULL;
      __pyx_pybuffer_outData.refcount = 0;
      __pyx_pybuffernd_outData.data = NULL;
      __pyx_pybuffernd_outData.rcbuffer = &__pyx_pybuffer_outData;
      __pyx_pybuffer_outCount.pybuffer.buf = NULL;
      __pyx_pybuffer_outCount.refcount = 0;
      __pyx_pybuffernd_outCount.data = NULL;
      __pyx_pybuffernd_outCount.rcbuffer = &__pyx_pybuffer_outCount;
      __pyx_pybuffer_outMerge.pybuffer.buf = NULL;
      __pyx_pybuffer_outMerge.refcount = 0;
      __pyx_pybuffernd_outMerge.data = NULL;
      __pyx_pybuffernd_outMerge.rcbuffer = &__pyx_pybuffer_outMerge;
      __pyx_pybuffer_outData_1d.pybuffer.buf = NULL;
      __pyx_pybuffer_outData_1d.refcount = 0;
      __pyx_pybuffernd_outData_1d.data = NULL;
      __pyx_pybuffernd_outData_1d.rcbuffer = &__pyx_pybuffer_outData_1d;
      __pyx_pybuffer_outCount_1d.pybuffer.buf = NULL;
      __pyx_pybuffer_outCount_1d.refcount = 0;
      __pyx_pybuffernd_outCount_1d.data = NULL;
      __pyx_pybuffernd_outCount_1d.rcbuffer = &__pyx_pybuffer_outCount_1d;
      __pyx_pybuffer_outMerge_1d.pybuffer.buf = NULL;
      __pyx_pybuffer_outMerge_1d.refcount = 0;
      __pyx_pybuffernd_outMerge_1d.data = NULL;
      __pyx_pybuffernd_outMerge_1d.rcbuffer = &__pyx_pybuffer_outMerge_1d;

      /* "splitBBoxLUT.pyx":685
     *     @cython.boundscheck(False)
     *     @cython.wraparound(False)
     *     def integrate(self, weights, dummy=None, delta_dummy=None, dark=None, flat=None, solidAngle=None, polarization=None):             # <<<<<<<<<<<<<<
     *         """
     *         Actually perform the 2D integration which in this case looks more like a matrix-vector product
     */
      __pyx_k_tuple_71 = PyTuple_Pack(41, ((PyObject *)__pyx_n_s__self), ((PyObject *)__pyx_n_s__weights), ((PyObject *)__pyx_n_s__dummy), ((PyObject *)__pyx_n_s__delta_dummy), ((PyObject *)__pyx_n_s__dark), ((PyObject *)__pyx_n_s__flat), ((PyObject *)__pyx_n_s__solidAngle), ((PyObject *)__pyx_n_s__polarization), ((PyObject *)__pyx_n_s__i), ((PyObject *)__pyx_n_s__j), ((PyObject *)__pyx_n_s__idx), ((PyObject *)__pyx_n_s__bins0), ((PyObject *)__pyx_n_s__bins1), ((PyObject *)__pyx_n_s__bins), ((PyObject *)__pyx_n_s__lut_size), ((PyObject *)__pyx_n_s__size), ((PyObject *)__pyx_n_s__sum_data), ((PyObject *)__pyx_n_s__sum_count), ((PyObject *)__pyx_n_s__epsilon), ((PyObject *)__pyx_n_s__data), ((PyObject *)__pyx_n_s__coef), ((PyObject *)__pyx_n_s__cdummy), ((PyObject *)__pyx_n_s__cddummy), ((PyObject *)__pyx_n_s__do_dummy), ((PyObject *)__pyx_n_s__do_dark), ((PyObject *)__pyx_n_s__do_flat), ((PyObject *)__pyx_n_s__do_polarization), ((PyObject *)__pyx_n_s__do_solidAngle), ((PyObject *)__pyx_n_s__outData), ((PyObject *)__pyx_n_s__outCount), ((PyObject *)__pyx_n_s__outMerge), ((PyObject *)__pyx_n_s__outData_1d), ((PyObject *)__pyx_n_s__outCount_1d), ((PyObject *)__pyx_n_s__outMerge_1d), ((PyObject *)__pyx_n_s__lut), ((PyObject *)__pyx_n_s__cdata), ((PyObject *)__pyx_n_s__tdata), ((PyObject *)__pyx_n_s__cflat), ((PyObject *)__pyx_n_s__cdark), ((PyObject *)__pyx_n_s__csolidAngle), ((PyObject *)__pyx_n_s__cpolarization)); if (unlikely(!__pyx_k_tuple_71)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 685; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_k_tuple_71);
      __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_71));
      __pyx_k_codeobj_72 = (PyObject*)__Pyx_PyCode_New(8, 0, 41, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_71, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_56, __pyx_n_s__integrate, 685, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_72)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 685; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

      /* "splitBBoxLUT.pyx":685
     *     @cython.boundscheck(False)
     *     @cython.wraparound(False)
     *     def integrate(self, weights, dummy=None, delta_dummy=None, dark=None, flat=None, solidAngle=None, polarization=None):             # <<<<<<<<<<<<<<
     *         """
     *         Actually perform the 2D integration which in this case looks more like a matrix-vector product
     */
      __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_12splitBBoxLUT_11HistoBBox2d_5integrate, 0, __pyx_n_s_74, NULL, __pyx_n_s__splitBBoxLUT, ((PyObject *)__pyx_k_codeobj_72)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 685; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_6, ((PyObject *)__pyx_k_tuple_73));
      if (PyObject_SetItem(__pyx_t_8, __pyx_n_s__integrate, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 685; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_k_tuple_73 = PyTuple_Pack(6, ((PyObject *)Py_None), ((PyObject *)Py_None), ((PyObject *)Py_None), ((PyObject *)Py_None), ((PyObject *)Py_None), ((PyObject *)Py_None)); if (unlikely(!__pyx_k_tuple_73)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 685; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_k_tuple_73);
      __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_73));

     686:         """

     687:         Actually perform the 2D integration which in this case looks more like a matrix-vector product

     688:

     689:         @param weights: input image

     690:         @type weights: ndarray

     691:         @param dummy: value for dead pixels (optional)

     692:         @type dummy: float

     693:         @param delta_dummy: precision for dead-pixel value in dynamic masking

     694:         @type delta_dummy: float

     695:         @param dark: array with the dark-current value to be subtracted (if any)

     696:         @type dark: ndarray

     697:         @param flat: array with the dark-current value to be divided by (if any)

     698:         @type flat: ndarray

     699:         @param solidAngle: array with the solid angle of each pixel to be divided by (if any)

     700:         @type solidAngle: ndarray

     701:         @param polarization: array with the polarization correction values to be divided by (if any)

     702:         @type polarization: ndarray

     703:         @return:  I(2d), edges0(1d), edges1(1d), weighted histogram(2d), unweighted histogram (2d)

     704:         @rtype: 5-tuple of ndarrays

     705:

     706:         """

     707:         cdef int i=0, j=0, idx=0, bins0=self.bins[0], bins1=self.bins[1], bins=bins0*bins1, lut_size=self.lut_size, size=self.size

      /* "splitBBoxLUT.pyx":707
     *
     *         """
     *         cdef int i=0, j=0, idx=0, bins0=self.bins[0], bins1=self.bins[1], bins=bins0*bins1, lut_size=self.lut_size, size=self.size             # <<<<<<<<<<<<<<
     *         cdef double sum_data=0, sum_count=0, epsilon=1e-10
     *         cdef float data=0, coef=0, cdummy=0, cddummy=0
     */
      __pyx_v_i = 0;
      __pyx_v_j = 0;
      __pyx_v_idx = 0;
      __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__bins); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 707; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 707; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_3 = __Pyx_PyInt_AsInt(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 707; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_v_bins0 = __pyx_t_3;
      __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__bins); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 707; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 707; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_3 = __Pyx_PyInt_AsInt(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 707; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v_bins1 = __pyx_t_3;
      __pyx_v_bins = (__pyx_v_bins0 * __pyx_v_bins1);
      __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__lut_size); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 707; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = __Pyx_PyInt_AsInt(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 707; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v_lut_size = __pyx_t_3;
      __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__size); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 707; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = __Pyx_PyInt_AsInt(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 707; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v_size = __pyx_t_3;

     708:         cdef double sum_data=0, sum_count=0, epsilon=1e-10

      /* "splitBBoxLUT.pyx":708
     *         """
     *         cdef int i=0, j=0, idx=0, bins0=self.bins[0], bins1=self.bins[1], bins=bins0*bins1, lut_size=self.lut_size, size=self.size
     *         cdef double sum_data=0, sum_count=0, epsilon=1e-10             # <<<<<<<<<<<<<<
     *         cdef float data=0, coef=0, cdummy=0, cddummy=0
     *         cdef bint do_dummy=False, do_dark=False, do_flat=False, do_polarization=False, do_solidAngle=False
     */
      __pyx_v_sum_data = 0.0;
      __pyx_v_sum_count = 0.0;
      __pyx_v_epsilon = 1e-10;

     709:         cdef float data=0, coef=0, cdummy=0, cddummy=0

      /* "splitBBoxLUT.pyx":709
     *         cdef int i=0, j=0, idx=0, bins0=self.bins[0], bins1=self.bins[1], bins=bins0*bins1, lut_size=self.lut_size, size=self.size
     *         cdef double sum_data=0, sum_count=0, epsilon=1e-10
     *         cdef float data=0, coef=0, cdummy=0, cddummy=0             # <<<<<<<<<<<<<<
     *         cdef bint do_dummy=False, do_dark=False, do_flat=False, do_polarization=False, do_solidAngle=False
     *         cdef numpy.ndarray[numpy.float64_t, ndim = 2] outData = numpy.zeros(self.bins, dtype=numpy.float64)
     */
      __pyx_v_data = 0.0;
      __pyx_v_coef = 0.0;
      __pyx_v_cdummy = 0.0;
      __pyx_v_cddummy = 0.0;

     710:         cdef bint do_dummy=False, do_dark=False, do_flat=False, do_polarization=False, do_solidAngle=False

      /* "splitBBoxLUT.pyx":710
     *         cdef double sum_data=0, sum_count=0, epsilon=1e-10
     *         cdef float data=0, coef=0, cdummy=0, cddummy=0
     *         cdef bint do_dummy=False, do_dark=False, do_flat=False, do_polarization=False, do_solidAngle=False             # <<<<<<<<<<<<<<
     *         cdef numpy.ndarray[numpy.float64_t, ndim = 2] outData = numpy.zeros(self.bins, dtype=numpy.float64)
     *         cdef numpy.ndarray[numpy.float64_t, ndim = 2] outCount = numpy.zeros(self.bins, dtype=numpy.float64)
     */
      __pyx_v_do_dummy = 0;
      __pyx_v_do_dark = 0;
      __pyx_v_do_flat = 0;
      __pyx_v_do_polarization = 0;
      __pyx_v_do_solidAngle = 0;

     711:         cdef numpy.ndarray[numpy.float64_t, ndim = 2] outData = numpy.zeros(self.bins, dtype=numpy.float64)

      /* "splitBBoxLUT.pyx":711
     *         cdef float data=0, coef=0, cdummy=0, cddummy=0
     *         cdef bint do_dummy=False, do_dark=False, do_flat=False, do_polarization=False, do_solidAngle=False
     *         cdef numpy.ndarray[numpy.float64_t, ndim = 2] outData = numpy.zeros(self.bins, dtype=numpy.float64)             # <<<<<<<<<<<<<<
     *         cdef numpy.ndarray[numpy.float64_t, ndim = 2] outCount = numpy.zeros(self.bins, dtype=numpy.float64)
     *         cdef numpy.ndarray[numpy.float32_t, ndim = 2] outMerge = numpy.zeros(self.bins, dtype=numpy.float32)
     */
      __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 711; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__zeros); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 711; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__bins); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 711; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 711; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 711; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_1));
      __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 711; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__float64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 711; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__dtype), __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 711; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 711; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
      if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 711; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_7 = ((PyArrayObject *)__pyx_t_6);
      {
        __Pyx_BufFmt_StackElem __pyx_stack[1];
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_outData.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
          __pyx_v_outData = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_outData.rcbuffer->pybuffer.buf = NULL;
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 711; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        } else {__pyx_pybuffernd_outData.diminfo[0].strides = __pyx_pybuffernd_outData.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_outData.diminfo[0].shape = __pyx_pybuffernd_outData.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_outData.diminfo[1].strides = __pyx_pybuffernd_outData.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_outData.diminfo[1].shape = __pyx_pybuffernd_outData.rcbuffer->pybuffer.shape[1];
        }
      }
      __pyx_t_7 = 0;
      __pyx_v_outData = ((PyArrayObject *)__pyx_t_6);
      __pyx_t_6 = 0;

     712:         cdef numpy.ndarray[numpy.float64_t, ndim = 2] outCount = numpy.zeros(self.bins, dtype=numpy.float64)

      /* "splitBBoxLUT.pyx":712
     *         cdef bint do_dummy=False, do_dark=False, do_flat=False, do_polarization=False, do_solidAngle=False
     *         cdef numpy.ndarray[numpy.float64_t, ndim = 2] outData = numpy.zeros(self.bins, dtype=numpy.float64)
     *         cdef numpy.ndarray[numpy.float64_t, ndim = 2] outCount = numpy.zeros(self.bins, dtype=numpy.float64)             # <<<<<<<<<<<<<<
     *         cdef numpy.ndarray[numpy.float32_t, ndim = 2] outMerge = numpy.zeros(self.bins, dtype=numpy.float32)
     *         cdef numpy.ndarray[numpy.float64_t, ndim = 1] outData_1d = outData.ravel()
     */
      __pyx_t_6 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 712; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_1 = PyObject_GetAttr(__pyx_t_6, __pyx_n_s__zeros); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 712; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__bins); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 712; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 712; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_6);
      __pyx_t_6 = 0;
      __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 712; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_6));
      __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 712; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_5 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__float64); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 712; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (PyDict_SetItem(__pyx_t_6, ((PyObject *)__pyx_n_s__dtype), __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 712; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_6)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 712; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
      if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 712; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_8 = ((PyArrayObject *)__pyx_t_5);
      {
        __Pyx_BufFmt_StackElem __pyx_stack[1];
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_outCount.rcbuffer->pybuffer, (PyObject*)__pyx_t_8, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
          __pyx_v_outCount = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_outCount.rcbuffer->pybuffer.buf = NULL;
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 712; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        } else {__pyx_pybuffernd_outCount.diminfo[0].strides = __pyx_pybuffernd_outCount.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_outCount.diminfo[0].shape = __pyx_pybuffernd_outCount.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_outCount.diminfo[1].strides = __pyx_pybuffernd_outCount.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_outCount.diminfo[1].shape = __pyx_pybuffernd_outCount.rcbuffer->pybuffer.shape[1];
        }
      }
      __pyx_t_8 = 0;
      __pyx_v_outCount = ((PyArrayObject *)__pyx_t_5);
      __pyx_t_5 = 0;

     713:         cdef numpy.ndarray[numpy.float32_t, ndim = 2] outMerge = numpy.zeros(self.bins, dtype=numpy.float32)

      /* "splitBBoxLUT.pyx":713
     *         cdef numpy.ndarray[numpy.float64_t, ndim = 2] outData = numpy.zeros(self.bins, dtype=numpy.float64)
     *         cdef numpy.ndarray[numpy.float64_t, ndim = 2] outCount = numpy.zeros(self.bins, dtype=numpy.float64)
     *         cdef numpy.ndarray[numpy.float32_t, ndim = 2] outMerge = numpy.zeros(self.bins, dtype=numpy.float32)             # <<<<<<<<<<<<<<
     *         cdef numpy.ndarray[numpy.float64_t, ndim = 1] outData_1d = outData.ravel()
     *         cdef numpy.ndarray[numpy.float64_t, ndim = 1] outCount_1d = outCount.ravel()
     */
      __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 713; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__zeros); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 713; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__bins); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 713; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 713; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_5);
      __pyx_t_5 = 0;
      __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 713; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_5));
      __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 713; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__float32); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 713; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (PyDict_SetItem(__pyx_t_5, ((PyObject *)__pyx_n_s__dtype), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 713; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 713; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 713; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_9 = ((PyArrayObject *)__pyx_t_2);
      {
        __Pyx_BufFmt_StackElem __pyx_stack[1];
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_outMerge.rcbuffer->pybuffer, (PyObject*)__pyx_t_9, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
          __pyx_v_outMerge = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_outMerge.rcbuffer->pybuffer.buf = NULL;
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 713; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        } else {__pyx_pybuffernd_outMerge.diminfo[0].strides = __pyx_pybuffernd_outMerge.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_outMerge.diminfo[0].shape = __pyx_pybuffernd_outMerge.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_outMerge.diminfo[1].strides = __pyx_pybuffernd_outMerge.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_outMerge.diminfo[1].shape = __pyx_pybuffernd_outMerge.rcbuffer->pybuffer.shape[1];
        }
      }
      __pyx_t_9 = 0;
      __pyx_v_outMerge = ((PyArrayObject *)__pyx_t_2);
      __pyx_t_2 = 0;

     714:         cdef numpy.ndarray[numpy.float64_t, ndim = 1] outData_1d = outData.ravel()

      /* "splitBBoxLUT.pyx":714
     *         cdef numpy.ndarray[numpy.float64_t, ndim = 2] outCount = numpy.zeros(self.bins, dtype=numpy.float64)
     *         cdef numpy.ndarray[numpy.float32_t, ndim = 2] outMerge = numpy.zeros(self.bins, dtype=numpy.float32)
     *         cdef numpy.ndarray[numpy.float64_t, ndim = 1] outData_1d = outData.ravel()             # <<<<<<<<<<<<<<
     *         cdef numpy.ndarray[numpy.float64_t, ndim = 1] outCount_1d = outCount.ravel()
     *         cdef numpy.ndarray[numpy.float32_t, ndim = 1] outMerge_1d = outMerge.ravel()
     */
      __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_v_outData), __pyx_n_s__ravel); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 714; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_5 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 714; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 714; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_10 = ((PyArrayObject *)__pyx_t_5);
      {
        __Pyx_BufFmt_StackElem __pyx_stack[1];
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_outData_1d.rcbuffer->pybuffer, (PyObject*)__pyx_t_10, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
          __pyx_v_outData_1d = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_outData_1d.rcbuffer->pybuffer.buf = NULL;
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 714; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        } else {__pyx_pybuffernd_outData_1d.diminfo[0].strides = __pyx_pybuffernd_outData_1d.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_outData_1d.diminfo[0].shape = __pyx_pybuffernd_outData_1d.rcbuffer->pybuffer.shape[0];
        }
      }
      __pyx_t_10 = 0;
      __pyx_v_outData_1d = ((PyArrayObject *)__pyx_t_5);
      __pyx_t_5 = 0;

     715:         cdef numpy.ndarray[numpy.float64_t, ndim = 1] outCount_1d = outCount.ravel()

      /* "splitBBoxLUT.pyx":715
     *         cdef numpy.ndarray[numpy.float32_t, ndim = 2] outMerge = numpy.zeros(self.bins, dtype=numpy.float32)
     *         cdef numpy.ndarray[numpy.float64_t, ndim = 1] outData_1d = outData.ravel()
     *         cdef numpy.ndarray[numpy.float64_t, ndim = 1] outCount_1d = outCount.ravel()             # <<<<<<<<<<<<<<
     *         cdef numpy.ndarray[numpy.float32_t, ndim = 1] outMerge_1d = outMerge.ravel()
     *
     */
      __pyx_t_5 = PyObject_GetAttr(((PyObject *)__pyx_v_outCount), __pyx_n_s__ravel); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 715; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_2 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 715; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 715; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_11 = ((PyArrayObject *)__pyx_t_2);
      {
        __Pyx_BufFmt_StackElem __pyx_stack[1];
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_outCount_1d.rcbuffer->pybuffer, (PyObject*)__pyx_t_11, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
          __pyx_v_outCount_1d = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_outCount_1d.rcbuffer->pybuffer.buf = NULL;
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 715; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        } else {__pyx_pybuffernd_outCount_1d.diminfo[0].strides = __pyx_pybuffernd_outCount_1d.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_outCount_1d.diminfo[0].shape = __pyx_pybuffernd_outCount_1d.rcbuffer->pybuffer.shape[0];
        }
      }
      __pyx_t_11 = 0;
      __pyx_v_outCount_1d = ((PyArrayObject *)__pyx_t_2);
      __pyx_t_2 = 0;

     716:         cdef numpy.ndarray[numpy.float32_t, ndim = 1] outMerge_1d = outMerge.ravel()

      /* "splitBBoxLUT.pyx":716
     *         cdef numpy.ndarray[numpy.float64_t, ndim = 1] outData_1d = outData.ravel()
     *         cdef numpy.ndarray[numpy.float64_t, ndim = 1] outCount_1d = outCount.ravel()
     *         cdef numpy.ndarray[numpy.float32_t, ndim = 1] outMerge_1d = outMerge.ravel()             # <<<<<<<<<<<<<<
     *
     *         cdef lut_point[:,:] lut = self.lut
     */
      __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_v_outMerge), __pyx_n_s__ravel); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 716; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_5 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 716; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 716; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_12 = ((PyArrayObject *)__pyx_t_5);
      {
        __Pyx_BufFmt_StackElem __pyx_stack[1];
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_outMerge_1d.rcbuffer->pybuffer, (PyObject*)__pyx_t_12, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
          __pyx_v_outMerge_1d = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_outMerge_1d.rcbuffer->pybuffer.buf = NULL;
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 716; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        } else {__pyx_pybuffernd_outMerge_1d.diminfo[0].strides = __pyx_pybuffernd_outMerge_1d.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_outMerge_1d.diminfo[0].shape = __pyx_pybuffernd_outMerge_1d.rcbuffer->pybuffer.shape[0];
        }
      }
      __pyx_t_12 = 0;
      __pyx_v_outMerge_1d = ((PyArrayObject *)__pyx_t_5);
      __pyx_t_5 = 0;

     717:

     718:         cdef lut_point[:,:] lut = self.lut

      /* "splitBBoxLUT.pyx":718
     *         cdef numpy.ndarray[numpy.float32_t, ndim = 1] outMerge_1d = outMerge.ravel()
     *
     *         cdef lut_point[:,:] lut = self.lut             # <<<<<<<<<<<<<<
     *         cdef float[:] cdata, tdata, cflat, cdark, csolidAngle, cpolarization
     *
     */
      __pyx_t_5 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__lut); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 718; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_13 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn_struct___pyx_t_12splitBBoxLUT_lut_point(__pyx_t_5);
      if (unlikely(!__pyx_t_13.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 718; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_v_lut = __pyx_t_13;
      __pyx_t_13.memview = NULL;
      __pyx_t_13.data = NULL;

     719:         cdef float[:] cdata, tdata, cflat, cdark, csolidAngle, cpolarization

     720:

     721:         assert size == weights.size

      /* "splitBBoxLUT.pyx":721
     *         cdef float[:] cdata, tdata, cflat, cdark, csolidAngle, cpolarization
     *
     *         assert size == weights.size             # <<<<<<<<<<<<<<
     *
     *         if dummy is not None:
     */
      #ifndef CYTHON_WITHOUT_ASSERTIONS
      __pyx_t_5 = PyInt_FromLong(__pyx_v_size); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 721; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_2 = PyObject_GetAttr(__pyx_v_weights, __pyx_n_s__size); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 721; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_4 = PyObject_RichCompare(__pyx_t_5, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 721; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_14 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 721; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_14)) {
        PyErr_SetNone(PyExc_AssertionError);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 721; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      #endif

     722:

     723:         if dummy is not None:

      /* "splitBBoxLUT.pyx":723
     *         assert size == weights.size
     *
     *         if dummy is not None:             # <<<<<<<<<<<<<<
     *             do_dummy = True
     *             cdummy =  <float>float(dummy)
     */
      __pyx_t_14 = (__pyx_v_dummy != Py_None);
      if (__pyx_t_14) {

     724:             do_dummy = True

        /* "splitBBoxLUT.pyx":724
     *
     *         if dummy is not None:
     *             do_dummy = True             # <<<<<<<<<<<<<<
     *             cdummy =  <float>float(dummy)
     *             if delta_dummy is None:
     */
        __pyx_v_do_dummy = 1;

     725:             cdummy =  <float>float(dummy)

        /* "splitBBoxLUT.pyx":725
     *         if dummy is not None:
     *             do_dummy = True
     *             cdummy =  <float>float(dummy)             # <<<<<<<<<<<<<<
     *             if delta_dummy is None:
     *                 cddummy = <float>0.0
     */
        __pyx_t_15 = __Pyx_PyObject_AsDouble(__pyx_v_dummy); if (unlikely(__pyx_t_15 == ((double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 725; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_v_cdummy = ((float)__pyx_t_15);

     726:             if delta_dummy is None:

        /* "splitBBoxLUT.pyx":726
     *             do_dummy = True
     *             cdummy =  <float>float(dummy)
     *             if delta_dummy is None:             # <<<<<<<<<<<<<<
     *                 cddummy = <float>0.0
     *             else:
     */
        __pyx_t_14 = (__pyx_v_delta_dummy == Py_None);
        if (__pyx_t_14) {

     727:                 cddummy = <float>0.0

          /* "splitBBoxLUT.pyx":727
     *             cdummy =  <float>float(dummy)
     *             if delta_dummy is None:
     *                 cddummy = <float>0.0             # <<<<<<<<<<<<<<
     *             else:
     *                 cddummy = <float>float(delta_dummy)
     */
          __pyx_v_cddummy = ((float)0.0);
          goto __pyx_L4;
        }
        /*else*/ {

     728:             else:

     729:                 cddummy = <float>float(delta_dummy)

          /* "splitBBoxLUT.pyx":729
     *                 cddummy = <float>0.0
     *             else:
     *                 cddummy = <float>float(delta_dummy)             # <<<<<<<<<<<<<<
     *
     *         if flat is not None:
     */
          __pyx_t_15 = __Pyx_PyObject_AsDouble(__pyx_v_delta_dummy); if (unlikely(__pyx_t_15 == ((double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 729; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __pyx_v_cddummy = ((float)__pyx_t_15);
        }
        __pyx_L4:;
        goto __pyx_L3;
      }
      __pyx_L3:;

     730:

     731:         if flat is not None:

      /* "splitBBoxLUT.pyx":731
     *                 cddummy = <float>float(delta_dummy)
     *
     *         if flat is not None:             # <<<<<<<<<<<<<<
     *             do_flat = True
     *             assert flat.size == size
     */
      __pyx_t_14 = (__pyx_v_flat != Py_None);
      if (__pyx_t_14) {

     732:             do_flat = True

        /* "splitBBoxLUT.pyx":732
     *
     *         if flat is not None:
     *             do_flat = True             # <<<<<<<<<<<<<<
     *             assert flat.size == size
     *             cflat = numpy.ascontiguousarray(flat.ravel(), dtype=numpy.float32)
     */
        __pyx_v_do_flat = 1;

     733:             assert flat.size == size

        /* "splitBBoxLUT.pyx":733
     *         if flat is not None:
     *             do_flat = True
     *             assert flat.size == size             # <<<<<<<<<<<<<<
     *             cflat = numpy.ascontiguousarray(flat.ravel(), dtype=numpy.float32)
     *         if dark is not None:
     */
        #ifndef CYTHON_WITHOUT_ASSERTIONS
        __pyx_t_4 = PyObject_GetAttr(__pyx_v_flat, __pyx_n_s__size); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 733; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_2 = PyInt_FromLong(__pyx_v_size); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 733; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_5 = PyObject_RichCompare(__pyx_t_4, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 733; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_14 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 733; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (unlikely(!__pyx_t_14)) {
          PyErr_SetNone(PyExc_AssertionError);
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 733; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        #endif

     734:             cflat = numpy.ascontiguousarray(flat.ravel(), dtype=numpy.float32)

        /* "splitBBoxLUT.pyx":734
     *             do_flat = True
     *             assert flat.size == size
     *             cflat = numpy.ascontiguousarray(flat.ravel(), dtype=numpy.float32)             # <<<<<<<<<<<<<<
     *         if dark is not None:
     *             do_dark = True
     */
        __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 734; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_2 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__ascontiguousarray); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 734; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = PyObject_GetAttr(__pyx_v_flat, __pyx_n_s__ravel); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 734; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_4 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 734; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 734; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
        __Pyx_GIVEREF(__pyx_t_4);
        __pyx_t_4 = 0;
        __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 734; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(((PyObject *)__pyx_t_4));
        __pyx_t_6 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 734; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_1 = PyObject_GetAttr(__pyx_t_6, __pyx_n_s__float32); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 734; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (PyDict_SetItem(__pyx_t_4, ((PyObject *)__pyx_n_s__dtype), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 734; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_5), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 734; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
        __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
        __pyx_t_16 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(__pyx_t_1);
        if (unlikely(!__pyx_t_16.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 734; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_v_cflat = __pyx_t_16;
        __pyx_t_16.memview = NULL;
        __pyx_t_16.data = NULL;
        goto __pyx_L5;
      }
      __pyx_L5:;

     735:         if dark is not None:

      /* "splitBBoxLUT.pyx":735
     *             assert flat.size == size
     *             cflat = numpy.ascontiguousarray(flat.ravel(), dtype=numpy.float32)
     *         if dark is not None:             # <<<<<<<<<<<<<<
     *             do_dark = True
     *             assert dark.size == size
     */
      __pyx_t_14 = (__pyx_v_dark != Py_None);
      if (__pyx_t_14) {

     736:             do_dark = True

        /* "splitBBoxLUT.pyx":736
     *             cflat = numpy.ascontiguousarray(flat.ravel(), dtype=numpy.float32)
     *         if dark is not None:
     *             do_dark = True             # <<<<<<<<<<<<<<
     *             assert dark.size == size
     *             cdark = numpy.ascontiguousarray(dark.ravel(), dtype=numpy.float32)
     */
        __pyx_v_do_dark = 1;

     737:             assert dark.size == size

        /* "splitBBoxLUT.pyx":737
     *         if dark is not None:
     *             do_dark = True
     *             assert dark.size == size             # <<<<<<<<<<<<<<
     *             cdark = numpy.ascontiguousarray(dark.ravel(), dtype=numpy.float32)
     *         if solidAngle is not None:
     */
        #ifndef CYTHON_WITHOUT_ASSERTIONS
        __pyx_t_1 = PyObject_GetAttr(__pyx_v_dark, __pyx_n_s__size); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 737; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_4 = PyInt_FromLong(__pyx_v_size); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 737; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_5 = PyObject_RichCompare(__pyx_t_1, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 737; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_14 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 737; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (unlikely(!__pyx_t_14)) {
          PyErr_SetNone(PyExc_AssertionError);
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 737; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        #endif

     738:             cdark = numpy.ascontiguousarray(dark.ravel(), dtype=numpy.float32)

        /* "splitBBoxLUT.pyx":738
     *             do_dark = True
     *             assert dark.size == size
     *             cdark = numpy.ascontiguousarray(dark.ravel(), dtype=numpy.float32)             # <<<<<<<<<<<<<<
     *         if solidAngle is not None:
     *             do_solidAngle = True
     */
        __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 738; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_4 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__ascontiguousarray); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 738; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = PyObject_GetAttr(__pyx_v_dark, __pyx_n_s__ravel); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 738; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_1 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 738; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 738; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1);
        __Pyx_GIVEREF(__pyx_t_1);
        __pyx_t_1 = 0;
        __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 738; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(((PyObject *)__pyx_t_1));
        __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 738; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_6 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__float32); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 738; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__dtype), __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 738; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_6 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_5), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 738; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
        __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
        __pyx_t_16 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(__pyx_t_6);
        if (unlikely(!__pyx_t_16.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 738; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_v_cdark = __pyx_t_16;
        __pyx_t_16.memview = NULL;
        __pyx_t_16.data = NULL;
        goto __pyx_L6;
      }
      __pyx_L6:;

     739:         if solidAngle is not None:

      /* "splitBBoxLUT.pyx":739
     *             assert dark.size == size
     *             cdark = numpy.ascontiguousarray(dark.ravel(), dtype=numpy.float32)
     *         if solidAngle is not None:             # <<<<<<<<<<<<<<
     *             do_solidAngle = True
     *             assert solidAngle.size == size
     */
      __pyx_t_14 = (__pyx_v_solidAngle != Py_None);
      if (__pyx_t_14) {

     740:             do_solidAngle = True

        /* "splitBBoxLUT.pyx":740
     *             cdark = numpy.ascontiguousarray(dark.ravel(), dtype=numpy.float32)
     *         if solidAngle is not None:
     *             do_solidAngle = True             # <<<<<<<<<<<<<<
     *             assert solidAngle.size == size
     *             csolidAngle = numpy.ascontiguousarray(solidAngle.ravel(), dtype=numpy.float32)
     */
        __pyx_v_do_solidAngle = 1;

     741:             assert solidAngle.size == size

        /* "splitBBoxLUT.pyx":741
     *         if solidAngle is not None:
     *             do_solidAngle = True
     *             assert solidAngle.size == size             # <<<<<<<<<<<<<<
     *             csolidAngle = numpy.ascontiguousarray(solidAngle.ravel(), dtype=numpy.float32)
     *         if polarization is not None:
     */
        #ifndef CYTHON_WITHOUT_ASSERTIONS
        __pyx_t_6 = PyObject_GetAttr(__pyx_v_solidAngle, __pyx_n_s__size); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 741; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_1 = PyInt_FromLong(__pyx_v_size); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 741; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_5 = PyObject_RichCompare(__pyx_t_6, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 741; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_14 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 741; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (unlikely(!__pyx_t_14)) {
          PyErr_SetNone(PyExc_AssertionError);
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 741; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        #endif

     742:             csolidAngle = numpy.ascontiguousarray(solidAngle.ravel(), dtype=numpy.float32)

        /* "splitBBoxLUT.pyx":742
     *             do_solidAngle = True
     *             assert solidAngle.size == size
     *             csolidAngle = numpy.ascontiguousarray(solidAngle.ravel(), dtype=numpy.float32)             # <<<<<<<<<<<<<<
     *         if polarization is not None:
     *             do_polarization = True
     */
        __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 742; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_1 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__ascontiguousarray); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 742; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = PyObject_GetAttr(__pyx_v_solidAngle, __pyx_n_s__ravel); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 742; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_6 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 742; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 742; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6);
        __Pyx_GIVEREF(__pyx_t_6);
        __pyx_t_6 = 0;
        __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 742; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(((PyObject *)__pyx_t_6));
        __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 742; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_2 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__float32); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 742; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (PyDict_SetItem(__pyx_t_6, ((PyObject *)__pyx_n_s__dtype), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 742; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_5), ((PyObject *)__pyx_t_6)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 742; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
        __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
        __pyx_t_16 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(__pyx_t_2);
        if (unlikely(!__pyx_t_16.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 742; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_v_csolidAngle = __pyx_t_16;
        __pyx_t_16.memview = NULL;
        __pyx_t_16.data = NULL;
        goto __pyx_L7;
      }
      __pyx_L7:;

     743:         if polarization is not None:

      /* "splitBBoxLUT.pyx":743
     *             assert solidAngle.size == size
     *             csolidAngle = numpy.ascontiguousarray(solidAngle.ravel(), dtype=numpy.float32)
     *         if polarization is not None:             # <<<<<<<<<<<<<<
     *             do_polarization = True
     *             assert polarization.size == size
     */
      __pyx_t_14 = (__pyx_v_polarization != Py_None);
      if (__pyx_t_14) {

     744:             do_polarization = True

        /* "splitBBoxLUT.pyx":744
     *             csolidAngle = numpy.ascontiguousarray(solidAngle.ravel(), dtype=numpy.float32)
     *         if polarization is not None:
     *             do_polarization = True             # <<<<<<<<<<<<<<
     *             assert polarization.size == size
     *             cpolarization = numpy.ascontiguousarray(polarization.ravel(), dtype=numpy.float32)
     */
        __pyx_v_do_polarization = 1;

     745:             assert polarization.size == size

        /* "splitBBoxLUT.pyx":745
     *         if polarization is not None:
     *             do_polarization = True
     *             assert polarization.size == size             # <<<<<<<<<<<<<<
     *             cpolarization = numpy.ascontiguousarray(polarization.ravel(), dtype=numpy.float32)
     *
     */
        #ifndef CYTHON_WITHOUT_ASSERTIONS
        __pyx_t_2 = PyObject_GetAttr(__pyx_v_polarization, __pyx_n_s__size); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 745; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_6 = PyInt_FromLong(__pyx_v_size); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 745; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_5 = PyObject_RichCompare(__pyx_t_2, __pyx_t_6, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 745; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_14 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 745; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (unlikely(!__pyx_t_14)) {
          PyErr_SetNone(PyExc_AssertionError);
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 745; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        #endif

     746:             cpolarization = numpy.ascontiguousarray(polarization.ravel(), dtype=numpy.float32)

        /* "splitBBoxLUT.pyx":746
     *             do_polarization = True
     *             assert polarization.size == size
     *             cpolarization = numpy.ascontiguousarray(polarization.ravel(), dtype=numpy.float32)             # <<<<<<<<<<<<<<
     *
     *         if (do_dark + do_flat + do_polarization + do_solidAngle):
     */
        __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 746; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_6 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__ascontiguousarray); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 746; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = PyObject_GetAttr(__pyx_v_polarization, __pyx_n_s__ravel); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 746; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_2 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 746; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 746; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2);
        __Pyx_GIVEREF(__pyx_t_2);
        __pyx_t_2 = 0;
        __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 746; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(((PyObject *)__pyx_t_2));
        __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 746; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_4 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__float32); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 746; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__dtype), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 746; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_4 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_t_5), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 746; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
        __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
        __pyx_t_16 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(__pyx_t_4);
        if (unlikely(!__pyx_t_16.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 746; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_v_cpolarization = __pyx_t_16;
        __pyx_t_16.memview = NULL;
        __pyx_t_16.data = NULL;
        goto __pyx_L8;
      }
      __pyx_L8:;

     747:

     748:         if (do_dark + do_flat + do_polarization + do_solidAngle):

      /* "splitBBoxLUT.pyx":748
     *             cpolarization = numpy.ascontiguousarray(polarization.ravel(), dtype=numpy.float32)
     *
     *         if (do_dark + do_flat + do_polarization + do_solidAngle):             # <<<<<<<<<<<<<<
     *             tdata = numpy.ascontiguousarray(weights.ravel(), dtype=numpy.float32)
     *             cdata = numpy.zeros(size,dtype=numpy.float32)
     */
      __pyx_t_3 = (((__pyx_v_do_dark + __pyx_v_do_flat) + __pyx_v_do_polarization) + __pyx_v_do_solidAngle);
      if (__pyx_t_3) {

     749:             tdata = numpy.ascontiguousarray(weights.ravel(), dtype=numpy.float32)

        /* "splitBBoxLUT.pyx":749
     *
     *         if (do_dark + do_flat + do_polarization + do_solidAngle):
     *             tdata = numpy.ascontiguousarray(weights.ravel(), dtype=numpy.float32)             # <<<<<<<<<<<<<<
     *             cdata = numpy.zeros(size,dtype=numpy.float32)
     *             if do_dummy:
     */
        __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 749; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_2 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__ascontiguousarray); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 749; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_4 = PyObject_GetAttr(__pyx_v_weights, __pyx_n_s__ravel); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 749; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_5 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 749; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 749; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
        __Pyx_GIVEREF(__pyx_t_5);
        __pyx_t_5 = 0;
        __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 749; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(((PyObject *)__pyx_t_5));
        __pyx_t_6 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 749; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_1 = PyObject_GetAttr(__pyx_t_6, __pyx_n_s__float32); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 749; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (PyDict_SetItem(__pyx_t_5, ((PyObject *)__pyx_n_s__dtype), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 749; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 749; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
        __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
        __pyx_t_16 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(__pyx_t_1);
        if (unlikely(!__pyx_t_16.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 749; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_v_tdata = __pyx_t_16;
        __pyx_t_16.memview = NULL;
        __pyx_t_16.data = NULL;

     750:             cdata = numpy.zeros(size,dtype=numpy.float32)

        /* "splitBBoxLUT.pyx":750
     *         if (do_dark + do_flat + do_polarization + do_solidAngle):
     *             tdata = numpy.ascontiguousarray(weights.ravel(), dtype=numpy.float32)
     *             cdata = numpy.zeros(size,dtype=numpy.float32)             # <<<<<<<<<<<<<<
     *             if do_dummy:
     *                 for i in prange(size, nogil=True, schedule="static"):
     */
        __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 750; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_5 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__zeros); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 750; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_t_1 = PyInt_FromLong(__pyx_v_size); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 750; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 750; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
        __Pyx_GIVEREF(__pyx_t_1);
        __pyx_t_1 = 0;
        __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 750; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(((PyObject *)__pyx_t_1));
        __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 750; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_6 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__float32); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 750; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__dtype), __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 750; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_6 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 750; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
        __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
        __pyx_t_16 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(__pyx_t_6);
        if (unlikely(!__pyx_t_16.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 750; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_v_cdata = __pyx_t_16;
        __pyx_t_16.memview = NULL;
        __pyx_t_16.data = NULL;

     751:             if do_dummy:

        /* "splitBBoxLUT.pyx":751
     *             tdata = numpy.ascontiguousarray(weights.ravel(), dtype=numpy.float32)
     *             cdata = numpy.zeros(size,dtype=numpy.float32)
     *             if do_dummy:             # <<<<<<<<<<<<<<
     *                 for i in prange(size, nogil=True, schedule="static"):
     *                     data = tdata[i]
     */
        if (__pyx_v_do_dummy) {

     752:                 for i in prange(size, nogil=True, schedule="static"):

          /* "splitBBoxLUT.pyx":752
     *             cdata = numpy.zeros(size,dtype=numpy.float32)
     *             if do_dummy:
     *                 for i in prange(size, nogil=True, schedule="static"):             # <<<<<<<<<<<<<<
     *                     data = tdata[i]
     *                     if ((cddummy!=0) and (fabs(data-cdummy) > cddummy)) or ((cddummy==0) and (data!=cdummy)):
     */
          {
              #ifdef WITH_THREAD
              PyThreadState *_save = NULL;
              #endif
              Py_UNBLOCK_THREADS
              /*try:*/ {
                __pyx_t_3 = __pyx_v_size;
                if (1 == 0) abort();
                {
                    #if ((defined(__APPLE__) || defined(__OSX__)) && (defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))))
                        #undef likely
                        #undef unlikely
                        #define likely(x)   (x)
                        #define unlikely(x) (x)
                    #endif
                    __pyx_t_18 = (__pyx_t_3 - 0) / 1;
                    if (__pyx_t_18 > 0)
                    {
                        #ifdef _OPENMP
                        #pragma omp parallel
                        #endif /* _OPENMP */
                        {
                            #ifdef _OPENMP
                            #pragma omp for lastprivate(__pyx_v_data) firstprivate(__pyx_v_i) lastprivate(__pyx_v_i) schedule(static)
                            #endif /* _OPENMP */
                            for (__pyx_t_17 = 0; __pyx_t_17 < __pyx_t_18; __pyx_t_17++){
                                {
                                    __pyx_v_i = 0 + 1 * __pyx_t_17;
                                    /* Initialize private variables to invalid values */
                                    __pyx_v_data = ((float)__PYX_NAN);

              /* "splitBBoxLUT.pyx":752
     *             cdata = numpy.zeros(size,dtype=numpy.float32)
     *             if do_dummy:
     *                 for i in prange(size, nogil=True, schedule="static"):             # <<<<<<<<<<<<<<
     *                     data = tdata[i]
     *                     if ((cddummy!=0) and (fabs(data-cdummy) > cddummy)) or ((cddummy==0) and (data!=cdummy)):
     */
              /*finally:*/ {
                int __pyx_why;
                __pyx_why = 0; goto __pyx_L13;
                __pyx_L11: __pyx_why = 3; goto __pyx_L13;
                __pyx_L12: __pyx_why = 4; goto __pyx_L13;
                __pyx_L13:;
                Py_BLOCK_THREADS
                switch (__pyx_why) {
                  case 3: goto __pyx_L0;
                  case 4: goto __pyx_L1_error;
                }
              }
          }
          goto __pyx_L10;
        }
        /*else*/ {

     753:                     data = tdata[i]

                                    /* "splitBBoxLUT.pyx":753
     *             if do_dummy:
     *                 for i in prange(size, nogil=True, schedule="static"):
     *                     data = tdata[i]             # <<<<<<<<<<<<<<
     *                     if ((cddummy!=0) and (fabs(data-cdummy) > cddummy)) or ((cddummy==0) and (data!=cdummy)):
     *                         #Nota: -= and /= operatore are seen as reduction in cython parallel.
     */
                                    __pyx_t_19 = __pyx_v_i;
                                    __pyx_v_data = (*((float *) ( /* dim=0 */ (__pyx_v_tdata.data + __pyx_t_19 * __pyx_v_tdata.strides[0]) )));

     754:                     if ((cddummy!=0) and (fabs(data-cdummy) > cddummy)) or ((cddummy==0) and (data!=cdummy)):

                                    /* "splitBBoxLUT.pyx":754
     *                 for i in prange(size, nogil=True, schedule="static"):
     *                     data = tdata[i]
     *                     if ((cddummy!=0) and (fabs(data-cdummy) > cddummy)) or ((cddummy==0) and (data!=cdummy)):             # <<<<<<<<<<<<<<
     *                         #Nota: -= and /= operatore are seen as reduction in cython parallel.
     *                         if do_dark:
     */
                                    __pyx_t_14 = (__pyx_v_cddummy != 0.0);
                                    if (__pyx_t_14) {
                                      __pyx_t_20 = (fabs((__pyx_v_data - __pyx_v_cdummy)) > __pyx_v_cddummy);
                                      __pyx_t_21 = __pyx_t_20;
                                    } else {
                                      __pyx_t_21 = __pyx_t_14;
                                    }
                                    if (!__pyx_t_21) {
                                      __pyx_t_14 = (__pyx_v_cddummy == 0.0);
                                      if (__pyx_t_14) {
                                        __pyx_t_20 = (__pyx_v_data != __pyx_v_cdummy);
                                        __pyx_t_22 = __pyx_t_20;
                                      } else {
                                        __pyx_t_22 = __pyx_t_14;
                                      }
                                      __pyx_t_14 = __pyx_t_22;
                                    } else {
                                      __pyx_t_14 = __pyx_t_21;
                                    }
                                    if (__pyx_t_14) {

     755:                         #Nota: -= and /= operatore are seen as reduction in cython parallel.

     756:                         if do_dark:

                                      /* "splitBBoxLUT.pyx":756
     *                     if ((cddummy!=0) and (fabs(data-cdummy) > cddummy)) or ((cddummy==0) and (data!=cdummy)):
     *                         #Nota: -= and /= operatore are seen as reduction in cython parallel.
     *                         if do_dark:             # <<<<<<<<<<<<<<
     *                             data = data - cdark[i]
     *                         if do_flat:
     */
                                      if (__pyx_v_do_dark) {

     757:                             data = data - cdark[i]

                                        /* "splitBBoxLUT.pyx":757
     *                         #Nota: -= and /= operatore are seen as reduction in cython parallel.
     *                         if do_dark:
     *                             data = data - cdark[i]             # <<<<<<<<<<<<<<
     *                         if do_flat:
     *                             data = data / cflat[i]
     */
                                        if (unlikely(!__pyx_v_cdark.memview)) { __Pyx_RaiseUnboundMemoryviewSliceNogil("cdark"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 757; __pyx_clineno = __LINE__; goto __pyx_L16_error;} }
                                        __pyx_t_23 = __pyx_v_i;
                                        __pyx_v_data = (__pyx_v_data - (*((float *) ( /* dim=0 */ (__pyx_v_cdark.data + __pyx_t_23 * __pyx_v_cdark.strides[0]) ))));
                                        goto __pyx_L19;
                                      }
                                      __pyx_L19:;

     758:                         if do_flat:

                                      /* "splitBBoxLUT.pyx":758
     *                         if do_dark:
     *                             data = data - cdark[i]
     *                         if do_flat:             # <<<<<<<<<<<<<<
     *                             data = data / cflat[i]
     *                         if do_polarization:
     */
                                      if (__pyx_v_do_flat) {

     759:                             data = data / cflat[i]

                                        /* "splitBBoxLUT.pyx":759
     *                             data = data - cdark[i]
     *                         if do_flat:
     *                             data = data / cflat[i]             # <<<<<<<<<<<<<<
     *                         if do_polarization:
     *                             data = data / cpolarization[i]
     */
                                        if (unlikely(!__pyx_v_cflat.memview)) { __Pyx_RaiseUnboundMemoryviewSliceNogil("cflat"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L16_error;} }
                                        __pyx_t_24 = __pyx_v_i;
                                        __pyx_v_data = (__pyx_v_data / (*((float *) ( /* dim=0 */ (__pyx_v_cflat.data + __pyx_t_24 * __pyx_v_cflat.strides[0]) ))));
                                        goto __pyx_L20;
                                      }
                                      __pyx_L20:;

     760:                         if do_polarization:

                                      /* "splitBBoxLUT.pyx":760
     *                         if do_flat:
     *                             data = data / cflat[i]
     *                         if do_polarization:             # <<<<<<<<<<<<<<
     *                             data = data / cpolarization[i]
     *                         if do_solidAngle:
     */
                                      if (__pyx_v_do_polarization) {

     761:                             data = data / cpolarization[i]

                                        /* "splitBBoxLUT.pyx":761
     *                             data = data / cflat[i]
     *                         if do_polarization:
     *                             data = data / cpolarization[i]             # <<<<<<<<<<<<<<
     *                         if do_solidAngle:
     *                             data = data / csolidAngle[i]
     */
                                        if (unlikely(!__pyx_v_cpolarization.memview)) { __Pyx_RaiseUnboundMemoryviewSliceNogil("cpolarization"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 761; __pyx_clineno = __LINE__; goto __pyx_L16_error;} }
                                        __pyx_t_25 = __pyx_v_i;
                                        __pyx_v_data = (__pyx_v_data / (*((float *) ( /* dim=0 */ (__pyx_v_cpolarization.data + __pyx_t_25 * __pyx_v_cpolarization.strides[0]) ))));
                                        goto __pyx_L21;
                                      }
                                      __pyx_L21:;

     762:                         if do_solidAngle:

                                      /* "splitBBoxLUT.pyx":762
     *                         if do_polarization:
     *                             data = data / cpolarization[i]
     *                         if do_solidAngle:             # <<<<<<<<<<<<<<
     *                             data = data / csolidAngle[i]
     *                         cdata[i]+=data
     */
                                      if (__pyx_v_do_solidAngle) {

     763:                             data = data / csolidAngle[i]

                                        /* "splitBBoxLUT.pyx":763
     *                             data = data / cpolarization[i]
     *                         if do_solidAngle:
     *                             data = data / csolidAngle[i]             # <<<<<<<<<<<<<<
     *                         cdata[i]+=data
     *                     else: #set all dummy_like values to cdummy. simplifies further processing
     */
                                        if (unlikely(!__pyx_v_csolidAngle.memview)) { __Pyx_RaiseUnboundMemoryviewSliceNogil("csolidAngle"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 763; __pyx_clineno = __LINE__; goto __pyx_L16_error;} }
                                        __pyx_t_26 = __pyx_v_i;
                                        __pyx_v_data = (__pyx_v_data / (*((float *) ( /* dim=0 */ (__pyx_v_csolidAngle.data + __pyx_t_26 * __pyx_v_csolidAngle.strides[0]) ))));
                                        goto __pyx_L22;
                                      }
                                      __pyx_L22:;

     764:                         cdata[i]+=data

                                      /* "splitBBoxLUT.pyx":764
     *                         if do_solidAngle:
     *                             data = data / csolidAngle[i]
     *                         cdata[i]+=data             # <<<<<<<<<<<<<<
     *                     else: #set all dummy_like values to cdummy. simplifies further processing
     *                         cdata[i]+=cdummy
     */
                                      __pyx_t_27 = __pyx_v_i;
                                      *((float *) ( /* dim=0 */ (__pyx_v_cdata.data + __pyx_t_27 * __pyx_v_cdata.strides[0]) )) += __pyx_v_data;
                                      goto __pyx_L18;
                                    }
                                    /*else*/ {

     765:                     else: #set all dummy_like values to cdummy. simplifies further processing

     766:                         cdata[i]+=cdummy

                                      /* "splitBBoxLUT.pyx":766
     *                         cdata[i]+=data
     *                     else: #set all dummy_like values to cdummy. simplifies further processing
     *                         cdata[i]+=cdummy             # <<<<<<<<<<<<<<
     *             else:
     *                 for i in prange(size, nogil=True, schedule="static"):
     */
                                      __pyx_t_28 = __pyx_v_i;
                                      *((float *) ( /* dim=0 */ (__pyx_v_cdata.data + __pyx_t_28 * __pyx_v_cdata.strides[0]) )) += __pyx_v_cdummy;
                                    }
                                    __pyx_L18:;
                                    goto __pyx_L24;
                                    __pyx_L16_error:;
                                    {
                                        #ifdef WITH_THREAD
                                        PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
                                        #endif
                                        #ifdef _OPENMP
                                        #pragma omp flush(__pyx_parallel_exc_type)
                                        #endif /* _OPENMP */
                                        if (!__pyx_parallel_exc_type) {
                                          __Pyx_ErrFetch(&__pyx_parallel_exc_type, &__pyx_parallel_exc_value, &__pyx_parallel_exc_tb);
                                          __pyx_parallel_filename = __pyx_filename; __pyx_parallel_lineno = __pyx_lineno; __pyx_parallel_clineno = __pyx_clineno;
                                          __Pyx_GOTREF(__pyx_parallel_exc_type);
                                        }
                                        #ifdef WITH_THREAD
                                        PyGILState_Release(__pyx_gilstate_save);
                                        #endif
                                    }
                                    __pyx_parallel_why = 4;
                                    goto __pyx_L23;
                                    __pyx_L23:;
                                    #ifdef _OPENMP
                                    #pragma omp critical(__pyx_parallel_lastprivates2)
                                    #endif /* _OPENMP */
                                    {
                                        __pyx_parallel_temp0 = __pyx_v_data;
                                        __pyx_parallel_temp1 = __pyx_v_i;
                                    }
                                    __pyx_L24:;
                                    #ifdef _OPENMP
                                    #pragma omp flush(__pyx_parallel_why)
                                    #endif /* _OPENMP */
                                }
                            }
                            #ifdef _OPENMP
                            Py_END_ALLOW_THREADS
                            #else
    {
    #ifdef WITH_THREAD
                            PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
                            #endif
                            #endif /* _OPENMP */
                            /* Clean up any temporaries */
                            #ifdef WITH_THREAD
                            PyGILState_Release(__pyx_gilstate_save);
                            #endif
                            #ifndef _OPENMP
    }
    #endif /* _OPENMP */
                        }
                    }
                    if (__pyx_parallel_exc_type) {
                      /* This may have been overridden by a continue, break or return in another thread. Prefer the error. */
                      __pyx_parallel_why = 4;
                    }
                    if (__pyx_parallel_why) {
                      __pyx_v_data = __pyx_parallel_temp0;
                      __pyx_v_i = __pyx_parallel_temp1;
                      switch (__pyx_parallel_why) {
                            case 3: goto __pyx_L11;
                            case 4:
                        {
                            #ifdef WITH_THREAD
                            PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
                            #endif
                            __Pyx_ErrRestore(__pyx_parallel_exc_type, __pyx_parallel_exc_value, __pyx_parallel_exc_tb);
                            __pyx_filename = __pyx_parallel_filename; __pyx_lineno = __pyx_parallel_lineno; __pyx_clineno = __pyx_parallel_clineno;
                            __Pyx_GIVEREF(__pyx_parallel_exc_type);
                            #ifdef WITH_THREAD
                            PyGILState_Release(__pyx_gilstate_save);
                            #endif
                        }
                        goto __pyx_L12;
                      }
                    }
                }
                #if ((defined(__APPLE__) || defined(__OSX__)) && (defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))))
                    #undef likely
                    #undef unlikely
                    #define likely(x)   __builtin_expect(!!(x), 1)
                    #define unlikely(x) __builtin_expect(!!(x), 0)
                #endif
              }

     767:             else:

     768:                 for i in prange(size, nogil=True, schedule="static"):

          /* "splitBBoxLUT.pyx":768
     *                         cdata[i]+=cdummy
     *             else:
     *                 for i in prange(size, nogil=True, schedule="static"):             # <<<<<<<<<<<<<<
     *                     data = tdata[i]
     *                     if do_dark:
     */
          {
              #ifdef WITH_THREAD
              PyThreadState *_save = NULL;
              #endif
              Py_UNBLOCK_THREADS
              /*try:*/ {
                __pyx_t_18 = __pyx_v_size;
                if (1 == 0) abort();
                {
                    #if ((defined(__APPLE__) || defined(__OSX__)) && (defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))))
                        #undef likely
                        #undef unlikely
                        #define likely(x)   (x)
                        #define unlikely(x) (x)
                    #endif
                    __pyx_t_3 = (__pyx_t_18 - 0) / 1;
                    if (__pyx_t_3 > 0)
                    {
                        #ifdef _OPENMP
                        #pragma omp parallel
                        #endif /* _OPENMP */
                        {
                            #ifdef _OPENMP
                            #pragma omp for lastprivate(__pyx_v_data) firstprivate(__pyx_v_i) lastprivate(__pyx_v_i) schedule(static)
                            #endif /* _OPENMP */
                            for (__pyx_t_17 = 0; __pyx_t_17 < __pyx_t_3; __pyx_t_17++){
                                {
                                    __pyx_v_i = 0 + 1 * __pyx_t_17;
                                    /* Initialize private variables to invalid values */
                                    __pyx_v_data = ((float)__PYX_NAN);

              /* "splitBBoxLUT.pyx":768
     *                         cdata[i]+=cdummy
     *             else:
     *                 for i in prange(size, nogil=True, schedule="static"):             # <<<<<<<<<<<<<<
     *                     data = tdata[i]
     *                     if do_dark:
     */
              /*finally:*/ {
                int __pyx_why;
                __pyx_why = 0; goto __pyx_L28;
                __pyx_L26: __pyx_why = 3; goto __pyx_L28;
                __pyx_L27: __pyx_why = 4; goto __pyx_L28;
                __pyx_L28:;
                Py_BLOCK_THREADS
                switch (__pyx_why) {
                  case 3: goto __pyx_L0;
                  case 4: goto __pyx_L1_error;
                }
              }
          }
        }
        __pyx_L10:;
        goto __pyx_L9;
      }
      /*else*/ {

     769:                     data = tdata[i]

                                    /* "splitBBoxLUT.pyx":769
     *             else:
     *                 for i in prange(size, nogil=True, schedule="static"):
     *                     data = tdata[i]             # <<<<<<<<<<<<<<
     *                     if do_dark:
     *                         data = data - cdark[i]
     */
                                    __pyx_t_29 = __pyx_v_i;
                                    __pyx_v_data = (*((float *) ( /* dim=0 */ (__pyx_v_tdata.data + __pyx_t_29 * __pyx_v_tdata.strides[0]) )));

     770:                     if do_dark:

                                    /* "splitBBoxLUT.pyx":770
     *                 for i in prange(size, nogil=True, schedule="static"):
     *                     data = tdata[i]
     *                     if do_dark:             # <<<<<<<<<<<<<<
     *                         data = data - cdark[i]
     *                     if do_flat:
     */
                                    if (__pyx_v_do_dark) {

     771:                         data = data - cdark[i]

                                      /* "splitBBoxLUT.pyx":771
     *                     data = tdata[i]
     *                     if do_dark:
     *                         data = data - cdark[i]             # <<<<<<<<<<<<<<
     *                     if do_flat:
     *                         data = data / cflat[i]
     */
                                      if (unlikely(!__pyx_v_cdark.memview)) { __Pyx_RaiseUnboundMemoryviewSliceNogil("cdark"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L31_error;} }
                                      __pyx_t_30 = __pyx_v_i;
                                      __pyx_v_data = (__pyx_v_data - (*((float *) ( /* dim=0 */ (__pyx_v_cdark.data + __pyx_t_30 * __pyx_v_cdark.strides[0]) ))));
                                      goto __pyx_L33;
                                    }
                                    __pyx_L33:;

     772:                     if do_flat:

                                    /* "splitBBoxLUT.pyx":772
     *                     if do_dark:
     *                         data = data - cdark[i]
     *                     if do_flat:             # <<<<<<<<<<<<<<
     *                         data = data / cflat[i]
     *                     if do_polarization:
     */
                                    if (__pyx_v_do_flat) {

     773:                         data = data / cflat[i]

                                      /* "splitBBoxLUT.pyx":773
     *                         data = data - cdark[i]
     *                     if do_flat:
     *                         data = data / cflat[i]             # <<<<<<<<<<<<<<
     *                     if do_polarization:
     *                         data = data / cpolarization[i]
     */
                                      if (unlikely(!__pyx_v_cflat.memview)) { __Pyx_RaiseUnboundMemoryviewSliceNogil("cflat"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L31_error;} }
                                      __pyx_t_31 = __pyx_v_i;
                                      __pyx_v_data = (__pyx_v_data / (*((float *) ( /* dim=0 */ (__pyx_v_cflat.data + __pyx_t_31 * __pyx_v_cflat.strides[0]) ))));
                                      goto __pyx_L34;
                                    }
                                    __pyx_L34:;

     774:                     if do_polarization:

                                    /* "splitBBoxLUT.pyx":774
     *                     if do_flat:
     *                         data = data / cflat[i]
     *                     if do_polarization:             # <<<<<<<<<<<<<<
     *                         data = data / cpolarization[i]
     *                     if do_solidAngle:
     */
                                    if (__pyx_v_do_polarization) {

     775:                         data = data / cpolarization[i]

                                      /* "splitBBoxLUT.pyx":775
     *                         data = data / cflat[i]
     *                     if do_polarization:
     *                         data = data / cpolarization[i]             # <<<<<<<<<<<<<<
     *                     if do_solidAngle:
     *                         data = data / csolidAngle[i]
     */
                                      if (unlikely(!__pyx_v_cpolarization.memview)) { __Pyx_RaiseUnboundMemoryviewSliceNogil("cpolarization"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 775; __pyx_clineno = __LINE__; goto __pyx_L31_error;} }
                                      __pyx_t_32 = __pyx_v_i;
                                      __pyx_v_data = (__pyx_v_data / (*((float *) ( /* dim=0 */ (__pyx_v_cpolarization.data + __pyx_t_32 * __pyx_v_cpolarization.strides[0]) ))));
                                      goto __pyx_L35;
                                    }
                                    __pyx_L35:;

     776:                     if do_solidAngle:

                                    /* "splitBBoxLUT.pyx":776
     *                     if do_polarization:
     *                         data = data / cpolarization[i]
     *                     if do_solidAngle:             # <<<<<<<<<<<<<<
     *                         data = data / csolidAngle[i]
     *                     cdata[i]+=data
     */
                                    if (__pyx_v_do_solidAngle) {

     777:                         data = data / csolidAngle[i]

                                      /* "splitBBoxLUT.pyx":777
     *                         data = data / cpolarization[i]
     *                     if do_solidAngle:
     *                         data = data / csolidAngle[i]             # <<<<<<<<<<<<<<
     *                     cdata[i]+=data
     *         else:
     */
                                      if (unlikely(!__pyx_v_csolidAngle.memview)) { __Pyx_RaiseUnboundMemoryviewSliceNogil("csolidAngle"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 777; __pyx_clineno = __LINE__; goto __pyx_L31_error;} }
                                      __pyx_t_33 = __pyx_v_i;
                                      __pyx_v_data = (__pyx_v_data / (*((float *) ( /* dim=0 */ (__pyx_v_csolidAngle.data + __pyx_t_33 * __pyx_v_csolidAngle.strides[0]) ))));
                                      goto __pyx_L36;
                                    }
                                    __pyx_L36:;

     778:                     cdata[i]+=data

                                    /* "splitBBoxLUT.pyx":778
     *                     if do_solidAngle:
     *                         data = data / csolidAngle[i]
     *                     cdata[i]+=data             # <<<<<<<<<<<<<<
     *         else:
     *             if do_dummy:
     */
                                    __pyx_t_34 = __pyx_v_i;
                                    *((float *) ( /* dim=0 */ (__pyx_v_cdata.data + __pyx_t_34 * __pyx_v_cdata.strides[0]) )) += __pyx_v_data;
                                    goto __pyx_L38;
                                    __pyx_L31_error:;
                                    {
                                        #ifdef WITH_THREAD
                                        PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
                                        #endif
                                        #ifdef _OPENMP
                                        #pragma omp flush(__pyx_parallel_exc_type)
                                        #endif /* _OPENMP */
                                        if (!__pyx_parallel_exc_type) {
                                          __Pyx_ErrFetch(&__pyx_parallel_exc_type, &__pyx_parallel_exc_value, &__pyx_parallel_exc_tb);
                                          __pyx_parallel_filename = __pyx_filename; __pyx_parallel_lineno = __pyx_lineno; __pyx_parallel_clineno = __pyx_clineno;
                                          __Pyx_GOTREF(__pyx_parallel_exc_type);
                                        }
                                        #ifdef WITH_THREAD
                                        PyGILState_Release(__pyx_gilstate_save);
                                        #endif
                                    }
                                    __pyx_parallel_why = 4;
                                    goto __pyx_L37;
                                    __pyx_L37:;
                                    #ifdef _OPENMP
                                    #pragma omp critical(__pyx_parallel_lastprivates3)
                                    #endif /* _OPENMP */
                                    {
                                        __pyx_parallel_temp0 = __pyx_v_data;
                                        __pyx_parallel_temp1 = __pyx_v_i;
                                    }
                                    __pyx_L38:;
                                    #ifdef _OPENMP
                                    #pragma omp flush(__pyx_parallel_why)
                                    #endif /* _OPENMP */
                                }
                            }
                            #ifdef _OPENMP
                            Py_END_ALLOW_THREADS
                            #else
    {
    #ifdef WITH_THREAD
                            PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
                            #endif
                            #endif /* _OPENMP */
                            /* Clean up any temporaries */
                            #ifdef WITH_THREAD
                            PyGILState_Release(__pyx_gilstate_save);
                            #endif
                            #ifndef _OPENMP
    }
    #endif /* _OPENMP */
                        }
                    }
                    if (__pyx_parallel_exc_type) {
                      /* This may have been overridden by a continue, break or return in another thread. Prefer the error. */
                      __pyx_parallel_why = 4;
                    }
                    if (__pyx_parallel_why) {
                      __pyx_v_data = __pyx_parallel_temp0;
                      __pyx_v_i = __pyx_parallel_temp1;
                      switch (__pyx_parallel_why) {
                            case 3: goto __pyx_L26;
                            case 4:
                        {
                            #ifdef WITH_THREAD
                            PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
                            #endif
                            __Pyx_ErrRestore(__pyx_parallel_exc_type, __pyx_parallel_exc_value, __pyx_parallel_exc_tb);
                            __pyx_filename = __pyx_parallel_filename; __pyx_lineno = __pyx_parallel_lineno; __pyx_clineno = __pyx_parallel_clineno;
                            __Pyx_GIVEREF(__pyx_parallel_exc_type);
                            #ifdef WITH_THREAD
                            PyGILState_Release(__pyx_gilstate_save);
                            #endif
                        }
                        goto __pyx_L27;
                      }
                    }
                }
                #if ((defined(__APPLE__) || defined(__OSX__)) && (defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))))
                    #undef likely
                    #undef unlikely
                    #define likely(x)   __builtin_expect(!!(x), 1)
                    #define unlikely(x) __builtin_expect(!!(x), 0)
                #endif
              }

     779:         else:

     780:             if do_dummy:

        /* "splitBBoxLUT.pyx":780
     *                     cdata[i]+=data
     *         else:
     *             if do_dummy:             # <<<<<<<<<<<<<<
     *                 tdata = numpy.ascontiguousarray(weights.ravel(), dtype=numpy.float32)
     *                 cdata = numpy.zeros(size,dtype=numpy.float32)
     */
        if (__pyx_v_do_dummy) {

     781:                 tdata = numpy.ascontiguousarray(weights.ravel(), dtype=numpy.float32)

          /* "splitBBoxLUT.pyx":781
     *         else:
     *             if do_dummy:
     *                 tdata = numpy.ascontiguousarray(weights.ravel(), dtype=numpy.float32)             # <<<<<<<<<<<<<<
     *                 cdata = numpy.zeros(size,dtype=numpy.float32)
     *                 for i in prange(size, nogil=True, schedule="static"):
     */
          __pyx_t_6 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 781; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_6);
          __pyx_t_1 = PyObject_GetAttr(__pyx_t_6, __pyx_n_s__ascontiguousarray); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 781; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          __pyx_t_6 = PyObject_GetAttr(__pyx_v_weights, __pyx_n_s__ravel); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 781; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_6);
          __pyx_t_4 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 781; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 781; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_6);
          PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4);
          __Pyx_GIVEREF(__pyx_t_4);
          __pyx_t_4 = 0;
          __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 781; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(((PyObject *)__pyx_t_4));
          __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 781; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_5);
          __pyx_t_2 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__float32); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 781; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          if (PyDict_SetItem(__pyx_t_4, ((PyObject *)__pyx_n_s__dtype), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 781; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_6), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 781; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
          __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
          __pyx_t_16 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(__pyx_t_2);
          if (unlikely(!__pyx_t_16.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 781; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __pyx_v_tdata = __pyx_t_16;
          __pyx_t_16.memview = NULL;
          __pyx_t_16.data = NULL;

     782:                 cdata = numpy.zeros(size,dtype=numpy.float32)

          /* "splitBBoxLUT.pyx":782
     *             if do_dummy:
     *                 tdata = numpy.ascontiguousarray(weights.ravel(), dtype=numpy.float32)
     *                 cdata = numpy.zeros(size,dtype=numpy.float32)             # <<<<<<<<<<<<<<
     *                 for i in prange(size, nogil=True, schedule="static"):
     *                     data = tdata[i]
     */
          __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 782; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_4 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__zeros); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 782; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __pyx_t_2 = PyInt_FromLong(__pyx_v_size); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 782; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 782; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_6);
          PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2);
          __Pyx_GIVEREF(__pyx_t_2);
          __pyx_t_2 = 0;
          __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 782; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(((PyObject *)__pyx_t_2));
          __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 782; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_5 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__float32); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 782; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__dtype), __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 782; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __pyx_t_5 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_6), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 782; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
          __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
          __pyx_t_16 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(__pyx_t_5);
          if (unlikely(!__pyx_t_16.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 782; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __pyx_v_cdata = __pyx_t_16;
          __pyx_t_16.memview = NULL;
          __pyx_t_16.data = NULL;

     783:                 for i in prange(size, nogil=True, schedule="static"):

          /* "splitBBoxLUT.pyx":783
     *                 tdata = numpy.ascontiguousarray(weights.ravel(), dtype=numpy.float32)
     *                 cdata = numpy.zeros(size,dtype=numpy.float32)
     *                 for i in prange(size, nogil=True, schedule="static"):             # <<<<<<<<<<<<<<
     *                     data = tdata[i]
     *                     if ((cddummy!=0) and (fabs(data-cdummy) > cddummy)) or ((cddummy==0) and (data!=cdummy)):
     */
          {
              #ifdef WITH_THREAD
              PyThreadState *_save = NULL;
              #endif
              Py_UNBLOCK_THREADS
              /*try:*/ {
                __pyx_t_3 = __pyx_v_size;
                if (1 == 0) abort();
                {
                    #if ((defined(__APPLE__) || defined(__OSX__)) && (defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))))
                        #undef likely
                        #undef unlikely
                        #define likely(x)   (x)
                        #define unlikely(x) (x)
                    #endif
                    __pyx_t_18 = (__pyx_t_3 - 0) / 1;
                    if (__pyx_t_18 > 0)
                    {
                        #ifdef _OPENMP
                        #pragma omp parallel
                        #endif /* _OPENMP */
                        {
                            #ifdef _OPENMP
                            #pragma omp for lastprivate(__pyx_v_data) firstprivate(__pyx_v_i) lastprivate(__pyx_v_i) schedule(static)
                            #endif /* _OPENMP */
                            for (__pyx_t_17 = 0; __pyx_t_17 < __pyx_t_18; __pyx_t_17++){
                                {
                                    __pyx_v_i = 0 + 1 * __pyx_t_17;
                                    /* Initialize private variables to invalid values */
                                    __pyx_v_data = ((float)__PYX_NAN);

              /* "splitBBoxLUT.pyx":783
     *                 tdata = numpy.ascontiguousarray(weights.ravel(), dtype=numpy.float32)
     *                 cdata = numpy.zeros(size,dtype=numpy.float32)
     *                 for i in prange(size, nogil=True, schedule="static"):             # <<<<<<<<<<<<<<
     *                     data = tdata[i]
     *                     if ((cddummy!=0) and (fabs(data-cdummy) > cddummy)) or ((cddummy==0) and (data!=cdummy)):
     */
              /*finally:*/ {
                Py_BLOCK_THREADS
              }
          }
          goto __pyx_L40;
        }
        /*else*/ {

     784:                     data = tdata[i]

                                    /* "splitBBoxLUT.pyx":784
     *                 cdata = numpy.zeros(size,dtype=numpy.float32)
     *                 for i in prange(size, nogil=True, schedule="static"):
     *                     data = tdata[i]             # <<<<<<<<<<<<<<
     *                     if ((cddummy!=0) and (fabs(data-cdummy) > cddummy)) or ((cddummy==0) and (data!=cdummy)):
     *                         cdata[i]+=data
     */
                                    __pyx_t_35 = __pyx_v_i;
                                    __pyx_v_data = (*((float *) ( /* dim=0 */ (__pyx_v_tdata.data + __pyx_t_35 * __pyx_v_tdata.strides[0]) )));

     785:                     if ((cddummy!=0) and (fabs(data-cdummy) > cddummy)) or ((cddummy==0) and (data!=cdummy)):

                                    /* "splitBBoxLUT.pyx":785
     *                 for i in prange(size, nogil=True, schedule="static"):
     *                     data = tdata[i]
     *                     if ((cddummy!=0) and (fabs(data-cdummy) > cddummy)) or ((cddummy==0) and (data!=cdummy)):             # <<<<<<<<<<<<<<
     *                         cdata[i]+=data
     *                     else:
     */
                                    __pyx_t_14 = (__pyx_v_cddummy != 0.0);
                                    if (__pyx_t_14) {
                                      __pyx_t_21 = (fabs((__pyx_v_data - __pyx_v_cdummy)) > __pyx_v_cddummy);
                                      __pyx_t_22 = __pyx_t_21;
                                    } else {
                                      __pyx_t_22 = __pyx_t_14;
                                    }
                                    if (!__pyx_t_22) {
                                      __pyx_t_14 = (__pyx_v_cddummy == 0.0);
                                      if (__pyx_t_14) {
                                        __pyx_t_21 = (__pyx_v_data != __pyx_v_cdummy);
                                        __pyx_t_20 = __pyx_t_21;
                                      } else {
                                        __pyx_t_20 = __pyx_t_14;
                                      }
                                      __pyx_t_14 = __pyx_t_20;
                                    } else {
                                      __pyx_t_14 = __pyx_t_22;
                                    }
                                    if (__pyx_t_14) {

     786:                         cdata[i]+=data

                                      /* "splitBBoxLUT.pyx":786
     *                     data = tdata[i]
     *                     if ((cddummy!=0) and (fabs(data-cdummy) > cddummy)) or ((cddummy==0) and (data!=cdummy)):
     *                         cdata[i]+=data             # <<<<<<<<<<<<<<
     *                     else:
     *                         cdata[i]+=cdummy
     */
                                      __pyx_t_36 = __pyx_v_i;
                                      *((float *) ( /* dim=0 */ (__pyx_v_cdata.data + __pyx_t_36 * __pyx_v_cdata.strides[0]) )) += __pyx_v_data;
                                      goto __pyx_L48;
                                    }
                                    /*else*/ {

     787:                     else:

     788:                         cdata[i]+=cdummy

                                      /* "splitBBoxLUT.pyx":788
     *                         cdata[i]+=data
     *                     else:
     *                         cdata[i]+=cdummy             # <<<<<<<<<<<<<<
     *             else:
     *                 cdata = numpy.ascontiguousarray(weights.ravel(), dtype=numpy.float32)
     */
                                      __pyx_t_37 = __pyx_v_i;
                                      *((float *) ( /* dim=0 */ (__pyx_v_cdata.data + __pyx_t_37 * __pyx_v_cdata.strides[0]) )) += __pyx_v_cdummy;
                                    }
                                    __pyx_L48:;
                                }
                            }
                        }
                    }
                }
                #if ((defined(__APPLE__) || defined(__OSX__)) && (defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))))
                    #undef likely
                    #undef unlikely
                    #define likely(x)   __builtin_expect(!!(x), 1)
                    #define unlikely(x) __builtin_expect(!!(x), 0)
                #endif
              }

     789:             else:

     790:                 cdata = numpy.ascontiguousarray(weights.ravel(), dtype=numpy.float32)

          /* "splitBBoxLUT.pyx":790
     *                         cdata[i]+=cdummy
     *             else:
     *                 cdata = numpy.ascontiguousarray(weights.ravel(), dtype=numpy.float32)             # <<<<<<<<<<<<<<
     *
     *         for i in prange(bins, nogil=True, schedule="guided"):
     */
          __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 790; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_5);
          __pyx_t_2 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__ascontiguousarray); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 790; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __pyx_t_5 = PyObject_GetAttr(__pyx_v_weights, __pyx_n_s__ravel); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 790; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_5);
          __pyx_t_6 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 790; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 790; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_5);
          PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6);
          __Pyx_GIVEREF(__pyx_t_6);
          __pyx_t_6 = 0;
          __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 790; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(((PyObject *)__pyx_t_6));
          __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 790; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_4);
          __pyx_t_1 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__float32); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 790; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (PyDict_SetItem(__pyx_t_6, ((PyObject *)__pyx_n_s__dtype), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 790; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_5), ((PyObject *)__pyx_t_6)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 790; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
          __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
          __pyx_t_16 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(__pyx_t_1);
          if (unlikely(!__pyx_t_16.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 790; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __pyx_v_cdata = __pyx_t_16;
          __pyx_t_16.memview = NULL;
          __pyx_t_16.data = NULL;
        }
        __pyx_L40:;
      }
      __pyx_L9:;

     791:

     792:         for i in prange(bins, nogil=True, schedule="guided"):

      /* "splitBBoxLUT.pyx":792
     *                 cdata = numpy.ascontiguousarray(weights.ravel(), dtype=numpy.float32)
     *
     *         for i in prange(bins, nogil=True, schedule="guided"):             # <<<<<<<<<<<<<<
     *             sum_data = 0.0
     *             sum_count = 0.0
     */
      {
          #ifdef WITH_THREAD
          PyThreadState *_save = NULL;
          #endif
          Py_UNBLOCK_THREADS
          /*try:*/ {
            __pyx_t_18 = __pyx_v_bins;
            if (1 == 0) abort();
            {
                #if ((defined(__APPLE__) || defined(__OSX__)) && (defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))))
                    #undef likely
                    #undef unlikely
                    #define likely(x)   (x)
                    #define unlikely(x) (x)
                #endif
                __pyx_t_3 = (__pyx_t_18 - 0) / 1;
                if (__pyx_t_3 > 0)
                {
                    #ifdef _OPENMP
                    #pragma omp parallel
                    #endif /* _OPENMP */
                    {
                        #ifdef _OPENMP
                        #pragma omp for lastprivate(__pyx_v_data) lastprivate(__pyx_v_sum_count) firstprivate(__pyx_v_i) lastprivate(__pyx_v_i) lastprivate(__pyx_v_j) lastprivate(__pyx_v_idx) lastprivate(__pyx_v_coef) lastprivate(__pyx_v_sum_data) schedule(guided)
                        #endif /* _OPENMP */
                        for (__pyx_t_17 = 0; __pyx_t_17 < __pyx_t_3; __pyx_t_17++){
                            {
                                __pyx_v_i = 0 + 1 * __pyx_t_17;
                                /* Initialize private variables to invalid values */
                                __pyx_v_data = ((float)__PYX_NAN);
                                __pyx_v_sum_count = ((double)__PYX_NAN);
                                __pyx_v_j = ((int)0xbad0bad0);
                                __pyx_v_idx = ((int)0xbad0bad0);
                                __pyx_v_coef = ((float)__PYX_NAN);
                                __pyx_v_sum_data = ((double)__PYX_NAN);

          /* "splitBBoxLUT.pyx":792
     *                 cdata = numpy.ascontiguousarray(weights.ravel(), dtype=numpy.float32)
     *
     *         for i in prange(bins, nogil=True, schedule="guided"):             # <<<<<<<<<<<<<<
     *             sum_data = 0.0
     *             sum_count = 0.0
     */
          /*finally:*/ {
            Py_BLOCK_THREADS
          }
      }

     793:             sum_data = 0.0

                                /* "splitBBoxLUT.pyx":793
     *
     *         for i in prange(bins, nogil=True, schedule="guided"):
     *             sum_data = 0.0             # <<<<<<<<<<<<<<
     *             sum_count = 0.0
     *             for j in range(lut_size):
     */
                                __pyx_v_sum_data = 0.0;

     794:             sum_count = 0.0

                                /* "splitBBoxLUT.pyx":794
     *         for i in prange(bins, nogil=True, schedule="guided"):
     *             sum_data = 0.0
     *             sum_count = 0.0             # <<<<<<<<<<<<<<
     *             for j in range(lut_size):
     *                 idx = lut[i, j].idx
     */
                                __pyx_v_sum_count = 0.0;

     795:             for j in range(lut_size):

                                /* "splitBBoxLUT.pyx":795
     *             sum_data = 0.0
     *             sum_count = 0.0
     *             for j in range(lut_size):             # <<<<<<<<<<<<<<
     *                 idx = lut[i, j].idx
     *                 coef = lut[i, j].coef
     */
                                __pyx_t_38 = __pyx_v_lut_size;
                                for (__pyx_t_39 = 0; __pyx_t_39 < __pyx_t_38; __pyx_t_39+=1) {
                                  __pyx_v_j = __pyx_t_39;

     796:                 idx = lut[i, j].idx

                                  /* "splitBBoxLUT.pyx":796
     *             sum_count = 0.0
     *             for j in range(lut_size):
     *                 idx = lut[i, j].idx             # <<<<<<<<<<<<<<
     *                 coef = lut[i, j].coef
     *                 if idx <= 0 and coef <= 0.0:
     */
                                  __pyx_t_40 = __pyx_v_i;
                                  __pyx_t_41 = __pyx_v_j;
                                  __pyx_t_42 = (*((struct __pyx_t_12splitBBoxLUT_lut_point *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_lut.data + __pyx_t_40 * __pyx_v_lut.strides[0]) ) + __pyx_t_41 * __pyx_v_lut.strides[1]) ))).idx;
                                  __pyx_v_idx = __pyx_t_42;

     797:                 coef = lut[i, j].coef

                                  /* "splitBBoxLUT.pyx":797
     *             for j in range(lut_size):
     *                 idx = lut[i, j].idx
     *                 coef = lut[i, j].coef             # <<<<<<<<<<<<<<
     *                 if idx <= 0 and coef <= 0.0:
     *                     break
     */
                                  __pyx_t_43 = __pyx_v_i;
                                  __pyx_t_44 = __pyx_v_j;
                                  __pyx_t_45 = (*((struct __pyx_t_12splitBBoxLUT_lut_point *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_lut.data + __pyx_t_43 * __pyx_v_lut.strides[0]) ) + __pyx_t_44 * __pyx_v_lut.strides[1]) ))).coef;
                                  __pyx_v_coef = __pyx_t_45;

     798:                 if idx <= 0 and coef <= 0.0:

                                  /* "splitBBoxLUT.pyx":798
     *                 idx = lut[i, j].idx
     *                 coef = lut[i, j].coef
     *                 if idx <= 0 and coef <= 0.0:             # <<<<<<<<<<<<<<
     *                     break
     *                 data = cdata[idx]
     */
                                  __pyx_t_14 = (__pyx_v_idx <= 0);
                                  if (__pyx_t_14) {
                                    __pyx_t_22 = (__pyx_v_coef <= 0.0);
                                    __pyx_t_20 = __pyx_t_22;
                                  } else {
                                    __pyx_t_20 = __pyx_t_14;
                                  }
                                  if (__pyx_t_20) {

     799:                     break

                                    /* "splitBBoxLUT.pyx":799
     *                 coef = lut[i, j].coef
     *                 if idx <= 0 and coef <= 0.0:
     *                     break             # <<<<<<<<<<<<<<
     *                 data = cdata[idx]
     *                 if do_dummy and data==cdummy:
     */
                                    goto __pyx_L59_break;
                                    goto __pyx_L60;
                                  }
                                  __pyx_L60:;

     800:                 data = cdata[idx]

                                  /* "splitBBoxLUT.pyx":800
     *                 if idx <= 0 and coef <= 0.0:
     *                     break
     *                 data = cdata[idx]             # <<<<<<<<<<<<<<
     *                 if do_dummy and data==cdummy:
     *                     continue
     */
                                  __pyx_t_46 = __pyx_v_idx;
                                  __pyx_v_data = (*((float *) ( /* dim=0 */ (__pyx_v_cdata.data + __pyx_t_46 * __pyx_v_cdata.strides[0]) )));

     801:                 if do_dummy and data==cdummy:

                                  /* "splitBBoxLUT.pyx":801
     *                     break
     *                 data = cdata[idx]
     *                 if do_dummy and data==cdummy:             # <<<<<<<<<<<<<<
     *                     continue
     *
     */
                                  if (__pyx_v_do_dummy) {
                                    __pyx_t_20 = (__pyx_v_data == __pyx_v_cdummy);
                                    __pyx_t_14 = __pyx_t_20;
                                  } else {
                                    __pyx_t_14 = __pyx_v_do_dummy;
                                  }
                                  if (__pyx_t_14) {

     802:                     continue

                                    /* "splitBBoxLUT.pyx":802
     *                 data = cdata[idx]
     *                 if do_dummy and data==cdummy:
     *                     continue             # <<<<<<<<<<<<<<
     *
     *                 sum_data = sum_data + coef * data
     */
                                    goto __pyx_L58_continue;
                                    goto __pyx_L61;
                                  }
                                  __pyx_L61:;

     803:

     804:                 sum_data = sum_data + coef * data

                                  /* "splitBBoxLUT.pyx":804
     *                     continue
     *
     *                 sum_data = sum_data + coef * data             # <<<<<<<<<<<<<<
     *                 sum_count = sum_count + coef
     *             outData_1d[i] += sum_data
     */
                                  __pyx_v_sum_data = (__pyx_v_sum_data + (__pyx_v_coef * __pyx_v_data));

     805:                 sum_count = sum_count + coef

                                  /* "splitBBoxLUT.pyx":805
     *
     *                 sum_data = sum_data + coef * data
     *                 sum_count = sum_count + coef             # <<<<<<<<<<<<<<
     *             outData_1d[i] += sum_data
     *             outCount_1d[i] += sum_count
     */
                                  __pyx_v_sum_count = (__pyx_v_sum_count + __pyx_v_coef);
                                  __pyx_L58_continue:;
                                }
                                __pyx_L59_break:;

     806:             outData_1d[i] += sum_data

                                /* "splitBBoxLUT.pyx":806
     *                 sum_data = sum_data + coef * data
     *                 sum_count = sum_count + coef
     *             outData_1d[i] += sum_data             # <<<<<<<<<<<<<<
     *             outCount_1d[i] += sum_count
     *             if sum_count > epsilon:
     */
                                __pyx_t_38 = __pyx_v_i;
                                *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_outData_1d.rcbuffer->pybuffer.buf, __pyx_t_38, __pyx_pybuffernd_outData_1d.diminfo[0].strides) += __pyx_v_sum_data;

     807:             outCount_1d[i] += sum_count

                                /* "splitBBoxLUT.pyx":807
     *                 sum_count = sum_count + coef
     *             outData_1d[i] += sum_data
     *             outCount_1d[i] += sum_count             # <<<<<<<<<<<<<<
     *             if sum_count > epsilon:
     *                 outMerge_1d[i] += sum_data / sum_count
     */
                                __pyx_t_39 = __pyx_v_i;
                                *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_outCount_1d.rcbuffer->pybuffer.buf, __pyx_t_39, __pyx_pybuffernd_outCount_1d.diminfo[0].strides) += __pyx_v_sum_count;

     808:             if sum_count > epsilon:

                                /* "splitBBoxLUT.pyx":808
     *             outData_1d[i] += sum_data
     *             outCount_1d[i] += sum_count
     *             if sum_count > epsilon:             # <<<<<<<<<<<<<<
     *                 outMerge_1d[i] += sum_data / sum_count
     *             else:
     */
                                __pyx_t_14 = (__pyx_v_sum_count > __pyx_v_epsilon);
                                if (__pyx_t_14) {

     809:                 outMerge_1d[i] += sum_data / sum_count

                                  /* "splitBBoxLUT.pyx":809
     *             outCount_1d[i] += sum_count
     *             if sum_count > epsilon:
     *                 outMerge_1d[i] += sum_data / sum_count             # <<<<<<<<<<<<<<
     *             else:
     *                 outMerge_1d[i] += cdummy
     */
                                  __pyx_t_47 = __pyx_v_i;
                                  *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_outMerge_1d.rcbuffer->pybuffer.buf, __pyx_t_47, __pyx_pybuffernd_outMerge_1d.diminfo[0].strides) += (__pyx_v_sum_data / __pyx_v_sum_count);
                                  goto __pyx_L62;
                                }
                                /*else*/ {

     810:             else:

     811:                 outMerge_1d[i] += cdummy

                                  /* "splitBBoxLUT.pyx":811
     *                 outMerge_1d[i] += sum_data / sum_count
     *             else:
     *                 outMerge_1d[i] += cdummy             # <<<<<<<<<<<<<<
     *         return  outMerge.T, self.outPos0, self.outPos1, outData.T, outCount.T
     *
     */
                                  __pyx_t_48 = __pyx_v_i;
                                  *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_outMerge_1d.rcbuffer->pybuffer.buf, __pyx_t_48, __pyx_pybuffernd_outMerge_1d.diminfo[0].strides) += __pyx_v_cdummy;
                                }
                                __pyx_L62:;
                            }
                        }
                    }
                }
            }
            #if ((defined(__APPLE__) || defined(__OSX__)) && (defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))))
                #undef likely
                #undef unlikely
                #define likely(x)   __builtin_expect(!!(x), 1)
                #define unlikely(x) __builtin_expect(!!(x), 0)
            #endif
          }

     812:         return  outMerge.T, self.outPos0, self.outPos1, outData.T, outCount.T

      /* "splitBBoxLUT.pyx":812
     *             else:
     *                 outMerge_1d[i] += cdummy
     *         return  outMerge.T, self.outPos0, self.outPos1, outData.T, outCount.T             # <<<<<<<<<<<<<<
     *
     * @cython.cdivision(True)
     */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_outMerge), __pyx_n_s__T); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_6 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__outPos0); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_5 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__outPos1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_v_outData), __pyx_n_s__T); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_4 = PyObject_GetAttr(((PyObject *)__pyx_v_outCount), __pyx_n_s__T); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_49 = PyTuple_New(5); if (unlikely(!__pyx_t_49)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_49);
      PyTuple_SET_ITEM(__pyx_t_49, 0, __pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_49, 1, __pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_49, 2, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_49, 3, __pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_49, 4, __pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_4);
      __pyx_t_1 = 0;
      __pyx_t_6 = 0;
      __pyx_t_5 = 0;
      __pyx_t_2 = 0;
      __pyx_t_4 = 0;
      __pyx_r = ((PyObject *)__pyx_t_49);
      __pyx_t_49 = 0;
      goto __pyx_L0;

      __pyx_r = Py_None; __Pyx_INCREF(Py_None);
      goto __pyx_L0;
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_6);
      __PYX_XDEC_MEMVIEW(&__pyx_t_13, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_16, 1);
      __Pyx_XDECREF(__pyx_t_49);
      { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
        __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
        __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_outCount.rcbuffer->pybuffer);
        __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_outCount_1d.rcbuffer->pybuffer);
        __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_outData.rcbuffer->pybuffer);
        __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_outData_1d.rcbuffer->pybuffer);
        __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_outMerge.rcbuffer->pybuffer);
        __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_outMerge_1d.rcbuffer->pybuffer);
      __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
      __Pyx_AddTraceback("splitBBoxLUT.HistoBBox2d.integrate", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      goto __pyx_L2;
      __pyx_L0:;
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_outCount.rcbuffer->pybuffer);
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_outCount_1d.rcbuffer->pybuffer);
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_outData.rcbuffer->pybuffer);
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_outData_1d.rcbuffer->pybuffer);
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_outMerge.rcbuffer->pybuffer);
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_outMerge_1d.rcbuffer->pybuffer);
      __pyx_L2:;
      __Pyx_XDECREF((PyObject *)__pyx_v_outData);
      __Pyx_XDECREF((PyObject *)__pyx_v_outCount);
      __Pyx_XDECREF((PyObject *)__pyx_v_outMerge);
      __Pyx_XDECREF((PyObject *)__pyx_v_outData_1d);
      __Pyx_XDECREF((PyObject *)__pyx_v_outCount_1d);
      __Pyx_XDECREF((PyObject *)__pyx_v_outMerge_1d);
      __PYX_XDEC_MEMVIEW(&__pyx_v_lut, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_cdata, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_tdata, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_cflat, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_cdark, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_csolidAngle, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_cpolarization, 1);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    /* Python wrapper */
    static PyObject *__pyx_pw_12splitBBoxLUT_1histoBBox2d(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
    static char __pyx_doc_12splitBBoxLUT_histoBBox2d[] = "\n    Calculate 2D histogram of pos0(tth),pos1(chi) weighted by weights\n\n    Splitting is done on the pixel's bounding box like fit2D\n\n\n    @param weights: array with intensities\n    @param pos0: 1D array with pos0: tth or q_vect\n    @param delta_pos0: 1D array with delta pos0: max center-corner distance\n    @param pos1: 1D array with pos1: chi\n    @param delta_pos1: 1D array with max pos1: max center-corner distance, unused !\n    @param bins: number of output bins (tth=100, chi=36 by default)\n    @param pos0Range: minimum and maximum  of the 2th range\n    @param pos1Range: minimum and maximum  of the chi range\n    @param dummy: value for bins without pixels & value of \"no good\" pixels\n    @param delta_dummy: precision of dummy value\n    @param mask: array (of int8) with masked pixels with 1 (0=not masked)\n    @param dark: array (of float32) with dark noise to be subtracted (or None)\n    @param flat: array (of float32) with flat-field image \n    @param polarization: array (of float32) with polarization corrections\n    @param solidangle: array (of float32) with solid angle corrections\n\n    @return  I, edges0, edges1, weighted histogram(2D), unweighted histogram (2D)\n    ";
    static PyMethodDef __pyx_mdef_12splitBBoxLUT_1histoBBox2d = {__Pyx_NAMESTR("histoBBox2d"), (PyCFunction)__pyx_pw_12splitBBoxLUT_1histoBBox2d, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_12splitBBoxLUT_histoBBox2d)};
    static PyObject *__pyx_pw_12splitBBoxLUT_1histoBBox2d(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
      PyArrayObject *__pyx_v_weights = 0;
      PyArrayObject *__pyx_v_pos0 = 0;
      PyArrayObject *__pyx_v_delta_pos0 = 0;
      PyArrayObject *__pyx_v_pos1 = 0;
      PyArrayObject *__pyx_v_delta_pos1 = 0;
      PyObject *__pyx_v_bins = 0;
      PyObject *__pyx_v_pos0Range = 0;
      PyObject *__pyx_v_pos1Range = 0;
      PyObject *__pyx_v_dummy = 0;
      PyObject *__pyx_v_delta_dummy = 0;
      PyObject *__pyx_v_mask = 0;
      PyObject *__pyx_v_dark = 0;
      PyObject *__pyx_v_flat = 0;
      PyObject *__pyx_v_solidangle = 0;
      PyObject *__pyx_v_polarization = 0;
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("histoBBox2d (wrapper)", 0);
      {
        static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__weights,&__pyx_n_s__pos0,&__pyx_n_s__delta_pos0,&__pyx_n_s__pos1,&__pyx_n_s__delta_pos1,&__pyx_n_s__bins,&__pyx_n_s__pos0Range,&__pyx_n_s__pos1Range,&__pyx_n_s__dummy,&__pyx_n_s__delta_dummy,&__pyx_n_s__mask,&__pyx_n_s__dark,&__pyx_n_s__flat,&__pyx_n_s__solidangle,&__pyx_n_s__polarization,0};
        PyObject* values[15] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};

     813:

     814: @cython.cdivision(True)

     815: @cython.boundscheck(False)

     816: @cython.wraparound(False)

     817: def histoBBox2d(numpy.ndarray weights not None,

    /* "splitBBoxLUT.pyx":817
     * @cython.boundscheck(False)
     * @cython.wraparound(False)
     * def histoBBox2d(numpy.ndarray weights not None,             # <<<<<<<<<<<<<<
     *                 numpy.ndarray pos0 not None,
     *                 numpy.ndarray delta_pos0 not None,
     */

    static PyObject *__pyx_pf_12splitBBoxLUT_histoBBox2d(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_weights, PyArrayObject *__pyx_v_pos0, PyArrayObject *__pyx_v_delta_pos0, PyArrayObject *__pyx_v_pos1, PyArrayObject *__pyx_v_delta_pos1, PyObject *__pyx_v_bins, PyObject *__pyx_v_pos0Range, PyObject *__pyx_v_pos1Range, PyObject *__pyx_v_dummy, PyObject *__pyx_v_delta_dummy, PyObject *__pyx_v_mask, PyObject *__pyx_v_dark, PyObject *__pyx_v_flat, PyObject *__pyx_v_solidangle, PyObject *__pyx_v_polarization) {
      int __pyx_v_bins0;
      int __pyx_v_bins1;
      int __pyx_v_i;
      int __pyx_v_j;
      int __pyx_v_idx;
      size_t __pyx_v_size;
      PyArrayObject *__pyx_v_cdata = 0;
      PyArrayObject *__pyx_v_cpos0 = 0;
      PyArrayObject *__pyx_v_dpos0 = 0;
      PyArrayObject *__pyx_v_cpos1 = 0;
      PyArrayObject *__pyx_v_dpos1 = 0;
      PyArrayObject *__pyx_v_cpos0_upper = 0;
      PyArrayObject *__pyx_v_cpos0_lower = 0;
      PyArrayObject *__pyx_v_outData = 0;
      PyArrayObject *__pyx_v_outCount = 0;
      PyArrayObject *__pyx_v_outMerge = 0;
      float __pyx_v_min0;
      float __pyx_v_max0;
      float __pyx_v_min1;
      float __pyx_v_max1;
      float __pyx_v_deltaR;
      float __pyx_v_deltaL;
      float __pyx_v_deltaU;
      float __pyx_v_deltaD;
      float __pyx_v_deltaA;
      float __pyx_v_delta0;
      float __pyx_v_delta1;
      float __pyx_v_pos0_min;
      float __pyx_v_pos0_max;
      float __pyx_v_pos1_min;
      float __pyx_v_pos1_max;
      float __pyx_v_pos0_maxin;
      float __pyx_v_pos1_maxin;
      float __pyx_v_fbin0_min;
      float __pyx_v_fbin0_max;
      float __pyx_v_fbin1_min;
      float __pyx_v_fbin1_max;
      float __pyx_v_data;
      float __pyx_v_epsilon;
      float __pyx_v_cdummy;
      float __pyx_v_ddummy;
      int __pyx_v_bin0_max;
      int __pyx_v_bin0_min;
      int __pyx_v_bin1_max;
      int __pyx_v_bin1_min;
      int __pyx_v_check_mask;
      int __pyx_v_check_dummy;
      int __pyx_v_do_dark;
      int __pyx_v_do_flat;
      int __pyx_v_do_polarization;
      int __pyx_v_do_solidangle;
      __Pyx_memviewslice __pyx_v_cmask = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_cflat = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_cdark = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_cpolarization = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_csolidangle = { 0, 0, { 0 }, { 0 }, { 0 } };
      PyObject *__pyx_v_edges0 = NULL;
      PyObject *__pyx_v_edges1 = NULL;
      __Pyx_LocalBuf_ND __pyx_pybuffernd_cdata;
      __Pyx_Buffer __pyx_pybuffer_cdata;
      __Pyx_LocalBuf_ND __pyx_pybuffernd_cpos0;
      __Pyx_Buffer __pyx_pybuffer_cpos0;
      __Pyx_LocalBuf_ND __pyx_pybuffernd_cpos0_lower;
      __Pyx_Buffer __pyx_pybuffer_cpos0_lower;
      __Pyx_LocalBuf_ND __pyx_pybuffernd_cpos0_upper;
      __Pyx_Buffer __pyx_pybuffer_cpos0_upper;
      __Pyx_LocalBuf_ND __pyx_pybuffernd_cpos1;
      __Pyx_Buffer __pyx_pybuffer_cpos1;
      __Pyx_LocalBuf_ND __pyx_pybuffernd_dpos0;
      __Pyx_Buffer __pyx_pybuffer_dpos0;
      __Pyx_LocalBuf_ND __pyx_pybuffernd_dpos1;
      __Pyx_Buffer __pyx_pybuffer_dpos1;
      __Pyx_LocalBuf_ND __pyx_pybuffernd_outCount;
      __Pyx_Buffer __pyx_pybuffer_outCount;
      __Pyx_LocalBuf_ND __pyx_pybuffernd_outData;
      __Pyx_Buffer __pyx_pybuffer_outData;
      __Pyx_LocalBuf_ND __pyx_pybuffernd_outMerge;
      __Pyx_Buffer __pyx_pybuffer_outMerge;
      PyObject *__pyx_r = NULL;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("histoBBox2d", 0);
      __pyx_pybuffer_cdata.pybuffer.buf = NULL;
      __pyx_pybuffer_cdata.refcount = 0;
      __pyx_pybuffernd_cdata.data = NULL;
      __pyx_pybuffernd_cdata.rcbuffer = &__pyx_pybuffer_cdata;
      __pyx_pybuffer_cpos0.pybuffer.buf = NULL;
      __pyx_pybuffer_cpos0.refcount = 0;
      __pyx_pybuffernd_cpos0.data = NULL;
      __pyx_pybuffernd_cpos0.rcbuffer = &__pyx_pybuffer_cpos0;
      __pyx_pybuffer_dpos0.pybuffer.buf = NULL;
      __pyx_pybuffer_dpos0.refcount = 0;
      __pyx_pybuffernd_dpos0.data = NULL;
      __pyx_pybuffernd_dpos0.rcbuffer = &__pyx_pybuffer_dpos0;
      __pyx_pybuffer_cpos1.pybuffer.buf = NULL;
      __pyx_pybuffer_cpos1.refcount = 0;
      __pyx_pybuffernd_cpos1.data = NULL;
      __pyx_pybuffernd_cpos1.rcbuffer = &__pyx_pybuffer_cpos1;
      __pyx_pybuffer_dpos1.pybuffer.buf = NULL;
      __pyx_pybuffer_dpos1.refcount = 0;
      __pyx_pybuffernd_dpos1.data = NULL;
      __pyx_pybuffernd_dpos1.rcbuffer = &__pyx_pybuffer_dpos1;
      __pyx_pybuffer_cpos0_upper.pybuffer.buf = NULL;
      __pyx_pybuffer_cpos0_upper.refcount = 0;
      __pyx_pybuffernd_cpos0_upper.data = NULL;
      __pyx_pybuffernd_cpos0_upper.rcbuffer = &__pyx_pybuffer_cpos0_upper;
      __pyx_pybuffer_cpos0_lower.pybuffer.buf = NULL;
      __pyx_pybuffer_cpos0_lower.refcount = 0;
      __pyx_pybuffernd_cpos0_lower.data = NULL;
      __pyx_pybuffernd_cpos0_lower.rcbuffer = &__pyx_pybuffer_cpos0_lower;
      __pyx_pybuffer_outData.pybuffer.buf = NULL;
      __pyx_pybuffer_outData.refcount = 0;
      __pyx_pybuffernd_outData.data = NULL;
      __pyx_pybuffernd_outData.rcbuffer = &__pyx_pybuffer_outData;
      __pyx_pybuffer_outCount.pybuffer.buf = NULL;
      __pyx_pybuffer_outCount.refcount = 0;
      __pyx_pybuffernd_outCount.data = NULL;
      __pyx_pybuffernd_outCount.rcbuffer = &__pyx_pybuffer_outCount;
      __pyx_pybuffer_outMerge.pybuffer.buf = NULL;
      __pyx_pybuffer_outMerge.refcount = 0;
      __pyx_pybuffernd_outMerge.data = NULL;
      __pyx_pybuffernd_outMerge.rcbuffer = &__pyx_pybuffer_outMerge;

      /* "splitBBoxLUT.pyx":817
     * @cython.boundscheck(False)
     * @cython.wraparound(False)
     * def histoBBox2d(numpy.ndarray weights not None,             # <<<<<<<<<<<<<<
     *                 numpy.ndarray pos0 not None,
     *                 numpy.ndarray delta_pos0 not None,
     */
      __pyx_k_tuple_75 = PyTuple_Pack(74, ((PyObject *)__pyx_n_s__weights), ((PyObject *)__pyx_n_s__pos0), ((PyObject *)__pyx_n_s__delta_pos0), ((PyObject *)__pyx_n_s__pos1), ((PyObject *)__pyx_n_s__delta_pos1), ((PyObject *)__pyx_n_s__bins), ((PyObject *)__pyx_n_s__pos0Range), ((PyObject *)__pyx_n_s__pos1Range), ((PyObject *)__pyx_n_s__dummy), ((PyObject *)__pyx_n_s__delta_dummy), ((PyObject *)__pyx_n_s__mask), ((PyObject *)__pyx_n_s__dark), ((PyObject *)__pyx_n_s__flat), ((PyObject *)__pyx_n_s__solidangle), ((PyObject *)__pyx_n_s__polarization), ((PyObject *)__pyx_n_s__bins0), ((PyObject *)__pyx_n_s__bins1), ((PyObject *)__pyx_n_s__i), ((PyObject *)__pyx_n_s__j), ((PyObject *)__pyx_n_s__idx), ((PyObject *)__pyx_n_s__size), ((PyObject *)__pyx_n_s__cdata), ((PyObject *)__pyx_n_s__cpos0), ((PyObject *)__pyx_n_s__dpos0), ((PyObject *)__pyx_n_s__cpos1), ((PyObject *)__pyx_n_s__dpos1), ((PyObject *)__pyx_n_s__cpos0_upper), ((PyObject *)__pyx_n_s__cpos0_lower), ((PyObject *)__pyx_n_s__outData), ((PyObject *)__pyx_n_s__outCount), ((PyObject *)__pyx_n_s__outMerge), ((PyObject *)__pyx_n_s__min0), ((PyObject *)__pyx_n_s__max0), ((PyObject *)__pyx_n_s__min1), ((PyObject *)__pyx_n_s__max1), ((PyObject *)__pyx_n_s__deltaR), ((PyObject *)__pyx_n_s__deltaL), ((PyObject *)__pyx_n_s__deltaU), ((PyObject *)__pyx_n_s__deltaD), ((PyObject *)__pyx_n_s__deltaA), ((PyObject *)__pyx_n_s__tmp), ((PyObject *)__pyx_n_s__delta0), ((PyObject *)__pyx_n_s__delta1), ((PyObject *)__pyx_n_s__pos0_min), ((PyObject *)__pyx_n_s__pos0_max), ((PyObject *)__pyx_n_s__pos1_min), ((PyObject *)__pyx_n_s__pos1_max), ((PyObject *)__pyx_n_s__pos0_maxin), ((PyObject *)__pyx_n_s__pos1_maxin), ((PyObject *)__pyx_n_s__fbin0_min), ((PyObject *)__pyx_n_s__fbin0_max), ((PyObject *)__pyx_n_s__fbin1_min), ((PyObject *)__pyx_n_s__fbin1_max), ((PyObject *)__pyx_n_s__data), ((PyObject *)__pyx_n_s__epsilon), ((PyObject *)__pyx_n_s__cdummy), ((PyObject *)__pyx_n_s__ddummy), ((PyObject *)__pyx_n_s__bin0_max), ((PyObject *)__pyx_n_s__bin0_min), ((PyObject *)__pyx_n_s__bin1_max), ((PyObject *)__pyx_n_s__bin1_min), ((PyObject *)__pyx_n_s__check_mask), ((PyObject *)__pyx_n_s__check_dummy), ((PyObject *)__pyx_n_s__do_dark), ((PyObject *)__pyx_n_s__do_flat), ((PyObject *)__pyx_n_s__do_polarization), ((PyObject *)__pyx_n_s__do_solidangle), ((PyObject *)__pyx_n_s__cmask), ((PyObject *)__pyx_n_s__cflat), ((PyObject *)__pyx_n_s__cdark), ((PyObject *)__pyx_n_s__cpolarization), ((PyObject *)__pyx_n_s__csolidangle), ((PyObject *)__pyx_n_s__edges0), ((PyObject *)__pyx_n_s__edges1)); if (unlikely(!__pyx_k_tuple_75)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_k_tuple_75);
      __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_75));

      /* "splitBBoxLUT.pyx":817
     * @cython.boundscheck(False)
     * @cython.wraparound(False)
     * def histoBBox2d(numpy.ndarray weights not None,             # <<<<<<<<<<<<<<
     *                 numpy.ndarray pos0 not None,
     *                 numpy.ndarray delta_pos0 not None,
     */
      __pyx_t_8 = PyCFunction_NewEx(&__pyx_mdef_12splitBBoxLUT_1histoBBox2d, NULL, __pyx_n_s__splitBBoxLUT); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      if (PyObject_SetAttr(__pyx_m, __pyx_n_s__histoBBox2d, __pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_k_codeobj_76 = (PyObject*)__Pyx_PyCode_New(15, 0, 74, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_75, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_56, __pyx_n_s__histoBBox2d, 817, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_76)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

     818:                 numpy.ndarray pos0 not None,

     819:                 numpy.ndarray delta_pos0 not None,

     820:                 numpy.ndarray pos1 not None,

     821:                 numpy.ndarray delta_pos1 not None,

     822:                 bins=(100, 36),

        /* "splitBBoxLUT.pyx":822
     *                 numpy.ndarray pos1 not None,
     *                 numpy.ndarray delta_pos1 not None,
     *                 bins=(100, 36),             # <<<<<<<<<<<<<<
     *                 pos0Range=None,
     *                 pos1Range=None,
     */
        values[5] = ((PyObject *)__pyx_k_tuple_8);

      /* "splitBBoxLUT.pyx":822
     *                 numpy.ndarray pos1 not None,
     *                 numpy.ndarray delta_pos1 not None,
     *                 bins=(100, 36),             # <<<<<<<<<<<<<<
     *                 pos0Range=None,
     *                 pos1Range=None,
     */
      __pyx_k_tuple_8 = PyTuple_Pack(2, __pyx_int_100, __pyx_int_36); if (unlikely(!__pyx_k_tuple_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_k_tuple_8);
      __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_8));

     823:                 pos0Range=None,

        /* "splitBBoxLUT.pyx":823
     *                 numpy.ndarray delta_pos1 not None,
     *                 bins=(100, 36),
     *                 pos0Range=None,             # <<<<<<<<<<<<<<
     *                 pos1Range=None,
     *                 dummy=None,
     */
        values[6] = ((PyObject *)Py_None);

     824:                 pos1Range=None,

        /* "splitBBoxLUT.pyx":824
     *                 bins=(100, 36),
     *                 pos0Range=None,
     *                 pos1Range=None,             # <<<<<<<<<<<<<<
     *                 dummy=None,
     *                 delta_dummy=None,
     */
        values[7] = ((PyObject *)Py_None);

     825:                 dummy=None,

        /* "splitBBoxLUT.pyx":825
     *                 pos0Range=None,
     *                 pos1Range=None,
     *                 dummy=None,             # <<<<<<<<<<<<<<
     *                 delta_dummy=None,
     *                 mask=None,
     */
        values[8] = ((PyObject *)Py_None);

     826:                 delta_dummy=None,

        /* "splitBBoxLUT.pyx":826
     *                 pos1Range=None,
     *                 dummy=None,
     *                 delta_dummy=None,             # <<<<<<<<<<<<<<
     *                 mask=None,
     *                 dark=None,
     */
        values[9] = ((PyObject *)Py_None);

     827:                 mask=None,

        /* "splitBBoxLUT.pyx":827
     *                 dummy=None,
     *                 delta_dummy=None,
     *                 mask=None,             # <<<<<<<<<<<<<<
     *                 dark=None,
     *                 flat=None,
     */
        values[10] = ((PyObject *)Py_None);

     828:                 dark=None,

        /* "splitBBoxLUT.pyx":828
     *                 delta_dummy=None,
     *                 mask=None,
     *                 dark=None,             # <<<<<<<<<<<<<<
     *                 flat=None,
     *                 solidangle=None,
     */
        values[11] = ((PyObject *)Py_None);

     829:                 flat=None,

        /* "splitBBoxLUT.pyx":829
     *                 mask=None,
     *                 dark=None,
     *                 flat=None,             # <<<<<<<<<<<<<<
     *                 solidangle=None,
     *                 polarization=None):
     */
        values[12] = ((PyObject *)Py_None);

     830:                 solidangle=None,

        /* "splitBBoxLUT.pyx":830
     *                 dark=None,
     *                 flat=None,
     *                 solidangle=None,             # <<<<<<<<<<<<<<
     *                 polarization=None):
     *     """
     */
        values[13] = ((PyObject *)Py_None);

     831:                 polarization=None):

        /* "splitBBoxLUT.pyx":831
     *                 flat=None,
     *                 solidangle=None,
     *                 polarization=None):             # <<<<<<<<<<<<<<
     *     """
     *     Calculate 2D histogram of pos0(tth),pos1(chi) weighted by weights
     */
        values[14] = ((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 15: values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
            case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
            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__weights)) != 0)) kw_args--;
            else goto __pyx_L5_argtuple_error;
            case  1:
            if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__pos0)) != 0)) kw_args--;
            else {
              __Pyx_RaiseArgtupleInvalid("histoBBox2d", 0, 5, 15, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
            }
            case  2:
            if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__delta_pos0)) != 0)) kw_args--;
            else {
              __Pyx_RaiseArgtupleInvalid("histoBBox2d", 0, 5, 15, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
            }
            case  3:
            if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__pos1)) != 0)) kw_args--;
            else {
              __Pyx_RaiseArgtupleInvalid("histoBBox2d", 0, 5, 15, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
            }
            case  4:
            if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__delta_pos1)) != 0)) kw_args--;
            else {
              __Pyx_RaiseArgtupleInvalid("histoBBox2d", 0, 5, 15, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
            }
            case  5:
            if (kw_args > 0) {
              PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__bins);
              if (value) { values[5] = value; kw_args--; }
            }
            case  6:
            if (kw_args > 0) {
              PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__pos0Range);
              if (value) { values[6] = value; kw_args--; }
            }
            case  7:
            if (kw_args > 0) {
              PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__pos1Range);
              if (value) { values[7] = value; kw_args--; }
            }
            case  8:
            if (kw_args > 0) {
              PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__dummy);
              if (value) { values[8] = value; kw_args--; }
            }
            case  9:
            if (kw_args > 0) {
              PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__delta_dummy);
              if (value) { values[9] = value; kw_args--; }
            }
            case 10:
            if (kw_args > 0) {
              PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__mask);
              if (value) { values[10] = value; kw_args--; }
            }
            case 11:
            if (kw_args > 0) {
              PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__dark);
              if (value) { values[11] = value; kw_args--; }
            }
            case 12:
            if (kw_args > 0) {
              PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__flat);
              if (value) { values[12] = value; kw_args--; }
            }
            case 13:
            if (kw_args > 0) {
              PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__solidangle);
              if (value) { values[13] = value; kw_args--; }
            }
            case 14:
            if (kw_args > 0) {
              PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__polarization);
              if (value) { values[14] = value; kw_args--; }
            }
          }
          if (unlikely(kw_args > 0)) {
            if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "histoBBox2d") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
          }
        } else {
          switch (PyTuple_GET_SIZE(__pyx_args)) {
            case 15: values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
            case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
            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);
            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_weights = ((PyArrayObject *)values[0]);
        __pyx_v_pos0 = ((PyArrayObject *)values[1]);
        __pyx_v_delta_pos0 = ((PyArrayObject *)values[2]);
        __pyx_v_pos1 = ((PyArrayObject *)values[3]);
        __pyx_v_delta_pos1 = ((PyArrayObject *)values[4]);
        __pyx_v_bins = values[5];
        __pyx_v_pos0Range = values[6];
        __pyx_v_pos1Range = values[7];
        __pyx_v_dummy = values[8];
        __pyx_v_delta_dummy = values[9];
        __pyx_v_mask = values[10];
        __pyx_v_dark = values[11];
        __pyx_v_flat = values[12];
        __pyx_v_solidangle = values[13];
        __pyx_v_polarization = values[14];
      }
      goto __pyx_L4_argument_unpacking_done;
      __pyx_L5_argtuple_error:;
      __Pyx_RaiseArgtupleInvalid("histoBBox2d", 0, 5, 15, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      __pyx_L3_error:;
      __Pyx_AddTraceback("splitBBoxLUT.histoBBox2d", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __Pyx_RefNannyFinishContext();
      return NULL;
      __pyx_L4_argument_unpacking_done:;
      if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_weights), __pyx_ptype_5numpy_ndarray, 0, "weights", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pos0), __pyx_ptype_5numpy_ndarray, 0, "pos0", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 818; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_delta_pos0), __pyx_ptype_5numpy_ndarray, 0, "delta_pos0", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 819; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pos1), __pyx_ptype_5numpy_ndarray, 0, "pos1", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 820; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_delta_pos1), __pyx_ptype_5numpy_ndarray, 0, "delta_pos1", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_r = __pyx_pf_12splitBBoxLUT_histoBBox2d(__pyx_self, __pyx_v_weights, __pyx_v_pos0, __pyx_v_delta_pos0, __pyx_v_pos1, __pyx_v_delta_pos1, __pyx_v_bins, __pyx_v_pos0Range, __pyx_v_pos1Range, __pyx_v_dummy, __pyx_v_delta_dummy, __pyx_v_mask, __pyx_v_dark, __pyx_v_flat, __pyx_v_solidangle, __pyx_v_polarization);
      goto __pyx_L0;
      __pyx_L1_error:;
      __pyx_r = NULL;
      __pyx_L0:;
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

     832:     """

     833:     Calculate 2D histogram of pos0(tth),pos1(chi) weighted by weights

     834:

     835:     Splitting is done on the pixel's bounding box like fit2D

     836:

     837:

     838:     @param weights: array with intensities

     839:     @param pos0: 1D array with pos0: tth or q_vect

     840:     @param delta_pos0: 1D array with delta pos0: max center-corner distance

     841:     @param pos1: 1D array with pos1: chi

     842:     @param delta_pos1: 1D array with max pos1: max center-corner distance, unused !

     843:     @param bins: number of output bins (tth=100, chi=36 by default)

     844:     @param pos0Range: minimum and maximum  of the 2th range

     845:     @param pos1Range: minimum and maximum  of the chi range

     846:     @param dummy: value for bins without pixels & value of "no good" pixels

     847:     @param delta_dummy: precision of dummy value

     848:     @param mask: array (of int8) with masked pixels with 1 (0=not masked)

     849:     @param dark: array (of float32) with dark noise to be subtracted (or None)

     850:     @param flat: array (of float32) with flat-field image

     851:     @param polarization: array (of float32) with polarization corrections

     852:     @param solidangle: array (of float32) with solid angle corrections

     853:

     854:     @return  I, edges0, edges1, weighted histogram(2D), unweighted histogram (2D)

     855:     """

     856:

     857:     cdef int bins0, bins1, i, j, idx

     858:     cdef size_t size = weights.size

      /* "splitBBoxLUT.pyx":858
     *
     *     cdef int bins0, bins1, i, j, idx
     *     cdef size_t size = weights.size             # <<<<<<<<<<<<<<
     *     assert pos0.size == size
     *     assert pos1.size == size
     */
      __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_weights), __pyx_n_s__size); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 858; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyInt_AsSize_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 858; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v_size = __pyx_t_2;

     859:     assert pos0.size == size

      /* "splitBBoxLUT.pyx":859
     *     cdef int bins0, bins1, i, j, idx
     *     cdef size_t size = weights.size
     *     assert pos0.size == size             # <<<<<<<<<<<<<<
     *     assert pos1.size == size
     *     assert delta_pos0.size == size
     */
      #ifndef CYTHON_WITHOUT_ASSERTIONS
      __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_pos0), __pyx_n_s__size); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 859; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = __Pyx_PyInt_FromSize_t(__pyx_v_size); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 859; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = PyObject_RichCompare(__pyx_t_1, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 859; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 859; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_5)) {
        PyErr_SetNone(PyExc_AssertionError);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 859; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      #endif

     860:     assert pos1.size == size

      /* "splitBBoxLUT.pyx":860
     *     cdef size_t size = weights.size
     *     assert pos0.size == size
     *     assert pos1.size == size             # <<<<<<<<<<<<<<
     *     assert delta_pos0.size == size
     *     assert delta_pos1.size == size
     */
      #ifndef CYTHON_WITHOUT_ASSERTIONS
      __pyx_t_4 = PyObject_GetAttr(((PyObject *)__pyx_v_pos1), __pyx_n_s__size); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 860; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = __Pyx_PyInt_FromSize_t(__pyx_v_size); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 860; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_1 = PyObject_RichCompare(__pyx_t_4, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 860; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 860; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (unlikely(!__pyx_t_5)) {
        PyErr_SetNone(PyExc_AssertionError);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 860; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      #endif

     861:     assert delta_pos0.size == size

      /* "splitBBoxLUT.pyx":861
     *     assert pos0.size == size
     *     assert pos1.size == size
     *     assert delta_pos0.size == size             # <<<<<<<<<<<<<<
     *     assert delta_pos1.size == size
     *     try:
     */
      #ifndef CYTHON_WITHOUT_ASSERTIONS
      __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_delta_pos0), __pyx_n_s__size); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 861; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = __Pyx_PyInt_FromSize_t(__pyx_v_size); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 861; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = PyObject_RichCompare(__pyx_t_1, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 861; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 861; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_5)) {
        PyErr_SetNone(PyExc_AssertionError);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 861; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      #endif

     862:     assert delta_pos1.size == size

      /* "splitBBoxLUT.pyx":862
     *     assert pos1.size == size
     *     assert delta_pos0.size == size
     *     assert delta_pos1.size == size             # <<<<<<<<<<<<<<
     *     try:
     *         bins0, bins1 = tuple(bins)
     */
      #ifndef CYTHON_WITHOUT_ASSERTIONS
      __pyx_t_4 = PyObject_GetAttr(((PyObject *)__pyx_v_delta_pos1), __pyx_n_s__size); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 862; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = __Pyx_PyInt_FromSize_t(__pyx_v_size); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 862; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_1 = PyObject_RichCompare(__pyx_t_4, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 862; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 862; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (unlikely(!__pyx_t_5)) {
        PyErr_SetNone(PyExc_AssertionError);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 862; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      #endif

     863:     try:

      /* "splitBBoxLUT.pyx":863
     *     assert delta_pos0.size == size
     *     assert delta_pos1.size == size
     *     try:             # <<<<<<<<<<<<<<
     *         bins0, bins1 = tuple(bins)
     *     except:
     */
      {
        __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
        __Pyx_XGOTREF(__pyx_t_6);
        __Pyx_XGOTREF(__pyx_t_7);
        __Pyx_XGOTREF(__pyx_t_8);
        /*try:*/ {

     864:         bins0, bins1 = tuple(bins)

          /* "splitBBoxLUT.pyx":864
     *     assert delta_pos1.size == size
     *     try:
     *         bins0, bins1 = tuple(bins)             # <<<<<<<<<<<<<<
     *     except:
     *         bins0 = bins1 = bins
     */
          __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 864; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_INCREF(__pyx_v_bins);
          PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_bins);
          __Pyx_GIVEREF(__pyx_v_bins);
          __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)(&PyTuple_Type))), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 864; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
          if (1) {
            PyObject* sequence = __pyx_t_3;
            #if CYTHON_COMPILING_IN_CPYTHON
            Py_ssize_t size = Py_SIZE(sequence);
            #else
            Py_ssize_t size = PySequence_Size(sequence);
            #endif
            if (unlikely(size != 2)) {
              if (size > 2) __Pyx_RaiseTooManyValuesError(2);
              else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
              {__pyx_filename = __pyx_f[0]; __pyx_lineno = 864; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
            }
            #if CYTHON_COMPILING_IN_CPYTHON
            __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0);
            __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
            __Pyx_INCREF(__pyx_t_1);
            __Pyx_INCREF(__pyx_t_4);
            #else
            __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 864; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
            __Pyx_GOTREF(__pyx_t_1);
            __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 864; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
            __Pyx_GOTREF(__pyx_t_4);
            #endif
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          } else if (1) {
            __Pyx_RaiseNoneNotIterableError(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 864; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
          } else
          {
            Py_ssize_t index = -1;
            __pyx_t_9 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 864; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
            __Pyx_GOTREF(__pyx_t_9);
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
            __pyx_t_10 = Py_TYPE(__pyx_t_9)->tp_iternext;
            index = 0; __pyx_t_1 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_1)) goto __pyx_L11_unpacking_failed;
            __Pyx_GOTREF(__pyx_t_1);
            index = 1; __pyx_t_4 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_4)) goto __pyx_L11_unpacking_failed;
            __Pyx_GOTREF(__pyx_t_4);
            if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 864; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
            __pyx_t_10 = NULL;
            __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
            goto __pyx_L12_unpacking_done;
            __pyx_L11_unpacking_failed:;
            __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
            __pyx_t_10 = NULL;
            if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 864; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
            __pyx_L12_unpacking_done:;
          }
          __pyx_t_11 = __Pyx_PyInt_AsInt(__pyx_t_1); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 864; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __pyx_t_12 = __Pyx_PyInt_AsInt(__pyx_t_4); if (unlikely((__pyx_t_12 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 864; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __pyx_v_bins0 = __pyx_t_11;
          __pyx_v_bins1 = __pyx_t_12;
        }
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        goto __pyx_L10_try_end;
        __pyx_L3_error:;
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;

     865:     except:

        /* "splitBBoxLUT.pyx":865
     *     try:
     *         bins0, bins1 = tuple(bins)
     *     except:             # <<<<<<<<<<<<<<
     *         bins0 = bins1 = bins
     *     if bins0 <= 0:
     */
        /*except:*/ {
          __Pyx_AddTraceback("splitBBoxLUT.histoBBox2d", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_4, &__pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 865; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_GOTREF(__pyx_t_1);

     866:         bins0 = bins1 = bins

          /* "splitBBoxLUT.pyx":866
     *         bins0, bins1 = tuple(bins)
     *     except:
     *         bins0 = bins1 = bins             # <<<<<<<<<<<<<<
     *     if bins0 <= 0:
     *         bins0 = 1
     */
          __pyx_t_12 = __Pyx_PyInt_AsInt(__pyx_v_bins); if (unlikely((__pyx_t_12 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 866; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
          __pyx_v_bins0 = __pyx_t_12;
          __pyx_t_12 = __Pyx_PyInt_AsInt(__pyx_v_bins); if (unlikely((__pyx_t_12 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 866; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
          __pyx_v_bins1 = __pyx_t_12;
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          goto __pyx_L4_exception_handled;
        }
        __pyx_L5_except_error:;
        __Pyx_XGIVEREF(__pyx_t_6);
        __Pyx_XGIVEREF(__pyx_t_7);
        __Pyx_XGIVEREF(__pyx_t_8);
        __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
        goto __pyx_L1_error;
        __pyx_L4_exception_handled:;
        __Pyx_XGIVEREF(__pyx_t_6);
        __Pyx_XGIVEREF(__pyx_t_7);
        __Pyx_XGIVEREF(__pyx_t_8);
        __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
        __pyx_L10_try_end:;
      }

     867:     if bins0 <= 0:

      /* "splitBBoxLUT.pyx":867
     *     except:
     *         bins0 = bins1 = bins
     *     if bins0 <= 0:             # <<<<<<<<<<<<<<
     *         bins0 = 1
     *     if bins1 <= 0:
     */
      __pyx_t_5 = (__pyx_v_bins0 <= 0);
      if (__pyx_t_5) {

     868:         bins0 = 1

        /* "splitBBoxLUT.pyx":868
     *         bins0 = bins1 = bins
     *     if bins0 <= 0:
     *         bins0 = 1             # <<<<<<<<<<<<<<
     *     if bins1 <= 0:
     *         bins1 = 1
     */
        __pyx_v_bins0 = 1;
        goto __pyx_L15;
      }
      __pyx_L15:;

     869:     if bins1 <= 0:

      /* "splitBBoxLUT.pyx":869
     *     if bins0 <= 0:
     *         bins0 = 1
     *     if bins1 <= 0:             # <<<<<<<<<<<<<<
     *         bins1 = 1
     *     cdef numpy.ndarray[numpy.float32_t, ndim = 1] cdata = numpy.ascontiguousarray(weights.ravel(),dtype=numpy.float32)
     */
      __pyx_t_5 = (__pyx_v_bins1 <= 0);
      if (__pyx_t_5) {

     870:         bins1 = 1

        /* "splitBBoxLUT.pyx":870
     *         bins0 = 1
     *     if bins1 <= 0:
     *         bins1 = 1             # <<<<<<<<<<<<<<
     *     cdef numpy.ndarray[numpy.float32_t, ndim = 1] cdata = numpy.ascontiguousarray(weights.ravel(),dtype=numpy.float32)
     *     cdef numpy.ndarray[numpy.float32_t, ndim = 1] cpos0 = numpy.ascontiguousarray(pos0.ravel(),dtype=numpy.float32)
     */
        __pyx_v_bins1 = 1;
        goto __pyx_L16;
      }
      __pyx_L16:;

     871:     cdef numpy.ndarray[numpy.float32_t, ndim = 1] cdata = numpy.ascontiguousarray(weights.ravel(),dtype=numpy.float32)

      /* "splitBBoxLUT.pyx":871
     *     if bins1 <= 0:
     *         bins1 = 1
     *     cdef numpy.ndarray[numpy.float32_t, ndim = 1] cdata = numpy.ascontiguousarray(weights.ravel(),dtype=numpy.float32)             # <<<<<<<<<<<<<<
     *     cdef numpy.ndarray[numpy.float32_t, ndim = 1] cpos0 = numpy.ascontiguousarray(pos0.ravel(),dtype=numpy.float32)
     *     cdef numpy.ndarray[numpy.float32_t, ndim = 1] dpos0 = numpy.ascontiguousarray(delta_pos0.ravel(),dtype=numpy.float32)
     */
      __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 871; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_4 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__ascontiguousarray); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 871; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_weights), __pyx_n_s__ravel); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 871; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 871; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 871; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      __pyx_t_3 = 0;
      __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 871; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_3));
      __pyx_t_9 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 871; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_13 = PyObject_GetAttr(__pyx_t_9, __pyx_n_s__float32); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 871; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_13);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__dtype), __pyx_t_13) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 871; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
      __pyx_t_13 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_1), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 871; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_13);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_13) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_13, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 871; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_14 = ((PyArrayObject *)__pyx_t_13);
      {
        __Pyx_BufFmt_StackElem __pyx_stack[1];
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_cdata.rcbuffer->pybuffer, (PyObject*)__pyx_t_14, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
          __pyx_v_cdata = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_cdata.rcbuffer->pybuffer.buf = NULL;
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 871; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        } else {__pyx_pybuffernd_cdata.diminfo[0].strides = __pyx_pybuffernd_cdata.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_cdata.diminfo[0].shape = __pyx_pybuffernd_cdata.rcbuffer->pybuffer.shape[0];
        }
      }
      __pyx_t_14 = 0;
      __pyx_v_cdata = ((PyArrayObject *)__pyx_t_13);
      __pyx_t_13 = 0;

     872:     cdef numpy.ndarray[numpy.float32_t, ndim = 1] cpos0 = numpy.ascontiguousarray(pos0.ravel(),dtype=numpy.float32)

      /* "splitBBoxLUT.pyx":872
     *         bins1 = 1
     *     cdef numpy.ndarray[numpy.float32_t, ndim = 1] cdata = numpy.ascontiguousarray(weights.ravel(),dtype=numpy.float32)
     *     cdef numpy.ndarray[numpy.float32_t, ndim = 1] cpos0 = numpy.ascontiguousarray(pos0.ravel(),dtype=numpy.float32)             # <<<<<<<<<<<<<<
     *     cdef numpy.ndarray[numpy.float32_t, ndim = 1] dpos0 = numpy.ascontiguousarray(delta_pos0.ravel(),dtype=numpy.float32)
     *     cdef numpy.ndarray[numpy.float32_t, ndim = 1] cpos1 = numpy.ascontiguousarray(pos1.ravel(),dtype=numpy.float32)
     */
      __pyx_t_13 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 872; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_13);
      __pyx_t_3 = PyObject_GetAttr(__pyx_t_13, __pyx_n_s__ascontiguousarray); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 872; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
      __pyx_t_13 = PyObject_GetAttr(((PyObject *)__pyx_v_pos0), __pyx_n_s__ravel); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 872; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_13);
      __pyx_t_1 = PyObject_Call(__pyx_t_13, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 872; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
      __pyx_t_13 = PyTuple_New(1); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 872; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_13);
      PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 872; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_1));
      __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 872; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_9 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__float32); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 872; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__dtype), __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 872; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __pyx_t_9 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_13), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 872; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_13)); __pyx_t_13 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
      if (!(likely(((__pyx_t_9) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_9, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 872; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_15 = ((PyArrayObject *)__pyx_t_9);
      {
        __Pyx_BufFmt_StackElem __pyx_stack[1];
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_cpos0.rcbuffer->pybuffer, (PyObject*)__pyx_t_15, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
          __pyx_v_cpos0 = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_cpos0.rcbuffer->pybuffer.buf = NULL;
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 872; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        } else {__pyx_pybuffernd_cpos0.diminfo[0].strides = __pyx_pybuffernd_cpos0.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_cpos0.diminfo[0].shape = __pyx_pybuffernd_cpos0.rcbuffer->pybuffer.shape[0];
        }
      }
      __pyx_t_15 = 0;
      __pyx_v_cpos0 = ((PyArrayObject *)__pyx_t_9);
      __pyx_t_9 = 0;

     873:     cdef numpy.ndarray[numpy.float32_t, ndim = 1] dpos0 = numpy.ascontiguousarray(delta_pos0.ravel(),dtype=numpy.float32)

      /* "splitBBoxLUT.pyx":873
     *     cdef numpy.ndarray[numpy.float32_t, ndim = 1] cdata = numpy.ascontiguousarray(weights.ravel(),dtype=numpy.float32)
     *     cdef numpy.ndarray[numpy.float32_t, ndim = 1] cpos0 = numpy.ascontiguousarray(pos0.ravel(),dtype=numpy.float32)
     *     cdef numpy.ndarray[numpy.float32_t, ndim = 1] dpos0 = numpy.ascontiguousarray(delta_pos0.ravel(),dtype=numpy.float32)             # <<<<<<<<<<<<<<
     *     cdef numpy.ndarray[numpy.float32_t, ndim = 1] cpos1 = numpy.ascontiguousarray(pos1.ravel(),dtype=numpy.float32)
     *     cdef numpy.ndarray[numpy.float32_t, ndim = 1] dpos1 = numpy.ascontiguousarray(delta_pos1.ravel(),dtype=numpy.float32)
     */
      __pyx_t_9 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 873; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_1 = PyObject_GetAttr(__pyx_t_9, __pyx_n_s__ascontiguousarray); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 873; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __pyx_t_9 = PyObject_GetAttr(((PyObject *)__pyx_v_delta_pos0), __pyx_n_s__ravel); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 873; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_13 = PyObject_Call(__pyx_t_9, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 873; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_13);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 873; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_9);
      PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_13);
      __Pyx_GIVEREF(__pyx_t_13);
      __pyx_t_13 = 0;
      __pyx_t_13 = PyDict_New(); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 873; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_13));
      __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 873; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__float32); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 873; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (PyDict_SetItem(__pyx_t_13, ((PyObject *)__pyx_n_s__dtype), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 873; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_9), ((PyObject *)__pyx_t_13)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 873; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_13)); __pyx_t_13 = 0;
      if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 873; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_16 = ((PyArrayObject *)__pyx_t_4);
      {
        __Pyx_BufFmt_StackElem __pyx_stack[1];
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dpos0.rcbuffer->pybuffer, (PyObject*)__pyx_t_16, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
          __pyx_v_dpos0 = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_dpos0.rcbuffer->pybuffer.buf = NULL;
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 873; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        } else {__pyx_pybuffernd_dpos0.diminfo[0].strides = __pyx_pybuffernd_dpos0.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_dpos0.diminfo[0].shape = __pyx_pybuffernd_dpos0.rcbuffer->pybuffer.shape[0];
        }
      }
      __pyx_t_16 = 0;
      __pyx_v_dpos0 = ((PyArrayObject *)__pyx_t_4);
      __pyx_t_4 = 0;

     874:     cdef numpy.ndarray[numpy.float32_t, ndim = 1] cpos1 = numpy.ascontiguousarray(pos1.ravel(),dtype=numpy.float32)

      /* "splitBBoxLUT.pyx":874
     *     cdef numpy.ndarray[numpy.float32_t, ndim = 1] cpos0 = numpy.ascontiguousarray(pos0.ravel(),dtype=numpy.float32)
     *     cdef numpy.ndarray[numpy.float32_t, ndim = 1] dpos0 = numpy.ascontiguousarray(delta_pos0.ravel(),dtype=numpy.float32)
     *     cdef numpy.ndarray[numpy.float32_t, ndim = 1] cpos1 = numpy.ascontiguousarray(pos1.ravel(),dtype=numpy.float32)             # <<<<<<<<<<<<<<
     *     cdef numpy.ndarray[numpy.float32_t, ndim = 1] dpos1 = numpy.ascontiguousarray(delta_pos1.ravel(),dtype=numpy.float32)
     *     cdef numpy.ndarray[numpy.float32_t, ndim = 1] cpos0_upper = numpy.empty(size,dtype=numpy.float32)
     */
      __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 874; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_13 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__ascontiguousarray); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 874; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_13);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = PyObject_GetAttr(((PyObject *)__pyx_v_pos1), __pyx_n_s__ravel); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 874; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_9 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 874; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 874; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_9);
      __Pyx_GIVEREF(__pyx_t_9);
      __pyx_t_9 = 0;
      __pyx_t_9 = PyDict_New(); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 874; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_9));
      __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 874; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__float32); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 874; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (PyDict_SetItem(__pyx_t_9, ((PyObject *)__pyx_n_s__dtype), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 874; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = PyObject_Call(__pyx_t_13, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_9)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 874; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0;
      if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 874; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_17 = ((PyArrayObject *)__pyx_t_3);
      {
        __Pyx_BufFmt_StackElem __pyx_stack[1];
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_cpos1.rcbuffer->pybuffer, (PyObject*)__pyx_t_17, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
          __pyx_v_cpos1 = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_cpos1.rcbuffer->pybuffer.buf = NULL;
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 874; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        } else {__pyx_pybuffernd_cpos1.diminfo[0].strides = __pyx_pybuffernd_cpos1.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_cpos1.diminfo[0].shape = __pyx_pybuffernd_cpos1.rcbuffer->pybuffer.shape[0];
        }
      }
      __pyx_t_17 = 0;
      __pyx_v_cpos1 = ((PyArrayObject *)__pyx_t_3);
      __pyx_t_3 = 0;

     875:     cdef numpy.ndarray[numpy.float32_t, ndim = 1] dpos1 = numpy.ascontiguousarray(delta_pos1.ravel(),dtype=numpy.float32)

      /* "splitBBoxLUT.pyx":875
     *     cdef numpy.ndarray[numpy.float32_t, ndim = 1] dpos0 = numpy.ascontiguousarray(delta_pos0.ravel(),dtype=numpy.float32)
     *     cdef numpy.ndarray[numpy.float32_t, ndim = 1] cpos1 = numpy.ascontiguousarray(pos1.ravel(),dtype=numpy.float32)
     *     cdef numpy.ndarray[numpy.float32_t, ndim = 1] dpos1 = numpy.ascontiguousarray(delta_pos1.ravel(),dtype=numpy.float32)             # <<<<<<<<<<<<<<
     *     cdef numpy.ndarray[numpy.float32_t, ndim = 1] cpos0_upper = numpy.empty(size,dtype=numpy.float32)
     *     cdef numpy.ndarray[numpy.float32_t, ndim = 1] cpos0_lower = numpy.empty(size,dtype=numpy.float32)
     */
      __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 875; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_9 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__ascontiguousarray); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 875; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = PyObject_GetAttr(((PyObject *)__pyx_v_delta_pos1), __pyx_n_s__ravel); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 875; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 875; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 875; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_4);
      __pyx_t_4 = 0;
      __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 875; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_4));
      __pyx_t_13 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 875; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_13);
      __pyx_t_1 = PyObject_GetAttr(__pyx_t_13, __pyx_n_s__float32); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 875; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
      if (PyDict_SetItem(__pyx_t_4, ((PyObject *)__pyx_n_s__dtype), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 875; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyObject_Call(__pyx_t_9, ((PyObject *)__pyx_t_3), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 875; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
      if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 875; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_18 = ((PyArrayObject *)__pyx_t_1);
      {
        __Pyx_BufFmt_StackElem __pyx_stack[1];
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dpos1.rcbuffer->pybuffer, (PyObject*)__pyx_t_18, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
          __pyx_v_dpos1 = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_dpos1.rcbuffer->pybuffer.buf = NULL;
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 875; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        } else {__pyx_pybuffernd_dpos1.diminfo[0].strides = __pyx_pybuffernd_dpos1.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_dpos1.diminfo[0].shape = __pyx_pybuffernd_dpos1.rcbuffer->pybuffer.shape[0];
        }
      }
      __pyx_t_18 = 0;
      __pyx_v_dpos1 = ((PyArrayObject *)__pyx_t_1);
      __pyx_t_1 = 0;

     876:     cdef numpy.ndarray[numpy.float32_t, ndim = 1] cpos0_upper = numpy.empty(size,dtype=numpy.float32)

      /* "splitBBoxLUT.pyx":876
     *     cdef numpy.ndarray[numpy.float32_t, ndim = 1] cpos1 = numpy.ascontiguousarray(pos1.ravel(),dtype=numpy.float32)
     *     cdef numpy.ndarray[numpy.float32_t, ndim = 1] dpos1 = numpy.ascontiguousarray(delta_pos1.ravel(),dtype=numpy.float32)
     *     cdef numpy.ndarray[numpy.float32_t, ndim = 1] cpos0_upper = numpy.empty(size,dtype=numpy.float32)             # <<<<<<<<<<<<<<
     *     cdef numpy.ndarray[numpy.float32_t, ndim = 1] cpos0_lower = numpy.empty(size,dtype=numpy.float32)
     *     cdef numpy.ndarray[numpy.float64_t, ndim = 2] outData = numpy.zeros((bins0, bins1), dtype=numpy.float64)
     */
      __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 876; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_4 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__empty); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 876; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_size); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 876; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 876; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 876; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_1));
      __pyx_t_9 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 876; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_13 = PyObject_GetAttr(__pyx_t_9, __pyx_n_s__float32); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 876; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_13);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__dtype), __pyx_t_13) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 876; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
      __pyx_t_13 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_3), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 876; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_13);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
      if (!(likely(((__pyx_t_13) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_13, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 876; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_19 = ((PyArrayObject *)__pyx_t_13);
      {
        __Pyx_BufFmt_StackElem __pyx_stack[1];
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_cpos0_upper.rcbuffer->pybuffer, (PyObject*)__pyx_t_19, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
          __pyx_v_cpos0_upper = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_cpos0_upper.rcbuffer->pybuffer.buf = NULL;
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 876; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        } else {__pyx_pybuffernd_cpos0_upper.diminfo[0].strides = __pyx_pybuffernd_cpos0_upper.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_cpos0_upper.diminfo[0].shape = __pyx_pybuffernd_cpos0_upper.rcbuffer->pybuffer.shape[0];
        }
      }
      __pyx_t_19 = 0;
      __pyx_v_cpos0_upper = ((PyArrayObject *)__pyx_t_13);
      __pyx_t_13 = 0;

     877:     cdef numpy.ndarray[numpy.float32_t, ndim = 1] cpos0_lower = numpy.empty(size,dtype=numpy.float32)

      /* "splitBBoxLUT.pyx":877
     *     cdef numpy.ndarray[numpy.float32_t, ndim = 1] dpos1 = numpy.ascontiguousarray(delta_pos1.ravel(),dtype=numpy.float32)
     *     cdef numpy.ndarray[numpy.float32_t, ndim = 1] cpos0_upper = numpy.empty(size,dtype=numpy.float32)
     *     cdef numpy.ndarray[numpy.float32_t, ndim = 1] cpos0_lower = numpy.empty(size,dtype=numpy.float32)             # <<<<<<<<<<<<<<
     *     cdef numpy.ndarray[numpy.float64_t, ndim = 2] outData = numpy.zeros((bins0, bins1), dtype=numpy.float64)
     *     cdef numpy.ndarray[numpy.float64_t, ndim = 2] outCount = numpy.zeros((bins0, bins1), dtype=numpy.float64)
     */
      __pyx_t_13 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 877; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_13);
      __pyx_t_1 = PyObject_GetAttr(__pyx_t_13, __pyx_n_s__empty); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 877; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
      __pyx_t_13 = __Pyx_PyInt_FromSize_t(__pyx_v_size); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 877; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_13);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 877; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_13);
      __Pyx_GIVEREF(__pyx_t_13);
      __pyx_t_13 = 0;
      __pyx_t_13 = PyDict_New(); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 877; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_13));
      __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 877; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_9 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__float32); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 877; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (PyDict_SetItem(__pyx_t_13, ((PyObject *)__pyx_n_s__dtype), __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 877; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __pyx_t_9 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), ((PyObject *)__pyx_t_13)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 877; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_13)); __pyx_t_13 = 0;
      if (!(likely(((__pyx_t_9) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_9, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 877; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_20 = ((PyArrayObject *)__pyx_t_9);
      {
        __Pyx_BufFmt_StackElem __pyx_stack[1];
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_cpos0_lower.rcbuffer->pybuffer, (PyObject*)__pyx_t_20, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
          __pyx_v_cpos0_lower = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_cpos0_lower.rcbuffer->pybuffer.buf = NULL;
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 877; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        } else {__pyx_pybuffernd_cpos0_lower.diminfo[0].strides = __pyx_pybuffernd_cpos0_lower.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_cpos0_lower.diminfo[0].shape = __pyx_pybuffernd_cpos0_lower.rcbuffer->pybuffer.shape[0];
        }
      }
      __pyx_t_20 = 0;
      __pyx_v_cpos0_lower = ((PyArrayObject *)__pyx_t_9);
      __pyx_t_9 = 0;

     878:     cdef numpy.ndarray[numpy.float64_t, ndim = 2] outData = numpy.zeros((bins0, bins1), dtype=numpy.float64)

      /* "splitBBoxLUT.pyx":878
     *     cdef numpy.ndarray[numpy.float32_t, ndim = 1] cpos0_upper = numpy.empty(size,dtype=numpy.float32)
     *     cdef numpy.ndarray[numpy.float32_t, ndim = 1] cpos0_lower = numpy.empty(size,dtype=numpy.float32)
     *     cdef numpy.ndarray[numpy.float64_t, ndim = 2] outData = numpy.zeros((bins0, bins1), dtype=numpy.float64)             # <<<<<<<<<<<<<<
     *     cdef numpy.ndarray[numpy.float64_t, ndim = 2] outCount = numpy.zeros((bins0, bins1), dtype=numpy.float64)
     *     cdef numpy.ndarray[numpy.float32_t, ndim = 2] outMerge = numpy.zeros((bins0, bins1), dtype=numpy.float32)
     */
      __pyx_t_9 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 878; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_13 = PyObject_GetAttr(__pyx_t_9, __pyx_n_s__zeros); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 878; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_13);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __pyx_t_9 = PyInt_FromLong(__pyx_v_bins0); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 878; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_3 = PyInt_FromLong(__pyx_v_bins1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 878; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 878; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_9);
      __Pyx_GIVEREF(__pyx_t_9);
      PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      __pyx_t_9 = 0;
      __pyx_t_3 = 0;
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 878; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_1));
      __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
      __pyx_t_1 = 0;
      __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 878; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_1));
      __pyx_t_9 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 878; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_4 = PyObject_GetAttr(__pyx_t_9, __pyx_n_s__float64); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 878; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__dtype), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 878; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = PyObject_Call(__pyx_t_13, ((PyObject *)__pyx_t_3), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 878; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
      if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 878; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_21 = ((PyArrayObject *)__pyx_t_4);
      {
        __Pyx_BufFmt_StackElem __pyx_stack[1];
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_outData.rcbuffer->pybuffer, (PyObject*)__pyx_t_21, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {
          __pyx_v_outData = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_outData.rcbuffer->pybuffer.buf = NULL;
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 878; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        } else {__pyx_pybuffernd_outData.diminfo[0].strides = __pyx_pybuffernd_outData.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_outData.diminfo[0].shape = __pyx_pybuffernd_outData.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_outData.diminfo[1].strides = __pyx_pybuffernd_outData.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_outData.diminfo[1].shape = __pyx_pybuffernd_outData.rcbuffer->pybuffer.shape[1];
        }
      }
      __pyx_t_21 = 0;
      __pyx_v_outData = ((PyArrayObject *)__pyx_t_4);
      __pyx_t_4 = 0;

     879:     cdef numpy.ndarray[numpy.float64_t, ndim = 2] outCount = numpy.zeros((bins0, bins1), dtype=numpy.float64)

      /* "splitBBoxLUT.pyx":879
     *     cdef numpy.ndarray[numpy.float32_t, ndim = 1] cpos0_lower = numpy.empty(size,dtype=numpy.float32)
     *     cdef numpy.ndarray[numpy.float64_t, ndim = 2] outData = numpy.zeros((bins0, bins1), dtype=numpy.float64)
     *     cdef numpy.ndarray[numpy.float64_t, ndim = 2] outCount = numpy.zeros((bins0, bins1), dtype=numpy.float64)             # <<<<<<<<<<<<<<
     *     cdef numpy.ndarray[numpy.float32_t, ndim = 2] outMerge = numpy.zeros((bins0, bins1), dtype=numpy.float32)
     *
     */
      __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 879; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_1 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__zeros); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 879; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = PyInt_FromLong(__pyx_v_bins0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 879; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = PyInt_FromLong(__pyx_v_bins1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 879; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_13 = PyTuple_New(2); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 879; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_13);
      PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      __pyx_t_4 = 0;
      __pyx_t_3 = 0;
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 879; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_13));
      __Pyx_GIVEREF(((PyObject *)__pyx_t_13));
      __pyx_t_13 = 0;
      __pyx_t_13 = PyDict_New(); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 879; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_13));
      __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 879; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_9 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__float64); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 879; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (PyDict_SetItem(__pyx_t_13, ((PyObject *)__pyx_n_s__dtype), __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 879; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __pyx_t_9 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), ((PyObject *)__pyx_t_13)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 879; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_13)); __pyx_t_13 = 0;
      if (!(likely(((__pyx_t_9) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_9, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 879; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_22 = ((PyArrayObject *)__pyx_t_9);
      {
        __Pyx_BufFmt_StackElem __pyx_stack[1];
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_outCount.rcbuffer->pybuffer, (PyObject*)__pyx_t_22, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {
          __pyx_v_outCount = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_outCount.rcbuffer->pybuffer.buf = NULL;
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 879; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        } else {__pyx_pybuffernd_outCount.diminfo[0].strides = __pyx_pybuffernd_outCount.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_outCount.diminfo[0].shape = __pyx_pybuffernd_outCount.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_outCount.diminfo[1].strides = __pyx_pybuffernd_outCount.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_outCount.diminfo[1].shape = __pyx_pybuffernd_outCount.rcbuffer->pybuffer.shape[1];
        }
      }
      __pyx_t_22 = 0;
      __pyx_v_outCount = ((PyArrayObject *)__pyx_t_9);
      __pyx_t_9 = 0;

     880:     cdef numpy.ndarray[numpy.float32_t, ndim = 2] outMerge = numpy.zeros((bins0, bins1), dtype=numpy.float32)

      /* "splitBBoxLUT.pyx":880
     *     cdef numpy.ndarray[numpy.float64_t, ndim = 2] outData = numpy.zeros((bins0, bins1), dtype=numpy.float64)
     *     cdef numpy.ndarray[numpy.float64_t, ndim = 2] outCount = numpy.zeros((bins0, bins1), dtype=numpy.float64)
     *     cdef numpy.ndarray[numpy.float32_t, ndim = 2] outMerge = numpy.zeros((bins0, bins1), dtype=numpy.float32)             # <<<<<<<<<<<<<<
     *
     *     cdef float min0, max0, min1, max1, deltaR, deltaL, deltaU, deltaD, deltaA, tmp, delta0, delta1
     */
      __pyx_t_9 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 880; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_13 = PyObject_GetAttr(__pyx_t_9, __pyx_n_s__zeros); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 880; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_13);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __pyx_t_9 = PyInt_FromLong(__pyx_v_bins0); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 880; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_3 = PyInt_FromLong(__pyx_v_bins1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 880; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 880; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_9);
      __Pyx_GIVEREF(__pyx_t_9);
      PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      __pyx_t_9 = 0;
      __pyx_t_3 = 0;
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 880; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_1));
      __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
      __pyx_t_1 = 0;
      __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 880; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_1));
      __pyx_t_9 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 880; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_4 = PyObject_GetAttr(__pyx_t_9, __pyx_n_s__float32); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 880; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__dtype), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 880; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = PyObject_Call(__pyx_t_13, ((PyObject *)__pyx_t_3), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 880; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
      if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 880; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_23 = ((PyArrayObject *)__pyx_t_4);
      {
        __Pyx_BufFmt_StackElem __pyx_stack[1];
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_outMerge.rcbuffer->pybuffer, (PyObject*)__pyx_t_23, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {
          __pyx_v_outMerge = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_outMerge.rcbuffer->pybuffer.buf = NULL;
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 880; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        } else {__pyx_pybuffernd_outMerge.diminfo[0].strides = __pyx_pybuffernd_outMerge.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_outMerge.diminfo[0].shape = __pyx_pybuffernd_outMerge.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_outMerge.diminfo[1].strides = __pyx_pybuffernd_outMerge.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_outMerge.diminfo[1].shape = __pyx_pybuffernd_outMerge.rcbuffer->pybuffer.shape[1];
        }
      }
      __pyx_t_23 = 0;
      __pyx_v_outMerge = ((PyArrayObject *)__pyx_t_4);
      __pyx_t_4 = 0;

     881:

     882:     cdef float min0, max0, min1, max1, deltaR, deltaL, deltaU, deltaD, deltaA, tmp, delta0, delta1

     883:     cdef float pos0_min, pos0_max, pos1_min, pos1_max, pos0_maxin, pos1_maxin

     884:     cdef float fbin0_min, fbin0_max, fbin1_min, fbin1_max, data, epsilon = 1e-10, cdummy, ddummy

      /* "splitBBoxLUT.pyx":884
     *     cdef float min0, max0, min1, max1, deltaR, deltaL, deltaU, deltaD, deltaA, tmp, delta0, delta1
     *     cdef float pos0_min, pos0_max, pos1_min, pos1_max, pos0_maxin, pos1_maxin
     *     cdef float fbin0_min, fbin0_max, fbin1_min, fbin1_max, data, epsilon = 1e-10, cdummy, ddummy             # <<<<<<<<<<<<<<
     *     cdef int  bin0_max, bin0_min, bin1_max, bin1_min
     *     cdef bint check_mask=False, check_dummy=False, do_dark=False, do_flat=False, do_polarization=False, do_solidangle=False
     */
      __pyx_v_epsilon = 1e-10;

     885:     cdef int  bin0_max, bin0_min, bin1_max, bin1_min

     886:     cdef bint check_mask=False, check_dummy=False, do_dark=False, do_flat=False, do_polarization=False, do_solidangle=False

      /* "splitBBoxLUT.pyx":886
     *     cdef float fbin0_min, fbin0_max, fbin1_min, fbin1_max, data, epsilon = 1e-10, cdummy, ddummy
     *     cdef int  bin0_max, bin0_min, bin1_max, bin1_min
     *     cdef bint check_mask=False, check_dummy=False, do_dark=False, do_flat=False, do_polarization=False, do_solidangle=False             # <<<<<<<<<<<<<<
     *     cdef numpy.int8_t[:] cmask
     *     cdef float[:] cflat, cdark, cpolarization, csolidangle
     */
      __pyx_v_check_mask = 0;
      __pyx_v_check_dummy = 0;
      __pyx_v_do_dark = 0;
      __pyx_v_do_flat = 0;
      __pyx_v_do_polarization = 0;
      __pyx_v_do_solidangle = 0;

     887:     cdef numpy.int8_t[:] cmask

     888:     cdef float[:] cflat, cdark, cpolarization, csolidangle

     889:

     890:     if  mask is not None:

      /* "splitBBoxLUT.pyx":890
     *     cdef float[:] cflat, cdark, cpolarization, csolidangle
     *
     *     if  mask is not None:             # <<<<<<<<<<<<<<
     *         assert mask.size == size
     *         check_mask = True
     */
      __pyx_t_5 = (__pyx_v_mask != Py_None);
      if (__pyx_t_5) {

     891:         assert mask.size == size

        /* "splitBBoxLUT.pyx":891
     *
     *     if  mask is not None:
     *         assert mask.size == size             # <<<<<<<<<<<<<<
     *         check_mask = True
     *         cmask = numpy.ascontiguousarray(mask.ravel(),dtype=numpy.int8)
     */
        #ifndef CYTHON_WITHOUT_ASSERTIONS
        __pyx_t_4 = PyObject_GetAttr(__pyx_v_mask, __pyx_n_s__size); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 891; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_size); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 891; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_3 = PyObject_RichCompare(__pyx_t_4, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 891; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 891; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (unlikely(!__pyx_t_5)) {
          PyErr_SetNone(PyExc_AssertionError);
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 891; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        #endif

     892:         check_mask = True

        /* "splitBBoxLUT.pyx":892
     *     if  mask is not None:
     *         assert mask.size == size
     *         check_mask = True             # <<<<<<<<<<<<<<
     *         cmask = numpy.ascontiguousarray(mask.ravel(),dtype=numpy.int8)
     *
     */
        __pyx_v_check_mask = 1;

     893:         cmask = numpy.ascontiguousarray(mask.ravel(),dtype=numpy.int8)

        /* "splitBBoxLUT.pyx":893
     *         assert mask.size == size
     *         check_mask = True
     *         cmask = numpy.ascontiguousarray(mask.ravel(),dtype=numpy.int8)             # <<<<<<<<<<<<<<
     *
     *     if (dummy is not None) and delta_dummy is not None:
     */
        __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 893; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_1 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__ascontiguousarray); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 893; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_3 = PyObject_GetAttr(__pyx_v_mask, __pyx_n_s__ravel); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 893; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 893; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 893; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
        __Pyx_GIVEREF(__pyx_t_4);
        __pyx_t_4 = 0;
        __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 893; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(((PyObject *)__pyx_t_4));
        __pyx_t_13 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 893; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_13);
        __pyx_t_9 = PyObject_GetAttr(__pyx_t_13, __pyx_n_s__int8); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 893; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        if (PyDict_SetItem(__pyx_t_4, ((PyObject *)__pyx_n_s__dtype), __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 893; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_9 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 893; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
        __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
        __pyx_t_24 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int8_t(__pyx_t_9);
        if (unlikely(!__pyx_t_24.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 893; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_v_cmask = __pyx_t_24;
        __pyx_t_24.memview = NULL;
        __pyx_t_24.data = NULL;
        goto __pyx_L17;
      }
      __pyx_L17:;

     894:

     895:     if (dummy is not None) and delta_dummy is not None:

      /* "splitBBoxLUT.pyx":895
     *         cmask = numpy.ascontiguousarray(mask.ravel(),dtype=numpy.int8)
     *
     *     if (dummy is not None) and delta_dummy is not None:             # <<<<<<<<<<<<<<
     *         check_dummy = True
     *         cdummy =  float(dummy)
     */
      __pyx_t_5 = (__pyx_v_dummy != Py_None);
      if (__pyx_t_5) {
        __pyx_t_25 = (__pyx_v_delta_dummy != Py_None);
        __pyx_t_26 = __pyx_t_25;
      } else {
        __pyx_t_26 = __pyx_t_5;
      }
      if (__pyx_t_26) {

     896:         check_dummy = True

        /* "splitBBoxLUT.pyx":896
     *
     *     if (dummy is not None) and delta_dummy is not None:
     *         check_dummy = True             # <<<<<<<<<<<<<<
     *         cdummy =  float(dummy)
     *         ddummy =  float(delta_dummy)
     */
        __pyx_v_check_dummy = 1;

     897:         cdummy =  float(dummy)

        /* "splitBBoxLUT.pyx":897
     *     if (dummy is not None) and delta_dummy is not None:
     *         check_dummy = True
     *         cdummy =  float(dummy)             # <<<<<<<<<<<<<<
     *         ddummy =  float(delta_dummy)
     *     elif (dummy is not None):
     */
        __pyx_t_27 = __Pyx_PyObject_AsDouble(__pyx_v_dummy); if (unlikely(__pyx_t_27 == ((double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 897; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_v_cdummy = __pyx_t_27;

     898:         ddummy =  float(delta_dummy)

        /* "splitBBoxLUT.pyx":898
     *         check_dummy = True
     *         cdummy =  float(dummy)
     *         ddummy =  float(delta_dummy)             # <<<<<<<<<<<<<<
     *     elif (dummy is not None):
     *         cdummy = float(dummy)
     */
        __pyx_t_27 = __Pyx_PyObject_AsDouble(__pyx_v_delta_dummy); if (unlikely(__pyx_t_27 == ((double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 898; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_v_ddummy = __pyx_t_27;
        goto __pyx_L18;
      }

     899:     elif (dummy is not None):

      /* "splitBBoxLUT.pyx":899
     *         cdummy =  float(dummy)
     *         ddummy =  float(delta_dummy)
     *     elif (dummy is not None):             # <<<<<<<<<<<<<<
     *         cdummy = float(dummy)
     *     else:
     */
      __pyx_t_26 = (__pyx_v_dummy != Py_None);
      if (__pyx_t_26) {

     900:         cdummy = float(dummy)

        /* "splitBBoxLUT.pyx":900
     *         ddummy =  float(delta_dummy)
     *     elif (dummy is not None):
     *         cdummy = float(dummy)             # <<<<<<<<<<<<<<
     *     else:
     *         cdummy=0.0
     */
        __pyx_t_27 = __Pyx_PyObject_AsDouble(__pyx_v_dummy); if (unlikely(__pyx_t_27 == ((double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 900; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_v_cdummy = __pyx_t_27;
        goto __pyx_L18;
      }
      /*else*/ {

     901:     else:

     902:         cdummy=0.0

        /* "splitBBoxLUT.pyx":902
     *         cdummy = float(dummy)
     *     else:
     *         cdummy=0.0             # <<<<<<<<<<<<<<
     *
     *     if dark is not None:
     */
        __pyx_v_cdummy = 0.0;
      }
      __pyx_L18:;

     903:

     904:     if dark is not None:

      /* "splitBBoxLUT.pyx":904
     *         cdummy=0.0
     *
     *     if dark is not None:             # <<<<<<<<<<<<<<
     *         assert dark.size == size
     *         do_dark = True
     */
      __pyx_t_26 = (__pyx_v_dark != Py_None);
      if (__pyx_t_26) {

     905:         assert dark.size == size

        /* "splitBBoxLUT.pyx":905
     *
     *     if dark is not None:
     *         assert dark.size == size             # <<<<<<<<<<<<<<
     *         do_dark = True
     *         cdark = numpy.ascontiguousarray(dark.ravel(),dtype=numpy.float32)
     */
        #ifndef CYTHON_WITHOUT_ASSERTIONS
        __pyx_t_9 = PyObject_GetAttr(__pyx_v_dark, __pyx_n_s__size); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 905; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_4 = __Pyx_PyInt_FromSize_t(__pyx_v_size); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 905; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_3 = PyObject_RichCompare(__pyx_t_9, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 905; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_26 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_26 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 905; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (unlikely(!__pyx_t_26)) {
          PyErr_SetNone(PyExc_AssertionError);
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 905; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        #endif

     906:         do_dark = True

        /* "splitBBoxLUT.pyx":906
     *     if dark is not None:
     *         assert dark.size == size
     *         do_dark = True             # <<<<<<<<<<<<<<
     *         cdark = numpy.ascontiguousarray(dark.ravel(),dtype=numpy.float32)
     *     if flat is not None:
     */
        __pyx_v_do_dark = 1;

     907:         cdark = numpy.ascontiguousarray(dark.ravel(),dtype=numpy.float32)

        /* "splitBBoxLUT.pyx":907
     *         assert dark.size == size
     *         do_dark = True
     *         cdark = numpy.ascontiguousarray(dark.ravel(),dtype=numpy.float32)             # <<<<<<<<<<<<<<
     *     if flat is not None:
     *         assert flat.size == size
     */
        __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 907; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_4 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__ascontiguousarray); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 907; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_3 = PyObject_GetAttr(__pyx_v_dark, __pyx_n_s__ravel); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 907; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_9 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 907; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 907; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_9);
        __Pyx_GIVEREF(__pyx_t_9);
        __pyx_t_9 = 0;
        __pyx_t_9 = PyDict_New(); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 907; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(((PyObject *)__pyx_t_9));
        __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 907; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_13 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__float32); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 907; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_13);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        if (PyDict_SetItem(__pyx_t_9, ((PyObject *)__pyx_n_s__dtype), __pyx_t_13) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 907; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        __pyx_t_13 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_3), ((PyObject *)__pyx_t_9)); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 907; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_13);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
        __Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0;
        __pyx_t_28 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(__pyx_t_13);
        if (unlikely(!__pyx_t_28.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 907; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        __pyx_v_cdark = __pyx_t_28;
        __pyx_t_28.memview = NULL;
        __pyx_t_28.data = NULL;
        goto __pyx_L19;
      }
      __pyx_L19:;

     908:     if flat is not None:

      /* "splitBBoxLUT.pyx":908
     *         do_dark = True
     *         cdark = numpy.ascontiguousarray(dark.ravel(),dtype=numpy.float32)
     *     if flat is not None:             # <<<<<<<<<<<<<<
     *         assert flat.size == size
     *         do_flat = True
     */
      __pyx_t_26 = (__pyx_v_flat != Py_None);
      if (__pyx_t_26) {

     909:         assert flat.size == size

        /* "splitBBoxLUT.pyx":909
     *         cdark = numpy.ascontiguousarray(dark.ravel(),dtype=numpy.float32)
     *     if flat is not None:
     *         assert flat.size == size             # <<<<<<<<<<<<<<
     *         do_flat = True
     *         cflat = numpy.ascontiguousarray(flat.ravel(),dtype=numpy.float32)
     */
        #ifndef CYTHON_WITHOUT_ASSERTIONS
        __pyx_t_13 = PyObject_GetAttr(__pyx_v_flat, __pyx_n_s__size); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 909; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_13);
        __pyx_t_9 = __Pyx_PyInt_FromSize_t(__pyx_v_size); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 909; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_3 = PyObject_RichCompare(__pyx_t_13, __pyx_t_9, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 909; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_26 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_26 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 909; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (unlikely(!__pyx_t_26)) {
          PyErr_SetNone(PyExc_AssertionError);
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 909; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        #endif

     910:         do_flat = True

        /* "splitBBoxLUT.pyx":910
     *     if flat is not None:
     *         assert flat.size == size
     *         do_flat = True             # <<<<<<<<<<<<<<
     *         cflat = numpy.ascontiguousarray(flat.ravel(),dtype=numpy.float32)
     *     if polarization is not None:
     */
        __pyx_v_do_flat = 1;

     911:         cflat = numpy.ascontiguousarray(flat.ravel(),dtype=numpy.float32)

        /* "splitBBoxLUT.pyx":911
     *         assert flat.size == size
     *         do_flat = True
     *         cflat = numpy.ascontiguousarray(flat.ravel(),dtype=numpy.float32)             # <<<<<<<<<<<<<<
     *     if polarization is not None:
     *         do_polarization = True
     */
        __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 911; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_9 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__ascontiguousarray); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 911; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_3 = PyObject_GetAttr(__pyx_v_flat, __pyx_n_s__ravel); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 911; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_13 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 911; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_13);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 911; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_13);
        __Pyx_GIVEREF(__pyx_t_13);
        __pyx_t_13 = 0;
        __pyx_t_13 = PyDict_New(); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 911; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(((PyObject *)__pyx_t_13));
        __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 911; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_1 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__float32); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 911; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (PyDict_SetItem(__pyx_t_13, ((PyObject *)__pyx_n_s__dtype), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 911; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_t_1 = PyObject_Call(__pyx_t_9, ((PyObject *)__pyx_t_3), ((PyObject *)__pyx_t_13)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 911; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
        __Pyx_DECREF(((PyObject *)__pyx_t_13)); __pyx_t_13 = 0;
        __pyx_t_28 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(__pyx_t_1);
        if (unlikely(!__pyx_t_28.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 911; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_v_cflat = __pyx_t_28;
        __pyx_t_28.memview = NULL;
        __pyx_t_28.data = NULL;
        goto __pyx_L20;
      }
      __pyx_L20:;

     912:     if polarization is not None:

      /* "splitBBoxLUT.pyx":912
     *         do_flat = True
     *         cflat = numpy.ascontiguousarray(flat.ravel(),dtype=numpy.float32)
     *     if polarization is not None:             # <<<<<<<<<<<<<<
     *         do_polarization = True
     *         assert polarization.size == size
     */
      __pyx_t_26 = (__pyx_v_polarization != Py_None);
      if (__pyx_t_26) {

     913:         do_polarization = True

        /* "splitBBoxLUT.pyx":913
     *         cflat = numpy.ascontiguousarray(flat.ravel(),dtype=numpy.float32)
     *     if polarization is not None:
     *         do_polarization = True             # <<<<<<<<<<<<<<
     *         assert polarization.size == size
     *         cpolarization = numpy.ascontiguousarray(polarization.ravel(), dtype=numpy.float32)
     */
        __pyx_v_do_polarization = 1;

     914:         assert polarization.size == size

        /* "splitBBoxLUT.pyx":914
     *     if polarization is not None:
     *         do_polarization = True
     *         assert polarization.size == size             # <<<<<<<<<<<<<<
     *         cpolarization = numpy.ascontiguousarray(polarization.ravel(), dtype=numpy.float32)
     *     if solidangle is not None:
     */
        #ifndef CYTHON_WITHOUT_ASSERTIONS
        __pyx_t_1 = PyObject_GetAttr(__pyx_v_polarization, __pyx_n_s__size); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 914; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_13 = __Pyx_PyInt_FromSize_t(__pyx_v_size); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 914; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_13);
        __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_13, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 914; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        __pyx_t_26 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_26 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 914; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (unlikely(!__pyx_t_26)) {
          PyErr_SetNone(PyExc_AssertionError);
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 914; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        #endif

     915:         cpolarization = numpy.ascontiguousarray(polarization.ravel(), dtype=numpy.float32)

        /* "splitBBoxLUT.pyx":915
     *         do_polarization = True
     *         assert polarization.size == size
     *         cpolarization = numpy.ascontiguousarray(polarization.ravel(), dtype=numpy.float32)             # <<<<<<<<<<<<<<
     *     if solidangle is not None:
     *         do_solidangle = True
     */
        __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 915; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_13 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__ascontiguousarray); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 915; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_13);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_3 = PyObject_GetAttr(__pyx_v_polarization, __pyx_n_s__ravel); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 915; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_1 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 915; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 915; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
        __Pyx_GIVEREF(__pyx_t_1);
        __pyx_t_1 = 0;
        __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 915; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(((PyObject *)__pyx_t_1));
        __pyx_t_9 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 915; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_4 = PyObject_GetAttr(__pyx_t_9, __pyx_n_s__float32); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 915; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__dtype), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 915; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_4 = PyObject_Call(__pyx_t_13, ((PyObject *)__pyx_t_3), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 915; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
        __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
        __pyx_t_28 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(__pyx_t_4);
        if (unlikely(!__pyx_t_28.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 915; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_v_cpolarization = __pyx_t_28;
        __pyx_t_28.memview = NULL;
        __pyx_t_28.data = NULL;
        goto __pyx_L21;
      }
      __pyx_L21:;

     916:     if solidangle is not None:

      /* "splitBBoxLUT.pyx":916
     *         assert polarization.size == size
     *         cpolarization = numpy.ascontiguousarray(polarization.ravel(), dtype=numpy.float32)
     *     if solidangle is not None:             # <<<<<<<<<<<<<<
     *         do_solidangle = True
     *         assert solidangle.size == size
     */
      __pyx_t_26 = (__pyx_v_solidangle != Py_None);
      if (__pyx_t_26) {

     917:         do_solidangle = True

        /* "splitBBoxLUT.pyx":917
     *         cpolarization = numpy.ascontiguousarray(polarization.ravel(), dtype=numpy.float32)
     *     if solidangle is not None:
     *         do_solidangle = True             # <<<<<<<<<<<<<<
     *         assert solidangle.size == size
     *         csolidangle = numpy.ascontiguousarray(solidangle.ravel(), dtype=numpy.float32)
     */
        __pyx_v_do_solidangle = 1;

     918:         assert solidangle.size == size

        /* "splitBBoxLUT.pyx":918
     *     if solidangle is not None:
     *         do_solidangle = True
     *         assert solidangle.size == size             # <<<<<<<<<<<<<<
     *         csolidangle = numpy.ascontiguousarray(solidangle.ravel(), dtype=numpy.float32)
     *
     */
        #ifndef CYTHON_WITHOUT_ASSERTIONS
        __pyx_t_4 = PyObject_GetAttr(__pyx_v_solidangle, __pyx_n_s__size); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 918; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_size); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 918; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_3 = PyObject_RichCompare(__pyx_t_4, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 918; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_t_26 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_26 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 918; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (unlikely(!__pyx_t_26)) {
          PyErr_SetNone(PyExc_AssertionError);
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 918; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        #endif

     919:         csolidangle = numpy.ascontiguousarray(solidangle.ravel(), dtype=numpy.float32)

        /* "splitBBoxLUT.pyx":919
     *         do_solidangle = True
     *         assert solidangle.size == size
     *         csolidangle = numpy.ascontiguousarray(solidangle.ravel(), dtype=numpy.float32)             # <<<<<<<<<<<<<<
     *
     *
     */
        __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 919; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_1 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__ascontiguousarray); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 919; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_3 = PyObject_GetAttr(__pyx_v_solidangle, __pyx_n_s__ravel); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 919; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 919; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 919; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
        __Pyx_GIVEREF(__pyx_t_4);
        __pyx_t_4 = 0;
        __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 919; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(((PyObject *)__pyx_t_4));
        __pyx_t_13 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 919; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_13);
        __pyx_t_9 = PyObject_GetAttr(__pyx_t_13, __pyx_n_s__float32); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 919; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        if (PyDict_SetItem(__pyx_t_4, ((PyObject *)__pyx_n_s__dtype), __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 919; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_9 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 919; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
        __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
        __pyx_t_28 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(__pyx_t_9);
        if (unlikely(!__pyx_t_28.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 919; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_v_csolidangle = __pyx_t_28;
        __pyx_t_28.memview = NULL;
        __pyx_t_28.data = NULL;
        goto __pyx_L22;
      }
      __pyx_L22:;

     920:

     921:

     922:     pos0_min=cpos0[0]

      /* "splitBBoxLUT.pyx":922
     *
     *
     *     pos0_min=cpos0[0]             # <<<<<<<<<<<<<<
     *     pos0_max=cpos0[0]
     *
     */
      __pyx_t_29 = 0;
      __pyx_v_pos0_min = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_cpos0.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_cpos0.diminfo[0].strides));

     923:     pos0_max=cpos0[0]

      /* "splitBBoxLUT.pyx":923
     *
     *     pos0_min=cpos0[0]
     *     pos0_max=cpos0[0]             # <<<<<<<<<<<<<<
     *
     *     with nogil:
     */
      __pyx_t_30 = 0;
      __pyx_v_pos0_max = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_cpos0.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_cpos0.diminfo[0].strides));

     924:

     925:     with nogil:

      /* "splitBBoxLUT.pyx":925
     *     pos0_max=cpos0[0]
     *
     *     with nogil:             # <<<<<<<<<<<<<<
     *         for idx in range(size):
     *             min0 = cpos0[idx] - dpos0[idx]
     */
      {
          #ifdef WITH_THREAD
          PyThreadState *_save = NULL;
          #endif
          Py_UNBLOCK_THREADS
          /*try:*/ {

          /* "splitBBoxLUT.pyx":925
     *     pos0_max=cpos0[0]
     *
     *     with nogil:             # <<<<<<<<<<<<<<
     *         for idx in range(size):
     *             min0 = cpos0[idx] - dpos0[idx]
     */
          /*finally:*/ {
            Py_BLOCK_THREADS
          }
      }

     926:         for idx in range(size):

            /* "splitBBoxLUT.pyx":926
     *
     *     with nogil:
     *         for idx in range(size):             # <<<<<<<<<<<<<<
     *             min0 = cpos0[idx] - dpos0[idx]
     *             max0 = cpos0[idx] + dpos0[idx]
     */
            __pyx_t_2 = __pyx_v_size;
            for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_2; __pyx_t_12+=1) {
              __pyx_v_idx = __pyx_t_12;

     927:             min0 = cpos0[idx] - dpos0[idx]

              /* "splitBBoxLUT.pyx":927
     *     with nogil:
     *         for idx in range(size):
     *             min0 = cpos0[idx] - dpos0[idx]             # <<<<<<<<<<<<<<
     *             max0 = cpos0[idx] + dpos0[idx]
     *             cpos0_upper[idx]=max0
     */
              __pyx_t_11 = __pyx_v_idx;
              __pyx_t_31 = __pyx_v_idx;
              __pyx_v_min0 = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_cpos0.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_cpos0.diminfo[0].strides)) - (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_dpos0.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_dpos0.diminfo[0].strides)));

     928:             max0 = cpos0[idx] + dpos0[idx]

              /* "splitBBoxLUT.pyx":928
     *         for idx in range(size):
     *             min0 = cpos0[idx] - dpos0[idx]
     *             max0 = cpos0[idx] + dpos0[idx]             # <<<<<<<<<<<<<<
     *             cpos0_upper[idx]=max0
     *             cpos0_lower[idx]=min0
     */
              __pyx_t_32 = __pyx_v_idx;
              __pyx_t_33 = __pyx_v_idx;
              __pyx_v_max0 = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_cpos0.rcbuffer->pybuffer.buf, __pyx_t_32, __pyx_pybuffernd_cpos0.diminfo[0].strides)) + (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_dpos0.rcbuffer->pybuffer.buf, __pyx_t_33, __pyx_pybuffernd_dpos0.diminfo[0].strides)));

     929:             cpos0_upper[idx]=max0

              /* "splitBBoxLUT.pyx":929
     *             min0 = cpos0[idx] - dpos0[idx]
     *             max0 = cpos0[idx] + dpos0[idx]
     *             cpos0_upper[idx]=max0             # <<<<<<<<<<<<<<
     *             cpos0_lower[idx]=min0
     *             if max0>pos0_max:
     */
              __pyx_t_34 = __pyx_v_idx;
              *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_cpos0_upper.rcbuffer->pybuffer.buf, __pyx_t_34, __pyx_pybuffernd_cpos0_upper.diminfo[0].strides) = __pyx_v_max0;

     930:             cpos0_lower[idx]=min0

              /* "splitBBoxLUT.pyx":930
     *             max0 = cpos0[idx] + dpos0[idx]
     *             cpos0_upper[idx]=max0
     *             cpos0_lower[idx]=min0             # <<<<<<<<<<<<<<
     *             if max0>pos0_max:
     *                 pos0_max=max0
     */
              __pyx_t_35 = __pyx_v_idx;
              *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_cpos0_lower.rcbuffer->pybuffer.buf, __pyx_t_35, __pyx_pybuffernd_cpos0_lower.diminfo[0].strides) = __pyx_v_min0;

     931:             if max0>pos0_max:

              /* "splitBBoxLUT.pyx":931
     *             cpos0_upper[idx]=max0
     *             cpos0_lower[idx]=min0
     *             if max0>pos0_max:             # <<<<<<<<<<<<<<
     *                 pos0_max=max0
     *             if min0<pos0_min:
     */
              __pyx_t_26 = (__pyx_v_max0 > __pyx_v_pos0_max);
              if (__pyx_t_26) {

     932:                 pos0_max=max0

                /* "splitBBoxLUT.pyx":932
     *             cpos0_lower[idx]=min0
     *             if max0>pos0_max:
     *                 pos0_max=max0             # <<<<<<<<<<<<<<
     *             if min0<pos0_min:
     *                 pos0_min=min0
     */
                __pyx_v_pos0_max = __pyx_v_max0;
                goto __pyx_L28;
              }
              __pyx_L28:;

     933:             if min0<pos0_min:

              /* "splitBBoxLUT.pyx":933
     *             if max0>pos0_max:
     *                 pos0_max=max0
     *             if min0<pos0_min:             # <<<<<<<<<<<<<<
     *                 pos0_min=min0
     *
     */
              __pyx_t_26 = (__pyx_v_min0 < __pyx_v_pos0_min);
              if (__pyx_t_26) {

     934:                 pos0_min=min0

                /* "splitBBoxLUT.pyx":934
     *                 pos0_max=max0
     *             if min0<pos0_min:
     *                 pos0_min=min0             # <<<<<<<<<<<<<<
     *
     *     if (pos0Range is not None) and (len(pos0Range) == 2):
     */
                __pyx_v_pos0_min = __pyx_v_min0;
                goto __pyx_L29;
              }
              __pyx_L29:;
            }
          }

     935:

     936:     if (pos0Range is not None) and (len(pos0Range) == 2):

      /* "splitBBoxLUT.pyx":936
     *                 pos0_min=min0
     *
     *     if (pos0Range is not None) and (len(pos0Range) == 2):             # <<<<<<<<<<<<<<
     *         pos0_min = min(pos0Range)
     *         pos0_maxin = max(pos0Range)
     */
      __pyx_t_26 = (__pyx_v_pos0Range != Py_None);
      if (__pyx_t_26) {
        __pyx_t_36 = PyObject_Length(__pyx_v_pos0Range); if (unlikely(__pyx_t_36 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 936; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_t_5 = (__pyx_t_36 == 2);
        __pyx_t_25 = __pyx_t_5;
      } else {
        __pyx_t_25 = __pyx_t_26;
      }
      if (__pyx_t_25) {

     937:         pos0_min = min(pos0Range)

        /* "splitBBoxLUT.pyx":937
     *
     *     if (pos0Range is not None) and (len(pos0Range) == 2):
     *         pos0_min = min(pos0Range)             # <<<<<<<<<<<<<<
     *         pos0_maxin = max(pos0Range)
     *     else:
     */
        __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 937; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_INCREF(__pyx_v_pos0Range);
        PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_pos0Range);
        __Pyx_GIVEREF(__pyx_v_pos0Range);
        __pyx_t_4 = PyObject_Call(__pyx_builtin_min, ((PyObject *)__pyx_t_9), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 937; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0;
        __pyx_t_37 = __pyx_PyFloat_AsFloat(__pyx_t_4); if (unlikely((__pyx_t_37 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 937; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_v_pos0_min = __pyx_t_37;

     938:         pos0_maxin = max(pos0Range)

        /* "splitBBoxLUT.pyx":938
     *     if (pos0Range is not None) and (len(pos0Range) == 2):
     *         pos0_min = min(pos0Range)
     *         pos0_maxin = max(pos0Range)             # <<<<<<<<<<<<<<
     *     else:
     * #        pos0_min = pos0_min
     */
        __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 938; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_INCREF(__pyx_v_pos0Range);
        PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_pos0Range);
        __Pyx_GIVEREF(__pyx_v_pos0Range);
        __pyx_t_9 = PyObject_Call(__pyx_builtin_max, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 938; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
        __pyx_t_37 = __pyx_PyFloat_AsFloat(__pyx_t_9); if (unlikely((__pyx_t_37 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 938; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_v_pos0_maxin = __pyx_t_37;
        goto __pyx_L30;
      }
      /*else*/ {

     939:     else:

     940: #        pos0_min = pos0_min

     941:         pos0_maxin = pos0_max

        /* "splitBBoxLUT.pyx":941
     *     else:
     * #        pos0_min = pos0_min
     *         pos0_maxin = pos0_max             # <<<<<<<<<<<<<<
     *     if pos0_min<0:
     *         pos0_min=0
     */
        __pyx_v_pos0_maxin = __pyx_v_pos0_max;
      }
      __pyx_L30:;

     942:     if pos0_min<0:

      /* "splitBBoxLUT.pyx":942
     * #        pos0_min = pos0_min
     *         pos0_maxin = pos0_max
     *     if pos0_min<0:             # <<<<<<<<<<<<<<
     *         pos0_min=0
     *     pos0_max = pos0_maxin * EPS32
     */
      __pyx_t_25 = (__pyx_v_pos0_min < 0.0);
      if (__pyx_t_25) {

     943:         pos0_min=0

        /* "splitBBoxLUT.pyx":943
     *         pos0_maxin = pos0_max
     *     if pos0_min<0:
     *         pos0_min=0             # <<<<<<<<<<<<<<
     *     pos0_max = pos0_maxin * EPS32
     *
     */
        __pyx_v_pos0_min = 0.0;
        goto __pyx_L31;
      }
      __pyx_L31:;

     944:     pos0_max = pos0_maxin * EPS32

      /* "splitBBoxLUT.pyx":944
     *     if pos0_min<0:
     *         pos0_min=0
     *     pos0_max = pos0_maxin * EPS32             # <<<<<<<<<<<<<<
     *
     *     if (pos1Range is not None) and (len(pos1Range) == 2):
     */
      __pyx_t_9 = PyFloat_FromDouble(__pyx_v_pos0_maxin); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 944; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__EPS32); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 944; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = PyNumber_Multiply(__pyx_t_9, __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 944; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_37 = __pyx_PyFloat_AsFloat(__pyx_t_3); if (unlikely((__pyx_t_37 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 944; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_v_pos0_max = __pyx_t_37;

     945:

     946:     if (pos1Range is not None) and (len(pos1Range) == 2):

      /* "splitBBoxLUT.pyx":946
     *     pos0_max = pos0_maxin * EPS32
     *
     *     if (pos1Range is not None) and (len(pos1Range) == 2):             # <<<<<<<<<<<<<<
     *         pos1_min = min(pos1Range)
     *         pos1_maxin = max(pos1Range)
     */
      __pyx_t_25 = (__pyx_v_pos1Range != Py_None);
      if (__pyx_t_25) {
        __pyx_t_36 = PyObject_Length(__pyx_v_pos1Range); if (unlikely(__pyx_t_36 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 946; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_t_26 = (__pyx_t_36 == 2);
        __pyx_t_5 = __pyx_t_26;
      } else {
        __pyx_t_5 = __pyx_t_25;
      }
      if (__pyx_t_5) {

     947:         pos1_min = min(pos1Range)

        /* "splitBBoxLUT.pyx":947
     *
     *     if (pos1Range is not None) and (len(pos1Range) == 2):
     *         pos1_min = min(pos1Range)             # <<<<<<<<<<<<<<
     *         pos1_maxin = max(pos1Range)
     *     else:
     */
        __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 947; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_INCREF(__pyx_v_pos1Range);
        PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_pos1Range);
        __Pyx_GIVEREF(__pyx_v_pos1Range);
        __pyx_t_4 = PyObject_Call(__pyx_builtin_min, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 947; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
        __pyx_t_37 = __pyx_PyFloat_AsFloat(__pyx_t_4); if (unlikely((__pyx_t_37 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 947; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_v_pos1_min = __pyx_t_37;

     948:         pos1_maxin = max(pos1Range)

        /* "splitBBoxLUT.pyx":948
     *     if (pos1Range is not None) and (len(pos1Range) == 2):
     *         pos1_min = min(pos1Range)
     *         pos1_maxin = max(pos1Range)             # <<<<<<<<<<<<<<
     *     else:
     *         pos1_min = cpos1.min()
     */
        __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 948; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_INCREF(__pyx_v_pos1Range);
        PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_pos1Range);
        __Pyx_GIVEREF(__pyx_v_pos1Range);
        __pyx_t_3 = PyObject_Call(__pyx_builtin_max, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 948; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
        __pyx_t_37 = __pyx_PyFloat_AsFloat(__pyx_t_3); if (unlikely((__pyx_t_37 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 948; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_v_pos1_maxin = __pyx_t_37;
        goto __pyx_L32;
      }
      /*else*/ {

     949:     else:

     950:         pos1_min = cpos1.min()

        /* "splitBBoxLUT.pyx":950
     *         pos1_maxin = max(pos1Range)
     *     else:
     *         pos1_min = cpos1.min()             # <<<<<<<<<<<<<<
     *         pos1_maxin = cpos1.max()
     *     pos1_max = pos1_maxin * EPS32
     */
        __pyx_t_3 = PyObject_GetAttr(((PyObject *)__pyx_v_cpos1), __pyx_n_s__min); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 950; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 950; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_37 = __pyx_PyFloat_AsFloat(__pyx_t_4); if (unlikely((__pyx_t_37 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 950; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_v_pos1_min = __pyx_t_37;

     951:         pos1_maxin = cpos1.max()

        /* "splitBBoxLUT.pyx":951
     *     else:
     *         pos1_min = cpos1.min()
     *         pos1_maxin = cpos1.max()             # <<<<<<<<<<<<<<
     *     pos1_max = pos1_maxin * EPS32
     *
     */
        __pyx_t_4 = PyObject_GetAttr(((PyObject *)__pyx_v_cpos1), __pyx_n_s__max); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 951; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_3 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 951; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_37 = __pyx_PyFloat_AsFloat(__pyx_t_3); if (unlikely((__pyx_t_37 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 951; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_v_pos1_maxin = __pyx_t_37;
      }
      __pyx_L32:;

     952:     pos1_max = pos1_maxin * EPS32

      /* "splitBBoxLUT.pyx":952
     *         pos1_min = cpos1.min()
     *         pos1_maxin = cpos1.max()
     *     pos1_max = pos1_maxin * EPS32             # <<<<<<<<<<<<<<
     *
     *     delta0 = (pos0_max - pos0_min) / (< float > (bins0))
     */
      __pyx_t_3 = PyFloat_FromDouble(__pyx_v_pos1_maxin); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 952; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__EPS32); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 952; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_9 = PyNumber_Multiply(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 952; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_37 = __pyx_PyFloat_AsFloat(__pyx_t_9); if (unlikely((__pyx_t_37 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 952; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __pyx_v_pos1_max = __pyx_t_37;

     953:

     954:     delta0 = (pos0_max - pos0_min) / (< float > (bins0))

      /* "splitBBoxLUT.pyx":954
     *     pos1_max = pos1_maxin * EPS32
     *
     *     delta0 = (pos0_max - pos0_min) / (< float > (bins0))             # <<<<<<<<<<<<<<
     *     delta1 = (pos1_max - pos1_min) / (< float > (bins1))
     *     edges0 = numpy.linspace(pos0_min+0.5*delta0, pos0_maxin-0.5*delta0, bins0)
     */
      __pyx_v_delta0 = ((__pyx_v_pos0_max - __pyx_v_pos0_min) / ((float)__pyx_v_bins0));

     955:     delta1 = (pos1_max - pos1_min) / (< float > (bins1))

      /* "splitBBoxLUT.pyx":955
     *
     *     delta0 = (pos0_max - pos0_min) / (< float > (bins0))
     *     delta1 = (pos1_max - pos1_min) / (< float > (bins1))             # <<<<<<<<<<<<<<
     *     edges0 = numpy.linspace(pos0_min+0.5*delta0, pos0_maxin-0.5*delta0, bins0)
     *     edges1 = numpy.linspace(pos1_min+0.5*delta1, pos1_maxin-0.5*delta1, bins1)
     */
      __pyx_v_delta1 = ((__pyx_v_pos1_max - __pyx_v_pos1_min) / ((float)__pyx_v_bins1));

     956:     edges0 = numpy.linspace(pos0_min+0.5*delta0, pos0_maxin-0.5*delta0, bins0)

      /* "splitBBoxLUT.pyx":956
     *     delta0 = (pos0_max - pos0_min) / (< float > (bins0))
     *     delta1 = (pos1_max - pos1_min) / (< float > (bins1))
     *     edges0 = numpy.linspace(pos0_min+0.5*delta0, pos0_maxin-0.5*delta0, bins0)             # <<<<<<<<<<<<<<
     *     edges1 = numpy.linspace(pos1_min+0.5*delta1, pos1_maxin-0.5*delta1, bins1)
     *     with nogil:
     */
      __pyx_t_9 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 956; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_4 = PyObject_GetAttr(__pyx_t_9, __pyx_n_s__linspace); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 956; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __pyx_t_9 = PyFloat_FromDouble((__pyx_v_pos0_min + (0.5 * __pyx_v_delta0))); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 956; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_3 = PyFloat_FromDouble((__pyx_v_pos0_maxin - (0.5 * __pyx_v_delta0))); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 956; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_1 = PyInt_FromLong(__pyx_v_bins0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 956; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_13 = PyTuple_New(3); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 956; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_13);
      PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_9);
      __Pyx_GIVEREF(__pyx_t_9);
      PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_13, 2, __pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_1);
      __pyx_t_9 = 0;
      __pyx_t_3 = 0;
      __pyx_t_1 = 0;
      __pyx_t_1 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_13), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 956; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_13)); __pyx_t_13 = 0;
      __pyx_v_edges0 = __pyx_t_1;
      __pyx_t_1 = 0;

     957:     edges1 = numpy.linspace(pos1_min+0.5*delta1, pos1_maxin-0.5*delta1, bins1)

      /* "splitBBoxLUT.pyx":957
     *     delta1 = (pos1_max - pos1_min) / (< float > (bins1))
     *     edges0 = numpy.linspace(pos0_min+0.5*delta0, pos0_maxin-0.5*delta0, bins0)
     *     edges1 = numpy.linspace(pos1_min+0.5*delta1, pos1_maxin-0.5*delta1, bins1)             # <<<<<<<<<<<<<<
     *     with nogil:
     *         for idx in range(size):
     */
      __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 957; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_13 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__linspace); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 957; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_13);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyFloat_FromDouble((__pyx_v_pos1_min + (0.5 * __pyx_v_delta1))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 957; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_4 = PyFloat_FromDouble((__pyx_v_pos1_maxin - (0.5 * __pyx_v_delta1))); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 957; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = PyInt_FromLong(__pyx_v_bins1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 957; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_9 = PyTuple_New(3); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 957; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_9);
      PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_9, 2, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      __pyx_t_1 = 0;
      __pyx_t_4 = 0;
      __pyx_t_3 = 0;
      __pyx_t_3 = PyObject_Call(__pyx_t_13, ((PyObject *)__pyx_t_9), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 957; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0;
      __pyx_v_edges1 = __pyx_t_3;
      __pyx_t_3 = 0;

     958:     with nogil:

      /* "splitBBoxLUT.pyx":958
     *     edges0 = numpy.linspace(pos0_min+0.5*delta0, pos0_maxin-0.5*delta0, bins0)
     *     edges1 = numpy.linspace(pos1_min+0.5*delta1, pos1_maxin-0.5*delta1, bins1)
     *     with nogil:             # <<<<<<<<<<<<<<
     *         for idx in range(size):
     *             if (check_mask) and cmask[idx]:
     */
      {
          #ifdef WITH_THREAD
          PyThreadState *_save = NULL;
          #endif
          Py_UNBLOCK_THREADS
          /*try:*/ {

          /* "splitBBoxLUT.pyx":958
     *     edges0 = numpy.linspace(pos0_min+0.5*delta0, pos0_maxin-0.5*delta0, bins0)
     *     edges1 = numpy.linspace(pos1_min+0.5*delta1, pos1_maxin-0.5*delta1, bins1)
     *     with nogil:             # <<<<<<<<<<<<<<
     *         for idx in range(size):
     *             if (check_mask) and cmask[idx]:
     */
          /*finally:*/ {
            int __pyx_why;
            __pyx_why = 0; goto __pyx_L35;
            __pyx_L34: __pyx_why = 4; goto __pyx_L35;
            __pyx_L35:;
            Py_BLOCK_THREADS
            switch (__pyx_why) {
              case 4: goto __pyx_L1_error;
            }
          }
      }

     959:         for idx in range(size):

            /* "splitBBoxLUT.pyx":959
     *     edges1 = numpy.linspace(pos1_min+0.5*delta1, pos1_maxin-0.5*delta1, bins1)
     *     with nogil:
     *         for idx in range(size):             # <<<<<<<<<<<<<<
     *             if (check_mask) and cmask[idx]:
     *                 continue
     */
            __pyx_t_2 = __pyx_v_size;
            for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_2; __pyx_t_12+=1) {
              __pyx_v_idx = __pyx_t_12;

     960:             if (check_mask) and cmask[idx]:

              /* "splitBBoxLUT.pyx":960
     *     with nogil:
     *         for idx in range(size):
     *             if (check_mask) and cmask[idx]:             # <<<<<<<<<<<<<<
     *                 continue
     *
     */
              __pyx_t_5 = __pyx_v_check_mask;
              if (__pyx_t_5) {
                if (unlikely(!__pyx_v_cmask.memview)) { __Pyx_RaiseUnboundMemoryviewSliceNogil("cmask"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 960; __pyx_clineno = __LINE__; goto __pyx_L34;} }
                __pyx_t_38 = __pyx_v_idx;
                __pyx_t_25 = (*((__pyx_t_5numpy_int8_t *) ( /* dim=0 */ (__pyx_v_cmask.data + __pyx_t_38 * __pyx_v_cmask.strides[0]) )));
              } else {
                __pyx_t_25 = __pyx_t_5;
              }
              if (__pyx_t_25) {

     961:                 continue

                /* "splitBBoxLUT.pyx":961
     *         for idx in range(size):
     *             if (check_mask) and cmask[idx]:
     *                 continue             # <<<<<<<<<<<<<<
     *
     *             data = cdata[idx]
     */
                goto __pyx_L36_continue;
                goto __pyx_L38;
              }
              __pyx_L38:;

     962:

     963:             data = cdata[idx]

              /* "splitBBoxLUT.pyx":963
     *                 continue
     *
     *             data = cdata[idx]             # <<<<<<<<<<<<<<
     *             if (check_dummy) and (fabs(data-cdummy)<=ddummy):
     *                 continue
     */
              __pyx_t_39 = __pyx_v_idx;
              __pyx_v_data = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_cdata.rcbuffer->pybuffer.buf, __pyx_t_39, __pyx_pybuffernd_cdata.diminfo[0].strides));

     964:             if (check_dummy) and (fabs(data-cdummy)<=ddummy):

              /* "splitBBoxLUT.pyx":964
     *
     *             data = cdata[idx]
     *             if (check_dummy) and (fabs(data-cdummy)<=ddummy):             # <<<<<<<<<<<<<<
     *                 continue
     *
     */
              if (__pyx_v_check_dummy) {
                __pyx_t_25 = (fabs((__pyx_v_data - __pyx_v_cdummy)) <= __pyx_v_ddummy);
                __pyx_t_5 = __pyx_t_25;
              } else {
                __pyx_t_5 = __pyx_v_check_dummy;
              }
              if (__pyx_t_5) {

     965:                 continue

                /* "splitBBoxLUT.pyx":965
     *             data = cdata[idx]
     *             if (check_dummy) and (fabs(data-cdummy)<=ddummy):
     *                 continue             # <<<<<<<<<<<<<<
     *
     *             if do_dark:
     */
                goto __pyx_L36_continue;
                goto __pyx_L39;
              }
              __pyx_L39:;

     966:

     967:             if do_dark:

              /* "splitBBoxLUT.pyx":967
     *                 continue
     *
     *             if do_dark:             # <<<<<<<<<<<<<<
     *                 data -= cdark[idx]
     *             if do_flat:
     */
              if (__pyx_v_do_dark) {

     968:                 data -= cdark[idx]

                /* "splitBBoxLUT.pyx":968
     *
     *             if do_dark:
     *                 data -= cdark[idx]             # <<<<<<<<<<<<<<
     *             if do_flat:
     *                 data /= cflat[idx]
     */
                if (unlikely(!__pyx_v_cdark.memview)) { __Pyx_RaiseUnboundMemoryviewSliceNogil("cdark"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 968; __pyx_clineno = __LINE__; goto __pyx_L34;} }
                __pyx_t_40 = __pyx_v_idx;
                __pyx_v_data = (__pyx_v_data - (*((float *) ( /* dim=0 */ (__pyx_v_cdark.data + __pyx_t_40 * __pyx_v_cdark.strides[0]) ))));
                goto __pyx_L40;
              }
              __pyx_L40:;

     969:             if do_flat:

              /* "splitBBoxLUT.pyx":969
     *             if do_dark:
     *                 data -= cdark[idx]
     *             if do_flat:             # <<<<<<<<<<<<<<
     *                 data /= cflat[idx]
     *             if do_polarization:
     */
              if (__pyx_v_do_flat) {

     970:                 data /= cflat[idx]

                /* "splitBBoxLUT.pyx":970
     *                 data -= cdark[idx]
     *             if do_flat:
     *                 data /= cflat[idx]             # <<<<<<<<<<<<<<
     *             if do_polarization:
     *                 data /= cpolarization[idx]
     */
                if (unlikely(!__pyx_v_cflat.memview)) { __Pyx_RaiseUnboundMemoryviewSliceNogil("cflat"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 970; __pyx_clineno = __LINE__; goto __pyx_L34;} }
                __pyx_t_41 = __pyx_v_idx;
                __pyx_v_data = (__pyx_v_data / (*((float *) ( /* dim=0 */ (__pyx_v_cflat.data + __pyx_t_41 * __pyx_v_cflat.strides[0]) ))));
                goto __pyx_L41;
              }
              __pyx_L41:;

     971:             if do_polarization:

              /* "splitBBoxLUT.pyx":971
     *             if do_flat:
     *                 data /= cflat[idx]
     *             if do_polarization:             # <<<<<<<<<<<<<<
     *                 data /= cpolarization[idx]
     *             if do_solidangle:
     */
              if (__pyx_v_do_polarization) {

     972:                 data /= cpolarization[idx]

                /* "splitBBoxLUT.pyx":972
     *                 data /= cflat[idx]
     *             if do_polarization:
     *                 data /= cpolarization[idx]             # <<<<<<<<<<<<<<
     *             if do_solidangle:
     *                 data /= csolidangle[idx]
     */
                if (unlikely(!__pyx_v_cpolarization.memview)) { __Pyx_RaiseUnboundMemoryviewSliceNogil("cpolarization"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 972; __pyx_clineno = __LINE__; goto __pyx_L34;} }
                __pyx_t_42 = __pyx_v_idx;
                __pyx_v_data = (__pyx_v_data / (*((float *) ( /* dim=0 */ (__pyx_v_cpolarization.data + __pyx_t_42 * __pyx_v_cpolarization.strides[0]) ))));
                goto __pyx_L42;
              }
              __pyx_L42:;

     973:             if do_solidangle:

              /* "splitBBoxLUT.pyx":973
     *             if do_polarization:
     *                 data /= cpolarization[idx]
     *             if do_solidangle:             # <<<<<<<<<<<<<<
     *                 data /= csolidangle[idx]
     *
     */
              if (__pyx_v_do_solidangle) {

     974:                 data /= csolidangle[idx]

                /* "splitBBoxLUT.pyx":974
     *                 data /= cpolarization[idx]
     *             if do_solidangle:
     *                 data /= csolidangle[idx]             # <<<<<<<<<<<<<<
     *
     *             min0 = cpos0_lower[idx]
     */
                if (unlikely(!__pyx_v_csolidangle.memview)) { __Pyx_RaiseUnboundMemoryviewSliceNogil("csolidangle"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 974; __pyx_clineno = __LINE__; goto __pyx_L34;} }
                __pyx_t_43 = __pyx_v_idx;
                __pyx_v_data = (__pyx_v_data / (*((float *) ( /* dim=0 */ (__pyx_v_csolidangle.data + __pyx_t_43 * __pyx_v_csolidangle.strides[0]) ))));
                goto __pyx_L43;
              }
              __pyx_L43:;

     975:

     976:             min0 = cpos0_lower[idx]

              /* "splitBBoxLUT.pyx":976
     *                 data /= csolidangle[idx]
     *
     *             min0 = cpos0_lower[idx]             # <<<<<<<<<<<<<<
     *             max0 = cpos0_upper[idx]
     *             min1 = cpos1[idx] - dpos1[idx]
     */
              __pyx_t_44 = __pyx_v_idx;
              __pyx_v_min0 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_cpos0_lower.rcbuffer->pybuffer.buf, __pyx_t_44, __pyx_pybuffernd_cpos0_lower.diminfo[0].strides));

     977:             max0 = cpos0_upper[idx]

              /* "splitBBoxLUT.pyx":977
     *
     *             min0 = cpos0_lower[idx]
     *             max0 = cpos0_upper[idx]             # <<<<<<<<<<<<<<
     *             min1 = cpos1[idx] - dpos1[idx]
     *             max1 = cpos1[idx] + dpos1[idx]
     */
              __pyx_t_45 = __pyx_v_idx;
              __pyx_v_max0 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_cpos0_upper.rcbuffer->pybuffer.buf, __pyx_t_45, __pyx_pybuffernd_cpos0_upper.diminfo[0].strides));

     978:             min1 = cpos1[idx] - dpos1[idx]

              /* "splitBBoxLUT.pyx":978
     *             min0 = cpos0_lower[idx]
     *             max0 = cpos0_upper[idx]
     *             min1 = cpos1[idx] - dpos1[idx]             # <<<<<<<<<<<<<<
     *             max1 = cpos1[idx] + dpos1[idx]
     *
     */
              __pyx_t_46 = __pyx_v_idx;
              __pyx_t_47 = __pyx_v_idx;
              __pyx_v_min1 = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_cpos1.rcbuffer->pybuffer.buf, __pyx_t_46, __pyx_pybuffernd_cpos1.diminfo[0].strides)) - (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_dpos1.rcbuffer->pybuffer.buf, __pyx_t_47, __pyx_pybuffernd_dpos1.diminfo[0].strides)));

     979:             max1 = cpos1[idx] + dpos1[idx]

              /* "splitBBoxLUT.pyx":979
     *             max0 = cpos0_upper[idx]
     *             min1 = cpos1[idx] - dpos1[idx]
     *             max1 = cpos1[idx] + dpos1[idx]             # <<<<<<<<<<<<<<
     *
     *             if (max0 < pos0_min) or (max1 < pos1_min) or (min0 > pos0_maxin) or (min1 > pos1_maxin) :
     */
              __pyx_t_48 = __pyx_v_idx;
              __pyx_t_49 = __pyx_v_idx;
              __pyx_v_max1 = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_cpos1.rcbuffer->pybuffer.buf, __pyx_t_48, __pyx_pybuffernd_cpos1.diminfo[0].strides)) + (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_dpos1.rcbuffer->pybuffer.buf, __pyx_t_49, __pyx_pybuffernd_dpos1.diminfo[0].strides)));

     980:

     981:             if (max0 < pos0_min) or (max1 < pos1_min) or (min0 > pos0_maxin) or (min1 > pos1_maxin) :

              /* "splitBBoxLUT.pyx":981
     *             max1 = cpos1[idx] + dpos1[idx]
     *
     *             if (max0 < pos0_min) or (max1 < pos1_min) or (min0 > pos0_maxin) or (min1 > pos1_maxin) :             # <<<<<<<<<<<<<<
     *                 continue
     *
     */
              __pyx_t_5 = (__pyx_v_max0 < __pyx_v_pos0_min);
              if (!__pyx_t_5) {
                __pyx_t_25 = (__pyx_v_max1 < __pyx_v_pos1_min);
                if (!__pyx_t_25) {
                  __pyx_t_26 = (__pyx_v_min0 > __pyx_v_pos0_maxin);
                  if (!__pyx_t_26) {
                    __pyx_t_50 = (__pyx_v_min1 > __pyx_v_pos1_maxin);
                    __pyx_t_51 = __pyx_t_50;
                  } else {
                    __pyx_t_51 = __pyx_t_26;
                  }
                  __pyx_t_26 = __pyx_t_51;
                } else {
                  __pyx_t_26 = __pyx_t_25;
                }
                __pyx_t_25 = __pyx_t_26;
              } else {
                __pyx_t_25 = __pyx_t_5;
              }
              if (__pyx_t_25) {

     982:                 continue

                /* "splitBBoxLUT.pyx":982
     *
     *             if (max0 < pos0_min) or (max1 < pos1_min) or (min0 > pos0_maxin) or (min1 > pos1_maxin) :
     *                 continue             # <<<<<<<<<<<<<<
     *
     *             if min0 < pos0_min:
     */
                goto __pyx_L36_continue;
                goto __pyx_L44;
              }
              __pyx_L44:;

     983:

     984:             if min0 < pos0_min:

              /* "splitBBoxLUT.pyx":984
     *                 continue
     *
     *             if min0 < pos0_min:             # <<<<<<<<<<<<<<
     *                 min0 = pos0_min
     *             if min1 < pos1_min:
     */
              __pyx_t_25 = (__pyx_v_min0 < __pyx_v_pos0_min);
              if (__pyx_t_25) {

     985:                 min0 = pos0_min

                /* "splitBBoxLUT.pyx":985
     *
     *             if min0 < pos0_min:
     *                 min0 = pos0_min             # <<<<<<<<<<<<<<
     *             if min1 < pos1_min:
     *                 min1 = pos1_min
     */
                __pyx_v_min0 = __pyx_v_pos0_min;
                goto __pyx_L45;
              }
              __pyx_L45:;

     986:             if min1 < pos1_min:

              /* "splitBBoxLUT.pyx":986
     *             if min0 < pos0_min:
     *                 min0 = pos0_min
     *             if min1 < pos1_min:             # <<<<<<<<<<<<<<
     *                 min1 = pos1_min
     *             if max0 > pos0_maxin:
     */
              __pyx_t_25 = (__pyx_v_min1 < __pyx_v_pos1_min);
              if (__pyx_t_25) {

     987:                 min1 = pos1_min

                /* "splitBBoxLUT.pyx":987
     *                 min0 = pos0_min
     *             if min1 < pos1_min:
     *                 min1 = pos1_min             # <<<<<<<<<<<<<<
     *             if max0 > pos0_maxin:
     *                 max0 = pos0_maxin
     */
                __pyx_v_min1 = __pyx_v_pos1_min;
                goto __pyx_L46;
              }
              __pyx_L46:;

     988:             if max0 > pos0_maxin:

              /* "splitBBoxLUT.pyx":988
     *             if min1 < pos1_min:
     *                 min1 = pos1_min
     *             if max0 > pos0_maxin:             # <<<<<<<<<<<<<<
     *                 max0 = pos0_maxin
     *             if max1 > pos1_maxin:
     */
              __pyx_t_25 = (__pyx_v_max0 > __pyx_v_pos0_maxin);
              if (__pyx_t_25) {

     989:                 max0 = pos0_maxin

                /* "splitBBoxLUT.pyx":989
     *                 min1 = pos1_min
     *             if max0 > pos0_maxin:
     *                 max0 = pos0_maxin             # <<<<<<<<<<<<<<
     *             if max1 > pos1_maxin:
     *                 max1 = pos1_maxin
     */
                __pyx_v_max0 = __pyx_v_pos0_maxin;
                goto __pyx_L47;
              }
              __pyx_L47:;

     990:             if max1 > pos1_maxin:

              /* "splitBBoxLUT.pyx":990
     *             if max0 > pos0_maxin:
     *                 max0 = pos0_maxin
     *             if max1 > pos1_maxin:             # <<<<<<<<<<<<<<
     *                 max1 = pos1_maxin
     *
     */
              __pyx_t_25 = (__pyx_v_max1 > __pyx_v_pos1_maxin);
              if (__pyx_t_25) {

     991:                 max1 = pos1_maxin

                /* "splitBBoxLUT.pyx":991
     *                 max0 = pos0_maxin
     *             if max1 > pos1_maxin:
     *                 max1 = pos1_maxin             # <<<<<<<<<<<<<<
     *
     *
     */
                __pyx_v_max1 = __pyx_v_pos1_maxin;
                goto __pyx_L48;
              }
              __pyx_L48:;

     992:

     993:

     994:             fbin0_min = getBinNr(min0, pos0_min, delta0)

              /* "splitBBoxLUT.pyx":994
     *
     *
     *             fbin0_min = getBinNr(min0, pos0_min, delta0)             # <<<<<<<<<<<<<<
     *             fbin0_max = getBinNr(max0, pos0_min, delta0)
     *             fbin1_min = getBinNr(min1, pos1_min, delta1)
     */
              __pyx_v_fbin0_min = __pyx_f_12splitBBoxLUT_getBinNr(__pyx_v_min0, __pyx_v_pos0_min, __pyx_v_delta0);

     995:             fbin0_max = getBinNr(max0, pos0_min, delta0)

              /* "splitBBoxLUT.pyx":995
     *
     *             fbin0_min = getBinNr(min0, pos0_min, delta0)
     *             fbin0_max = getBinNr(max0, pos0_min, delta0)             # <<<<<<<<<<<<<<
     *             fbin1_min = getBinNr(min1, pos1_min, delta1)
     *             fbin1_max = getBinNr(max1, pos1_min, delta1)
     */
              __pyx_v_fbin0_max = __pyx_f_12splitBBoxLUT_getBinNr(__pyx_v_max0, __pyx_v_pos0_min, __pyx_v_delta0);

     996:             fbin1_min = getBinNr(min1, pos1_min, delta1)

              /* "splitBBoxLUT.pyx":996
     *             fbin0_min = getBinNr(min0, pos0_min, delta0)
     *             fbin0_max = getBinNr(max0, pos0_min, delta0)
     *             fbin1_min = getBinNr(min1, pos1_min, delta1)             # <<<<<<<<<<<<<<
     *             fbin1_max = getBinNr(max1, pos1_min, delta1)
     *
     */
              __pyx_v_fbin1_min = __pyx_f_12splitBBoxLUT_getBinNr(__pyx_v_min1, __pyx_v_pos1_min, __pyx_v_delta1);

     997:             fbin1_max = getBinNr(max1, pos1_min, delta1)

              /* "splitBBoxLUT.pyx":997
     *             fbin0_max = getBinNr(max0, pos0_min, delta0)
     *             fbin1_min = getBinNr(min1, pos1_min, delta1)
     *             fbin1_max = getBinNr(max1, pos1_min, delta1)             # <<<<<<<<<<<<<<
     *
     *             bin0_min = <int> fbin0_min
     */
              __pyx_v_fbin1_max = __pyx_f_12splitBBoxLUT_getBinNr(__pyx_v_max1, __pyx_v_pos1_min, __pyx_v_delta1);

     998:

     999:             bin0_min = <int> fbin0_min

              /* "splitBBoxLUT.pyx":999
     *             fbin1_max = getBinNr(max1, pos1_min, delta1)
     *
     *             bin0_min = <int> fbin0_min             # <<<<<<<<<<<<<<
     *             bin0_max = <int> fbin0_max
     *             bin1_min = <int> fbin1_min
     */
              __pyx_v_bin0_min = ((int)__pyx_v_fbin0_min);

     1000:             bin0_max = <int> fbin0_max

              /* "splitBBoxLUT.pyx":1000
     *
     *             bin0_min = <int> fbin0_min
     *             bin0_max = <int> fbin0_max             # <<<<<<<<<<<<<<
     *             bin1_min = <int> fbin1_min
     *             bin1_max = <int> fbin1_max
     */
              __pyx_v_bin0_max = ((int)__pyx_v_fbin0_max);

     1001:             bin1_min = <int> fbin1_min

              /* "splitBBoxLUT.pyx":1001
     *             bin0_min = <int> fbin0_min
     *             bin0_max = <int> fbin0_max
     *             bin1_min = <int> fbin1_min             # <<<<<<<<<<<<<<
     *             bin1_max = <int> fbin1_max
     *
     */
              __pyx_v_bin1_min = ((int)__pyx_v_fbin1_min);

     1002:             bin1_max = <int> fbin1_max

              /* "splitBBoxLUT.pyx":1002
     *             bin0_max = <int> fbin0_max
     *             bin1_min = <int> fbin1_min
     *             bin1_max = <int> fbin1_max             # <<<<<<<<<<<<<<
     *
     *
     */
              __pyx_v_bin1_max = ((int)__pyx_v_fbin1_max);

     1003:

     1004:

     1005:             if bin0_min == bin0_max:

              /* "splitBBoxLUT.pyx":1005
     *
     *
     *             if bin0_min == bin0_max:             # <<<<<<<<<<<<<<
     *                 if bin1_min == bin1_max:
     *                     #All pixel is within a single bin
     */
              __pyx_t_25 = (__pyx_v_bin0_min == __pyx_v_bin0_max);
              if (__pyx_t_25) {

     1006:                 if bin1_min == bin1_max:

                /* "splitBBoxLUT.pyx":1006
     *
     *             if bin0_min == bin0_max:
     *                 if bin1_min == bin1_max:             # <<<<<<<<<<<<<<
     *                     #All pixel is within a single bin
     *                     outCount[bin0_min, bin1_min] += 1.0
     */
                __pyx_t_25 = (__pyx_v_bin1_min == __pyx_v_bin1_max);
                if (__pyx_t_25) {

     1007:                     #All pixel is within a single bin

     1008:                     outCount[bin0_min, bin1_min] += 1.0

                  /* "splitBBoxLUT.pyx":1008
     *                 if bin1_min == bin1_max:
     *                     #All pixel is within a single bin
     *                     outCount[bin0_min, bin1_min] += 1.0             # <<<<<<<<<<<<<<
     *                     outData[bin0_min, bin1_min] += data
     *                 else:
     */
                  __pyx_t_52 = __pyx_v_bin0_min;
                  __pyx_t_53 = __pyx_v_bin1_min;
                  *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_outCount.rcbuffer->pybuffer.buf, __pyx_t_52, __pyx_pybuffernd_outCount.diminfo[0].strides, __pyx_t_53, __pyx_pybuffernd_outCount.diminfo[1].strides) += 1.0;

     1009:                     outData[bin0_min, bin1_min] += data

                  /* "splitBBoxLUT.pyx":1009
     *                     #All pixel is within a single bin
     *                     outCount[bin0_min, bin1_min] += 1.0
     *                     outData[bin0_min, bin1_min] += data             # <<<<<<<<<<<<<<
     *                 else:
     *                     #spread on more than 2 bins
     */
                  __pyx_t_54 = __pyx_v_bin0_min;
                  __pyx_t_55 = __pyx_v_bin1_min;
                  *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_outData.rcbuffer->pybuffer.buf, __pyx_t_54, __pyx_pybuffernd_outData.diminfo[0].strides, __pyx_t_55, __pyx_pybuffernd_outData.diminfo[1].strides) += __pyx_v_data;
                  goto __pyx_L50;
                }
                /*else*/ {

     1010:                 else:

     1011:                     #spread on more than 2 bins

     1012:                     deltaD = (< float > (bin1_min + 1)) - fbin1_min

                  /* "splitBBoxLUT.pyx":1012
     *                 else:
     *                     #spread on more than 2 bins
     *                     deltaD = (< float > (bin1_min + 1)) - fbin1_min             # <<<<<<<<<<<<<<
     *                     deltaU = fbin1_max - ( bin1_max)
     *                     deltaA = 1.0 / (fbin1_max - fbin1_min)
     */
                  __pyx_v_deltaD = (((float)(__pyx_v_bin1_min + 1)) - __pyx_v_fbin1_min);

     1013:                     deltaU = fbin1_max - ( bin1_max)

                  /* "splitBBoxLUT.pyx":1013
     *                     #spread on more than 2 bins
     *                     deltaD = (< float > (bin1_min + 1)) - fbin1_min
     *                     deltaU = fbin1_max - ( bin1_max)             # <<<<<<<<<<<<<<
     *                     deltaA = 1.0 / (fbin1_max - fbin1_min)
     *
     */
                  __pyx_v_deltaU = (__pyx_v_fbin1_max - __pyx_v_bin1_max);

     1014:                     deltaA = 1.0 / (fbin1_max - fbin1_min)

                  /* "splitBBoxLUT.pyx":1014
     *                     deltaD = (< float > (bin1_min + 1)) - fbin1_min
     *                     deltaU = fbin1_max - ( bin1_max)
     *                     deltaA = 1.0 / (fbin1_max - fbin1_min)             # <<<<<<<<<<<<<<
     *
     *                     outCount[bin0_min, bin1_min] +=  deltaA * deltaD
     */
                  __pyx_v_deltaA = (1.0 / (__pyx_v_fbin1_max - __pyx_v_fbin1_min));

     1015:

     1016:                     outCount[bin0_min, bin1_min] +=  deltaA * deltaD

                  /* "splitBBoxLUT.pyx":1016
     *                     deltaA = 1.0 / (fbin1_max - fbin1_min)
     *
     *                     outCount[bin0_min, bin1_min] +=  deltaA * deltaD             # <<<<<<<<<<<<<<
     *                     outData[bin0_min, bin1_min] += data * deltaA * deltaD
     *
     */
                  __pyx_t_56 = __pyx_v_bin0_min;
                  __pyx_t_57 = __pyx_v_bin1_min;
                  *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_outCount.rcbuffer->pybuffer.buf, __pyx_t_56, __pyx_pybuffernd_outCount.diminfo[0].strides, __pyx_t_57, __pyx_pybuffernd_outCount.diminfo[1].strides) += (__pyx_v_deltaA * __pyx_v_deltaD);

     1017:                     outData[bin0_min, bin1_min] += data * deltaA * deltaD

                  /* "splitBBoxLUT.pyx":1017
     *
     *                     outCount[bin0_min, bin1_min] +=  deltaA * deltaD
     *                     outData[bin0_min, bin1_min] += data * deltaA * deltaD             # <<<<<<<<<<<<<<
     *
     *                     outCount[bin0_min, bin1_max] +=  deltaA * deltaU
     */
                  __pyx_t_58 = __pyx_v_bin0_min;
                  __pyx_t_59 = __pyx_v_bin1_min;
                  *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_outData.rcbuffer->pybuffer.buf, __pyx_t_58, __pyx_pybuffernd_outData.diminfo[0].strides, __pyx_t_59, __pyx_pybuffernd_outData.diminfo[1].strides) += ((__pyx_v_data * __pyx_v_deltaA) * __pyx_v_deltaD);

     1018:

     1019:                     outCount[bin0_min, bin1_max] +=  deltaA * deltaU

                  /* "splitBBoxLUT.pyx":1019
     *                     outData[bin0_min, bin1_min] += data * deltaA * deltaD
     *
     *                     outCount[bin0_min, bin1_max] +=  deltaA * deltaU             # <<<<<<<<<<<<<<
     *                     outData[bin0_min, bin1_max] += data * deltaA * deltaU
     *                     for j in range(bin1_min + 1, bin1_max):
     */
                  __pyx_t_60 = __pyx_v_bin0_min;
                  __pyx_t_61 = __pyx_v_bin1_max;
                  *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_outCount.rcbuffer->pybuffer.buf, __pyx_t_60, __pyx_pybuffernd_outCount.diminfo[0].strides, __pyx_t_61, __pyx_pybuffernd_outCount.diminfo[1].strides) += (__pyx_v_deltaA * __pyx_v_deltaU);

     1020:                     outData[bin0_min, bin1_max] += data * deltaA * deltaU

                  /* "splitBBoxLUT.pyx":1020
     *
     *                     outCount[bin0_min, bin1_max] +=  deltaA * deltaU
     *                     outData[bin0_min, bin1_max] += data * deltaA * deltaU             # <<<<<<<<<<<<<<
     *                     for j in range(bin1_min + 1, bin1_max):
     *                         outCount[bin0_min, j] +=  deltaA
     */
                  __pyx_t_62 = __pyx_v_bin0_min;
                  __pyx_t_63 = __pyx_v_bin1_max;
                  *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_outData.rcbuffer->pybuffer.buf, __pyx_t_62, __pyx_pybuffernd_outData.diminfo[0].strides, __pyx_t_63, __pyx_pybuffernd_outData.diminfo[1].strides) += ((__pyx_v_data * __pyx_v_deltaA) * __pyx_v_deltaU);

     1021:                     for j in range(bin1_min + 1, bin1_max):

                  /* "splitBBoxLUT.pyx":1021
     *                     outCount[bin0_min, bin1_max] +=  deltaA * deltaU
     *                     outData[bin0_min, bin1_max] += data * deltaA * deltaU
     *                     for j in range(bin1_min + 1, bin1_max):             # <<<<<<<<<<<<<<
     *                         outCount[bin0_min, j] +=  deltaA
     *                         outData[bin0_min, j] += data * deltaA
     */
                  __pyx_t_64 = __pyx_v_bin1_max;
                  for (__pyx_t_65 = (__pyx_v_bin1_min + 1); __pyx_t_65 < __pyx_t_64; __pyx_t_65+=1) {
                    __pyx_v_j = __pyx_t_65;

     1022:                         outCount[bin0_min, j] +=  deltaA

                    /* "splitBBoxLUT.pyx":1022
     *                     outData[bin0_min, bin1_max] += data * deltaA * deltaU
     *                     for j in range(bin1_min + 1, bin1_max):
     *                         outCount[bin0_min, j] +=  deltaA             # <<<<<<<<<<<<<<
     *                         outData[bin0_min, j] += data * deltaA
     *
     */
                    __pyx_t_66 = __pyx_v_bin0_min;
                    __pyx_t_67 = __pyx_v_j;
                    *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_outCount.rcbuffer->pybuffer.buf, __pyx_t_66, __pyx_pybuffernd_outCount.diminfo[0].strides, __pyx_t_67, __pyx_pybuffernd_outCount.diminfo[1].strides) += __pyx_v_deltaA;

     1023:                         outData[bin0_min, j] += data * deltaA

                    /* "splitBBoxLUT.pyx":1023
     *                     for j in range(bin1_min + 1, bin1_max):
     *                         outCount[bin0_min, j] +=  deltaA
     *                         outData[bin0_min, j] += data * deltaA             # <<<<<<<<<<<<<<
     *
     *             else: #spread on more than 2 bins in dim 0
     */
                    __pyx_t_68 = __pyx_v_bin0_min;
                    __pyx_t_69 = __pyx_v_j;
                    *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_outData.rcbuffer->pybuffer.buf, __pyx_t_68, __pyx_pybuffernd_outData.diminfo[0].strides, __pyx_t_69, __pyx_pybuffernd_outData.diminfo[1].strides) += (__pyx_v_data * __pyx_v_deltaA);
                  }
                }
                __pyx_L50:;
                goto __pyx_L49;
              }
              /*else*/ {

     1024:

     1025:             else: #spread on more than 2 bins in dim 0

     1026:                 if bin1_min == bin1_max:

                /* "splitBBoxLUT.pyx":1026
     *
     *             else: #spread on more than 2 bins in dim 0
     *                 if bin1_min == bin1_max:             # <<<<<<<<<<<<<<
     *                     #All pixel fall on 1 bins in dim 1
     *                     deltaA = 1.0 / (fbin0_max - fbin0_min)
     */
                __pyx_t_25 = (__pyx_v_bin1_min == __pyx_v_bin1_max);
                if (__pyx_t_25) {

     1027:                     #All pixel fall on 1 bins in dim 1

     1028:                     deltaA = 1.0 / (fbin0_max - fbin0_min)

                  /* "splitBBoxLUT.pyx":1028
     *                 if bin1_min == bin1_max:
     *                     #All pixel fall on 1 bins in dim 1
     *                     deltaA = 1.0 / (fbin0_max - fbin0_min)             # <<<<<<<<<<<<<<
     *                     deltaL = (< float > (bin0_min + 1)) - fbin0_min
     *                     outCount[bin0_min, bin1_min] +=  deltaA * deltaL
     */
                  __pyx_v_deltaA = (1.0 / (__pyx_v_fbin0_max - __pyx_v_fbin0_min));

     1029:                     deltaL = (< float > (bin0_min + 1)) - fbin0_min

                  /* "splitBBoxLUT.pyx":1029
     *                     #All pixel fall on 1 bins in dim 1
     *                     deltaA = 1.0 / (fbin0_max - fbin0_min)
     *                     deltaL = (< float > (bin0_min + 1)) - fbin0_min             # <<<<<<<<<<<<<<
     *                     outCount[bin0_min, bin1_min] +=  deltaA * deltaL
     *                     outData[bin0_min, bin1_min] +=  data * deltaA * deltaL
     */
                  __pyx_v_deltaL = (((float)(__pyx_v_bin0_min + 1)) - __pyx_v_fbin0_min);

     1030:                     outCount[bin0_min, bin1_min] +=  deltaA * deltaL

                  /* "splitBBoxLUT.pyx":1030
     *                     deltaA = 1.0 / (fbin0_max - fbin0_min)
     *                     deltaL = (< float > (bin0_min + 1)) - fbin0_min
     *                     outCount[bin0_min, bin1_min] +=  deltaA * deltaL             # <<<<<<<<<<<<<<
     *                     outData[bin0_min, bin1_min] +=  data * deltaA * deltaL
     *                     deltaR = fbin0_max - (< float > bin0_max)
     */
                  __pyx_t_64 = __pyx_v_bin0_min;
                  __pyx_t_65 = __pyx_v_bin1_min;
                  *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_outCount.rcbuffer->pybuffer.buf, __pyx_t_64, __pyx_pybuffernd_outCount.diminfo[0].strides, __pyx_t_65, __pyx_pybuffernd_outCount.diminfo[1].strides) += (__pyx_v_deltaA * __pyx_v_deltaL);

     1031:                     outData[bin0_min, bin1_min] +=  data * deltaA * deltaL

                  /* "splitBBoxLUT.pyx":1031
     *                     deltaL = (< float > (bin0_min + 1)) - fbin0_min
     *                     outCount[bin0_min, bin1_min] +=  deltaA * deltaL
     *                     outData[bin0_min, bin1_min] +=  data * deltaA * deltaL             # <<<<<<<<<<<<<<
     *                     deltaR = fbin0_max - (< float > bin0_max)
     *                     outCount[bin0_max, bin1_min] +=  deltaA * deltaR
     */
                  __pyx_t_70 = __pyx_v_bin0_min;
                  __pyx_t_71 = __pyx_v_bin1_min;
                  *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_outData.rcbuffer->pybuffer.buf, __pyx_t_70, __pyx_pybuffernd_outData.diminfo[0].strides, __pyx_t_71, __pyx_pybuffernd_outData.diminfo[1].strides) += ((__pyx_v_data * __pyx_v_deltaA) * __pyx_v_deltaL);

     1032:                     deltaR = fbin0_max - (< float > bin0_max)

                  /* "splitBBoxLUT.pyx":1032
     *                     outCount[bin0_min, bin1_min] +=  deltaA * deltaL
     *                     outData[bin0_min, bin1_min] +=  data * deltaA * deltaL
     *                     deltaR = fbin0_max - (< float > bin0_max)             # <<<<<<<<<<<<<<
     *                     outCount[bin0_max, bin1_min] +=  deltaA * deltaR
     *                     outData[bin0_max, bin1_min] +=  data * deltaA * deltaR
     */
                  __pyx_v_deltaR = (__pyx_v_fbin0_max - ((float)__pyx_v_bin0_max));

     1033:                     outCount[bin0_max, bin1_min] +=  deltaA * deltaR

                  /* "splitBBoxLUT.pyx":1033
     *                     outData[bin0_min, bin1_min] +=  data * deltaA * deltaL
     *                     deltaR = fbin0_max - (< float > bin0_max)
     *                     outCount[bin0_max, bin1_min] +=  deltaA * deltaR             # <<<<<<<<<<<<<<
     *                     outData[bin0_max, bin1_min] +=  data * deltaA * deltaR
     *                     for i in range(bin0_min + 1, bin0_max):
     */
                  __pyx_t_72 = __pyx_v_bin0_max;
                  __pyx_t_73 = __pyx_v_bin1_min;
                  *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_outCount.rcbuffer->pybuffer.buf, __pyx_t_72, __pyx_pybuffernd_outCount.diminfo[0].strides, __pyx_t_73, __pyx_pybuffernd_outCount.diminfo[1].strides) += (__pyx_v_deltaA * __pyx_v_deltaR);

     1034:                     outData[bin0_max, bin1_min] +=  data * deltaA * deltaR

                  /* "splitBBoxLUT.pyx":1034
     *                     deltaR = fbin0_max - (< float > bin0_max)
     *                     outCount[bin0_max, bin1_min] +=  deltaA * deltaR
     *                     outData[bin0_max, bin1_min] +=  data * deltaA * deltaR             # <<<<<<<<<<<<<<
     *                     for i in range(bin0_min + 1, bin0_max):
     *                             outCount[i, bin1_min] +=  deltaA
     */
                  __pyx_t_74 = __pyx_v_bin0_max;
                  __pyx_t_75 = __pyx_v_bin1_min;
                  *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_outData.rcbuffer->pybuffer.buf, __pyx_t_74, __pyx_pybuffernd_outData.diminfo[0].strides, __pyx_t_75, __pyx_pybuffernd_outData.diminfo[1].strides) += ((__pyx_v_data * __pyx_v_deltaA) * __pyx_v_deltaR);

     1035:                     for i in range(bin0_min + 1, bin0_max):

                  /* "splitBBoxLUT.pyx":1035
     *                     outCount[bin0_max, bin1_min] +=  deltaA * deltaR
     *                     outData[bin0_max, bin1_min] +=  data * deltaA * deltaR
     *                     for i in range(bin0_min + 1, bin0_max):             # <<<<<<<<<<<<<<
     *                             outCount[i, bin1_min] +=  deltaA
     *                             outData[i, bin1_min] +=  data * deltaA
     */
                  __pyx_t_76 = __pyx_v_bin0_max;
                  for (__pyx_t_77 = (__pyx_v_bin0_min + 1); __pyx_t_77 < __pyx_t_76; __pyx_t_77+=1) {
                    __pyx_v_i = __pyx_t_77;

     1036:                             outCount[i, bin1_min] +=  deltaA

                    /* "splitBBoxLUT.pyx":1036
     *                     outData[bin0_max, bin1_min] +=  data * deltaA * deltaR
     *                     for i in range(bin0_min + 1, bin0_max):
     *                             outCount[i, bin1_min] +=  deltaA             # <<<<<<<<<<<<<<
     *                             outData[i, bin1_min] +=  data * deltaA
     *                 else:
     */
                    __pyx_t_78 = __pyx_v_i;
                    __pyx_t_79 = __pyx_v_bin1_min;
                    *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_outCount.rcbuffer->pybuffer.buf, __pyx_t_78, __pyx_pybuffernd_outCount.diminfo[0].strides, __pyx_t_79, __pyx_pybuffernd_outCount.diminfo[1].strides) += __pyx_v_deltaA;

     1037:                             outData[i, bin1_min] +=  data * deltaA

                    /* "splitBBoxLUT.pyx":1037
     *                     for i in range(bin0_min + 1, bin0_max):
     *                             outCount[i, bin1_min] +=  deltaA
     *                             outData[i, bin1_min] +=  data * deltaA             # <<<<<<<<<<<<<<
     *                 else:
     *                     #spread on n pix in dim0 and m pixel in dim1:
     */
                    __pyx_t_80 = __pyx_v_i;
                    __pyx_t_81 = __pyx_v_bin1_min;
                    *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_outData.rcbuffer->pybuffer.buf, __pyx_t_80, __pyx_pybuffernd_outData.diminfo[0].strides, __pyx_t_81, __pyx_pybuffernd_outData.diminfo[1].strides) += (__pyx_v_data * __pyx_v_deltaA);
                  }
                  goto __pyx_L53;
                }
                /*else*/ {

     1038:                 else:

     1039:                     #spread on n pix in dim0 and m pixel in dim1:

     1040:                     deltaL = (< float > (bin0_min + 1)) - fbin0_min

                  /* "splitBBoxLUT.pyx":1040
     *                 else:
     *                     #spread on n pix in dim0 and m pixel in dim1:
     *                     deltaL = (< float > (bin0_min + 1)) - fbin0_min             # <<<<<<<<<<<<<<
     *                     deltaR = fbin0_max - (< float > bin0_max)
     *                     deltaD = (< float > (bin1_min + 1)) - fbin1_min
     */
                  __pyx_v_deltaL = (((float)(__pyx_v_bin0_min + 1)) - __pyx_v_fbin0_min);

     1041:                     deltaR = fbin0_max - (< float > bin0_max)

                  /* "splitBBoxLUT.pyx":1041
     *                     #spread on n pix in dim0 and m pixel in dim1:
     *                     deltaL = (< float > (bin0_min + 1)) - fbin0_min
     *                     deltaR = fbin0_max - (< float > bin0_max)             # <<<<<<<<<<<<<<
     *                     deltaD = (< float > (bin1_min + 1)) - fbin1_min
     *                     deltaU = fbin1_max - (< float > bin1_max)
     */
                  __pyx_v_deltaR = (__pyx_v_fbin0_max - ((float)__pyx_v_bin0_max));

     1042:                     deltaD = (< float > (bin1_min + 1)) - fbin1_min

                  /* "splitBBoxLUT.pyx":1042
     *                     deltaL = (< float > (bin0_min + 1)) - fbin0_min
     *                     deltaR = fbin0_max - (< float > bin0_max)
     *                     deltaD = (< float > (bin1_min + 1)) - fbin1_min             # <<<<<<<<<<<<<<
     *                     deltaU = fbin1_max - (< float > bin1_max)
     *                     deltaA = 1.0 / ((fbin0_max - fbin0_min) * (fbin1_max - fbin1_min))
     */
                  __pyx_v_deltaD = (((float)(__pyx_v_bin1_min + 1)) - __pyx_v_fbin1_min);

     1043:                     deltaU = fbin1_max - (< float > bin1_max)

                  /* "splitBBoxLUT.pyx":1043
     *                     deltaR = fbin0_max - (< float > bin0_max)
     *                     deltaD = (< float > (bin1_min + 1)) - fbin1_min
     *                     deltaU = fbin1_max - (< float > bin1_max)             # <<<<<<<<<<<<<<
     *                     deltaA = 1.0 / ((fbin0_max - fbin0_min) * (fbin1_max - fbin1_min))
     *
     */
                  __pyx_v_deltaU = (__pyx_v_fbin1_max - ((float)__pyx_v_bin1_max));

     1044:                     deltaA = 1.0 / ((fbin0_max - fbin0_min) * (fbin1_max - fbin1_min))

                  /* "splitBBoxLUT.pyx":1044
     *                     deltaD = (< float > (bin1_min + 1)) - fbin1_min
     *                     deltaU = fbin1_max - (< float > bin1_max)
     *                     deltaA = 1.0 / ((fbin0_max - fbin0_min) * (fbin1_max - fbin1_min))             # <<<<<<<<<<<<<<
     *
     *                     outCount[bin0_min, bin1_min] +=  deltaA * deltaL * deltaD
     */
                  __pyx_v_deltaA = (1.0 / ((__pyx_v_fbin0_max - __pyx_v_fbin0_min) * (__pyx_v_fbin1_max - __pyx_v_fbin1_min)));

     1045:

     1046:                     outCount[bin0_min, bin1_min] +=  deltaA * deltaL * deltaD

                  /* "splitBBoxLUT.pyx":1046
     *                     deltaA = 1.0 / ((fbin0_max - fbin0_min) * (fbin1_max - fbin1_min))
     *
     *                     outCount[bin0_min, bin1_min] +=  deltaA * deltaL * deltaD             # <<<<<<<<<<<<<<
     *                     outData[bin0_min, bin1_min] +=  data * deltaA * deltaL * deltaD
     *
     */
                  __pyx_t_76 = __pyx_v_bin0_min;
                  __pyx_t_77 = __pyx_v_bin1_min;
                  *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_outCount.rcbuffer->pybuffer.buf, __pyx_t_76, __pyx_pybuffernd_outCount.diminfo[0].strides, __pyx_t_77, __pyx_pybuffernd_outCount.diminfo[1].strides) += ((__pyx_v_deltaA * __pyx_v_deltaL) * __pyx_v_deltaD);

     1047:                     outData[bin0_min, bin1_min] +=  data * deltaA * deltaL * deltaD

                  /* "splitBBoxLUT.pyx":1047
     *
     *                     outCount[bin0_min, bin1_min] +=  deltaA * deltaL * deltaD
     *                     outData[bin0_min, bin1_min] +=  data * deltaA * deltaL * deltaD             # <<<<<<<<<<<<<<
     *
     *                     outCount[bin0_min, bin1_max] +=  deltaA * deltaL * deltaU
     */
                  __pyx_t_82 = __pyx_v_bin0_min;
                  __pyx_t_83 = __pyx_v_bin1_min;
                  *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_outData.rcbuffer->pybuffer.buf, __pyx_t_82, __pyx_pybuffernd_outData.diminfo[0].strides, __pyx_t_83, __pyx_pybuffernd_outData.diminfo[1].strides) += (((__pyx_v_data * __pyx_v_deltaA) * __pyx_v_deltaL) * __pyx_v_deltaD);

     1048:

     1049:                     outCount[bin0_min, bin1_max] +=  deltaA * deltaL * deltaU

                  /* "splitBBoxLUT.pyx":1049
     *                     outData[bin0_min, bin1_min] +=  data * deltaA * deltaL * deltaD
     *
     *                     outCount[bin0_min, bin1_max] +=  deltaA * deltaL * deltaU             # <<<<<<<<<<<<<<
     *                     outData[bin0_min, bin1_max] +=  data * deltaA * deltaL * deltaU
     *
     */
                  __pyx_t_84 = __pyx_v_bin0_min;
                  __pyx_t_85 = __pyx_v_bin1_max;
                  *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_outCount.rcbuffer->pybuffer.buf, __pyx_t_84, __pyx_pybuffernd_outCount.diminfo[0].strides, __pyx_t_85, __pyx_pybuffernd_outCount.diminfo[1].strides) += ((__pyx_v_deltaA * __pyx_v_deltaL) * __pyx_v_deltaU);

     1050:                     outData[bin0_min, bin1_max] +=  data * deltaA * deltaL * deltaU

                  /* "splitBBoxLUT.pyx":1050
     *
     *                     outCount[bin0_min, bin1_max] +=  deltaA * deltaL * deltaU
     *                     outData[bin0_min, bin1_max] +=  data * deltaA * deltaL * deltaU             # <<<<<<<<<<<<<<
     *
     *                     outCount[bin0_max, bin1_min] +=  deltaA * deltaR * deltaD
     */
                  __pyx_t_86 = __pyx_v_bin0_min;
                  __pyx_t_87 = __pyx_v_bin1_max;
                  *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_outData.rcbuffer->pybuffer.buf, __pyx_t_86, __pyx_pybuffernd_outData.diminfo[0].strides, __pyx_t_87, __pyx_pybuffernd_outData.diminfo[1].strides) += (((__pyx_v_data * __pyx_v_deltaA) * __pyx_v_deltaL) * __pyx_v_deltaU);

     1051:

     1052:                     outCount[bin0_max, bin1_min] +=  deltaA * deltaR * deltaD

                  /* "splitBBoxLUT.pyx":1052
     *                     outData[bin0_min, bin1_max] +=  data * deltaA * deltaL * deltaU
     *
     *                     outCount[bin0_max, bin1_min] +=  deltaA * deltaR * deltaD             # <<<<<<<<<<<<<<
     *                     outData[bin0_max, bin1_min] +=  data * deltaA * deltaR * deltaD
     *
     */
                  __pyx_t_88 = __pyx_v_bin0_max;
                  __pyx_t_89 = __pyx_v_bin1_min;
                  *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_outCount.rcbuffer->pybuffer.buf, __pyx_t_88, __pyx_pybuffernd_outCount.diminfo[0].strides, __pyx_t_89, __pyx_pybuffernd_outCount.diminfo[1].strides) += ((__pyx_v_deltaA * __pyx_v_deltaR) * __pyx_v_deltaD);

     1053:                     outData[bin0_max, bin1_min] +=  data * deltaA * deltaR * deltaD

                  /* "splitBBoxLUT.pyx":1053
     *
     *                     outCount[bin0_max, bin1_min] +=  deltaA * deltaR * deltaD
     *                     outData[bin0_max, bin1_min] +=  data * deltaA * deltaR * deltaD             # <<<<<<<<<<<<<<
     *
     *                     outCount[bin0_max, bin1_max] +=  deltaA * deltaR * deltaU
     */
                  __pyx_t_90 = __pyx_v_bin0_max;
                  __pyx_t_91 = __pyx_v_bin1_min;
                  *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_outData.rcbuffer->pybuffer.buf, __pyx_t_90, __pyx_pybuffernd_outData.diminfo[0].strides, __pyx_t_91, __pyx_pybuffernd_outData.diminfo[1].strides) += (((__pyx_v_data * __pyx_v_deltaA) * __pyx_v_deltaR) * __pyx_v_deltaD);

     1054:

     1055:                     outCount[bin0_max, bin1_max] +=  deltaA * deltaR * deltaU

                  /* "splitBBoxLUT.pyx":1055
     *                     outData[bin0_max, bin1_min] +=  data * deltaA * deltaR * deltaD
     *
     *                     outCount[bin0_max, bin1_max] +=  deltaA * deltaR * deltaU             # <<<<<<<<<<<<<<
     *                     outData[bin0_max, bin1_max] +=  data * deltaA * deltaR * deltaU
     *                     for i in range(bin0_min + 1, bin0_max):
     */
                  __pyx_t_92 = __pyx_v_bin0_max;
                  __pyx_t_93 = __pyx_v_bin1_max;
                  *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_outCount.rcbuffer->pybuffer.buf, __pyx_t_92, __pyx_pybuffernd_outCount.diminfo[0].strides, __pyx_t_93, __pyx_pybuffernd_outCount.diminfo[1].strides) += ((__pyx_v_deltaA * __pyx_v_deltaR) * __pyx_v_deltaU);

     1056:                     outData[bin0_max, bin1_max] +=  data * deltaA * deltaR * deltaU

                  /* "splitBBoxLUT.pyx":1056
     *
     *                     outCount[bin0_max, bin1_max] +=  deltaA * deltaR * deltaU
     *                     outData[bin0_max, bin1_max] +=  data * deltaA * deltaR * deltaU             # <<<<<<<<<<<<<<
     *                     for i in range(bin0_min + 1, bin0_max):
     *                             outCount[i, bin1_min] +=  deltaA * deltaD
     */
                  __pyx_t_94 = __pyx_v_bin0_max;
                  __pyx_t_95 = __pyx_v_bin1_max;
                  *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_outData.rcbuffer->pybuffer.buf, __pyx_t_94, __pyx_pybuffernd_outData.diminfo[0].strides, __pyx_t_95, __pyx_pybuffernd_outData.diminfo[1].strides) += (((__pyx_v_data * __pyx_v_deltaA) * __pyx_v_deltaR) * __pyx_v_deltaU);

     1057:                     for i in range(bin0_min + 1, bin0_max):

                  /* "splitBBoxLUT.pyx":1057
     *                     outCount[bin0_max, bin1_max] +=  deltaA * deltaR * deltaU
     *                     outData[bin0_max, bin1_max] +=  data * deltaA * deltaR * deltaU
     *                     for i in range(bin0_min + 1, bin0_max):             # <<<<<<<<<<<<<<
     *                             outCount[i, bin1_min] +=  deltaA * deltaD
     *                             outData[i, bin1_min] +=  data * deltaA * deltaD
     */
                  __pyx_t_96 = __pyx_v_bin0_max;
                  for (__pyx_t_97 = (__pyx_v_bin0_min + 1); __pyx_t_97 < __pyx_t_96; __pyx_t_97+=1) {
                    __pyx_v_i = __pyx_t_97;

     1058:                             outCount[i, bin1_min] +=  deltaA * deltaD

                    /* "splitBBoxLUT.pyx":1058
     *                     outData[bin0_max, bin1_max] +=  data * deltaA * deltaR * deltaU
     *                     for i in range(bin0_min + 1, bin0_max):
     *                             outCount[i, bin1_min] +=  deltaA * deltaD             # <<<<<<<<<<<<<<
     *                             outData[i, bin1_min] +=  data * deltaA * deltaD
     *                             for j in range(bin1_min + 1, bin1_max):
     */
                    __pyx_t_98 = __pyx_v_i;
                    __pyx_t_99 = __pyx_v_bin1_min;
                    *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_outCount.rcbuffer->pybuffer.buf, __pyx_t_98, __pyx_pybuffernd_outCount.diminfo[0].strides, __pyx_t_99, __pyx_pybuffernd_outCount.diminfo[1].strides) += (__pyx_v_deltaA * __pyx_v_deltaD);

     1059:                             outData[i, bin1_min] +=  data * deltaA * deltaD

                    /* "splitBBoxLUT.pyx":1059
     *                     for i in range(bin0_min + 1, bin0_max):
     *                             outCount[i, bin1_min] +=  deltaA * deltaD
     *                             outData[i, bin1_min] +=  data * deltaA * deltaD             # <<<<<<<<<<<<<<
     *                             for j in range(bin1_min + 1, bin1_max):
     *                                 outCount[i, j] +=  deltaA
     */
                    __pyx_t_100 = __pyx_v_i;
                    __pyx_t_101 = __pyx_v_bin1_min;
                    *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_outData.rcbuffer->pybuffer.buf, __pyx_t_100, __pyx_pybuffernd_outData.diminfo[0].strides, __pyx_t_101, __pyx_pybuffernd_outData.diminfo[1].strides) += ((__pyx_v_data * __pyx_v_deltaA) * __pyx_v_deltaD);

     1060:                             for j in range(bin1_min + 1, bin1_max):

                    /* "splitBBoxLUT.pyx":1060
     *                             outCount[i, bin1_min] +=  deltaA * deltaD
     *                             outData[i, bin1_min] +=  data * deltaA * deltaD
     *                             for j in range(bin1_min + 1, bin1_max):             # <<<<<<<<<<<<<<
     *                                 outCount[i, j] +=  deltaA
     *                                 outData[i, j] +=  data * deltaA
     */
                    __pyx_t_102 = __pyx_v_bin1_max;
                    for (__pyx_t_103 = (__pyx_v_bin1_min + 1); __pyx_t_103 < __pyx_t_102; __pyx_t_103+=1) {
                      __pyx_v_j = __pyx_t_103;

     1061:                                 outCount[i, j] +=  deltaA

                      /* "splitBBoxLUT.pyx":1061
     *                             outData[i, bin1_min] +=  data * deltaA * deltaD
     *                             for j in range(bin1_min + 1, bin1_max):
     *                                 outCount[i, j] +=  deltaA             # <<<<<<<<<<<<<<
     *                                 outData[i, j] +=  data * deltaA
     *                             outCount[i, bin1_max] +=  deltaA * deltaU
     */
                      __pyx_t_104 = __pyx_v_i;
                      __pyx_t_105 = __pyx_v_j;
                      *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_outCount.rcbuffer->pybuffer.buf, __pyx_t_104, __pyx_pybuffernd_outCount.diminfo[0].strides, __pyx_t_105, __pyx_pybuffernd_outCount.diminfo[1].strides) += __pyx_v_deltaA;

     1062:                                 outData[i, j] +=  data * deltaA

                      /* "splitBBoxLUT.pyx":1062
     *                             for j in range(bin1_min + 1, bin1_max):
     *                                 outCount[i, j] +=  deltaA
     *                                 outData[i, j] +=  data * deltaA             # <<<<<<<<<<<<<<
     *                             outCount[i, bin1_max] +=  deltaA * deltaU
     *                             outData[i, bin1_max] +=  data * deltaA * deltaU
     */
                      __pyx_t_106 = __pyx_v_i;
                      __pyx_t_107 = __pyx_v_j;
                      *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_outData.rcbuffer->pybuffer.buf, __pyx_t_106, __pyx_pybuffernd_outData.diminfo[0].strides, __pyx_t_107, __pyx_pybuffernd_outData.diminfo[1].strides) += (__pyx_v_data * __pyx_v_deltaA);
                    }

     1063:                             outCount[i, bin1_max] +=  deltaA * deltaU

                    /* "splitBBoxLUT.pyx":1063
     *                                 outCount[i, j] +=  deltaA
     *                                 outData[i, j] +=  data * deltaA
     *                             outCount[i, bin1_max] +=  deltaA * deltaU             # <<<<<<<<<<<<<<
     *                             outData[i, bin1_max] +=  data * deltaA * deltaU
     *                     for j in range(bin1_min + 1, bin1_max):
     */
                    __pyx_t_102 = __pyx_v_i;
                    __pyx_t_103 = __pyx_v_bin1_max;
                    *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_outCount.rcbuffer->pybuffer.buf, __pyx_t_102, __pyx_pybuffernd_outCount.diminfo[0].strides, __pyx_t_103, __pyx_pybuffernd_outCount.diminfo[1].strides) += (__pyx_v_deltaA * __pyx_v_deltaU);

     1064:                             outData[i, bin1_max] +=  data * deltaA * deltaU

                    /* "splitBBoxLUT.pyx":1064
     *                                 outData[i, j] +=  data * deltaA
     *                             outCount[i, bin1_max] +=  deltaA * deltaU
     *                             outData[i, bin1_max] +=  data * deltaA * deltaU             # <<<<<<<<<<<<<<
     *                     for j in range(bin1_min + 1, bin1_max):
     *                             outCount[bin0_min, j] +=  deltaA * deltaL
     */
                    __pyx_t_108 = __pyx_v_i;
                    __pyx_t_109 = __pyx_v_bin1_max;
                    *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_outData.rcbuffer->pybuffer.buf, __pyx_t_108, __pyx_pybuffernd_outData.diminfo[0].strides, __pyx_t_109, __pyx_pybuffernd_outData.diminfo[1].strides) += ((__pyx_v_data * __pyx_v_deltaA) * __pyx_v_deltaU);
                  }

     1065:                     for j in range(bin1_min + 1, bin1_max):

                  /* "splitBBoxLUT.pyx":1065
     *                             outCount[i, bin1_max] +=  deltaA * deltaU
     *                             outData[i, bin1_max] +=  data * deltaA * deltaU
     *                     for j in range(bin1_min + 1, bin1_max):             # <<<<<<<<<<<<<<
     *                             outCount[bin0_min, j] +=  deltaA * deltaL
     *                             outData[bin0_min, j] +=  data * deltaA * deltaL
     */
                  __pyx_t_96 = __pyx_v_bin1_max;
                  for (__pyx_t_97 = (__pyx_v_bin1_min + 1); __pyx_t_97 < __pyx_t_96; __pyx_t_97+=1) {
                    __pyx_v_j = __pyx_t_97;

     1066:                             outCount[bin0_min, j] +=  deltaA * deltaL

                    /* "splitBBoxLUT.pyx":1066
     *                             outData[i, bin1_max] +=  data * deltaA * deltaU
     *                     for j in range(bin1_min + 1, bin1_max):
     *                             outCount[bin0_min, j] +=  deltaA * deltaL             # <<<<<<<<<<<<<<
     *                             outData[bin0_min, j] +=  data * deltaA * deltaL
     *
     */
                    __pyx_t_110 = __pyx_v_bin0_min;
                    __pyx_t_111 = __pyx_v_j;
                    *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_outCount.rcbuffer->pybuffer.buf, __pyx_t_110, __pyx_pybuffernd_outCount.diminfo[0].strides, __pyx_t_111, __pyx_pybuffernd_outCount.diminfo[1].strides) += (__pyx_v_deltaA * __pyx_v_deltaL);

     1067:                             outData[bin0_min, j] +=  data * deltaA * deltaL

                    /* "splitBBoxLUT.pyx":1067
     *                     for j in range(bin1_min + 1, bin1_max):
     *                             outCount[bin0_min, j] +=  deltaA * deltaL
     *                             outData[bin0_min, j] +=  data * deltaA * deltaL             # <<<<<<<<<<<<<<
     *
     *                             outCount[bin0_max, j] +=  deltaA * deltaR
     */
                    __pyx_t_112 = __pyx_v_bin0_min;
                    __pyx_t_113 = __pyx_v_j;
                    *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_outData.rcbuffer->pybuffer.buf, __pyx_t_112, __pyx_pybuffernd_outData.diminfo[0].strides, __pyx_t_113, __pyx_pybuffernd_outData.diminfo[1].strides) += ((__pyx_v_data * __pyx_v_deltaA) * __pyx_v_deltaL);

     1068:

     1069:                             outCount[bin0_max, j] +=  deltaA * deltaR

                    /* "splitBBoxLUT.pyx":1069
     *                             outData[bin0_min, j] +=  data * deltaA * deltaL
     *
     *                             outCount[bin0_max, j] +=  deltaA * deltaR             # <<<<<<<<<<<<<<
     *                             outData[bin0_max, j] +=  data * deltaA * deltaR
     *
     */
                    __pyx_t_114 = __pyx_v_bin0_max;
                    __pyx_t_115 = __pyx_v_j;
                    *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_outCount.rcbuffer->pybuffer.buf, __pyx_t_114, __pyx_pybuffernd_outCount.diminfo[0].strides, __pyx_t_115, __pyx_pybuffernd_outCount.diminfo[1].strides) += (__pyx_v_deltaA * __pyx_v_deltaR);

     1070:                             outData[bin0_max, j] +=  data * deltaA * deltaR

                    /* "splitBBoxLUT.pyx":1070
     *
     *                             outCount[bin0_max, j] +=  deltaA * deltaR
     *                             outData[bin0_max, j] +=  data * deltaA * deltaR             # <<<<<<<<<<<<<<
     *
     *         for i in range(bins0):
     */
                    __pyx_t_116 = __pyx_v_bin0_max;
                    __pyx_t_117 = __pyx_v_j;
                    *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_outData.rcbuffer->pybuffer.buf, __pyx_t_116, __pyx_pybuffernd_outData.diminfo[0].strides, __pyx_t_117, __pyx_pybuffernd_outData.diminfo[1].strides) += ((__pyx_v_data * __pyx_v_deltaA) * __pyx_v_deltaR);
                  }
                }
                __pyx_L53:;
              }
              __pyx_L49:;
              __pyx_L36_continue:;
            }

     1071:

     1072:         for i in range(bins0):

            /* "splitBBoxLUT.pyx":1072
     *                             outData[bin0_max, j] +=  data * deltaA * deltaR
     *
     *         for i in range(bins0):             # <<<<<<<<<<<<<<
     *             for j in range(bins1):
     *                 if outCount[i, j] > epsilon:
     */
            __pyx_t_12 = __pyx_v_bins0;
            for (__pyx_t_96 = 0; __pyx_t_96 < __pyx_t_12; __pyx_t_96+=1) {
              __pyx_v_i = __pyx_t_96;

     1073:             for j in range(bins1):

              /* "splitBBoxLUT.pyx":1073
     *
     *         for i in range(bins0):
     *             for j in range(bins1):             # <<<<<<<<<<<<<<
     *                 if outCount[i, j] > epsilon:
     *                     outMerge[i, j] = <float> (outData[i, j] / outCount[i, j])
     */
              __pyx_t_97 = __pyx_v_bins1;
              for (__pyx_t_118 = 0; __pyx_t_118 < __pyx_t_97; __pyx_t_118+=1) {
                __pyx_v_j = __pyx_t_118;

     1074:                 if outCount[i, j] > epsilon:

                /* "splitBBoxLUT.pyx":1074
     *         for i in range(bins0):
     *             for j in range(bins1):
     *                 if outCount[i, j] > epsilon:             # <<<<<<<<<<<<<<
     *                     outMerge[i, j] = <float> (outData[i, j] / outCount[i, j])
     *                 else:
     */
                __pyx_t_119 = __pyx_v_i;
                __pyx_t_120 = __pyx_v_j;
                __pyx_t_25 = ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_outCount.rcbuffer->pybuffer.buf, __pyx_t_119, __pyx_pybuffernd_outCount.diminfo[0].strides, __pyx_t_120, __pyx_pybuffernd_outCount.diminfo[1].strides)) > __pyx_v_epsilon);
                if (__pyx_t_25) {

     1075:                     outMerge[i, j] = <float> (outData[i, j] / outCount[i, j])

                  /* "splitBBoxLUT.pyx":1075
     *             for j in range(bins1):
     *                 if outCount[i, j] > epsilon:
     *                     outMerge[i, j] = <float> (outData[i, j] / outCount[i, j])             # <<<<<<<<<<<<<<
     *                 else:
     *                     outMerge[i, j] = cdummy
     */
                  __pyx_t_121 = __pyx_v_i;
                  __pyx_t_122 = __pyx_v_j;
                  __pyx_t_123 = __pyx_v_i;
                  __pyx_t_124 = __pyx_v_j;
                  __pyx_t_125 = __pyx_v_i;
                  __pyx_t_126 = __pyx_v_j;
                  *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_outMerge.rcbuffer->pybuffer.buf, __pyx_t_125, __pyx_pybuffernd_outMerge.diminfo[0].strides, __pyx_t_126, __pyx_pybuffernd_outMerge.diminfo[1].strides) = ((float)((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_outData.rcbuffer->pybuffer.buf, __pyx_t_121, __pyx_pybuffernd_outData.diminfo[0].strides, __pyx_t_122, __pyx_pybuffernd_outData.diminfo[1].strides)) / (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_outCount.rcbuffer->pybuffer.buf, __pyx_t_123, __pyx_pybuffernd_outCount.diminfo[0].strides, __pyx_t_124, __pyx_pybuffernd_outCount.diminfo[1].strides))));
                  goto __pyx_L66;
                }
                /*else*/ {

     1076:                 else:

     1077:                     outMerge[i, j] = cdummy

                  /* "splitBBoxLUT.pyx":1077
     *                     outMerge[i, j] = <float> (outData[i, j] / outCount[i, j])
     *                 else:
     *                     outMerge[i, j] = cdummy             # <<<<<<<<<<<<<<
     *     return outMerge.T, edges0, edges1, outData.T, outCount.T
     *
     */
                  __pyx_t_127 = __pyx_v_i;
                  __pyx_t_128 = __pyx_v_j;
                  *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_outMerge.rcbuffer->pybuffer.buf, __pyx_t_127, __pyx_pybuffernd_outMerge.diminfo[0].strides, __pyx_t_128, __pyx_pybuffernd_outMerge.diminfo[1].strides) = __pyx_v_cdummy;
                }
                __pyx_L66:;
              }
            }
          }

     1078:     return outMerge.T, edges0, edges1, outData.T, outCount.T

      /* "splitBBoxLUT.pyx":1078
     *                 else:
     *                     outMerge[i, j] = cdummy
     *     return outMerge.T, edges0, edges1, outData.T, outCount.T             # <<<<<<<<<<<<<<
     *
     *
     */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_3 = PyObject_GetAttr(((PyObject *)__pyx_v_outMerge), __pyx_n_s__T); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1078; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_9 = PyObject_GetAttr(((PyObject *)__pyx_v_outData), __pyx_n_s__T); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1078; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_13 = PyObject_GetAttr(((PyObject *)__pyx_v_outCount), __pyx_n_s__T); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1078; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_13);
      __pyx_t_4 = PyTuple_New(5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1078; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      __Pyx_INCREF(__pyx_v_edges0);
      PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_edges0);
      __Pyx_GIVEREF(__pyx_v_edges0);
      __Pyx_INCREF(__pyx_v_edges1);
      PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_edges1);
      __Pyx_GIVEREF(__pyx_v_edges1);
      PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_t_9);
      __Pyx_GIVEREF(__pyx_t_9);
      PyTuple_SET_ITEM(__pyx_t_4, 4, __pyx_t_13);
      __Pyx_GIVEREF(__pyx_t_13);
      __pyx_t_3 = 0;
      __pyx_t_9 = 0;
      __pyx_t_13 = 0;
      __pyx_r = ((PyObject *)__pyx_t_4);
      __pyx_t_4 = 0;
      goto __pyx_L0;

      __pyx_r = Py_None; __Pyx_INCREF(Py_None);
      goto __pyx_L0;
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_9);
      __Pyx_XDECREF(__pyx_t_13);
      __PYX_XDEC_MEMVIEW(&__pyx_t_24, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_28, 1);
      { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
        __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
        __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_cdata.rcbuffer->pybuffer);
        __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_cpos0.rcbuffer->pybuffer);
        __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_cpos0_lower.rcbuffer->pybuffer);
        __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_cpos0_upper.rcbuffer->pybuffer);
        __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_cpos1.rcbuffer->pybuffer);
        __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dpos0.rcbuffer->pybuffer);
        __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dpos1.rcbuffer->pybuffer);
        __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_outCount.rcbuffer->pybuffer);
        __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_outData.rcbuffer->pybuffer);
        __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_outMerge.rcbuffer->pybuffer);
      __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
      __Pyx_AddTraceback("splitBBoxLUT.histoBBox2d", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      goto __pyx_L2;
      __pyx_L0:;
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_cdata.rcbuffer->pybuffer);
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_cpos0.rcbuffer->pybuffer);
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_cpos0_lower.rcbuffer->pybuffer);
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_cpos0_upper.rcbuffer->pybuffer);
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_cpos1.rcbuffer->pybuffer);
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dpos0.rcbuffer->pybuffer);
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dpos1.rcbuffer->pybuffer);
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_outCount.rcbuffer->pybuffer);
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_outData.rcbuffer->pybuffer);
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_outMerge.rcbuffer->pybuffer);
      __pyx_L2:;
      __Pyx_XDECREF((PyObject *)__pyx_v_cdata);
      __Pyx_XDECREF((PyObject *)__pyx_v_cpos0);
      __Pyx_XDECREF((PyObject *)__pyx_v_dpos0);
      __Pyx_XDECREF((PyObject *)__pyx_v_cpos1);
      __Pyx_XDECREF((PyObject *)__pyx_v_dpos1);
      __Pyx_XDECREF((PyObject *)__pyx_v_cpos0_upper);
      __Pyx_XDECREF((PyObject *)__pyx_v_cpos0_lower);
      __Pyx_XDECREF((PyObject *)__pyx_v_outData);
      __Pyx_XDECREF((PyObject *)__pyx_v_outCount);
      __Pyx_XDECREF((PyObject *)__pyx_v_outMerge);
      __PYX_XDEC_MEMVIEW(&__pyx_v_cmask, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_cflat, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_cdark, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_cpolarization, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_csolidangle, 1);
      __Pyx_XDECREF(__pyx_v_edges0);
      __Pyx_XDECREF(__pyx_v_edges1);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    /* Python wrapper */
    static PyObject *__pyx_pw_12splitBBoxLUT_3histoBBox1d(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
    static char __pyx_doc_12splitBBoxLUT_2histoBBox1d[] = "\n    Calculates histogram of pos0 (tth) weighted by weights\n\n    Splitting is done on the pixel's bounding box like fit2D\n\n    @param weights: array with intensities\n    @param pos0: 1D array with pos0: tth or q_vect\n    @param delta_pos0: 1D array with delta pos0: max center-corner distance\n    @param pos1: 1D array with pos1: chi\n    @param delta_pos1: 1D array with max pos1: max center-corner distance, unused !\n    @param bins: number of output bins\n    @param pos0Range: minimum and maximum  of the 2th range\n    @param pos1Range: minimum and maximum  of the chi range\n    @param dummy: value for bins without pixels & value of \"no good\" pixels\n    @param delta_dummy: precision of dummy value\n    @param mask: array (of int8) with masked pixels with 1 (0=not masked)\n    @param dark: array (of float32) with dark noise to be subtracted (or None)\n    @param flat: array (of float32) with flat image (including solid angle correctons or not...)\n    @return 2theta, I, weighted histogram, unweighted histogram\n    ";
    static PyMethodDef __pyx_mdef_12splitBBoxLUT_3histoBBox1d = {__Pyx_NAMESTR("histoBBox1d"), (PyCFunction)__pyx_pw_12splitBBoxLUT_3histoBBox1d, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_12splitBBoxLUT_2histoBBox1d)};
    static PyObject *__pyx_pw_12splitBBoxLUT_3histoBBox1d(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
      PyObject *__pyx_v_weights = 0;
      PyObject *__pyx_v_pos0 = 0;
      PyObject *__pyx_v_delta_pos0 = 0;
      PyObject *__pyx_v_pos1 = 0;
      PyObject *__pyx_v_delta_pos1 = 0;
      PyObject *__pyx_v_bins = 0;
      PyObject *__pyx_v_pos0Range = 0;
      PyObject *__pyx_v_pos1Range = 0;
      PyObject *__pyx_v_dummy = 0;
      PyObject *__pyx_v_delta_dummy = 0;
      PyObject *__pyx_v_mask = 0;
      PyObject *__pyx_v_dark = 0;
      PyObject *__pyx_v_flat = 0;
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("histoBBox1d (wrapper)", 0);
      {
        static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__weights,&__pyx_n_s__pos0,&__pyx_n_s__delta_pos0,&__pyx_n_s__pos1,&__pyx_n_s__delta_pos1,&__pyx_n_s__bins,&__pyx_n_s__pos0Range,&__pyx_n_s__pos1Range,&__pyx_n_s__dummy,&__pyx_n_s__delta_dummy,&__pyx_n_s__mask,&__pyx_n_s__dark,&__pyx_n_s__flat,0};
        PyObject* values[13] = {0,0,0,0,0,0,0,0,0,0,0,0,0};

     1079:

     1080:

     1081: def histoBBox1d(weights ,

    /* "splitBBoxLUT.pyx":1081
     *
     *
     * def histoBBox1d(weights ,             # <<<<<<<<<<<<<<
     *                 pos0,
     *                 delta_pos0,
     */

    static PyObject *__pyx_pf_12splitBBoxLUT_2histoBBox1d(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_weights, PyObject *__pyx_v_pos0, PyObject *__pyx_v_delta_pos0, PyObject *__pyx_v_pos1, PyObject *__pyx_v_delta_pos1, PyObject *__pyx_v_bins, PyObject *__pyx_v_pos0Range, PyObject *__pyx_v_pos1Range, PyObject *__pyx_v_dummy, PyObject *__pyx_v_delta_dummy, PyObject *__pyx_v_mask, PyObject *__pyx_v_dark, PyObject *__pyx_v_flat) {
      PyObject *__pyx_v_size = NULL;
      CYTHON_UNUSED long __pyx_v_bin;
      double __pyx_v_epsilon;
      double __pyx_v_cdummy;
      double __pyx_v_ddummy;
      long __pyx_v_check_pos1;
      long __pyx_v_check_mask;
      long __pyx_v_do_dummy;
      long __pyx_v_do_dark;
      long __pyx_v_do_flat;
      PyObject *__pyx_v_cdata = NULL;
      PyObject *__pyx_v_cpos0 = NULL;
      PyObject *__pyx_v_dpos0 = NULL;
      PyObject *__pyx_v_outData = NULL;
      PyObject *__pyx_v_outCount = NULL;
      PyObject *__pyx_v_outMax = NULL;
      PyObject *__pyx_v_outMerge = NULL;
      PyObject *__pyx_v_cmask = NULL;
      PyObject *__pyx_v_cdark = NULL;
      PyObject *__pyx_v_cflat = NULL;
      PyObject *__pyx_v_cpos0_lower = NULL;
      PyObject *__pyx_v_cpos0_upper = NULL;
      PyObject *__pyx_v_pos0_min = NULL;
      PyObject *__pyx_v_pos0_max = NULL;
      PyObject *__pyx_v_idx = NULL;
      PyObject *__pyx_v_min0 = NULL;
      PyObject *__pyx_v_max0 = NULL;
      PyObject *__pyx_v_pos0_maxin = NULL;
      PyObject *__pyx_v_cpos1 = NULL;
      PyObject *__pyx_v_dpos1 = NULL;
      PyObject *__pyx_v_pos1_min = NULL;
      PyObject *__pyx_v_pos1_maxin = NULL;
      PyObject *__pyx_v_pos1_max = NULL;
      PyObject *__pyx_v_delta = NULL;
      PyObject *__pyx_v_outPos = NULL;
      PyObject *__pyx_v_data = NULL;
      PyObject *__pyx_v_fbin0_min = NULL;
      PyObject *__pyx_v_fbin0_max = NULL;
      PyObject *__pyx_v_bin0_min = NULL;
      PyObject *__pyx_v_bin0_max = NULL;
      PyObject *__pyx_v_deltaA = NULL;
      PyObject *__pyx_v_deltaL = NULL;
      PyObject *__pyx_v_deltaR = NULL;
      PyObject *__pyx_v_i = NULL;
      PyObject *__pyx_r = NULL;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("histoBBox1d", 0);

      /* "splitBBoxLUT.pyx":1081
     *
     *
     * def histoBBox1d(weights ,             # <<<<<<<<<<<<<<
     *                 pos0,
     *                 delta_pos0,
     */
      __pyx_k_tuple_77 = PyTuple_Pack(57, ((PyObject *)__pyx_n_s__weights), ((PyObject *)__pyx_n_s__pos0), ((PyObject *)__pyx_n_s__delta_pos0), ((PyObject *)__pyx_n_s__pos1), ((PyObject *)__pyx_n_s__delta_pos1), ((PyObject *)__pyx_n_s__bins), ((PyObject *)__pyx_n_s__pos0Range), ((PyObject *)__pyx_n_s__pos1Range), ((PyObject *)__pyx_n_s__dummy), ((PyObject *)__pyx_n_s__delta_dummy), ((PyObject *)__pyx_n_s__mask), ((PyObject *)__pyx_n_s__dark), ((PyObject *)__pyx_n_s__flat), ((PyObject *)__pyx_n_s__size), ((PyObject *)__pyx_n_s__bin), ((PyObject *)__pyx_n_s__epsilon), ((PyObject *)__pyx_n_s__cdummy), ((PyObject *)__pyx_n_s__ddummy), ((PyObject *)__pyx_n_s__check_pos1), ((PyObject *)__pyx_n_s__check_mask), ((PyObject *)__pyx_n_s__do_dummy), ((PyObject *)__pyx_n_s__do_dark), ((PyObject *)__pyx_n_s__do_flat), ((PyObject *)__pyx_n_s__cdata), ((PyObject *)__pyx_n_s__cpos0), ((PyObject *)__pyx_n_s__dpos0), ((PyObject *)__pyx_n_s__outData), ((PyObject *)__pyx_n_s__outCount), ((PyObject *)__pyx_n_s__outMax), ((PyObject *)__pyx_n_s__outMerge), ((PyObject *)__pyx_n_s__cmask), ((PyObject *)__pyx_n_s__cdark), ((PyObject *)__pyx_n_s__cflat), ((PyObject *)__pyx_n_s__cpos0_lower), ((PyObject *)__pyx_n_s__cpos0_upper), ((PyObject *)__pyx_n_s__pos0_min), ((PyObject *)__pyx_n_s__pos0_max), ((PyObject *)__pyx_n_s__idx), ((PyObject *)__pyx_n_s__min0), ((PyObject *)__pyx_n_s__max0), ((PyObject *)__pyx_n_s__pos0_maxin), ((PyObject *)__pyx_n_s__cpos1), ((PyObject *)__pyx_n_s__dpos1), ((PyObject *)__pyx_n_s__pos1_min), ((PyObject *)__pyx_n_s__pos1_maxin), ((PyObject *)__pyx_n_s__pos1_max), ((PyObject *)__pyx_n_s__delta), ((PyObject *)__pyx_n_s__outPos), ((PyObject *)__pyx_n_s__data), ((PyObject *)__pyx_n_s__fbin0_min), ((PyObject *)__pyx_n_s__fbin0_max), ((PyObject *)__pyx_n_s__bin0_min), ((PyObject *)__pyx_n_s__bin0_max), ((PyObject *)__pyx_n_s__deltaA), ((PyObject *)__pyx_n_s__deltaL), ((PyObject *)__pyx_n_s__deltaR), ((PyObject *)__pyx_n_s__i)); if (unlikely(!__pyx_k_tuple_77)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1081; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_k_tuple_77);
      __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_77));

      /* "splitBBoxLUT.pyx":1081
     *
     *
     * def histoBBox1d(weights ,             # <<<<<<<<<<<<<<
     *                 pos0,
     *                 delta_pos0,
     */
      __pyx_t_8 = PyCFunction_NewEx(&__pyx_mdef_12splitBBoxLUT_3histoBBox1d, NULL, __pyx_n_s__splitBBoxLUT); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1081; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      if (PyObject_SetAttr(__pyx_m, __pyx_n_s__histoBBox1d, __pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1081; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_k_codeobj_78 = (PyObject*)__Pyx_PyCode_New(13, 0, 57, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_77, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_56, __pyx_n_s__histoBBox1d, 1081, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_78)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1081; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

     1082:                 pos0,

     1083:                 delta_pos0,

     1084:                 pos1=None,

        /* "splitBBoxLUT.pyx":1084
     *                 pos0,
     *                 delta_pos0,
     *                 pos1=None,             # <<<<<<<<<<<<<<
     *                 delta_pos1=None,
     *                 bins=100,
     */
        values[3] = ((PyObject *)Py_None);

     1085:                 delta_pos1=None,

        /* "splitBBoxLUT.pyx":1085
     *                 delta_pos0,
     *                 pos1=None,
     *                 delta_pos1=None,             # <<<<<<<<<<<<<<
     *                 bins=100,
     *                 pos0Range=None,
     */
        values[4] = ((PyObject *)Py_None);
        values[5] = ((PyObject *)__pyx_int_100);

     1086:                 bins=100,

     1087:                 pos0Range=None,

        /* "splitBBoxLUT.pyx":1087
     *                 delta_pos1=None,
     *                 bins=100,
     *                 pos0Range=None,             # <<<<<<<<<<<<<<
     *                 pos1Range=None,
     *                 dummy=None,
     */
        values[6] = ((PyObject *)Py_None);

     1088:                 pos1Range=None,

        /* "splitBBoxLUT.pyx":1088
     *                 bins=100,
     *                 pos0Range=None,
     *                 pos1Range=None,             # <<<<<<<<<<<<<<
     *                 dummy=None,
     *                 delta_dummy=None,
     */
        values[7] = ((PyObject *)Py_None);

     1089:                 dummy=None,

        /* "splitBBoxLUT.pyx":1089
     *                 pos0Range=None,
     *                 pos1Range=None,
     *                 dummy=None,             # <<<<<<<<<<<<<<
     *                 delta_dummy=None,
     *                 mask=None,
     */
        values[8] = ((PyObject *)Py_None);

     1090:                 delta_dummy=None,

        /* "splitBBoxLUT.pyx":1090
     *                 pos1Range=None,
     *                 dummy=None,
     *                 delta_dummy=None,             # <<<<<<<<<<<<<<
     *                 mask=None,
     *                 dark=None,
     */
        values[9] = ((PyObject *)Py_None);

     1091:                 mask=None,

        /* "splitBBoxLUT.pyx":1091
     *                 dummy=None,
     *                 delta_dummy=None,
     *                 mask=None,             # <<<<<<<<<<<<<<
     *                 dark=None,
     *                 flat=None
     */
        values[10] = ((PyObject *)Py_None);

     1092:                 dark=None,

        /* "splitBBoxLUT.pyx":1092
     *                 delta_dummy=None,
     *                 mask=None,
     *                 dark=None,             # <<<<<<<<<<<<<<
     *                 flat=None
     *               ):
     */
        values[11] = ((PyObject *)Py_None);

     1093:                 flat=None

        /* "splitBBoxLUT.pyx":1093
     *                 mask=None,
     *                 dark=None,
     *                 flat=None             # <<<<<<<<<<<<<<
     *               ):
     *     """
     */
        values[12] = ((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 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__weights)) != 0)) kw_args--;
            else goto __pyx_L5_argtuple_error;
            case  1:
            if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__pos0)) != 0)) kw_args--;
            else {
              __Pyx_RaiseArgtupleInvalid("histoBBox1d", 0, 3, 13, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1081; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
            }
            case  2:
            if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__delta_pos0)) != 0)) kw_args--;
            else {
              __Pyx_RaiseArgtupleInvalid("histoBBox1d", 0, 3, 13, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1081; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
            }
            case  3:
            if (kw_args > 0) {
              PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__pos1);
              if (value) { values[3] = value; kw_args--; }
            }
            case  4:
            if (kw_args > 0) {
              PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__delta_pos1);
              if (value) { values[4] = value; kw_args--; }
            }
            case  5:
            if (kw_args > 0) {
              PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__bins);
              if (value) { values[5] = value; kw_args--; }
            }
            case  6:
            if (kw_args > 0) {
              PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__pos0Range);
              if (value) { values[6] = value; kw_args--; }
            }
            case  7:
            if (kw_args > 0) {
              PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__pos1Range);
              if (value) { values[7] = value; kw_args--; }
            }
            case  8:
            if (kw_args > 0) {
              PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__dummy);
              if (value) { values[8] = value; kw_args--; }
            }
            case  9:
            if (kw_args > 0) {
              PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__delta_dummy);
              if (value) { values[9] = value; kw_args--; }
            }
            case 10:
            if (kw_args > 0) {
              PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__mask);
              if (value) { values[10] = value; kw_args--; }
            }
            case 11:
            if (kw_args > 0) {
              PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__dark);
              if (value) { values[11] = value; kw_args--; }
            }
            case 12:
            if (kw_args > 0) {
              PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__flat);
              if (value) { values[12] = value; kw_args--; }
            }
          }
          if (unlikely(kw_args > 0)) {
            if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "histoBBox1d") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1081; __pyx_clineno = __LINE__; goto __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);
            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_weights = values[0];
        __pyx_v_pos0 = values[1];
        __pyx_v_delta_pos0 = values[2];
        __pyx_v_pos1 = values[3];
        __pyx_v_delta_pos1 = values[4];
        __pyx_v_bins = values[5];
        __pyx_v_pos0Range = values[6];
        __pyx_v_pos1Range = values[7];
        __pyx_v_dummy = values[8];
        __pyx_v_delta_dummy = values[9];
        __pyx_v_mask = values[10];
        __pyx_v_dark = values[11];
        __pyx_v_flat = values[12];
      }
      goto __pyx_L4_argument_unpacking_done;
      __pyx_L5_argtuple_error:;
      __Pyx_RaiseArgtupleInvalid("histoBBox1d", 0, 3, 13, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1081; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      __pyx_L3_error:;
      __Pyx_AddTraceback("splitBBoxLUT.histoBBox1d", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __Pyx_RefNannyFinishContext();
      return NULL;
      __pyx_L4_argument_unpacking_done:;
      __pyx_r = __pyx_pf_12splitBBoxLUT_2histoBBox1d(__pyx_self, __pyx_v_weights, __pyx_v_pos0, __pyx_v_delta_pos0, __pyx_v_pos1, __pyx_v_delta_pos1, __pyx_v_bins, __pyx_v_pos0Range, __pyx_v_pos1Range, __pyx_v_dummy, __pyx_v_delta_dummy, __pyx_v_mask, __pyx_v_dark, __pyx_v_flat);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

     1094:               ):

     1095:     """

     1096:     Calculates histogram of pos0 (tth) weighted by weights

     1097:

     1098:     Splitting is done on the pixel's bounding box like fit2D

     1099:

     1100:     @param weights: array with intensities

     1101:     @param pos0: 1D array with pos0: tth or q_vect

     1102:     @param delta_pos0: 1D array with delta pos0: max center-corner distance

     1103:     @param pos1: 1D array with pos1: chi

     1104:     @param delta_pos1: 1D array with max pos1: max center-corner distance, unused !

     1105:     @param bins: number of output bins

     1106:     @param pos0Range: minimum and maximum  of the 2th range

     1107:     @param pos1Range: minimum and maximum  of the chi range

     1108:     @param dummy: value for bins without pixels & value of "no good" pixels

     1109:     @param delta_dummy: precision of dummy value

     1110:     @param mask: array (of int8) with masked pixels with 1 (0=not masked)

     1111:     @param dark: array (of float32) with dark noise to be subtracted (or None)

     1112:     @param flat: array (of float32) with flat image (including solid angle correctons or not...)

     1113:     @return 2theta, I, weighted histogram, unweighted histogram

     1114:     """

     1115:     size = weights.size

      /* "splitBBoxLUT.pyx":1115
     *     @return 2theta, I, weighted histogram, unweighted histogram
     *     """
     *     size = weights.size             # <<<<<<<<<<<<<<
     *     assert pos0.size == size
     *     assert delta_pos0.size == size
     */
      __pyx_t_1 = PyObject_GetAttr(__pyx_v_weights, __pyx_n_s__size); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_v_size = __pyx_t_1;
      __pyx_t_1 = 0;

     1116:     assert pos0.size == size

      /* "splitBBoxLUT.pyx":1116
     *     """
     *     size = weights.size
     *     assert pos0.size == size             # <<<<<<<<<<<<<<
     *     assert delta_pos0.size == size
     *     assert  bins > 1
     */
      #ifndef CYTHON_WITHOUT_ASSERTIONS
      __pyx_t_1 = PyObject_GetAttr(__pyx_v_pos0, __pyx_n_s__size); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_v_size, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_3)) {
        PyErr_SetNone(PyExc_AssertionError);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      #endif

     1117:     assert delta_pos0.size == size

      /* "splitBBoxLUT.pyx":1117
     *     size = weights.size
     *     assert pos0.size == size
     *     assert delta_pos0.size == size             # <<<<<<<<<<<<<<
     *     assert  bins > 1
     *     bin = 0
     */
      #ifndef CYTHON_WITHOUT_ASSERTIONS
      __pyx_t_2 = PyObject_GetAttr(__pyx_v_delta_pos0, __pyx_n_s__size); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_v_size, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (unlikely(!__pyx_t_3)) {
        PyErr_SetNone(PyExc_AssertionError);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      #endif

     1118:     assert  bins > 1

      /* "splitBBoxLUT.pyx":1118
     *     assert pos0.size == size
     *     assert delta_pos0.size == size
     *     assert  bins > 1             # <<<<<<<<<<<<<<
     *     bin = 0
     *     epsilon = 1e-10
     */
      #ifndef CYTHON_WITHOUT_ASSERTIONS
      __pyx_t_1 = PyObject_RichCompare(__pyx_v_bins, __pyx_int_1, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (unlikely(!__pyx_t_3)) {
        PyErr_SetNone(PyExc_AssertionError);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      #endif

     1119:     bin = 0

      /* "splitBBoxLUT.pyx":1119
     *     assert delta_pos0.size == size
     *     assert  bins > 1
     *     bin = 0             # <<<<<<<<<<<<<<
     *     epsilon = 1e-10
     *     cdummy = 0
     */
      __pyx_v_bin = 0;

     1120:     epsilon = 1e-10

      /* "splitBBoxLUT.pyx":1120
     *     assert  bins > 1
     *     bin = 0
     *     epsilon = 1e-10             # <<<<<<<<<<<<<<
     *     cdummy = 0
     *     ddummy = 0
     */
      __pyx_v_epsilon = 1e-10;

     1121:     cdummy = 0

      /* "splitBBoxLUT.pyx":1121
     *     bin = 0
     *     epsilon = 1e-10
     *     cdummy = 0             # <<<<<<<<<<<<<<
     *     ddummy = 0
     *
     */
      __pyx_v_cdummy = 0.0;

     1122:     ddummy = 0

      /* "splitBBoxLUT.pyx":1122
     *     epsilon = 1e-10
     *     cdummy = 0
     *     ddummy = 0             # <<<<<<<<<<<<<<
     *
     *     check_pos1 = 0
     */
      __pyx_v_ddummy = 0.0;

     1123:

     1124:     check_pos1 = 0

      /* "splitBBoxLUT.pyx":1124
     *     ddummy = 0
     *
     *     check_pos1 = 0             # <<<<<<<<<<<<<<
     *     check_mask = 0
     *     do_dummy = 0
     */
      __pyx_v_check_pos1 = 0;

     1125:     check_mask = 0

      /* "splitBBoxLUT.pyx":1125
     *
     *     check_pos1 = 0
     *     check_mask = 0             # <<<<<<<<<<<<<<
     *     do_dummy = 0
     *     do_dark = 0
     */
      __pyx_v_check_mask = 0;

     1126:     do_dummy = 0

      /* "splitBBoxLUT.pyx":1126
     *     check_pos1 = 0
     *     check_mask = 0
     *     do_dummy = 0             # <<<<<<<<<<<<<<
     *     do_dark = 0
     *     do_flat = 0
     */
      __pyx_v_do_dummy = 0;

     1127:     do_dark = 0

      /* "splitBBoxLUT.pyx":1127
     *     check_mask = 0
     *     do_dummy = 0
     *     do_dark = 0             # <<<<<<<<<<<<<<
     *     do_flat = 0
     *
     */
      __pyx_v_do_dark = 0;

     1128:     do_flat = 0

      /* "splitBBoxLUT.pyx":1128
     *     do_dummy = 0
     *     do_dark = 0
     *     do_flat = 0             # <<<<<<<<<<<<<<
     *
     *     cdata = numpy.ascontiguousarray(weights.ravel(), dtype=numpy.float32)
     */
      __pyx_v_do_flat = 0;

     1129:

     1130:     cdata = numpy.ascontiguousarray(weights.ravel(), dtype=numpy.float32)

      /* "splitBBoxLUT.pyx":1130
     *     do_flat = 0
     *
     *     cdata = numpy.ascontiguousarray(weights.ravel(), dtype=numpy.float32)             # <<<<<<<<<<<<<<
     *     cpos0 = numpy.ascontiguousarray(pos0.ravel(), dtype=numpy.float32)
     *     dpos0 = numpy.ascontiguousarray(delta_pos0.ravel(), dtype=numpy.float32)
     */
      __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__ascontiguousarray); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyObject_GetAttr(__pyx_v_weights, __pyx_n_s__ravel); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_4);
      __pyx_t_4 = 0;
      __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_4));
      __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__float32); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (PyDict_SetItem(__pyx_t_4, ((PyObject *)__pyx_n_s__dtype), __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
      __pyx_v_cdata = __pyx_t_6;
      __pyx_t_6 = 0;

     1131:     cpos0 = numpy.ascontiguousarray(pos0.ravel(), dtype=numpy.float32)

      /* "splitBBoxLUT.pyx":1131
     *
     *     cdata = numpy.ascontiguousarray(weights.ravel(), dtype=numpy.float32)
     *     cpos0 = numpy.ascontiguousarray(pos0.ravel(), dtype=numpy.float32)             # <<<<<<<<<<<<<<
     *     dpos0 = numpy.ascontiguousarray(delta_pos0.ravel(), dtype=numpy.float32)
     *
     */
      __pyx_t_6 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_4 = PyObject_GetAttr(__pyx_t_6, __pyx_n_s__ascontiguousarray); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = PyObject_GetAttr(__pyx_v_pos0, __pyx_n_s__ravel); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_1 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_1));
      __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_5 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__float32); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__dtype), __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_6), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
      __pyx_v_cpos0 = __pyx_t_5;
      __pyx_t_5 = 0;

     1132:     dpos0 = numpy.ascontiguousarray(delta_pos0.ravel(), dtype=numpy.float32)

      /* "splitBBoxLUT.pyx":1132
     *     cdata = numpy.ascontiguousarray(weights.ravel(), dtype=numpy.float32)
     *     cpos0 = numpy.ascontiguousarray(pos0.ravel(), dtype=numpy.float32)
     *     dpos0 = numpy.ascontiguousarray(delta_pos0.ravel(), dtype=numpy.float32)             # <<<<<<<<<<<<<<
     *
     *
     */
      __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_1 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__ascontiguousarray); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = PyObject_GetAttr(__pyx_v_delta_pos0, __pyx_n_s__ravel); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_6);
      __pyx_t_6 = 0;
      __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_6));
      __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_2 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__float32); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (PyDict_SetItem(__pyx_t_6, ((PyObject *)__pyx_n_s__dtype), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_5), ((PyObject *)__pyx_t_6)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
      __pyx_v_dpos0 = __pyx_t_2;
      __pyx_t_2 = 0;

     1133:

     1134:

     1135:     outData = numpy.zeros(bins, dtype=numpy.float64)

      /* "splitBBoxLUT.pyx":1135
     *
     *
     *     outData = numpy.zeros(bins, dtype=numpy.float64)             # <<<<<<<<<<<<<<
     *     outCount = numpy.zeros(bins, dtype=numpy.float64)
     *     outMax = numpy.zeros(bins, dtype=numpy.int64)
     */
      __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_6 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__zeros); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1135; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_v_bins);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_bins);
      __Pyx_GIVEREF(__pyx_v_bins);
      __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_5));
      __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_4 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__float64); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (PyDict_SetItem(__pyx_t_5, ((PyObject *)__pyx_n_s__dtype), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_t_2), ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
      __pyx_v_outData = __pyx_t_4;
      __pyx_t_4 = 0;

     1136:     outCount = numpy.zeros(bins, dtype=numpy.float64)

      /* "splitBBoxLUT.pyx":1136
     *
     *     outData = numpy.zeros(bins, dtype=numpy.float64)
     *     outCount = numpy.zeros(bins, dtype=numpy.float64)             # <<<<<<<<<<<<<<
     *     outMax = numpy.zeros(bins, dtype=numpy.int64)
     *     outMerge = numpy.zeros(bins, dtype=numpy.float32)
     */
      __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__zeros); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_INCREF(__pyx_v_bins);
      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_bins);
      __Pyx_GIVEREF(__pyx_v_bins);
      __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_2));
      __pyx_t_6 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_1 = PyObject_GetAttr(__pyx_t_6, __pyx_n_s__float64); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__dtype), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
      __pyx_v_outCount = __pyx_t_1;
      __pyx_t_1 = 0;

     1137:     outMax = numpy.zeros(bins, dtype=numpy.int64)

      /* "splitBBoxLUT.pyx":1137
     *     outData = numpy.zeros(bins, dtype=numpy.float64)
     *     outCount = numpy.zeros(bins, dtype=numpy.float64)
     *     outMax = numpy.zeros(bins, dtype=numpy.int64)             # <<<<<<<<<<<<<<
     *     outMerge = numpy.zeros(bins, dtype=numpy.float32)
     * #    outPos = numpy.zeros(bins, dtype=numpy.float32)
     */
      __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__zeros); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_INCREF(__pyx_v_bins);
      PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_bins);
      __Pyx_GIVEREF(__pyx_v_bins);
      __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_4));
      __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__int64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (PyDict_SetItem(__pyx_t_4, ((PyObject *)__pyx_n_s__dtype), __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
      __pyx_v_outMax = __pyx_t_6;
      __pyx_t_6 = 0;

     1138:     outMerge = numpy.zeros(bins, dtype=numpy.float32)

      /* "splitBBoxLUT.pyx":1138
     *     outCount = numpy.zeros(bins, dtype=numpy.float64)
     *     outMax = numpy.zeros(bins, dtype=numpy.int64)
     *     outMerge = numpy.zeros(bins, dtype=numpy.float32)             # <<<<<<<<<<<<<<
     * #    outPos = numpy.zeros(bins, dtype=numpy.float32)
     *
     */
      __pyx_t_6 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_4 = PyObject_GetAttr(__pyx_t_6, __pyx_n_s__zeros); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1138; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_INCREF(__pyx_v_bins);
      PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_bins);
      __Pyx_GIVEREF(__pyx_v_bins);
      __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_1));
      __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_5 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__float32); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__dtype), __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_6), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
      __pyx_v_outMerge = __pyx_t_5;
      __pyx_t_5 = 0;

     1139: #    outPos = numpy.zeros(bins, dtype=numpy.float32)

     1140:

     1141:     if  mask is not None:

      /* "splitBBoxLUT.pyx":1141
     * #    outPos = numpy.zeros(bins, dtype=numpy.float32)
     *
     *     if  mask is not None:             # <<<<<<<<<<<<<<
     *         assert mask.size == size
     *         check_mask = 1
     */
      __pyx_t_3 = (__pyx_v_mask != Py_None);
      if (__pyx_t_3) {

     1142:         assert mask.size == size

        /* "splitBBoxLUT.pyx":1142
     *
     *     if  mask is not None:
     *         assert mask.size == size             # <<<<<<<<<<<<<<
     *         check_mask = 1
     *         cmask = numpy.ascontiguousarray(mask.ravel(), dtype=numpy.int8)
     */
        #ifndef CYTHON_WITHOUT_ASSERTIONS
        __pyx_t_5 = PyObject_GetAttr(__pyx_v_mask, __pyx_n_s__size); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_1 = PyObject_RichCompare(__pyx_t_5, __pyx_v_size, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        if (unlikely(!__pyx_t_3)) {
          PyErr_SetNone(PyExc_AssertionError);
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        #endif

     1143:         check_mask = 1

        /* "splitBBoxLUT.pyx":1143
     *     if  mask is not None:
     *         assert mask.size == size
     *         check_mask = 1             # <<<<<<<<<<<<<<
     *         cmask = numpy.ascontiguousarray(mask.ravel(), dtype=numpy.int8)
     *
     */
        __pyx_v_check_mask = 1;

     1144:         cmask = numpy.ascontiguousarray(mask.ravel(), dtype=numpy.int8)

        /* "splitBBoxLUT.pyx":1144
     *         assert mask.size == size
     *         check_mask = 1
     *         cmask = numpy.ascontiguousarray(mask.ravel(), dtype=numpy.int8)             # <<<<<<<<<<<<<<
     *
     *     if (dummy is not None) and delta_dummy is not None:
     */
        __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_5 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__ascontiguousarray); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_t_1 = PyObject_GetAttr(__pyx_v_mask, __pyx_n_s__ravel); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_6 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_6);
        __Pyx_GIVEREF(__pyx_t_6);
        __pyx_t_6 = 0;
        __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(((PyObject *)__pyx_t_6));
        __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_2 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__int8); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (PyDict_SetItem(__pyx_t_6, ((PyObject *)__pyx_n_s__dtype), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_t_2 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_1), ((PyObject *)__pyx_t_6)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
        __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
        __pyx_v_cmask = __pyx_t_2;
        __pyx_t_2 = 0;
        goto __pyx_L3;
      }
      __pyx_L3:;

     1145:

     1146:     if (dummy is not None) and delta_dummy is not None:

      /* "splitBBoxLUT.pyx":1146
     *         cmask = numpy.ascontiguousarray(mask.ravel(), dtype=numpy.int8)
     *
     *     if (dummy is not None) and delta_dummy is not None:             # <<<<<<<<<<<<<<
     *         do_dummy = 1
     *         cdummy = float(dummy)
     */
      __pyx_t_3 = (__pyx_v_dummy != Py_None);
      if (__pyx_t_3) {
        __pyx_t_7 = (__pyx_v_delta_dummy != Py_None);
        __pyx_t_8 = __pyx_t_7;
      } else {
        __pyx_t_8 = __pyx_t_3;
      }
      if (__pyx_t_8) {

     1147:         do_dummy = 1

        /* "splitBBoxLUT.pyx":1147
     *
     *     if (dummy is not None) and delta_dummy is not None:
     *         do_dummy = 1             # <<<<<<<<<<<<<<
     *         cdummy = float(dummy)
     *         ddummy = float(delta_dummy)
     */
        __pyx_v_do_dummy = 1;

     1148:         cdummy = float(dummy)

        /* "splitBBoxLUT.pyx":1148
     *     if (dummy is not None) and delta_dummy is not None:
     *         do_dummy = 1
     *         cdummy = float(dummy)             # <<<<<<<<<<<<<<
     *         ddummy = float(delta_dummy)
     *     elif (dummy is not None):
     */
        __pyx_t_9 = __Pyx_PyObject_AsDouble(__pyx_v_dummy); if (unlikely(__pyx_t_9 == ((double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_v_cdummy = __pyx_t_9;

     1149:         ddummy = float(delta_dummy)

        /* "splitBBoxLUT.pyx":1149
     *         do_dummy = 1
     *         cdummy = float(dummy)
     *         ddummy = float(delta_dummy)             # <<<<<<<<<<<<<<
     *     elif (dummy is not None):
     *         cdummy = float(dummy)
     */
        __pyx_t_9 = __Pyx_PyObject_AsDouble(__pyx_v_delta_dummy); if (unlikely(__pyx_t_9 == ((double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1149; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_v_ddummy = __pyx_t_9;
        goto __pyx_L4;
      }

     1150:     elif (dummy is not None):

      /* "splitBBoxLUT.pyx":1150
     *         cdummy = float(dummy)
     *         ddummy = float(delta_dummy)
     *     elif (dummy is not None):             # <<<<<<<<<<<<<<
     *         cdummy = float(dummy)
     *     else:
     */
      __pyx_t_8 = (__pyx_v_dummy != Py_None);
      if (__pyx_t_8) {

     1151:         cdummy = float(dummy)

        /* "splitBBoxLUT.pyx":1151
     *         ddummy = float(delta_dummy)
     *     elif (dummy is not None):
     *         cdummy = float(dummy)             # <<<<<<<<<<<<<<
     *     else:
     *         cdummy = 0.0
     */
        __pyx_t_9 = __Pyx_PyObject_AsDouble(__pyx_v_dummy); if (unlikely(__pyx_t_9 == ((double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_v_cdummy = __pyx_t_9;
        goto __pyx_L4;
      }
      /*else*/ {

     1152:     else:

     1153:         cdummy = 0.0

        /* "splitBBoxLUT.pyx":1153
     *         cdummy = float(dummy)
     *     else:
     *         cdummy = 0.0             # <<<<<<<<<<<<<<
     *
     *     if dark is not None:
     */
        __pyx_v_cdummy = 0.0;
      }
      __pyx_L4:;

     1154:

     1155:     if dark is not None:

      /* "splitBBoxLUT.pyx":1155
     *         cdummy = 0.0
     *
     *     if dark is not None:             # <<<<<<<<<<<<<<
     *         assert dark.size == size
     *         do_dark = 1
     */
      __pyx_t_8 = (__pyx_v_dark != Py_None);
      if (__pyx_t_8) {

     1156:         assert dark.size == size

        /* "splitBBoxLUT.pyx":1156
     *
     *     if dark is not None:
     *         assert dark.size == size             # <<<<<<<<<<<<<<
     *         do_dark = 1
     *         cdark = numpy.ascontiguousarray(dark.ravel(), dtype=numpy.float32)
     */
        #ifndef CYTHON_WITHOUT_ASSERTIONS
        __pyx_t_2 = PyObject_GetAttr(__pyx_v_dark, __pyx_n_s__size); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_6 = PyObject_RichCompare(__pyx_t_2, __pyx_v_size, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1156; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (unlikely(!__pyx_t_8)) {
          PyErr_SetNone(PyExc_AssertionError);
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        #endif

     1157:         do_dark = 1

        /* "splitBBoxLUT.pyx":1157
     *     if dark is not None:
     *         assert dark.size == size
     *         do_dark = 1             # <<<<<<<<<<<<<<
     *         cdark = numpy.ascontiguousarray(dark.ravel(), dtype=numpy.float32)
     *
     */
        __pyx_v_do_dark = 1;

     1158:         cdark = numpy.ascontiguousarray(dark.ravel(), dtype=numpy.float32)

        /* "splitBBoxLUT.pyx":1158
     *         assert dark.size == size
     *         do_dark = 1
     *         cdark = numpy.ascontiguousarray(dark.ravel(), dtype=numpy.float32)             # <<<<<<<<<<<<<<
     *
     *     if flat is not None:
     */
        __pyx_t_6 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_2 = PyObject_GetAttr(__pyx_t_6, __pyx_n_s__ascontiguousarray); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_6 = PyObject_GetAttr(__pyx_v_dark, __pyx_n_s__ravel); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_1 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_6);
        PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1);
        __Pyx_GIVEREF(__pyx_t_1);
        __pyx_t_1 = 0;
        __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(((PyObject *)__pyx_t_1));
        __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_4 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__float32); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__dtype), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_6), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
        __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
        __pyx_v_cdark = __pyx_t_4;
        __pyx_t_4 = 0;
        goto __pyx_L5;
      }
      __pyx_L5:;

     1159:

     1160:     if flat is not None:

      /* "splitBBoxLUT.pyx":1160
     *         cdark = numpy.ascontiguousarray(dark.ravel(), dtype=numpy.float32)
     *
     *     if flat is not None:             # <<<<<<<<<<<<<<
     *         assert flat.size == size
     *         do_flat = 1
     */
      __pyx_t_8 = (__pyx_v_flat != Py_None);
      if (__pyx_t_8) {

     1161:         assert flat.size == size

        /* "splitBBoxLUT.pyx":1161
     *
     *     if flat is not None:
     *         assert flat.size == size             # <<<<<<<<<<<<<<
     *         do_flat = 1
     *         cflat = numpy.ascontiguousarray(flat.ravel(), dtype=numpy.float32)
     */
        #ifndef CYTHON_WITHOUT_ASSERTIONS
        __pyx_t_4 = PyObject_GetAttr(__pyx_v_flat, __pyx_n_s__size); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_1 = PyObject_RichCompare(__pyx_t_4, __pyx_v_size, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        if (unlikely(!__pyx_t_8)) {
          PyErr_SetNone(PyExc_AssertionError);
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        #endif

     1162:         do_flat = 1

        /* "splitBBoxLUT.pyx":1162
     *     if flat is not None:
     *         assert flat.size == size
     *         do_flat = 1             # <<<<<<<<<<<<<<
     *         cflat = numpy.ascontiguousarray(flat.ravel(), dtype=numpy.float32)
     *
     */
        __pyx_v_do_flat = 1;

     1163:         cflat = numpy.ascontiguousarray(flat.ravel(), dtype=numpy.float32)

        /* "splitBBoxLUT.pyx":1163
     *         assert flat.size == size
     *         do_flat = 1
     *         cflat = numpy.ascontiguousarray(flat.ravel(), dtype=numpy.float32)             # <<<<<<<<<<<<<<
     *
     *
     */
        __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_4 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__ascontiguousarray); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_t_1 = PyObject_GetAttr(__pyx_v_flat, __pyx_n_s__ravel); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_6 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_6);
        __Pyx_GIVEREF(__pyx_t_6);
        __pyx_t_6 = 0;
        __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(((PyObject *)__pyx_t_6));
        __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_5 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__float32); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        if (PyDict_SetItem(__pyx_t_6, ((PyObject *)__pyx_n_s__dtype), __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_1), ((PyObject *)__pyx_t_6)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
        __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
        __pyx_v_cflat = __pyx_t_5;
        __pyx_t_5 = 0;
        goto __pyx_L6;
      }
      __pyx_L6:;

     1164:

     1165:

     1166:     cpos0_lower = numpy.zeros(size, dtype=numpy.float32)

      /* "splitBBoxLUT.pyx":1166
     *
     *
     *     cpos0_lower = numpy.zeros(size, dtype=numpy.float32)             # <<<<<<<<<<<<<<
     *     cpos0_upper = numpy.zeros(size, dtype=numpy.float32)
     *     pos0_min = cpos0[0]
     */
      __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__zeros); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_INCREF(__pyx_v_size);
      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_size);
      __Pyx_GIVEREF(__pyx_v_size);
      __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_1));
      __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_2 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__float32); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__dtype), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_t_5), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
      __pyx_v_cpos0_lower = __pyx_t_2;
      __pyx_t_2 = 0;

     1167:     cpos0_upper = numpy.zeros(size, dtype=numpy.float32)

      /* "splitBBoxLUT.pyx":1167
     *
     *     cpos0_lower = numpy.zeros(size, dtype=numpy.float32)
     *     cpos0_upper = numpy.zeros(size, dtype=numpy.float32)             # <<<<<<<<<<<<<<
     *     pos0_min = cpos0[0]
     *     pos0_max = cpos0[0]
     */
      __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__zeros); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_v_size);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_size);
      __Pyx_GIVEREF(__pyx_v_size);
      __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_5));
      __pyx_t_6 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_4 = PyObject_GetAttr(__pyx_t_6, __pyx_n_s__float32); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (PyDict_SetItem(__pyx_t_5, ((PyObject *)__pyx_n_s__dtype), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
      __pyx_v_cpos0_upper = __pyx_t_4;
      __pyx_t_4 = 0;

     1168:     pos0_min = cpos0[0]

      /* "splitBBoxLUT.pyx":1168
     *     cpos0_lower = numpy.zeros(size, dtype=numpy.float32)
     *     cpos0_upper = numpy.zeros(size, dtype=numpy.float32)
     *     pos0_min = cpos0[0]             # <<<<<<<<<<<<<<
     *     pos0_max = cpos0[0]
     *     for idx in range(size):
     */
      __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_cpos0, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_v_pos0_min = __pyx_t_4;
      __pyx_t_4 = 0;

     1169:     pos0_max = cpos0[0]

      /* "splitBBoxLUT.pyx":1169
     *     cpos0_upper = numpy.zeros(size, dtype=numpy.float32)
     *     pos0_min = cpos0[0]
     *     pos0_max = cpos0[0]             # <<<<<<<<<<<<<<
     *     for idx in range(size):
     *             min0 = cpos0[idx] - dpos0[idx]
     */
      __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_cpos0, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1169; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_v_pos0_max = __pyx_t_4;
      __pyx_t_4 = 0;

     1170:     for idx in range(size):

      /* "splitBBoxLUT.pyx":1170
     *     pos0_min = cpos0[0]
     *     pos0_max = cpos0[0]
     *     for idx in range(size):             # <<<<<<<<<<<<<<
     *             min0 = cpos0[idx] - dpos0[idx]
     *             max0 = cpos0[idx] + dpos0[idx]
     */
      __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_INCREF(__pyx_v_size);
      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_size);
      __Pyx_GIVEREF(__pyx_v_size);
      __pyx_t_5 = PyObject_Call(__pyx_builtin_range, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
      if (PyList_CheckExact(__pyx_t_5) || PyTuple_CheckExact(__pyx_t_5)) {
        __pyx_t_4 = __pyx_t_5; __Pyx_INCREF(__pyx_t_4); __pyx_t_10 = 0;
        __pyx_t_11 = NULL;
      } else {
        __pyx_t_10 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_11 = Py_TYPE(__pyx_t_4)->tp_iternext;
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      for (;;) {
        if (!__pyx_t_11 && PyList_CheckExact(__pyx_t_4)) {
          if (__pyx_t_10 >= PyList_GET_SIZE(__pyx_t_4)) break;
          #if CYTHON_COMPILING_IN_CPYTHON
          __pyx_t_5 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_10); __Pyx_INCREF(__pyx_t_5); __pyx_t_10++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          #else
          __pyx_t_5 = PySequence_ITEM(__pyx_t_4, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          #endif
        } else if (!__pyx_t_11 && PyTuple_CheckExact(__pyx_t_4)) {
          if (__pyx_t_10 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
          #if CYTHON_COMPILING_IN_CPYTHON
          __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_10); __Pyx_INCREF(__pyx_t_5); __pyx_t_10++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          #else
          __pyx_t_5 = PySequence_ITEM(__pyx_t_4, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          #endif
        } else {
          __pyx_t_5 = __pyx_t_11(__pyx_t_4);
          if (unlikely(!__pyx_t_5)) {
            if (PyErr_Occurred()) {
              if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
              else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            }
            break;
          }
          __Pyx_GOTREF(__pyx_t_5);
        }
        __Pyx_XDECREF(__pyx_v_idx);
        __pyx_v_idx = __pyx_t_5;
        __pyx_t_5 = 0;

     1171:             min0 = cpos0[idx] - dpos0[idx]

        /* "splitBBoxLUT.pyx":1171
     *     pos0_max = cpos0[0]
     *     for idx in range(size):
     *             min0 = cpos0[idx] - dpos0[idx]             # <<<<<<<<<<<<<<
     *             max0 = cpos0[idx] + dpos0[idx]
     *             cpos0_upper[idx] = max0
     */
        __pyx_t_5 = PyObject_GetItem(__pyx_v_cpos0, __pyx_v_idx); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_2 = PyObject_GetItem(__pyx_v_dpos0, __pyx_v_idx); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_1 = PyNumber_Subtract(__pyx_t_5, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_XDECREF(__pyx_v_min0);
        __pyx_v_min0 = __pyx_t_1;
        __pyx_t_1 = 0;

     1172:             max0 = cpos0[idx] + dpos0[idx]

        /* "splitBBoxLUT.pyx":1172
     *     for idx in range(size):
     *             min0 = cpos0[idx] - dpos0[idx]
     *             max0 = cpos0[idx] + dpos0[idx]             # <<<<<<<<<<<<<<
     *             cpos0_upper[idx] = max0
     *             cpos0_lower[idx] = min0
     */
        __pyx_t_1 = PyObject_GetItem(__pyx_v_cpos0, __pyx_v_idx); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_2 = PyObject_GetItem(__pyx_v_dpos0, __pyx_v_idx); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_5 = PyNumber_Add(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_XDECREF(__pyx_v_max0);
        __pyx_v_max0 = __pyx_t_5;
        __pyx_t_5 = 0;

     1173:             cpos0_upper[idx] = max0

        /* "splitBBoxLUT.pyx":1173
     *             min0 = cpos0[idx] - dpos0[idx]
     *             max0 = cpos0[idx] + dpos0[idx]
     *             cpos0_upper[idx] = max0             # <<<<<<<<<<<<<<
     *             cpos0_lower[idx] = min0
     *             if max0 > pos0_max:
     */
        if (PyObject_SetItem(__pyx_v_cpos0_upper, __pyx_v_idx, __pyx_v_max0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

     1174:             cpos0_lower[idx] = min0

        /* "splitBBoxLUT.pyx":1174
     *             max0 = cpos0[idx] + dpos0[idx]
     *             cpos0_upper[idx] = max0
     *             cpos0_lower[idx] = min0             # <<<<<<<<<<<<<<
     *             if max0 > pos0_max:
     *                 pos0_max = max0
     */
        if (PyObject_SetItem(__pyx_v_cpos0_lower, __pyx_v_idx, __pyx_v_min0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

     1175:             if max0 > pos0_max:

        /* "splitBBoxLUT.pyx":1175
     *             cpos0_upper[idx] = max0
     *             cpos0_lower[idx] = min0
     *             if max0 > pos0_max:             # <<<<<<<<<<<<<<
     *                 pos0_max = max0
     *             if min0 < pos0_min:
     */
        __pyx_t_5 = PyObject_RichCompare(__pyx_v_max0, __pyx_v_pos0_max, Py_GT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (__pyx_t_8) {

     1176:                 pos0_max = max0

          /* "splitBBoxLUT.pyx":1176
     *             cpos0_lower[idx] = min0
     *             if max0 > pos0_max:
     *                 pos0_max = max0             # <<<<<<<<<<<<<<
     *             if min0 < pos0_min:
     *                 pos0_min = min0
     */
          __Pyx_INCREF(__pyx_v_max0);
          __Pyx_DECREF(__pyx_v_pos0_max);
          __pyx_v_pos0_max = __pyx_v_max0;
          goto __pyx_L9;
        }
        __pyx_L9:;

     1177:             if min0 < pos0_min:

        /* "splitBBoxLUT.pyx":1177
     *             if max0 > pos0_max:
     *                 pos0_max = max0
     *             if min0 < pos0_min:             # <<<<<<<<<<<<<<
     *                 pos0_min = min0
     *
     */
        __pyx_t_5 = PyObject_RichCompare(__pyx_v_min0, __pyx_v_pos0_min, Py_LT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (__pyx_t_8) {

     1178:                 pos0_min = min0

          /* "splitBBoxLUT.pyx":1178
     *                 pos0_max = max0
     *             if min0 < pos0_min:
     *                 pos0_min = min0             # <<<<<<<<<<<<<<
     *
     *     if pos0Range is not None and len(pos0Range) > 1:
     */
          __Pyx_INCREF(__pyx_v_min0);
          __Pyx_DECREF(__pyx_v_pos0_min);
          __pyx_v_pos0_min = __pyx_v_min0;
          goto __pyx_L10;
        }
        __pyx_L10:;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

     1179:

     1180:     if pos0Range is not None and len(pos0Range) > 1:

      /* "splitBBoxLUT.pyx":1180
     *                 pos0_min = min0
     *
     *     if pos0Range is not None and len(pos0Range) > 1:             # <<<<<<<<<<<<<<
     *         pos0_min = min(pos0Range)
     *         pos0_maxin = max(pos0Range)
     */
      __pyx_t_8 = (__pyx_v_pos0Range != Py_None);
      if (__pyx_t_8) {
        __pyx_t_10 = PyObject_Length(__pyx_v_pos0Range); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_t_3 = (__pyx_t_10 > 1);
        __pyx_t_7 = __pyx_t_3;
      } else {
        __pyx_t_7 = __pyx_t_8;
      }
      if (__pyx_t_7) {

     1181:         pos0_min = min(pos0Range)

        /* "splitBBoxLUT.pyx":1181
     *
     *     if pos0Range is not None and len(pos0Range) > 1:
     *         pos0_min = min(pos0Range)             # <<<<<<<<<<<<<<
     *         pos0_maxin = max(pos0Range)
     *     else:
     */
        __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_INCREF(__pyx_v_pos0Range);
        PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_pos0Range);
        __Pyx_GIVEREF(__pyx_v_pos0Range);
        __pyx_t_5 = PyObject_Call(__pyx_builtin_min, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_v_pos0_min);
        __pyx_v_pos0_min = __pyx_t_5;
        __pyx_t_5 = 0;

     1182:         pos0_maxin = max(pos0Range)

        /* "splitBBoxLUT.pyx":1182
     *     if pos0Range is not None and len(pos0Range) > 1:
     *         pos0_min = min(pos0Range)
     *         pos0_maxin = max(pos0Range)             # <<<<<<<<<<<<<<
     *     else:
     *         pos0_maxin = pos0_max
     */
        __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_INCREF(__pyx_v_pos0Range);
        PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_pos0Range);
        __Pyx_GIVEREF(__pyx_v_pos0Range);
        __pyx_t_4 = PyObject_Call(__pyx_builtin_max, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
        __pyx_v_pos0_maxin = __pyx_t_4;
        __pyx_t_4 = 0;
        goto __pyx_L11;
      }
      /*else*/ {

     1183:     else:

     1184:         pos0_maxin = pos0_max

        /* "splitBBoxLUT.pyx":1184
     *         pos0_maxin = max(pos0Range)
     *     else:
     *         pos0_maxin = pos0_max             # <<<<<<<<<<<<<<
     *     if pos0_min < 0: pos0_min = 0
     *     pos0_max = pos0_maxin * EPS32
     */
        __Pyx_INCREF(__pyx_v_pos0_max);
        __pyx_v_pos0_maxin = __pyx_v_pos0_max;
      }
      __pyx_L11:;

     1185:     if pos0_min < 0: pos0_min = 0

      /* "splitBBoxLUT.pyx":1185
     *     else:
     *         pos0_maxin = pos0_max
     *     if pos0_min < 0: pos0_min = 0             # <<<<<<<<<<<<<<
     *     pos0_max = pos0_maxin * EPS32
     *
     */
      __pyx_t_4 = PyObject_RichCompare(__pyx_v_pos0_min, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (__pyx_t_7) {
        __Pyx_INCREF(__pyx_int_0);
        __Pyx_DECREF(__pyx_v_pos0_min);
        __pyx_v_pos0_min = __pyx_int_0;
        goto __pyx_L12;
      }
      __pyx_L12:;

     1186:     pos0_max = pos0_maxin * EPS32

      /* "splitBBoxLUT.pyx":1186
     *         pos0_maxin = pos0_max
     *     if pos0_min < 0: pos0_min = 0
     *     pos0_max = pos0_maxin * EPS32             # <<<<<<<<<<<<<<
     *
     *     if pos1Range is not None and len(pos1Range) > 1:
     */
      __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__EPS32); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = PyNumber_Multiply(__pyx_v_pos0_maxin, __pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_v_pos0_max);
      __pyx_v_pos0_max = __pyx_t_5;
      __pyx_t_5 = 0;

     1187:

     1188:     if pos1Range is not None and len(pos1Range) > 1:

      /* "splitBBoxLUT.pyx":1188
     *     pos0_max = pos0_maxin * EPS32
     *
     *     if pos1Range is not None and len(pos1Range) > 1:             # <<<<<<<<<<<<<<
     *         assert pos1.size == size
     *         assert delta_pos1.size == size
     */
      __pyx_t_7 = (__pyx_v_pos1Range != Py_None);
      if (__pyx_t_7) {
        __pyx_t_10 = PyObject_Length(__pyx_v_pos1Range); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_t_8 = (__pyx_t_10 > 1);
        __pyx_t_3 = __pyx_t_8;
      } else {
        __pyx_t_3 = __pyx_t_7;
      }
      if (__pyx_t_3) {

     1189:         assert pos1.size == size

        /* "splitBBoxLUT.pyx":1189
     *
     *     if pos1Range is not None and len(pos1Range) > 1:
     *         assert pos1.size == size             # <<<<<<<<<<<<<<
     *         assert delta_pos1.size == size
     *         check_pos1 = 1
     */
        #ifndef CYTHON_WITHOUT_ASSERTIONS
        __pyx_t_5 = PyObject_GetAttr(__pyx_v_pos1, __pyx_n_s__size); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_4 = PyObject_RichCompare(__pyx_t_5, __pyx_v_size, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_3)) {
          PyErr_SetNone(PyExc_AssertionError);
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        #endif

     1190:         assert delta_pos1.size == size

        /* "splitBBoxLUT.pyx":1190
     *     if pos1Range is not None and len(pos1Range) > 1:
     *         assert pos1.size == size
     *         assert delta_pos1.size == size             # <<<<<<<<<<<<<<
     *         check_pos1 = 1
     *         cpos1 = numpy.ascontiguousarray(pos1.ravel(), dtype=numpy.float32)
     */
        #ifndef CYTHON_WITHOUT_ASSERTIONS
        __pyx_t_4 = PyObject_GetAttr(__pyx_v_delta_pos1, __pyx_n_s__size); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_5 = PyObject_RichCompare(__pyx_t_4, __pyx_v_size, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (unlikely(!__pyx_t_3)) {
          PyErr_SetNone(PyExc_AssertionError);
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        #endif

     1191:         check_pos1 = 1

        /* "splitBBoxLUT.pyx":1191
     *         assert pos1.size == size
     *         assert delta_pos1.size == size
     *         check_pos1 = 1             # <<<<<<<<<<<<<<
     *         cpos1 = numpy.ascontiguousarray(pos1.ravel(), dtype=numpy.float32)
     *         dpos1 = numpy.ascontiguousarray(delta_pos1.ravel(), dtype=numpy.float32)
     */
        __pyx_v_check_pos1 = 1;

     1192:         cpos1 = numpy.ascontiguousarray(pos1.ravel(), dtype=numpy.float32)

        /* "splitBBoxLUT.pyx":1192
     *         assert delta_pos1.size == size
     *         check_pos1 = 1
     *         cpos1 = numpy.ascontiguousarray(pos1.ravel(), dtype=numpy.float32)             # <<<<<<<<<<<<<<
     *         dpos1 = numpy.ascontiguousarray(delta_pos1.ravel(), dtype=numpy.float32)
     *         pos1_min = min(pos1Range)
     */
        __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_4 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__ascontiguousarray); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = PyObject_GetAttr(__pyx_v_pos1, __pyx_n_s__ravel); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_2 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2);
        __Pyx_GIVEREF(__pyx_t_2);
        __pyx_t_2 = 0;
        __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(((PyObject *)__pyx_t_2));
        __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_6 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__float32); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__dtype), __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_6 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_5), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
        __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
        __pyx_v_cpos1 = __pyx_t_6;
        __pyx_t_6 = 0;

     1193:         dpos1 = numpy.ascontiguousarray(delta_pos1.ravel(), dtype=numpy.float32)

        /* "splitBBoxLUT.pyx":1193
     *         check_pos1 = 1
     *         cpos1 = numpy.ascontiguousarray(pos1.ravel(), dtype=numpy.float32)
     *         dpos1 = numpy.ascontiguousarray(delta_pos1.ravel(), dtype=numpy.float32)             # <<<<<<<<<<<<<<
     *         pos1_min = min(pos1Range)
     *         pos1_maxin = max(pos1Range)
     */
        __pyx_t_6 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1193; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_2 = PyObject_GetAttr(__pyx_t_6, __pyx_n_s__ascontiguousarray); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1193; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_6 = PyObject_GetAttr(__pyx_v_delta_pos1, __pyx_n_s__ravel); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1193; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_5 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1193; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1193; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_6);
        PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5);
        __Pyx_GIVEREF(__pyx_t_5);
        __pyx_t_5 = 0;
        __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1193; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(((PyObject *)__pyx_t_5));
        __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1193; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_1 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__float32); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1193; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (PyDict_SetItem(__pyx_t_5, ((PyObject *)__pyx_n_s__dtype), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1193; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_6), ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1193; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
        __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
        __pyx_v_dpos1 = __pyx_t_1;
        __pyx_t_1 = 0;

     1194:         pos1_min = min(pos1Range)

        /* "splitBBoxLUT.pyx":1194
     *         cpos1 = numpy.ascontiguousarray(pos1.ravel(), dtype=numpy.float32)
     *         dpos1 = numpy.ascontiguousarray(delta_pos1.ravel(), dtype=numpy.float32)
     *         pos1_min = min(pos1Range)             # <<<<<<<<<<<<<<
     *         pos1_maxin = max(pos1Range)
     *         pos1_max = pos1_maxin * EPS32
     */
        __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1194; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_INCREF(__pyx_v_pos1Range);
        PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_pos1Range);
        __Pyx_GIVEREF(__pyx_v_pos1Range);
        __pyx_t_5 = PyObject_Call(__pyx_builtin_min, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1194; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
        __pyx_v_pos1_min = __pyx_t_5;
        __pyx_t_5 = 0;

     1195:         pos1_maxin = max(pos1Range)

        /* "splitBBoxLUT.pyx":1195
     *         dpos1 = numpy.ascontiguousarray(delta_pos1.ravel(), dtype=numpy.float32)
     *         pos1_min = min(pos1Range)
     *         pos1_maxin = max(pos1Range)             # <<<<<<<<<<<<<<
     *         pos1_max = pos1_maxin * EPS32
     *
     */
        __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1195; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_INCREF(__pyx_v_pos1Range);
        PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_pos1Range);
        __Pyx_GIVEREF(__pyx_v_pos1Range);
        __pyx_t_1 = PyObject_Call(__pyx_builtin_max, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1195; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
        __pyx_v_pos1_maxin = __pyx_t_1;
        __pyx_t_1 = 0;

     1196:         pos1_max = pos1_maxin * EPS32

        /* "splitBBoxLUT.pyx":1196
     *         pos1_min = min(pos1Range)
     *         pos1_maxin = max(pos1Range)
     *         pos1_max = pos1_maxin * EPS32             # <<<<<<<<<<<<<<
     *
     *     delta = (pos0_max - pos0_min) / ((bins))
     */
        __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__EPS32); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1196; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_5 = PyNumber_Multiply(__pyx_v_pos1_maxin, __pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1196; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_v_pos1_max = __pyx_t_5;
        __pyx_t_5 = 0;
        goto __pyx_L13;
      }
      __pyx_L13:;

     1197:

     1198:     delta = (pos0_max - pos0_min) / ((bins))

      /* "splitBBoxLUT.pyx":1198
     *         pos1_max = pos1_maxin * EPS32
     *
     *     delta = (pos0_max - pos0_min) / ((bins))             # <<<<<<<<<<<<<<
     *
     * #    for i in range(bins):
     */
      __pyx_t_5 = PyNumber_Subtract(__pyx_v_pos0_max, __pyx_v_pos0_min); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1198; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_1 = __Pyx_PyNumber_Divide(__pyx_t_5, __pyx_v_bins); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1198; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_v_delta = __pyx_t_1;
      __pyx_t_1 = 0;

     1199:

     1200: #    for i in range(bins):

     1201: #                outPos[i] = pos0_min + (0.5 + i) * delta

     1202:     outPos = numpy.linspace(pos0_min+0.5*delta,pos0_max-0.5*delta, bins)

      /* "splitBBoxLUT.pyx":1202
     * #    for i in range(bins):
     * #                outPos[i] = pos0_min + (0.5 + i) * delta
     *     outPos = numpy.linspace(pos0_min+0.5*delta,pos0_max-0.5*delta, bins)             # <<<<<<<<<<<<<<
     *     for idx in range(size):
     *             if (check_mask) and (cmask[idx]):
     */
      __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1202; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_5 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__linspace); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1202; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyFloat_FromDouble(0.5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1202; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_6 = PyNumber_Multiply(__pyx_t_1, __pyx_v_delta); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1202; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyNumber_Add(__pyx_v_pos0_min, __pyx_t_6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1202; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = PyFloat_FromDouble(0.5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1202; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_2 = PyNumber_Multiply(__pyx_t_6, __pyx_v_delta); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1202; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = PyNumber_Subtract(__pyx_v_pos0_max, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1202; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1202; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_6);
      __Pyx_INCREF(__pyx_v_bins);
      PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_bins);
      __Pyx_GIVEREF(__pyx_v_bins);
      __pyx_t_1 = 0;
      __pyx_t_6 = 0;
      __pyx_t_6 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1202; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
      __pyx_v_outPos = __pyx_t_6;
      __pyx_t_6 = 0;

     1203:     for idx in range(size):

      /* "splitBBoxLUT.pyx":1203
     * #                outPos[i] = pos0_min + (0.5 + i) * delta
     *     outPos = numpy.linspace(pos0_min+0.5*delta,pos0_max-0.5*delta, bins)
     *     for idx in range(size):             # <<<<<<<<<<<<<<
     *             if (check_mask) and (cmask[idx]):
     *                 continue
     */
      __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_INCREF(__pyx_v_size);
      PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_size);
      __Pyx_GIVEREF(__pyx_v_size);
      __pyx_t_2 = PyObject_Call(__pyx_builtin_range, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
      if (PyList_CheckExact(__pyx_t_2) || PyTuple_CheckExact(__pyx_t_2)) {
        __pyx_t_6 = __pyx_t_2; __Pyx_INCREF(__pyx_t_6); __pyx_t_10 = 0;
        __pyx_t_11 = NULL;
      } else {
        __pyx_t_10 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_11 = Py_TYPE(__pyx_t_6)->tp_iternext;
      }
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      for (;;) {
        if (!__pyx_t_11 && PyList_CheckExact(__pyx_t_6)) {
          if (__pyx_t_10 >= PyList_GET_SIZE(__pyx_t_6)) break;
          #if CYTHON_COMPILING_IN_CPYTHON
          __pyx_t_2 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_10); __Pyx_INCREF(__pyx_t_2); __pyx_t_10++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          #else
          __pyx_t_2 = PySequence_ITEM(__pyx_t_6, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          #endif
        } else if (!__pyx_t_11 && PyTuple_CheckExact(__pyx_t_6)) {
          if (__pyx_t_10 >= PyTuple_GET_SIZE(__pyx_t_6)) break;
          #if CYTHON_COMPILING_IN_CPYTHON
          __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_10); __Pyx_INCREF(__pyx_t_2); __pyx_t_10++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          #else
          __pyx_t_2 = PySequence_ITEM(__pyx_t_6, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          #endif
        } else {
          __pyx_t_2 = __pyx_t_11(__pyx_t_6);
          if (unlikely(!__pyx_t_2)) {
            if (PyErr_Occurred()) {
              if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
              else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            }
            break;
          }
          __Pyx_GOTREF(__pyx_t_2);
        }
        __Pyx_XDECREF(__pyx_v_idx);
        __pyx_v_idx = __pyx_t_2;
        __pyx_t_2 = 0;

     1204:             if (check_mask) and (cmask[idx]):

        /* "splitBBoxLUT.pyx":1204
     *     outPos = numpy.linspace(pos0_min+0.5*delta,pos0_max-0.5*delta, bins)
     *     for idx in range(size):
     *             if (check_mask) and (cmask[idx]):             # <<<<<<<<<<<<<<
     *                 continue
     *
     */
        if (__pyx_v_check_mask) {
          if (unlikely(!__pyx_v_cmask)) { __Pyx_RaiseUnboundLocalError("cmask"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1204; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
          __pyx_t_2 = PyObject_GetItem(__pyx_v_cmask, __pyx_v_idx); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1204; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1204; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __pyx_t_7 = __pyx_t_3;
        } else {
          __pyx_t_7 = __pyx_v_check_mask;
        }
        if (__pyx_t_7) {

     1205:                 continue

          /* "splitBBoxLUT.pyx":1205
     *     for idx in range(size):
     *             if (check_mask) and (cmask[idx]):
     *                 continue             # <<<<<<<<<<<<<<
     *
     *             data = cdata[idx]
     */
          goto __pyx_L14_continue;
          goto __pyx_L16;
        }
        __pyx_L16:;

     1206:

     1207:             data = cdata[idx]

        /* "splitBBoxLUT.pyx":1207
     *                 continue
     *
     *             data = cdata[idx]             # <<<<<<<<<<<<<<
     *             if do_dummy and (fabs(data - cdummy) <= ddummy):
     *                 continue
     */
        __pyx_t_2 = PyObject_GetItem(__pyx_v_cdata, __pyx_v_idx); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_XDECREF(__pyx_v_data);
        __pyx_v_data = __pyx_t_2;
        __pyx_t_2 = 0;

     1208:             if do_dummy and (fabs(data - cdummy) <= ddummy):

        /* "splitBBoxLUT.pyx":1208
     *
     *             data = cdata[idx]
     *             if do_dummy and (fabs(data - cdummy) <= ddummy):             # <<<<<<<<<<<<<<
     *                 continue
     *
     */
        if (__pyx_v_do_dummy) {
          __pyx_t_2 = PyFloat_FromDouble(__pyx_v_cdummy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_5 = PyNumber_Subtract(__pyx_v_data, __pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_t_5); if (unlikely((__pyx_t_9 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __pyx_t_7 = (fabs(__pyx_t_9) <= __pyx_v_ddummy);
          __pyx_t_3 = __pyx_t_7;
        } else {
          __pyx_t_3 = __pyx_v_do_dummy;
        }
        if (__pyx_t_3) {

     1209:                 continue

          /* "splitBBoxLUT.pyx":1209
     *             data = cdata[idx]
     *             if do_dummy and (fabs(data - cdummy) <= ddummy):
     *                 continue             # <<<<<<<<<<<<<<
     *
     *             min0 = cpos0_lower[idx]
     */
          goto __pyx_L14_continue;
          goto __pyx_L17;
        }
        __pyx_L17:;

     1210:

     1211:             min0 = cpos0_lower[idx]

        /* "splitBBoxLUT.pyx":1211
     *                 continue
     *
     *             min0 = cpos0_lower[idx]             # <<<<<<<<<<<<<<
     *             max0 = cpos0_upper[idx]
     *
     */
        __pyx_t_5 = PyObject_GetItem(__pyx_v_cpos0_lower, __pyx_v_idx); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1211; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_XDECREF(__pyx_v_min0);
        __pyx_v_min0 = __pyx_t_5;
        __pyx_t_5 = 0;

     1212:             max0 = cpos0_upper[idx]

        /* "splitBBoxLUT.pyx":1212
     *
     *             min0 = cpos0_lower[idx]
     *             max0 = cpos0_upper[idx]             # <<<<<<<<<<<<<<
     *
     *             if check_pos1 and (((cpos1[idx] + dpos1[idx]) < pos1_min) or ((cpos1[idx] - dpos1[idx]) > pos1_max)):
     */
        __pyx_t_5 = PyObject_GetItem(__pyx_v_cpos0_upper, __pyx_v_idx); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_XDECREF(__pyx_v_max0);
        __pyx_v_max0 = __pyx_t_5;
        __pyx_t_5 = 0;

     1213:

     1214:             if check_pos1 and (((cpos1[idx] + dpos1[idx]) < pos1_min) or ((cpos1[idx] - dpos1[idx]) > pos1_max)):

        /* "splitBBoxLUT.pyx":1214
     *             max0 = cpos0_upper[idx]
     *
     *             if check_pos1 and (((cpos1[idx] + dpos1[idx]) < pos1_min) or ((cpos1[idx] - dpos1[idx]) > pos1_max)):             # <<<<<<<<<<<<<<
     *                     continue
     *
     */
        if (__pyx_v_check_pos1) {
          if (unlikely(!__pyx_v_cpos1)) { __Pyx_RaiseUnboundLocalError("cpos1"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1214; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
          __pyx_t_5 = PyObject_GetItem(__pyx_v_cpos1, __pyx_v_idx); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1214; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_5);
          if (unlikely(!__pyx_v_dpos1)) { __Pyx_RaiseUnboundLocalError("dpos1"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1214; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
          __pyx_t_2 = PyObject_GetItem(__pyx_v_dpos1, __pyx_v_idx); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1214; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_1 = PyNumber_Add(__pyx_t_5, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1214; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          if (unlikely(!__pyx_v_pos1_min)) { __Pyx_RaiseUnboundLocalError("pos1_min"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1214; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
          __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_v_pos1_min, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1214; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1214; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          if (!__pyx_t_3) {
            __pyx_t_2 = PyObject_GetItem(__pyx_v_cpos1, __pyx_v_idx); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1214; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_2);
            __pyx_t_1 = PyObject_GetItem(__pyx_v_dpos1, __pyx_v_idx); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1214; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_1);
            __pyx_t_5 = PyNumber_Subtract(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1214; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            if (unlikely(!__pyx_v_pos1_max)) { __Pyx_RaiseUnboundLocalError("pos1_max"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1214; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
            __pyx_t_1 = PyObject_RichCompare(__pyx_t_5, __pyx_v_pos1_max, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1214; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
            __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1214; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            __pyx_t_8 = __pyx_t_7;
          } else {
            __pyx_t_8 = __pyx_t_3;
          }
          __pyx_t_3 = __pyx_t_8;
        } else {
          __pyx_t_3 = __pyx_v_check_pos1;
        }
        if (__pyx_t_3) {

     1215:                     continue

          /* "splitBBoxLUT.pyx":1215
     *
     *             if check_pos1 and (((cpos1[idx] + dpos1[idx]) < pos1_min) or ((cpos1[idx] - dpos1[idx]) > pos1_max)):
     *                     continue             # <<<<<<<<<<<<<<
     *
     *             fbin0_min = getBinNr(min0, pos0_min, delta)
     */
          goto __pyx_L14_continue;
          goto __pyx_L18;
        }
        __pyx_L18:;

     1216:

     1217:             fbin0_min = getBinNr(min0, pos0_min, delta)

        /* "splitBBoxLUT.pyx":1217
     *                     continue
     *
     *             fbin0_min = getBinNr(min0, pos0_min, delta)             # <<<<<<<<<<<<<<
     *             fbin0_max = getBinNr(max0, pos0_min, delta)
     *             bin0_min = <int> (fbin0_min)
     */
        __pyx_t_12 = __pyx_PyFloat_AsFloat(__pyx_v_min0); if (unlikely((__pyx_t_12 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_t_13 = __pyx_PyFloat_AsFloat(__pyx_v_pos0_min); if (unlikely((__pyx_t_13 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_t_14 = __pyx_PyFloat_AsFloat(__pyx_v_delta); if (unlikely((__pyx_t_14 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_t_1 = PyFloat_FromDouble(__pyx_f_12splitBBoxLUT_getBinNr(__pyx_t_12, __pyx_t_13, __pyx_t_14)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_XDECREF(__pyx_v_fbin0_min);
        __pyx_v_fbin0_min = __pyx_t_1;
        __pyx_t_1 = 0;

     1218:             fbin0_max = getBinNr(max0, pos0_min, delta)

        /* "splitBBoxLUT.pyx":1218
     *
     *             fbin0_min = getBinNr(min0, pos0_min, delta)
     *             fbin0_max = getBinNr(max0, pos0_min, delta)             # <<<<<<<<<<<<<<
     *             bin0_min = <int> (fbin0_min)
     *             bin0_max = <int> (fbin0_max)
     */
        __pyx_t_14 = __pyx_PyFloat_AsFloat(__pyx_v_max0); if (unlikely((__pyx_t_14 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1218; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_t_13 = __pyx_PyFloat_AsFloat(__pyx_v_pos0_min); if (unlikely((__pyx_t_13 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1218; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_t_12 = __pyx_PyFloat_AsFloat(__pyx_v_delta); if (unlikely((__pyx_t_12 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1218; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_t_1 = PyFloat_FromDouble(__pyx_f_12splitBBoxLUT_getBinNr(__pyx_t_14, __pyx_t_13, __pyx_t_12)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1218; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_XDECREF(__pyx_v_fbin0_max);
        __pyx_v_fbin0_max = __pyx_t_1;
        __pyx_t_1 = 0;

     1219:             bin0_min = <int> (fbin0_min)

        /* "splitBBoxLUT.pyx":1219
     *             fbin0_min = getBinNr(min0, pos0_min, delta)
     *             fbin0_max = getBinNr(max0, pos0_min, delta)
     *             bin0_min = <int> (fbin0_min)             # <<<<<<<<<<<<<<
     *             bin0_max = <int> (fbin0_max)
     *
     */
        __pyx_t_15 = __Pyx_PyInt_AsInt(__pyx_v_fbin0_min); if (unlikely((__pyx_t_15 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_t_1 = PyInt_FromLong(((int)__pyx_t_15)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_XDECREF(__pyx_v_bin0_min);
        __pyx_v_bin0_min = __pyx_t_1;
        __pyx_t_1 = 0;

     1220:             bin0_max = <int> (fbin0_max)

        /* "splitBBoxLUT.pyx":1220
     *             fbin0_max = getBinNr(max0, pos0_min, delta)
     *             bin0_min = <int> (fbin0_min)
     *             bin0_max = <int> (fbin0_max)             # <<<<<<<<<<<<<<
     *
     *             if (bin0_max < 0) or (bin0_min >= bins):
     */
        __pyx_t_15 = __Pyx_PyInt_AsInt(__pyx_v_fbin0_max); if (unlikely((__pyx_t_15 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1220; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_t_1 = PyInt_FromLong(((int)__pyx_t_15)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1220; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_XDECREF(__pyx_v_bin0_max);
        __pyx_v_bin0_max = __pyx_t_1;
        __pyx_t_1 = 0;

     1221:

     1222:             if (bin0_max < 0) or (bin0_min >= bins):

        /* "splitBBoxLUT.pyx":1222
     *             bin0_max = <int> (fbin0_max)
     *
     *             if (bin0_max < 0) or (bin0_min >= bins):             # <<<<<<<<<<<<<<
     *                 continue
     *             if bin0_max >= bins:
     */
        __pyx_t_1 = PyObject_RichCompare(__pyx_v_bin0_max, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        if (!__pyx_t_3) {
          __pyx_t_1 = PyObject_RichCompare(__pyx_v_bin0_min, __pyx_v_bins, Py_GE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __pyx_t_7 = __pyx_t_8;
        } else {
          __pyx_t_7 = __pyx_t_3;
        }
        if (__pyx_t_7) {

     1223:                 continue

          /* "splitBBoxLUT.pyx":1223
     *
     *             if (bin0_max < 0) or (bin0_min >= bins):
     *                 continue             # <<<<<<<<<<<<<<
     *             if bin0_max >= bins:
     *                 bin0_max = bins - 1
     */
          goto __pyx_L14_continue;
          goto __pyx_L19;
        }
        __pyx_L19:;

     1224:             if bin0_max >= bins:

        /* "splitBBoxLUT.pyx":1224
     *             if (bin0_max < 0) or (bin0_min >= bins):
     *                 continue
     *             if bin0_max >= bins:             # <<<<<<<<<<<<<<
     *                 bin0_max = bins - 1
     *             if  bin0_min < 0:
     */
        __pyx_t_1 = PyObject_RichCompare(__pyx_v_bin0_max, __pyx_v_bins, Py_GE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1224; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1224; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        if (__pyx_t_7) {

     1225:                 bin0_max = bins - 1

          /* "splitBBoxLUT.pyx":1225
     *                 continue
     *             if bin0_max >= bins:
     *                 bin0_max = bins - 1             # <<<<<<<<<<<<<<
     *             if  bin0_min < 0:
     *                 bin0_min = 0
     */
          __pyx_t_1 = PyNumber_Subtract(__pyx_v_bins, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1225; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_v_bin0_max);
          __pyx_v_bin0_max = __pyx_t_1;
          __pyx_t_1 = 0;
          goto __pyx_L20;
        }
        __pyx_L20:;

     1226:             if  bin0_min < 0:

        /* "splitBBoxLUT.pyx":1226
     *             if bin0_max >= bins:
     *                 bin0_max = bins - 1
     *             if  bin0_min < 0:             # <<<<<<<<<<<<<<
     *                 bin0_min = 0
     *
     */
        __pyx_t_1 = PyObject_RichCompare(__pyx_v_bin0_min, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        if (__pyx_t_7) {

     1227:                 bin0_min = 0

          /* "splitBBoxLUT.pyx":1227
     *                 bin0_max = bins - 1
     *             if  bin0_min < 0:
     *                 bin0_min = 0             # <<<<<<<<<<<<<<
     *
     *             if do_dark:
     */
          __Pyx_INCREF(__pyx_int_0);
          __Pyx_DECREF(__pyx_v_bin0_min);
          __pyx_v_bin0_min = __pyx_int_0;
          goto __pyx_L21;
        }
        __pyx_L21:;

     1228:

     1229:             if do_dark:

        /* "splitBBoxLUT.pyx":1229
     *                 bin0_min = 0
     *
     *             if do_dark:             # <<<<<<<<<<<<<<
     *                 data -= cdark[idx]
     *             if do_flat:
     */
        if (__pyx_v_do_dark) {

     1230:                 data -= cdark[idx]

          /* "splitBBoxLUT.pyx":1230
     *
     *             if do_dark:
     *                 data -= cdark[idx]             # <<<<<<<<<<<<<<
     *             if do_flat:
     *                 data /= cflat[idx]
     */
          if (unlikely(!__pyx_v_cdark)) { __Pyx_RaiseUnboundLocalError("cdark"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1230; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
          __pyx_t_1 = PyObject_GetItem(__pyx_v_cdark, __pyx_v_idx); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_5 = PyNumber_InPlaceSubtract(__pyx_v_data, __pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_DECREF(__pyx_v_data);
          __pyx_v_data = __pyx_t_5;
          __pyx_t_5 = 0;
          goto __pyx_L22;
        }
        __pyx_L22:;

     1231:             if do_flat:

        /* "splitBBoxLUT.pyx":1231
     *             if do_dark:
     *                 data -= cdark[idx]
     *             if do_flat:             # <<<<<<<<<<<<<<
     *                 data /= cflat[idx]
     *
     */
        if (__pyx_v_do_flat) {

     1232:                 data /= cflat[idx]

          /* "splitBBoxLUT.pyx":1232
     *                 data -= cdark[idx]
     *             if do_flat:
     *                 data /= cflat[idx]             # <<<<<<<<<<<<<<
     *
     *             if bin0_min == bin0_max:
     */
          if (unlikely(!__pyx_v_cflat)) { __Pyx_RaiseUnboundLocalError("cflat"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1232; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
          __pyx_t_5 = PyObject_GetItem(__pyx_v_cflat, __pyx_v_idx); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1232; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_5);
          __pyx_t_1 = __Pyx_PyNumber_InPlaceDivide(__pyx_v_data, __pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1232; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_DECREF(__pyx_v_data);
          __pyx_v_data = __pyx_t_1;
          __pyx_t_1 = 0;
          goto __pyx_L23;
        }
        __pyx_L23:;

     1233:

     1234:             if bin0_min == bin0_max:

        /* "splitBBoxLUT.pyx":1234
     *                 data /= cflat[idx]
     *
     *             if bin0_min == bin0_max:             # <<<<<<<<<<<<<<
     *                 #All pixel is within a single bin
     *                 outCount[bin0_min] += 1.0
     */
        __pyx_t_1 = PyObject_RichCompare(__pyx_v_bin0_min, __pyx_v_bin0_max, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1234; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1234; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        if (__pyx_t_7) {

     1235:                 #All pixel is within a single bin

     1236:                 outCount[bin0_min] += 1.0

          /* "splitBBoxLUT.pyx":1236
     *             if bin0_min == bin0_max:
     *                 #All pixel is within a single bin
     *                 outCount[bin0_min] += 1.0             # <<<<<<<<<<<<<<
     *                 outData[bin0_min] += data
     *                 outMax[bin0_min] += 1
     */
          __Pyx_INCREF(__pyx_v_bin0_min);
          __pyx_t_1 = __pyx_v_bin0_min;
          __pyx_t_5 = PyObject_GetItem(__pyx_v_outCount, __pyx_t_1); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1236; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_5);
          __pyx_t_2 = PyFloat_FromDouble(1.0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1236; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_t_5, __pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1236; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          if (PyObject_SetItem(__pyx_v_outCount, __pyx_t_1, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1236; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

     1237:                 outData[bin0_min] += data

          /* "splitBBoxLUT.pyx":1237
     *                 #All pixel is within a single bin
     *                 outCount[bin0_min] += 1.0
     *                 outData[bin0_min] += data             # <<<<<<<<<<<<<<
     *                 outMax[bin0_min] += 1
     *
     */
          __Pyx_INCREF(__pyx_v_bin0_min);
          __pyx_t_1 = __pyx_v_bin0_min;
          __pyx_t_4 = PyObject_GetItem(__pyx_v_outData, __pyx_t_1); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1237; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_4);
          __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_t_4, __pyx_v_data); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1237; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (PyObject_SetItem(__pyx_v_outData, __pyx_t_1, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1237; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

     1238:                 outMax[bin0_min] += 1

          /* "splitBBoxLUT.pyx":1238
     *                 outCount[bin0_min] += 1.0
     *                 outData[bin0_min] += data
     *                 outMax[bin0_min] += 1             # <<<<<<<<<<<<<<
     *
     *             else: #we have pixel spliting.
     */
          __Pyx_INCREF(__pyx_v_bin0_min);
          __pyx_t_1 = __pyx_v_bin0_min;
          __pyx_t_2 = PyObject_GetItem(__pyx_v_outMax, __pyx_t_1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1238; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_t_2, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1238; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          if (PyObject_SetItem(__pyx_v_outMax, __pyx_t_1, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1238; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          goto __pyx_L24;
        }
        /*else*/ {

     1239:

     1240:             else: #we have pixel spliting.

     1241:                 deltaA = 1.0 / (fbin0_max - fbin0_min)

          /* "splitBBoxLUT.pyx":1241
     *
     *             else: #we have pixel spliting.
     *                 deltaA = 1.0 / (fbin0_max - fbin0_min)             # <<<<<<<<<<<<<<
     *
     *                 deltaL = (bin0_min + 1) - fbin0_min
     */
          __pyx_t_1 = PyFloat_FromDouble(1.0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1241; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_4 = PyNumber_Subtract(__pyx_v_fbin0_max, __pyx_v_fbin0_min); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1241; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_4);
          __pyx_t_2 = __Pyx_PyNumber_Divide(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1241; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_XDECREF(__pyx_v_deltaA);
          __pyx_v_deltaA = __pyx_t_2;
          __pyx_t_2 = 0;

     1242:

     1243:                 deltaL = (bin0_min + 1) - fbin0_min

          /* "splitBBoxLUT.pyx":1243
     *                 deltaA = 1.0 / (fbin0_max - fbin0_min)
     *
     *                 deltaL = (bin0_min + 1) - fbin0_min             # <<<<<<<<<<<<<<
     *                 deltaR = fbin0_max - (bin0_max)
     *
     */
          __pyx_t_2 = PyNumber_Add(__pyx_v_bin0_min, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1243; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_4 = PyNumber_Subtract(__pyx_t_2, __pyx_v_fbin0_min); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1243; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_XDECREF(__pyx_v_deltaL);
          __pyx_v_deltaL = __pyx_t_4;
          __pyx_t_4 = 0;

     1244:                 deltaR = fbin0_max - (bin0_max)

          /* "splitBBoxLUT.pyx":1244
     *
     *                 deltaL = (bin0_min + 1) - fbin0_min
     *                 deltaR = fbin0_max - (bin0_max)             # <<<<<<<<<<<<<<
     *
     *                 outCount[bin0_min] += (deltaA * deltaL)
     */
          __pyx_t_4 = PyNumber_Subtract(__pyx_v_fbin0_max, __pyx_v_bin0_max); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1244; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_XDECREF(__pyx_v_deltaR);
          __pyx_v_deltaR = __pyx_t_4;
          __pyx_t_4 = 0;

     1245:

     1246:                 outCount[bin0_min] += (deltaA * deltaL)

          /* "splitBBoxLUT.pyx":1246
     *                 deltaR = fbin0_max - (bin0_max)
     *
     *                 outCount[bin0_min] += (deltaA * deltaL)             # <<<<<<<<<<<<<<
     *                 outData[bin0_min] += (data * deltaA * deltaL)
     *                 outMax[bin0_min] += 1
     */
          __Pyx_INCREF(__pyx_v_bin0_min);
          __pyx_t_4 = __pyx_v_bin0_min;
          __pyx_t_2 = PyObject_GetItem(__pyx_v_outCount, __pyx_t_4); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1246; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_1 = PyNumber_Multiply(__pyx_v_deltaA, __pyx_v_deltaL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1246; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1246; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          if (PyObject_SetItem(__pyx_v_outCount, __pyx_t_4, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1246; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

     1247:                 outData[bin0_min] += (data * deltaA * deltaL)

          /* "splitBBoxLUT.pyx":1247
     *
     *                 outCount[bin0_min] += (deltaA * deltaL)
     *                 outData[bin0_min] += (data * deltaA * deltaL)             # <<<<<<<<<<<<<<
     *                 outMax[bin0_min] += 1
     *
     */
          __Pyx_INCREF(__pyx_v_bin0_min);
          __pyx_t_4 = __pyx_v_bin0_min;
          __pyx_t_5 = PyObject_GetItem(__pyx_v_outData, __pyx_t_4); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_5);
          __pyx_t_1 = PyNumber_Multiply(__pyx_v_data, __pyx_v_deltaA); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_2 = PyNumber_Multiply(__pyx_t_1, __pyx_v_deltaL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_t_5, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          if (PyObject_SetItem(__pyx_v_outData, __pyx_t_4, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

     1248:                 outMax[bin0_min] += 1

          /* "splitBBoxLUT.pyx":1248
     *                 outCount[bin0_min] += (deltaA * deltaL)
     *                 outData[bin0_min] += (data * deltaA * deltaL)
     *                 outMax[bin0_min] += 1             # <<<<<<<<<<<<<<
     *
     *                 outCount[bin0_max] += (deltaA * deltaR)
     */
          __Pyx_INCREF(__pyx_v_bin0_min);
          __pyx_t_4 = __pyx_v_bin0_min;
          __pyx_t_1 = PyObject_GetItem(__pyx_v_outMax, __pyx_t_4); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1248; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_t_1, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1248; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          if (PyObject_SetItem(__pyx_v_outMax, __pyx_t_4, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1248; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

     1249:

     1250:                 outCount[bin0_max] += (deltaA * deltaR)

          /* "splitBBoxLUT.pyx":1250
     *                 outMax[bin0_min] += 1
     *
     *                 outCount[bin0_max] += (deltaA * deltaR)             # <<<<<<<<<<<<<<
     *                 outData[bin0_max] += (data * deltaA * deltaR)
     *                 outMax[bin0_max] += 1
     */
          __Pyx_INCREF(__pyx_v_bin0_max);
          __pyx_t_4 = __pyx_v_bin0_max;
          __pyx_t_2 = PyObject_GetItem(__pyx_v_outCount, __pyx_t_4); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1250; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_1 = PyNumber_Multiply(__pyx_v_deltaA, __pyx_v_deltaR); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1250; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1250; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          if (PyObject_SetItem(__pyx_v_outCount, __pyx_t_4, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1250; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

     1251:                 outData[bin0_max] += (data * deltaA * deltaR)

          /* "splitBBoxLUT.pyx":1251
     *
     *                 outCount[bin0_max] += (deltaA * deltaR)
     *                 outData[bin0_max] += (data * deltaA * deltaR)             # <<<<<<<<<<<<<<
     *                 outMax[bin0_max] += 1
     *                 if bin0_min + 1 < bin0_max:
     */
          __Pyx_INCREF(__pyx_v_bin0_max);
          __pyx_t_4 = __pyx_v_bin0_max;
          __pyx_t_5 = PyObject_GetItem(__pyx_v_outData, __pyx_t_4); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_5);
          __pyx_t_1 = PyNumber_Multiply(__pyx_v_data, __pyx_v_deltaA); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_2 = PyNumber_Multiply(__pyx_t_1, __pyx_v_deltaR); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_t_5, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          if (PyObject_SetItem(__pyx_v_outData, __pyx_t_4, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

     1252:                 outMax[bin0_max] += 1

          /* "splitBBoxLUT.pyx":1252
     *                 outCount[bin0_max] += (deltaA * deltaR)
     *                 outData[bin0_max] += (data * deltaA * deltaR)
     *                 outMax[bin0_max] += 1             # <<<<<<<<<<<<<<
     *                 if bin0_min + 1 < bin0_max:
     *                     for i in range(bin0_min + 1, bin0_max):
     */
          __Pyx_INCREF(__pyx_v_bin0_max);
          __pyx_t_4 = __pyx_v_bin0_max;
          __pyx_t_1 = PyObject_GetItem(__pyx_v_outMax, __pyx_t_4); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1252; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_t_1, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1252; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          if (PyObject_SetItem(__pyx_v_outMax, __pyx_t_4, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1252; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

     1253:                 if bin0_min + 1 < bin0_max:

          /* "splitBBoxLUT.pyx":1253
     *                 outData[bin0_max] += (data * deltaA * deltaR)
     *                 outMax[bin0_max] += 1
     *                 if bin0_min + 1 < bin0_max:             # <<<<<<<<<<<<<<
     *                     for i in range(bin0_min + 1, bin0_max):
     *                         outCount[i] += deltaA
     */
          __pyx_t_4 = PyNumber_Add(__pyx_v_bin0_min, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1253; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_4);
          __pyx_t_2 = PyObject_RichCompare(__pyx_t_4, __pyx_v_bin0_max, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1253; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1253; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          if (__pyx_t_7) {

     1254:                     for i in range(bin0_min + 1, bin0_max):

            /* "splitBBoxLUT.pyx":1254
     *                 outMax[bin0_max] += 1
     *                 if bin0_min + 1 < bin0_max:
     *                     for i in range(bin0_min + 1, bin0_max):             # <<<<<<<<<<<<<<
     *                         outCount[i] += deltaA
     *                         outData[i] += (data * deltaA)
     */
            __pyx_t_2 = PyNumber_Add(__pyx_v_bin0_min, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1254; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_2);
            __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1254; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_4);
            PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
            __Pyx_GIVEREF(__pyx_t_2);
            __Pyx_INCREF(__pyx_v_bin0_max);
            PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_bin0_max);
            __Pyx_GIVEREF(__pyx_v_bin0_max);
            __pyx_t_2 = 0;
            __pyx_t_2 = PyObject_Call(__pyx_builtin_range, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1254; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_2);
            __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
            if (PyList_CheckExact(__pyx_t_2) || PyTuple_CheckExact(__pyx_t_2)) {
              __pyx_t_4 = __pyx_t_2; __Pyx_INCREF(__pyx_t_4); __pyx_t_16 = 0;
              __pyx_t_17 = NULL;
            } else {
              __pyx_t_16 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1254; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              __Pyx_GOTREF(__pyx_t_4);
              __pyx_t_17 = Py_TYPE(__pyx_t_4)->tp_iternext;
            }
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            for (;;) {
              if (!__pyx_t_17 && PyList_CheckExact(__pyx_t_4)) {
                if (__pyx_t_16 >= PyList_GET_SIZE(__pyx_t_4)) break;
                #if CYTHON_COMPILING_IN_CPYTHON
                __pyx_t_2 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_16); __Pyx_INCREF(__pyx_t_2); __pyx_t_16++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1254; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                #else
                __pyx_t_2 = PySequence_ITEM(__pyx_t_4, __pyx_t_16); __pyx_t_16++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1254; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                #endif
              } else if (!__pyx_t_17 && PyTuple_CheckExact(__pyx_t_4)) {
                if (__pyx_t_16 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
                #if CYTHON_COMPILING_IN_CPYTHON
                __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_16); __Pyx_INCREF(__pyx_t_2); __pyx_t_16++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1254; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                #else
                __pyx_t_2 = PySequence_ITEM(__pyx_t_4, __pyx_t_16); __pyx_t_16++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1254; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                #endif
              } else {
                __pyx_t_2 = __pyx_t_17(__pyx_t_4);
                if (unlikely(!__pyx_t_2)) {
                  if (PyErr_Occurred()) {
                    if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
                    else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1254; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                  }
                  break;
                }
                __Pyx_GOTREF(__pyx_t_2);
              }
              __Pyx_XDECREF(__pyx_v_i);
              __pyx_v_i = __pyx_t_2;
              __pyx_t_2 = 0;

     1255:                         outCount[i] += deltaA

              /* "splitBBoxLUT.pyx":1255
     *                 if bin0_min + 1 < bin0_max:
     *                     for i in range(bin0_min + 1, bin0_max):
     *                         outCount[i] += deltaA             # <<<<<<<<<<<<<<
     *                         outData[i] += (data * deltaA)
     *                         outMax[i] += 1
     */
              __Pyx_INCREF(__pyx_v_i);
              __pyx_t_2 = __pyx_v_i;
              __pyx_t_1 = PyObject_GetItem(__pyx_v_outCount, __pyx_t_2); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1255; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              __Pyx_GOTREF(__pyx_t_1);
              __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_t_1, __pyx_v_deltaA); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1255; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              __Pyx_GOTREF(__pyx_t_5);
              __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
              if (PyObject_SetItem(__pyx_v_outCount, __pyx_t_2, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1255; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
              __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

     1256:                         outData[i] += (data * deltaA)

              /* "splitBBoxLUT.pyx":1256
     *                     for i in range(bin0_min + 1, bin0_max):
     *                         outCount[i] += deltaA
     *                         outData[i] += (data * deltaA)             # <<<<<<<<<<<<<<
     *                         outMax[i] += 1
     *
     */
              __Pyx_INCREF(__pyx_v_i);
              __pyx_t_2 = __pyx_v_i;
              __pyx_t_5 = PyObject_GetItem(__pyx_v_outData, __pyx_t_2); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1256; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              __Pyx_GOTREF(__pyx_t_5);
              __pyx_t_1 = PyNumber_Multiply(__pyx_v_data, __pyx_v_deltaA); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1256; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              __Pyx_GOTREF(__pyx_t_1);
              __pyx_t_18 = PyNumber_InPlaceAdd(__pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1256; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              __Pyx_GOTREF(__pyx_t_18);
              __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
              __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
              if (PyObject_SetItem(__pyx_v_outData, __pyx_t_2, __pyx_t_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1256; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
              __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

     1257:                         outMax[i] += 1

              /* "splitBBoxLUT.pyx":1257
     *                         outCount[i] += deltaA
     *                         outData[i] += (data * deltaA)
     *                         outMax[i] += 1             # <<<<<<<<<<<<<<
     *
     *     for i in range(bins):
     */
              __Pyx_INCREF(__pyx_v_i);
              __pyx_t_2 = __pyx_v_i;
              __pyx_t_18 = PyObject_GetItem(__pyx_v_outMax, __pyx_t_2); if (!__pyx_t_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              __Pyx_GOTREF(__pyx_t_18);
              __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_t_18, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              __Pyx_GOTREF(__pyx_t_1);
              __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
              if (PyObject_SetItem(__pyx_v_outMax, __pyx_t_2, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
              __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            }
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
            goto __pyx_L25;
          }
          __pyx_L25:;
        }
        __pyx_L24:;
        __pyx_L14_continue:;
      }
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

     1258:

     1259:     for i in range(bins):

      /* "splitBBoxLUT.pyx":1259
     *                         outMax[i] += 1
     *
     *     for i in range(bins):             # <<<<<<<<<<<<<<
     *                 if outCount[i] > epsilon:
     *                     outMerge[i] = (outData[i] / outCount[i])
     */
      __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1259; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_INCREF(__pyx_v_bins);
      PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_bins);
      __Pyx_GIVEREF(__pyx_v_bins);
      __pyx_t_4 = PyObject_Call(__pyx_builtin_range, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1259; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
      if (PyList_CheckExact(__pyx_t_4) || PyTuple_CheckExact(__pyx_t_4)) {
        __pyx_t_6 = __pyx_t_4; __Pyx_INCREF(__pyx_t_6); __pyx_t_10 = 0;
        __pyx_t_11 = NULL;
      } else {
        __pyx_t_10 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1259; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_11 = Py_TYPE(__pyx_t_6)->tp_iternext;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      for (;;) {
        if (!__pyx_t_11 && PyList_CheckExact(__pyx_t_6)) {
          if (__pyx_t_10 >= PyList_GET_SIZE(__pyx_t_6)) break;
          #if CYTHON_COMPILING_IN_CPYTHON
          __pyx_t_4 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_10); __Pyx_INCREF(__pyx_t_4); __pyx_t_10++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1259; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          #else
          __pyx_t_4 = PySequence_ITEM(__pyx_t_6, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1259; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          #endif
        } else if (!__pyx_t_11 && PyTuple_CheckExact(__pyx_t_6)) {
          if (__pyx_t_10 >= PyTuple_GET_SIZE(__pyx_t_6)) break;
          #if CYTHON_COMPILING_IN_CPYTHON
          __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_10); __Pyx_INCREF(__pyx_t_4); __pyx_t_10++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1259; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          #else
          __pyx_t_4 = PySequence_ITEM(__pyx_t_6, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1259; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          #endif
        } else {
          __pyx_t_4 = __pyx_t_11(__pyx_t_6);
          if (unlikely(!__pyx_t_4)) {
            if (PyErr_Occurred()) {
              if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
              else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1259; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            }
            break;
          }
          __Pyx_GOTREF(__pyx_t_4);
        }
        __Pyx_XDECREF(__pyx_v_i);
        __pyx_v_i = __pyx_t_4;
        __pyx_t_4 = 0;

     1260:                 if outCount[i] > epsilon:

        /* "splitBBoxLUT.pyx":1260
     *
     *     for i in range(bins):
     *                 if outCount[i] > epsilon:             # <<<<<<<<<<<<<<
     *                     outMerge[i] = (outData[i] / outCount[i])
     *                 else:
     */
        __pyx_t_4 = PyObject_GetItem(__pyx_v_outCount, __pyx_v_i); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1260; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_2 = PyFloat_FromDouble(__pyx_v_epsilon); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1260; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_1 = PyObject_RichCompare(__pyx_t_4, __pyx_t_2, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1260; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1260; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        if (__pyx_t_7) {

     1261:                     outMerge[i] = (outData[i] / outCount[i])

          /* "splitBBoxLUT.pyx":1261
     *     for i in range(bins):
     *                 if outCount[i] > epsilon:
     *                     outMerge[i] = (outData[i] / outCount[i])             # <<<<<<<<<<<<<<
     *                 else:
     *                     outMerge[i] = cdummy
     */
          __pyx_t_1 = PyObject_GetItem(__pyx_v_outData, __pyx_v_i); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1261; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_2 = PyObject_GetItem(__pyx_v_outCount, __pyx_v_i); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1261; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_4 = __Pyx_PyNumber_Divide(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1261; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          if (PyObject_SetItem(__pyx_v_outMerge, __pyx_v_i, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1261; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          goto __pyx_L30;
        }
        /*else*/ {

     1262:                 else:

     1263:                     outMerge[i] = cdummy

          /* "splitBBoxLUT.pyx":1263
     *                     outMerge[i] = (outData[i] / outCount[i])
     *                 else:
     *                     outMerge[i] = cdummy             # <<<<<<<<<<<<<<
     *
     *     return  outPos, outMerge, outData, outCount, outMax
     */
          __pyx_t_4 = PyFloat_FromDouble(__pyx_v_cdummy); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1263; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_4);
          if (PyObject_SetItem(__pyx_v_outMerge, __pyx_v_i, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1263; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        }
        __pyx_L30:;
      }
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

     1264:

     1265:     return  outPos, outMerge, outData, outCount, outMax

      /* "splitBBoxLUT.pyx":1265
     *                     outMerge[i] = cdummy
     *
     *     return  outPos, outMerge, outData, outCount, outMax             # <<<<<<<<<<<<<<
     *
     *
     */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_6 = PyTuple_New(5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1265; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_INCREF(__pyx_v_outPos);
      PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_outPos);
      __Pyx_GIVEREF(__pyx_v_outPos);
      __Pyx_INCREF(__pyx_v_outMerge);
      PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_outMerge);
      __Pyx_GIVEREF(__pyx_v_outMerge);
      __Pyx_INCREF(__pyx_v_outData);
      PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_v_outData);
      __Pyx_GIVEREF(__pyx_v_outData);
      __Pyx_INCREF(__pyx_v_outCount);
      PyTuple_SET_ITEM(__pyx_t_6, 3, __pyx_v_outCount);
      __Pyx_GIVEREF(__pyx_v_outCount);
      __Pyx_INCREF(__pyx_v_outMax);
      PyTuple_SET_ITEM(__pyx_t_6, 4, __pyx_v_outMax);
      __Pyx_GIVEREF(__pyx_v_outMax);
      __pyx_r = ((PyObject *)__pyx_t_6);
      __pyx_t_6 = 0;
      goto __pyx_L0;

      __pyx_r = Py_None; __Pyx_INCREF(Py_None);
      goto __pyx_L0;
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_6);
      __Pyx_XDECREF(__pyx_t_18);
      __Pyx_AddTraceback("splitBBoxLUT.histoBBox1d", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __Pyx_XDECREF(__pyx_v_size);
      __Pyx_XDECREF(__pyx_v_cdata);
      __Pyx_XDECREF(__pyx_v_cpos0);
      __Pyx_XDECREF(__pyx_v_dpos0);
      __Pyx_XDECREF(__pyx_v_outData);
      __Pyx_XDECREF(__pyx_v_outCount);
      __Pyx_XDECREF(__pyx_v_outMax);
      __Pyx_XDECREF(__pyx_v_outMerge);
      __Pyx_XDECREF(__pyx_v_cmask);
      __Pyx_XDECREF(__pyx_v_cdark);
      __Pyx_XDECREF(__pyx_v_cflat);
      __Pyx_XDECREF(__pyx_v_cpos0_lower);
      __Pyx_XDECREF(__pyx_v_cpos0_upper);
      __Pyx_XDECREF(__pyx_v_pos0_min);
      __Pyx_XDECREF(__pyx_v_pos0_max);
      __Pyx_XDECREF(__pyx_v_idx);
      __Pyx_XDECREF(__pyx_v_min0);
      __Pyx_XDECREF(__pyx_v_max0);
      __Pyx_XDECREF(__pyx_v_pos0_maxin);
      __Pyx_XDECREF(__pyx_v_cpos1);
      __Pyx_XDECREF(__pyx_v_dpos1);
      __Pyx_XDECREF(__pyx_v_pos1_min);
      __Pyx_XDECREF(__pyx_v_pos1_maxin);
      __Pyx_XDECREF(__pyx_v_pos1_max);
      __Pyx_XDECREF(__pyx_v_delta);
      __Pyx_XDECREF(__pyx_v_outPos);
      __Pyx_XDECREF(__pyx_v_data);
      __Pyx_XDECREF(__pyx_v_fbin0_min);
      __Pyx_XDECREF(__pyx_v_fbin0_max);
      __Pyx_XDECREF(__pyx_v_bin0_min);
      __Pyx_XDECREF(__pyx_v_bin0_max);
      __Pyx_XDECREF(__pyx_v_deltaA);
      __Pyx_XDECREF(__pyx_v_deltaL);
      __Pyx_XDECREF(__pyx_v_deltaR);
      __Pyx_XDECREF(__pyx_v_i);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    /* 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));
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

     1266:

     1267:

     1268:

     1269: