Generated by Cython 0.15.1+ on Wed Nov 9 08:54:07 2011

Raw output: splitBBox.c

     1: #!/usr/bin/env python

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

     2: # -*- coding: utf8 -*-

     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: cimport numpy

     30: import numpy

      /* "splitBBox.pyx":30
     * import cython
     * cimport numpy
     * import numpy             # <<<<<<<<<<<<<<
     *
     * cdef extern from "math.h":
     */
      __pyx_t_1 = __Pyx_Import(((PyObject *)__pyx_n_s__numpy), 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __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 = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

     31:

     32: cdef extern from "math.h":

     33:     double floor(float)nogil

     34:

     35:

     36: ctypedef numpy.int64_t DTYPE_int64_t

    /* "splitBBox.pyx":36
     *
     *
     * ctypedef numpy.int64_t DTYPE_int64_t             # <<<<<<<<<<<<<<
     * ctypedef numpy.float64_t DTYPE_float64_t
     * ctypedef numpy.float32_t DTYPE_float32_t
     */
    typedef __pyx_t_5numpy_int64_t __pyx_t_9splitBBox_DTYPE_int64_t;

     37: ctypedef numpy.float64_t DTYPE_float64_t

    /* "splitBBox.pyx":37
     *
     * ctypedef numpy.int64_t DTYPE_int64_t
     * ctypedef numpy.float64_t DTYPE_float64_t             # <<<<<<<<<<<<<<
     * ctypedef numpy.float32_t DTYPE_float32_t
     *
     */
    typedef __pyx_t_5numpy_float64_t __pyx_t_9splitBBox_DTYPE_float64_t;

     38: ctypedef numpy.float32_t DTYPE_float32_t

     39:

     40:

     41: @cython.cdivision(True)

     42: cdef float  getBinNr(float x0, float pos0_min, float dpos) nogil:

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

    static float __pyx_f_9splitBBox_getBinNr(float __pyx_v_x0, float __pyx_v_pos0_min, float __pyx_v_dpos) {
      float __pyx_r;

     43:     """

     44:     calculate the bin number for any point

     45:     param x0: current position

     46:     param pos0_min: position minimum

     47:     param dpos: bin width

     48:     """

     49:     return (x0 - pos0_min) / dpos

      /* "splitBBox.pyx":49
     *     param dpos: bin width
     *     """
     *     return (x0 - pos0_min) / dpos             # <<<<<<<<<<<<<<
     *
     *
     */
      __pyx_r = ((__pyx_v_x0 - __pyx_v_pos0_min) / __pyx_v_dpos);
      goto __pyx_L0;

      __pyx_r = 0;
      __pyx_L0:;
      return __pyx_r;
    }

     50:

     51:

     52: @cython.cdivision(True)

     53: @cython.boundscheck(False)

     54: @cython.wraparound(False)

     55: def histoBBox1d(numpy.ndarray weights not None,

    /* "splitBBox.pyx":55
     * @cython.boundscheck(False)
     * @cython.wraparound(False)
     * def histoBBox1d(numpy.ndarray weights not None,             # <<<<<<<<<<<<<<
     *                 numpy.ndarray pos0 not None,
     *                 numpy.ndarray delta_pos0 not None,
     */

    static PyObject *__pyx_pf_9splitBBox_histoBBox1d(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
    static char __pyx_doc_9splitBBox_histoBBox1d[] = "\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 \n    @return 2theta, I, weighted histogram, unweighted histogram\n    ";
    static PyMethodDef __pyx_mdef_9splitBBox_histoBBox1d = {__Pyx_NAMESTR("histoBBox1d"), (PyCFunction)__pyx_pf_9splitBBox_histoBBox1d, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_9splitBBox_histoBBox1d)};
    static PyObject *__pyx_pf_9splitBBox_histoBBox1d(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;
      PyObject *__pyx_v_pos1 = 0;
      PyObject *__pyx_v_delta_pos1 = 0;
      long __pyx_v_bins;
      PyObject *__pyx_v_pos0Range = 0;
      PyObject *__pyx_v_pos1Range = 0;
      float __pyx_v_dummy;
      long __pyx_v_size;
      PyArrayObject *__pyx_v_cdata = 0;
      PyArrayObject *__pyx_v_cpos0_inf = 0;
      PyArrayObject *__pyx_v_cpos0_sup = 0;
      PyArrayObject *__pyx_v_cpos1_inf = 0;
      PyArrayObject *__pyx_v_cpos1_sup = 0;
      PyArrayObject *__pyx_v_outData = 0;
      PyArrayObject *__pyx_v_outCount = 0;
      PyArrayObject *__pyx_v_outMerge = 0;
      PyArrayObject *__pyx_v_outPos = 0;
      float __pyx_v_deltaR;
      float __pyx_v_deltaL;
      float __pyx_v_deltaA;
      float __pyx_v_pos0_min;
      float __pyx_v_pos0_max;
      float __pyx_v_pos0_maxin;
      float __pyx_v_pos1_min;
      float __pyx_v_pos1_max;
      float __pyx_v_pos1_maxin;
      float __pyx_v_min0;
      float __pyx_v_max0;
      float __pyx_v_fbin0_min;
      float __pyx_v_fbin0_max;
      int __pyx_v_checkpos1;
      float __pyx_v_dpos;
      CYTHON_UNUSED long __pyx_v_bin;
      long __pyx_v_i;
      long __pyx_v_idx;
      long __pyx_v_bin0_max;
      long __pyx_v_bin0_min;
      double __pyx_v_epsilon;
      double __pyx_v_data;
      __Pyx_LocalBuf_ND __pyx_pybuffernd_outMerge;
      __Pyx_Buffer __pyx_pybuffer_outMerge;
      __Pyx_LocalBuf_ND __pyx_pybuffernd_cpos0_inf;
      __Pyx_Buffer __pyx_pybuffer_cpos0_inf;
      __Pyx_LocalBuf_ND __pyx_pybuffernd_outPos;
      __Pyx_Buffer __pyx_pybuffer_outPos;
      __Pyx_LocalBuf_ND __pyx_pybuffernd_cpos0_sup;
      __Pyx_Buffer __pyx_pybuffer_cpos0_sup;
      __Pyx_LocalBuf_ND __pyx_pybuffernd_cpos1_sup;
      __Pyx_Buffer __pyx_pybuffer_cpos1_sup;
      __Pyx_LocalBuf_ND __pyx_pybuffernd_outCount;
      __Pyx_Buffer __pyx_pybuffer_outCount;
      __Pyx_LocalBuf_ND __pyx_pybuffernd_cdata;
      __Pyx_Buffer __pyx_pybuffer_cdata;
      __Pyx_LocalBuf_ND __pyx_pybuffernd_outData;
      __Pyx_Buffer __pyx_pybuffer_outData;
      __Pyx_LocalBuf_ND __pyx_pybuffernd_cpos1_inf;
      __Pyx_Buffer __pyx_pybuffer_cpos1_inf;
      PyObject *__pyx_r = NULL;
      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,0};
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("histoBBox1d");
      __pyx_self = __pyx_self;
      {
        PyObject* values[9] = {0,0,0,0,0,0,0,0,0};

      /* "splitBBox.pyx":55
     * @cython.boundscheck(False)
     * @cython.wraparound(False)
     * def histoBBox1d(numpy.ndarray weights not None,             # <<<<<<<<<<<<<<
     *                 numpy.ndarray pos0 not None,
     *                 numpy.ndarray delta_pos0 not None,
     */
      __pyx_k_tuple_24 = PyTuple_New(41); if (unlikely(!__pyx_k_tuple_24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_k_tuple_24);
      __Pyx_INCREF(((PyObject *)__pyx_n_s__weights));
      PyTuple_SET_ITEM(__pyx_k_tuple_24, 0, ((PyObject *)__pyx_n_s__weights));
      __Pyx_GIVEREF(((PyObject *)__pyx_n_s__weights));
      __Pyx_INCREF(((PyObject *)__pyx_n_s__pos0));
      PyTuple_SET_ITEM(__pyx_k_tuple_24, 1, ((PyObject *)__pyx_n_s__pos0));
      __Pyx_GIVEREF(((PyObject *)__pyx_n_s__pos0));
      __Pyx_INCREF(((PyObject *)__pyx_n_s__delta_pos0));
      PyTuple_SET_ITEM(__pyx_k_tuple_24, 2, ((PyObject *)__pyx_n_s__delta_pos0));
      __Pyx_GIVEREF(((PyObject *)__pyx_n_s__delta_pos0));
      __Pyx_INCREF(((PyObject *)__pyx_n_s__pos1));
      PyTuple_SET_ITEM(__pyx_k_tuple_24, 3, ((PyObject *)__pyx_n_s__pos1));
      __Pyx_GIVEREF(((PyObject *)__pyx_n_s__pos1));
      __Pyx_INCREF(((PyObject *)__pyx_n_s__delta_pos1));
      PyTuple_SET_ITEM(__pyx_k_tuple_24, 4, ((PyObject *)__pyx_n_s__delta_pos1));
      __Pyx_GIVEREF(((PyObject *)__pyx_n_s__delta_pos1));
      __Pyx_INCREF(((PyObject *)__pyx_n_s__bins));
      PyTuple_SET_ITEM(__pyx_k_tuple_24, 5, ((PyObject *)__pyx_n_s__bins));
      __Pyx_GIVEREF(((PyObject *)__pyx_n_s__bins));
      __Pyx_INCREF(((PyObject *)__pyx_n_s__pos0Range));
      PyTuple_SET_ITEM(__pyx_k_tuple_24, 6, ((PyObject *)__pyx_n_s__pos0Range));
      __Pyx_GIVEREF(((PyObject *)__pyx_n_s__pos0Range));
      __Pyx_INCREF(((PyObject *)__pyx_n_s__pos1Range));
      PyTuple_SET_ITEM(__pyx_k_tuple_24, 7, ((PyObject *)__pyx_n_s__pos1Range));
      __Pyx_GIVEREF(((PyObject *)__pyx_n_s__pos1Range));
      __Pyx_INCREF(((PyObject *)__pyx_n_s__dummy));
      PyTuple_SET_ITEM(__pyx_k_tuple_24, 8, ((PyObject *)__pyx_n_s__dummy));
      __Pyx_GIVEREF(((PyObject *)__pyx_n_s__dummy));
      __Pyx_INCREF(((PyObject *)__pyx_n_s__size));
      PyTuple_SET_ITEM(__pyx_k_tuple_24, 9, ((PyObject *)__pyx_n_s__size));
      __Pyx_GIVEREF(((PyObject *)__pyx_n_s__size));
      __Pyx_INCREF(((PyObject *)__pyx_n_s__cdata));
      PyTuple_SET_ITEM(__pyx_k_tuple_24, 10, ((PyObject *)__pyx_n_s__cdata));
      __Pyx_GIVEREF(((PyObject *)__pyx_n_s__cdata));
      __Pyx_INCREF(((PyObject *)__pyx_n_s__cpos0_inf));
      PyTuple_SET_ITEM(__pyx_k_tuple_24, 11, ((PyObject *)__pyx_n_s__cpos0_inf));
      __Pyx_GIVEREF(((PyObject *)__pyx_n_s__cpos0_inf));
      __Pyx_INCREF(((PyObject *)__pyx_n_s__cpos0_sup));
      PyTuple_SET_ITEM(__pyx_k_tuple_24, 12, ((PyObject *)__pyx_n_s__cpos0_sup));
      __Pyx_GIVEREF(((PyObject *)__pyx_n_s__cpos0_sup));
      __Pyx_INCREF(((PyObject *)__pyx_n_s__cpos1_inf));
      PyTuple_SET_ITEM(__pyx_k_tuple_24, 13, ((PyObject *)__pyx_n_s__cpos1_inf));
      __Pyx_GIVEREF(((PyObject *)__pyx_n_s__cpos1_inf));
      __Pyx_INCREF(((PyObject *)__pyx_n_s__cpos1_sup));
      PyTuple_SET_ITEM(__pyx_k_tuple_24, 14, ((PyObject *)__pyx_n_s__cpos1_sup));
      __Pyx_GIVEREF(((PyObject *)__pyx_n_s__cpos1_sup));
      __Pyx_INCREF(((PyObject *)__pyx_n_s__outData));
      PyTuple_SET_ITEM(__pyx_k_tuple_24, 15, ((PyObject *)__pyx_n_s__outData));
      __Pyx_GIVEREF(((PyObject *)__pyx_n_s__outData));
      __Pyx_INCREF(((PyObject *)__pyx_n_s__outCount));
      PyTuple_SET_ITEM(__pyx_k_tuple_24, 16, ((PyObject *)__pyx_n_s__outCount));
      __Pyx_GIVEREF(((PyObject *)__pyx_n_s__outCount));
      __Pyx_INCREF(((PyObject *)__pyx_n_s__outMerge));
      PyTuple_SET_ITEM(__pyx_k_tuple_24, 17, ((PyObject *)__pyx_n_s__outMerge));
      __Pyx_GIVEREF(((PyObject *)__pyx_n_s__outMerge));
      __Pyx_INCREF(((PyObject *)__pyx_n_s__outPos));
      PyTuple_SET_ITEM(__pyx_k_tuple_24, 18, ((PyObject *)__pyx_n_s__outPos));
      __Pyx_GIVEREF(((PyObject *)__pyx_n_s__outPos));
      __Pyx_INCREF(((PyObject *)__pyx_n_s__deltaR));
      PyTuple_SET_ITEM(__pyx_k_tuple_24, 19, ((PyObject *)__pyx_n_s__deltaR));
      __Pyx_GIVEREF(((PyObject *)__pyx_n_s__deltaR));
      __Pyx_INCREF(((PyObject *)__pyx_n_s__deltaL));
      PyTuple_SET_ITEM(__pyx_k_tuple_24, 20, ((PyObject *)__pyx_n_s__deltaL));
      __Pyx_GIVEREF(((PyObject *)__pyx_n_s__deltaL));
      __Pyx_INCREF(((PyObject *)__pyx_n_s__deltaA));
      PyTuple_SET_ITEM(__pyx_k_tuple_24, 21, ((PyObject *)__pyx_n_s__deltaA));
      __Pyx_GIVEREF(((PyObject *)__pyx_n_s__deltaA));
      __Pyx_INCREF(((PyObject *)__pyx_n_s__pos0_min));
      PyTuple_SET_ITEM(__pyx_k_tuple_24, 22, ((PyObject *)__pyx_n_s__pos0_min));
      __Pyx_GIVEREF(((PyObject *)__pyx_n_s__pos0_min));
      __Pyx_INCREF(((PyObject *)__pyx_n_s__pos0_max));
      PyTuple_SET_ITEM(__pyx_k_tuple_24, 23, ((PyObject *)__pyx_n_s__pos0_max));
      __Pyx_GIVEREF(((PyObject *)__pyx_n_s__pos0_max));
      __Pyx_INCREF(((PyObject *)__pyx_n_s__pos0_maxin));
      PyTuple_SET_ITEM(__pyx_k_tuple_24, 24, ((PyObject *)__pyx_n_s__pos0_maxin));
      __Pyx_GIVEREF(((PyObject *)__pyx_n_s__pos0_maxin));
      __Pyx_INCREF(((PyObject *)__pyx_n_s__pos1_min));
      PyTuple_SET_ITEM(__pyx_k_tuple_24, 25, ((PyObject *)__pyx_n_s__pos1_min));
      __Pyx_GIVEREF(((PyObject *)__pyx_n_s__pos1_min));
      __Pyx_INCREF(((PyObject *)__pyx_n_s__pos1_max));
      PyTuple_SET_ITEM(__pyx_k_tuple_24, 26, ((PyObject *)__pyx_n_s__pos1_max));
      __Pyx_GIVEREF(((PyObject *)__pyx_n_s__pos1_max));
      __Pyx_INCREF(((PyObject *)__pyx_n_s__pos1_maxin));
      PyTuple_SET_ITEM(__pyx_k_tuple_24, 27, ((PyObject *)__pyx_n_s__pos1_maxin));
      __Pyx_GIVEREF(((PyObject *)__pyx_n_s__pos1_maxin));
      __Pyx_INCREF(((PyObject *)__pyx_n_s__min0));
      PyTuple_SET_ITEM(__pyx_k_tuple_24, 28, ((PyObject *)__pyx_n_s__min0));
      __Pyx_GIVEREF(((PyObject *)__pyx_n_s__min0));
      __Pyx_INCREF(((PyObject *)__pyx_n_s__max0));
      PyTuple_SET_ITEM(__pyx_k_tuple_24, 29, ((PyObject *)__pyx_n_s__max0));
      __Pyx_GIVEREF(((PyObject *)__pyx_n_s__max0));
      __Pyx_INCREF(((PyObject *)__pyx_n_s__fbin0_min));
      PyTuple_SET_ITEM(__pyx_k_tuple_24, 30, ((PyObject *)__pyx_n_s__fbin0_min));
      __Pyx_GIVEREF(((PyObject *)__pyx_n_s__fbin0_min));
      __Pyx_INCREF(((PyObject *)__pyx_n_s__fbin0_max));
      PyTuple_SET_ITEM(__pyx_k_tuple_24, 31, ((PyObject *)__pyx_n_s__fbin0_max));
      __Pyx_GIVEREF(((PyObject *)__pyx_n_s__fbin0_max));
      __Pyx_INCREF(((PyObject *)__pyx_n_s__checkpos1));
      PyTuple_SET_ITEM(__pyx_k_tuple_24, 32, ((PyObject *)__pyx_n_s__checkpos1));
      __Pyx_GIVEREF(((PyObject *)__pyx_n_s__checkpos1));
      __Pyx_INCREF(((PyObject *)__pyx_n_s__dpos));
      PyTuple_SET_ITEM(__pyx_k_tuple_24, 33, ((PyObject *)__pyx_n_s__dpos));
      __Pyx_GIVEREF(((PyObject *)__pyx_n_s__dpos));
      __Pyx_INCREF(((PyObject *)__pyx_n_s__bin));
      PyTuple_SET_ITEM(__pyx_k_tuple_24, 34, ((PyObject *)__pyx_n_s__bin));
      __Pyx_GIVEREF(((PyObject *)__pyx_n_s__bin));
      __Pyx_INCREF(((PyObject *)__pyx_n_s__i));
      PyTuple_SET_ITEM(__pyx_k_tuple_24, 35, ((PyObject *)__pyx_n_s__i));
      __Pyx_GIVEREF(((PyObject *)__pyx_n_s__i));
      __Pyx_INCREF(((PyObject *)__pyx_n_s__idx));
      PyTuple_SET_ITEM(__pyx_k_tuple_24, 36, ((PyObject *)__pyx_n_s__idx));
      __Pyx_GIVEREF(((PyObject *)__pyx_n_s__idx));
      __Pyx_INCREF(((PyObject *)__pyx_n_s__bin0_max));
      PyTuple_SET_ITEM(__pyx_k_tuple_24, 37, ((PyObject *)__pyx_n_s__bin0_max));
      __Pyx_GIVEREF(((PyObject *)__pyx_n_s__bin0_max));
      __Pyx_INCREF(((PyObject *)__pyx_n_s__bin0_min));
      PyTuple_SET_ITEM(__pyx_k_tuple_24, 38, ((PyObject *)__pyx_n_s__bin0_min));
      __Pyx_GIVEREF(((PyObject *)__pyx_n_s__bin0_min));
      __Pyx_INCREF(((PyObject *)__pyx_n_s__epsilon));
      PyTuple_SET_ITEM(__pyx_k_tuple_24, 39, ((PyObject *)__pyx_n_s__epsilon));
      __Pyx_GIVEREF(((PyObject *)__pyx_n_s__epsilon));
      __Pyx_INCREF(((PyObject *)__pyx_n_s__data));
      PyTuple_SET_ITEM(__pyx_k_tuple_24, 40, ((PyObject *)__pyx_n_s__data));
      __Pyx_GIVEREF(((PyObject *)__pyx_n_s__data));
      __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_24));

      /* "splitBBox.pyx":55
     * @cython.boundscheck(False)
     * @cython.wraparound(False)
     * def histoBBox1d(numpy.ndarray weights not None,             # <<<<<<<<<<<<<<
     *                 numpy.ndarray pos0 not None,
     *                 numpy.ndarray delta_pos0 not None,
     */
      __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_9splitBBox_histoBBox1d, NULL, __pyx_n_s__splitBBox); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      if (PyObject_SetAttr(__pyx_m, __pyx_n_s__histoBBox1d, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_k_codeobj_25 = (PyObject*)__Pyx_PyCode_New(9, 0, 41, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_24, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_26, __pyx_n_s__histoBBox1d, 55, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_25)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

     56:                 numpy.ndarray pos0 not None,

     57:                 numpy.ndarray delta_pos0 not None,

     58:                 pos1=None,

        /* "splitBBox.pyx":58
     *                 numpy.ndarray pos0 not None,
     *                 numpy.ndarray delta_pos0 not None,
     *                 pos1=None,             # <<<<<<<<<<<<<<
     *                 delta_pos1=None,
     *                 long bins=100,
     */
        values[3] = ((PyObject *)Py_None);

     59:                 delta_pos1=None,

        /* "splitBBox.pyx":59
     *                 numpy.ndarray delta_pos0 not None,
     *                 pos1=None,
     *                 delta_pos1=None,             # <<<<<<<<<<<<<<
     *                 long bins=100,
     *                 pos0Range=None,
     */
        values[4] = ((PyObject *)Py_None);

     60:                 long bins=100,

     61:                 pos0Range=None,

        /* "splitBBox.pyx":61
     *                 delta_pos1=None,
     *                 long bins=100,
     *                 pos0Range=None,             # <<<<<<<<<<<<<<
     *                 pos1Range=None,
     *                 float dummy=0.0
     */
        values[6] = ((PyObject *)Py_None);

     62:                 pos1Range=None,

        /* "splitBBox.pyx":62
     *                 long bins=100,
     *                 pos0Range=None,
     *                 pos1Range=None,             # <<<<<<<<<<<<<<
     *                 float dummy=0.0
     *               ):
     */
        values[7] = ((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  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:
            values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__weights);
            if (likely(values[0])) kw_args--;
            else goto __pyx_L5_argtuple_error;
            case  1:
            values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__pos0);
            if (likely(values[1])) kw_args--;
            else {
              __Pyx_RaiseArgtupleInvalid("histoBBox1d", 0, 3, 9, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
            }
            case  2:
            values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__delta_pos0);
            if (likely(values[2])) kw_args--;
            else {
              __Pyx_RaiseArgtupleInvalid("histoBBox1d", 0, 3, 9, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __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--; }
            }
          }
          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 = 55; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
          }
          __pyx_v_weights = ((PyArrayObject *)values[0]);
          __pyx_v_pos0 = ((PyArrayObject *)values[1]);
          __pyx_v_delta_pos0 = ((PyArrayObject *)values[2]);
          __pyx_v_pos1 = values[3];
          __pyx_v_delta_pos1 = values[4];
          if (values[5]) {
            __pyx_v_bins = __Pyx_PyInt_AsLong(values[5]); if (unlikely((__pyx_v_bins == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
          } else {
            __pyx_v_bins = ((long)100);
          }
          __pyx_v_pos0Range = values[6];
          __pyx_v_pos1Range = values[7];
          if (values[8]) {
            __pyx_v_dummy = __pyx_PyFloat_AsDouble(values[8]); if (unlikely((__pyx_v_dummy == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
          } else {

     63:                 float dummy=0.0

            /* "splitBBox.pyx":63
     *                 pos0Range=None,
     *                 pos1Range=None,
     *                 float dummy=0.0             # <<<<<<<<<<<<<<
     *               ):
     *     """
     */
            __pyx_v_dummy = ((float)0.0);
          }
        } else {
          switch (PyTuple_GET_SIZE(__pyx_args)) {
            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 = ((PyArrayObject *)values[0]);
        __pyx_v_pos0 = ((PyArrayObject *)values[1]);
        __pyx_v_delta_pos0 = ((PyArrayObject *)values[2]);
        __pyx_v_pos1 = values[3];
        __pyx_v_delta_pos1 = values[4];
        if (values[5]) {
          __pyx_v_bins = __Pyx_PyInt_AsLong(values[5]); if (unlikely((__pyx_v_bins == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        } else {
          __pyx_v_bins = ((long)100);
        }
        __pyx_v_pos0Range = values[6];
        __pyx_v_pos1Range = values[7];
        if (values[8]) {
          __pyx_v_dummy = __pyx_PyFloat_AsDouble(values[8]); if (unlikely((__pyx_v_dummy == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        } else {
          __pyx_v_dummy = ((float)0.0);
        }
      }
      goto __pyx_L4_argument_unpacking_done;
      __pyx_L5_argtuple_error:;
      __Pyx_RaiseArgtupleInvalid("histoBBox1d", 0, 3, 9, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      __pyx_L3_error:;
      __Pyx_AddTraceback("splitBBox.histoBBox1d", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __Pyx_RefNannyFinishContext();
      return NULL;
      __pyx_L4_argument_unpacking_done:;
      __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_inf.pybuffer.buf = NULL;
      __pyx_pybuffer_cpos0_inf.refcount = 0;
      __pyx_pybuffernd_cpos0_inf.data = NULL;
      __pyx_pybuffernd_cpos0_inf.rcbuffer = &__pyx_pybuffer_cpos0_inf;
      __pyx_pybuffer_cpos0_sup.pybuffer.buf = NULL;
      __pyx_pybuffer_cpos0_sup.refcount = 0;
      __pyx_pybuffernd_cpos0_sup.data = NULL;
      __pyx_pybuffernd_cpos0_sup.rcbuffer = &__pyx_pybuffer_cpos0_sup;
      __pyx_pybuffer_cpos1_inf.pybuffer.buf = NULL;
      __pyx_pybuffer_cpos1_inf.refcount = 0;
      __pyx_pybuffernd_cpos1_inf.data = NULL;
      __pyx_pybuffernd_cpos1_inf.rcbuffer = &__pyx_pybuffer_cpos1_inf;
      __pyx_pybuffer_cpos1_sup.pybuffer.buf = NULL;
      __pyx_pybuffer_cpos1_sup.refcount = 0;
      __pyx_pybuffernd_cpos1_sup.data = NULL;
      __pyx_pybuffernd_cpos1_sup.rcbuffer = &__pyx_pybuffer_cpos1_sup;
      __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_outPos.pybuffer.buf = NULL;
      __pyx_pybuffer_outPos.refcount = 0;
      __pyx_pybuffernd_outPos.data = NULL;
      __pyx_pybuffernd_outPos.rcbuffer = &__pyx_pybuffer_outPos;
      if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_weights), __pyx_ptype_5numpy_ndarray, 0, "weights", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __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 = 56; __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 = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

     64:               ):

     65:     """

     66:     Calculates histogram of pos0 (tth) weighted by weights

     67:

     68:     Splitting is done on the pixel's bounding box like fit2D

     69:

     70:     @param weights: array with intensities

     71:     @param pos0: 1D array with pos0: tth or q_vect

     72:     @param delta_pos0: 1D array with delta pos0: max center-corner distance

     73:     @param pos1: 1D array with pos1: chi

     74:     @param delta_pos1: 1D array with max pos1: max center-corner distance, unused !

     75:     @param bins: number of output bins

     76:     @param pos0Range: minimum and maximum  of the 2th range

     77:     @param pos1Range: minimum and maximum  of the chi range

     78:     @param dummy: value for bins without pixels

     79:     @return 2theta, I, weighted histogram, unweighted histogram

     80:     """

     81:     cdef long  size = weights.size

      /* "splitBBox.pyx":81
     *     @return 2theta, I, weighted histogram, unweighted histogram
     *     """
     *     cdef long  size = weights.size             # <<<<<<<<<<<<<<
     *     assert pos0.size == size
     *     assert delta_pos0.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 = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyInt_AsLong(__pyx_t_1); if (unlikely((__pyx_t_2 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v_size = __pyx_t_2;

     82:     assert pos0.size == size

      /* "splitBBox.pyx":82
     *     """
     *     cdef long  size = weights.size
     *     assert pos0.size == size             # <<<<<<<<<<<<<<
     *     assert delta_pos0.size == size
     *     assert  bins > 1
     */
      #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 = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = PyInt_FromLong(__pyx_v_size); 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_t_4 = PyObject_RichCompare(__pyx_t_1, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __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_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 = 82; __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 = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      #endif

     83:     assert delta_pos0.size == size

      /* "splitBBox.pyx":83
     *     cdef long  size = weights.size
     *     assert pos0.size == size
     *     assert delta_pos0.size == size             # <<<<<<<<<<<<<<
     *     assert  bins > 1
     *
     */
      #ifndef CYTHON_WITHOUT_ASSERTIONS
      __pyx_t_4 = PyObject_GetAttr(((PyObject *)__pyx_v_delta_pos0), __pyx_n_s__size); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = PyInt_FromLong(__pyx_v_size); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __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); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_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 = 83; __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 = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      #endif

     84:     assert  bins > 1

      /* "splitBBox.pyx":84
     *     assert pos0.size == size
     *     assert delta_pos0.size == size
     *     assert  bins > 1             # <<<<<<<<<<<<<<
     *
     *     cdef numpy.ndarray[DTYPE_float64_t, ndim = 1] cdata = weights.ravel().astype("float64")
     */
      #ifndef CYTHON_WITHOUT_ASSERTIONS
      if (unlikely(!(__pyx_v_bins > 1))) {
        PyErr_SetNone(PyExc_AssertionError);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      #endif

     85:

     86:     cdef numpy.ndarray[DTYPE_float64_t, ndim = 1] cdata = weights.ravel().astype("float64")

      /* "splitBBox.pyx":86
     *     assert  bins > 1
     *
     *     cdef numpy.ndarray[DTYPE_float64_t, ndim = 1] cdata = weights.ravel().astype("float64")             # <<<<<<<<<<<<<<
     *     cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cpos0_inf = (pos0.ravel() - delta_pos0.ravel()).astype("float32")
     *     cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cpos0_sup = (pos0.ravel() + delta_pos0.ravel()).astype("float32")
     */
      __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 = 86; __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 = 86; __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_t_3, __pyx_n_s__astype); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __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_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_6 = ((PyArrayObject *)__pyx_t_3);
      {
        __Pyx_BufFmt_StackElem __pyx_stack[1];
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_cdata.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_9splitBBox_DTYPE_float64_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 = 86; __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_6 = 0;
      __pyx_v_cdata = ((PyArrayObject *)__pyx_t_3);
      __pyx_t_3 = 0;

      /* "splitBBox.pyx":86
     *     assert  bins > 1
     *
     *     cdef numpy.ndarray[DTYPE_float64_t, ndim = 1] cdata = weights.ravel().astype("float64")             # <<<<<<<<<<<<<<
     *     cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cpos0_inf = (pos0.ravel() - delta_pos0.ravel()).astype("float32")
     *     cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cpos0_sup = (pos0.ravel() + delta_pos0.ravel()).astype("float32")
     */
      __pyx_k_tuple_1 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_k_tuple_1);
      __Pyx_INCREF(((PyObject *)__pyx_n_s__float64));
      PyTuple_SET_ITEM(__pyx_k_tuple_1, 0, ((PyObject *)__pyx_n_s__float64));
      __Pyx_GIVEREF(((PyObject *)__pyx_n_s__float64));
      __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_1));

     87:     cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cpos0_inf = (pos0.ravel() - delta_pos0.ravel()).astype("float32")

      /* "splitBBox.pyx":87
     *
     *     cdef numpy.ndarray[DTYPE_float64_t, ndim = 1] cdata = weights.ravel().astype("float64")
     *     cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cpos0_inf = (pos0.ravel() - delta_pos0.ravel()).astype("float32")             # <<<<<<<<<<<<<<
     *     cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cpos0_sup = (pos0.ravel() + delta_pos0.ravel()).astype("float32")
     *     cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cpos1_inf
     */
      __pyx_t_3 = PyObject_GetAttr(((PyObject *)__pyx_v_pos0), __pyx_n_s__ravel); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __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 = 87; __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(((PyObject *)__pyx_v_delta_pos0), __pyx_n_s__ravel); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __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 = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = PyNumber_Subtract(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__astype); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __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_Call(__pyx_t_4, ((PyObject *)__pyx_k_tuple_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_7 = ((PyArrayObject *)__pyx_t_3);
      {
        __Pyx_BufFmt_StackElem __pyx_stack[1];
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_cpos0_inf.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_9splitBBox_DTYPE_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
          __pyx_v_cpos0_inf = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_cpos0_inf.rcbuffer->pybuffer.buf = NULL;
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        } else {__pyx_pybuffernd_cpos0_inf.diminfo[0].strides = __pyx_pybuffernd_cpos0_inf.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_cpos0_inf.diminfo[0].shape = __pyx_pybuffernd_cpos0_inf.rcbuffer->pybuffer.shape[0];
        }
      }
      __pyx_t_7 = 0;
      __pyx_v_cpos0_inf = ((PyArrayObject *)__pyx_t_3);
      __pyx_t_3 = 0;

      /* "splitBBox.pyx":87
     *
     *     cdef numpy.ndarray[DTYPE_float64_t, ndim = 1] cdata = weights.ravel().astype("float64")
     *     cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cpos0_inf = (pos0.ravel() - delta_pos0.ravel()).astype("float32")             # <<<<<<<<<<<<<<
     *     cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cpos0_sup = (pos0.ravel() + delta_pos0.ravel()).astype("float32")
     *     cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cpos1_inf
     */
      __pyx_k_tuple_2 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_k_tuple_2);
      __Pyx_INCREF(((PyObject *)__pyx_n_s__float32));
      PyTuple_SET_ITEM(__pyx_k_tuple_2, 0, ((PyObject *)__pyx_n_s__float32));
      __Pyx_GIVEREF(((PyObject *)__pyx_n_s__float32));
      __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_2));

     88:     cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cpos0_sup = (pos0.ravel() + delta_pos0.ravel()).astype("float32")

      /* "splitBBox.pyx":88
     *     cdef numpy.ndarray[DTYPE_float64_t, ndim = 1] cdata = weights.ravel().astype("float64")
     *     cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cpos0_inf = (pos0.ravel() - delta_pos0.ravel()).astype("float32")
     *     cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cpos0_sup = (pos0.ravel() + delta_pos0.ravel()).astype("float32")             # <<<<<<<<<<<<<<
     *     cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cpos1_inf
     *     cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cpos1_sup
     */
      __pyx_t_3 = PyObject_GetAttr(((PyObject *)__pyx_v_pos0), __pyx_n_s__ravel); 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_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __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(((PyObject *)__pyx_v_delta_pos0), __pyx_n_s__ravel); 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_1 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = PyNumber_Add(__pyx_t_4, __pyx_t_1); 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_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__astype); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __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_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_3), NULL); 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_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_8 = ((PyArrayObject *)__pyx_t_3);
      {
        __Pyx_BufFmt_StackElem __pyx_stack[1];
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_cpos0_sup.rcbuffer->pybuffer, (PyObject*)__pyx_t_8, &__Pyx_TypeInfo_nn___pyx_t_9splitBBox_DTYPE_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
          __pyx_v_cpos0_sup = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_cpos0_sup.rcbuffer->pybuffer.buf = NULL;
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        } else {__pyx_pybuffernd_cpos0_sup.diminfo[0].strides = __pyx_pybuffernd_cpos0_sup.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_cpos0_sup.diminfo[0].shape = __pyx_pybuffernd_cpos0_sup.rcbuffer->pybuffer.shape[0];
        }
      }
      __pyx_t_8 = 0;
      __pyx_v_cpos0_sup = ((PyArrayObject *)__pyx_t_3);
      __pyx_t_3 = 0;

      /* "splitBBox.pyx":88
     *     cdef numpy.ndarray[DTYPE_float64_t, ndim = 1] cdata = weights.ravel().astype("float64")
     *     cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cpos0_inf = (pos0.ravel() - delta_pos0.ravel()).astype("float32")
     *     cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cpos0_sup = (pos0.ravel() + delta_pos0.ravel()).astype("float32")             # <<<<<<<<<<<<<<
     *     cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cpos1_inf
     *     cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cpos1_sup
     */
      __pyx_k_tuple_3 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_k_tuple_3);
      __Pyx_INCREF(((PyObject *)__pyx_n_s__float32));
      PyTuple_SET_ITEM(__pyx_k_tuple_3, 0, ((PyObject *)__pyx_n_s__float32));
      __Pyx_GIVEREF(((PyObject *)__pyx_n_s__float32));
      __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_3));

     89:     cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cpos1_inf

     90:     cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cpos1_sup

     91:

     92:     cdef numpy.ndarray[DTYPE_float64_t, ndim = 1] outData = numpy.zeros(bins, dtype="float64")

      /* "splitBBox.pyx":92
     *     cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cpos1_sup
     *
     *     cdef numpy.ndarray[DTYPE_float64_t, ndim = 1] outData = numpy.zeros(bins, dtype="float64")             # <<<<<<<<<<<<<<
     *     cdef numpy.ndarray[DTYPE_float64_t, ndim = 1] outCount = numpy.zeros(bins, dtype="float64")
     *     cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] outMerge = numpy.zeros(bins, dtype="float32")
     */
      __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); 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_1 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__zeros); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = PyInt_FromLong(__pyx_v_bins); 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_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __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 = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_3));
      if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__dtype), ((PyObject *)__pyx_n_s__float64)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_9 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __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_4)); __pyx_t_4 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 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 = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_10 = ((PyArrayObject *)__pyx_t_9);
      {
        __Pyx_BufFmt_StackElem __pyx_stack[1];
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_outData.rcbuffer->pybuffer, (PyObject*)__pyx_t_10, &__Pyx_TypeInfo_nn___pyx_t_9splitBBox_DTYPE_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 = 92; __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_10 = 0;
      __pyx_v_outData = ((PyArrayObject *)__pyx_t_9);
      __pyx_t_9 = 0;

     93:     cdef numpy.ndarray[DTYPE_float64_t, ndim = 1] outCount = numpy.zeros(bins, dtype="float64")

      /* "splitBBox.pyx":93
     *
     *     cdef numpy.ndarray[DTYPE_float64_t, ndim = 1] outData = numpy.zeros(bins, dtype="float64")
     *     cdef numpy.ndarray[DTYPE_float64_t, ndim = 1] outCount = numpy.zeros(bins, dtype="float64")             # <<<<<<<<<<<<<<
     *     cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] outMerge = numpy.zeros(bins, dtype="float32")
     *     cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] outPos = numpy.zeros(bins, dtype="float32")
     */
      __pyx_t_9 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_3 = PyObject_GetAttr(__pyx_t_9, __pyx_n_s__zeros); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __pyx_t_9 = PyInt_FromLong(__pyx_v_bins); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __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 = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_9));
      if (PyDict_SetItem(__pyx_t_9, ((PyObject *)__pyx_n_s__dtype), ((PyObject *)__pyx_n_s__float64)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_1 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_9)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 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_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_11 = ((PyArrayObject *)__pyx_t_1);
      {
        __Pyx_BufFmt_StackElem __pyx_stack[1];
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_outCount.rcbuffer->pybuffer, (PyObject*)__pyx_t_11, &__Pyx_TypeInfo_nn___pyx_t_9splitBBox_DTYPE_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 = 93; __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_11 = 0;
      __pyx_v_outCount = ((PyArrayObject *)__pyx_t_1);
      __pyx_t_1 = 0;

     94:     cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] outMerge = numpy.zeros(bins, dtype="float32")

      /* "splitBBox.pyx":94
     *     cdef numpy.ndarray[DTYPE_float64_t, ndim = 1] outData = numpy.zeros(bins, dtype="float64")
     *     cdef numpy.ndarray[DTYPE_float64_t, ndim = 1] outCount = numpy.zeros(bins, dtype="float64")
     *     cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] outMerge = numpy.zeros(bins, dtype="float32")             # <<<<<<<<<<<<<<
     *     cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] outPos = numpy.zeros(bins, dtype="float32")
     *     cdef float  deltaR, deltaL, deltaA
     */
      __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_9 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__zeros); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_9);
      __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 = 94; __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 = 94; __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 = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_1));
      if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__dtype), ((PyObject *)__pyx_n_s__float32)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_3 = PyObject_Call(__pyx_t_9, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_1)); 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_9); __pyx_t_9 = 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_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_12 = ((PyArrayObject *)__pyx_t_3);
      {
        __Pyx_BufFmt_StackElem __pyx_stack[1];
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_outMerge.rcbuffer->pybuffer, (PyObject*)__pyx_t_12, &__Pyx_TypeInfo_nn___pyx_t_9splitBBox_DTYPE_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 = 94; __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_12 = 0;
      __pyx_v_outMerge = ((PyArrayObject *)__pyx_t_3);
      __pyx_t_3 = 0;

     95:     cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] outPos = numpy.zeros(bins, dtype="float32")

      /* "splitBBox.pyx":95
     *     cdef numpy.ndarray[DTYPE_float64_t, ndim = 1] outCount = numpy.zeros(bins, dtype="float64")
     *     cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] outMerge = numpy.zeros(bins, dtype="float32")
     *     cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] outPos = numpy.zeros(bins, dtype="float32")             # <<<<<<<<<<<<<<
     *     cdef float  deltaR, deltaL, deltaA
     *     cdef float pos0_min, pos0_max, pos0_maxin, pos1_min, pos1_max, pos1_maxin, min0, max0, fbin0_min, fbin0_max
     */
      __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__zeros); 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;
      __pyx_t_3 = PyInt_FromLong(__pyx_v_bins); 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_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __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 = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_3));
      if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__dtype), ((PyObject *)__pyx_n_s__float32)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_9 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __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_4)); __pyx_t_4 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 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 = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_13 = ((PyArrayObject *)__pyx_t_9);
      {
        __Pyx_BufFmt_StackElem __pyx_stack[1];
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_outPos.rcbuffer->pybuffer, (PyObject*)__pyx_t_13, &__Pyx_TypeInfo_nn___pyx_t_9splitBBox_DTYPE_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
          __pyx_v_outPos = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_outPos.rcbuffer->pybuffer.buf = NULL;
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        } else {__pyx_pybuffernd_outPos.diminfo[0].strides = __pyx_pybuffernd_outPos.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_outPos.diminfo[0].shape = __pyx_pybuffernd_outPos.rcbuffer->pybuffer.shape[0];
        }
      }
      __pyx_t_13 = 0;
      __pyx_v_outPos = ((PyArrayObject *)__pyx_t_9);
      __pyx_t_9 = 0;

     96:     cdef float  deltaR, deltaL, deltaA

     97:     cdef float pos0_min, pos0_max, pos0_maxin, pos1_min, pos1_max, pos1_maxin, min0, max0, fbin0_min, fbin0_max

     98:     cdef int checkpos1 = 0

      /* "splitBBox.pyx":98
     *     cdef float  deltaR, deltaL, deltaA
     *     cdef float pos0_min, pos0_max, pos0_maxin, pos1_min, pos1_max, pos1_maxin, min0, max0, fbin0_min, fbin0_max
     *     cdef int checkpos1 = 0             # <<<<<<<<<<<<<<
     *
     *     if pos0Range is not None and len(pos0Range) > 1:
     */
      __pyx_v_checkpos1 = 0;

     99:

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

      /* "splitBBox.pyx":100
     *     cdef int checkpos1 = 0
     *
     *     if pos0Range is not None and len(pos0Range) > 1:             # <<<<<<<<<<<<<<
     *         pos0_min = min(pos0Range)
     *         if pos0_min < 0.0:
     */
      __pyx_t_5 = (__pyx_v_pos0Range != Py_None);
      if (__pyx_t_5) {
        __pyx_t_14 = PyObject_Length(__pyx_v_pos0Range); if (unlikely(__pyx_t_14 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_t_15 = (__pyx_t_14 > 1);
        __pyx_t_16 = __pyx_t_15;
      } else {
        __pyx_t_16 = __pyx_t_5;
      }
      if (__pyx_t_16) {

     101:         pos0_min = min(pos0Range)

        /* "splitBBox.pyx":101
     *
     *     if pos0Range is not None and len(pos0Range) > 1:
     *         pos0_min = min(pos0Range)             # <<<<<<<<<<<<<<
     *         if pos0_min < 0.0:
     *             pos0_min = 0.0
     */
        __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __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_3 = PyObject_Call(__pyx_builtin_min, ((PyObject *)__pyx_t_9), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0;
        __pyx_t_17 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_17 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_v_pos0_min = __pyx_t_17;

     102:         if pos0_min < 0.0:

        /* "splitBBox.pyx":102
     *     if pos0Range is not None and len(pos0Range) > 1:
     *         pos0_min = min(pos0Range)
     *         if pos0_min < 0.0:             # <<<<<<<<<<<<<<
     *             pos0_min = 0.0
     *         pos0_maxin = max(pos0Range)
     */
        __pyx_t_16 = (__pyx_v_pos0_min < 0.0);
        if (__pyx_t_16) {

     103:             pos0_min = 0.0

          /* "splitBBox.pyx":103
     *         pos0_min = min(pos0Range)
     *         if pos0_min < 0.0:
     *             pos0_min = 0.0             # <<<<<<<<<<<<<<
     *         pos0_maxin = max(pos0Range)
     *     else:
     */
          __pyx_v_pos0_min = 0.0;
          goto __pyx_L7;
        }
        __pyx_L7:;

     104:         pos0_maxin = max(pos0Range)

        /* "splitBBox.pyx":104
     *         if pos0_min < 0.0:
     *             pos0_min = 0.0
     *         pos0_maxin = max(pos0Range)             # <<<<<<<<<<<<<<
     *     else:
     *         pos0_min = cpos0_inf.min()
     */
        __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __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_9 = PyObject_Call(__pyx_builtin_max, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
        __pyx_t_17 = __pyx_PyFloat_AsDouble(__pyx_t_9); if (unlikely((__pyx_t_17 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_v_pos0_maxin = __pyx_t_17;
        goto __pyx_L6;
      }
      /*else*/ {

     105:     else:

     106:         pos0_min = cpos0_inf.min()

        /* "splitBBox.pyx":106
     *         pos0_maxin = max(pos0Range)
     *     else:
     *         pos0_min = cpos0_inf.min()             # <<<<<<<<<<<<<<
     *         pos0_maxin = cpos0_sup.max()
     *     pos0_max = pos0_maxin * (1 + numpy.finfo(numpy.float32).eps)
     */
        __pyx_t_9 = PyObject_GetAttr(((PyObject *)__pyx_v_cpos0_inf), __pyx_n_s__min); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_3 = PyObject_Call(__pyx_t_9, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_17 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_17 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_v_pos0_min = __pyx_t_17;

     107:         pos0_maxin = cpos0_sup.max()

        /* "splitBBox.pyx":107
     *     else:
     *         pos0_min = cpos0_inf.min()
     *         pos0_maxin = cpos0_sup.max()             # <<<<<<<<<<<<<<
     *     pos0_max = pos0_maxin * (1 + numpy.finfo(numpy.float32).eps)
     *
     */
        __pyx_t_3 = PyObject_GetAttr(((PyObject *)__pyx_v_cpos0_sup), __pyx_n_s__max); 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_t_9 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_17 = __pyx_PyFloat_AsDouble(__pyx_t_9); if (unlikely((__pyx_t_17 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_v_pos0_maxin = __pyx_t_17;
      }
      __pyx_L6:;

     108:     pos0_max = pos0_maxin * (1 + numpy.finfo(numpy.float32).eps)

      /* "splitBBox.pyx":108
     *         pos0_min = cpos0_inf.min()
     *         pos0_maxin = cpos0_sup.max()
     *     pos0_max = pos0_maxin * (1 + numpy.finfo(numpy.float32).eps)             # <<<<<<<<<<<<<<
     *
     *     if pos1Range is not None and len(pos1Range) > 1:
     */
      __pyx_t_9 = PyFloat_FromDouble(__pyx_v_pos0_maxin); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__finfo); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __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 = 108; __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 = 108; __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 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __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_3)); __pyx_t_3 = 0;
      __pyx_t_3 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__eps); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyNumber_Add(__pyx_int_1, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = PyNumber_Multiply(__pyx_t_9, __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __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_1); __pyx_t_1 = 0;
      __pyx_t_17 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_17 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_v_pos0_max = __pyx_t_17;

     109:

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

      /* "splitBBox.pyx":110
     *     pos0_max = pos0_maxin * (1 + numpy.finfo(numpy.float32).eps)
     *
     *     if pos1Range is not None and len(pos1Range) > 1:             # <<<<<<<<<<<<<<
     *         assert pos1.size == size
     *         assert delta_pos1.size == size
     */
      __pyx_t_16 = (__pyx_v_pos1Range != Py_None);
      if (__pyx_t_16) {
        __pyx_t_14 = PyObject_Length(__pyx_v_pos1Range); if (unlikely(__pyx_t_14 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_t_5 = (__pyx_t_14 > 1);
        __pyx_t_15 = __pyx_t_5;
      } else {
        __pyx_t_15 = __pyx_t_16;
      }
      if (__pyx_t_15) {

     111:         assert pos1.size == size

        /* "splitBBox.pyx":111
     *
     *     if pos1Range is not None and len(pos1Range) > 1:
     *         assert pos1.size == size             # <<<<<<<<<<<<<<
     *         assert delta_pos1.size == size
     *         checkpos1 = 1
     */
        #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 = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_1 = PyInt_FromLong(__pyx_v_size); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_9 = PyObject_RichCompare(__pyx_t_3, __pyx_t_1, Py_EQ); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __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_1); __pyx_t_1 = 0;
        __pyx_t_15 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        if (unlikely(!__pyx_t_15)) {
          PyErr_SetNone(PyExc_AssertionError);
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        #endif

     112:         assert delta_pos1.size == size

        /* "splitBBox.pyx":112
     *     if pos1Range is not None and len(pos1Range) > 1:
     *         assert pos1.size == size
     *         assert delta_pos1.size == size             # <<<<<<<<<<<<<<
     *         checkpos1 = 1
     *         cpos1_inf = (pos1.ravel() - delta_pos1.ravel()).astype("float32")
     */
        #ifndef CYTHON_WITHOUT_ASSERTIONS
        __pyx_t_9 = PyObject_GetAttr(__pyx_v_delta_pos1, __pyx_n_s__size); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_1 = PyInt_FromLong(__pyx_v_size); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_3 = PyObject_RichCompare(__pyx_t_9, __pyx_t_1, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __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_1); __pyx_t_1 = 0;
        __pyx_t_15 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (unlikely(!__pyx_t_15)) {
          PyErr_SetNone(PyExc_AssertionError);
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        #endif

     113:         checkpos1 = 1

        /* "splitBBox.pyx":113
     *         assert pos1.size == size
     *         assert delta_pos1.size == size
     *         checkpos1 = 1             # <<<<<<<<<<<<<<
     *         cpos1_inf = (pos1.ravel() - delta_pos1.ravel()).astype("float32")
     *         cpos1_sup = (pos1.ravel() + delta_pos1.ravel()).astype("float32")
     */
        __pyx_v_checkpos1 = 1;

     114:         cpos1_inf = (pos1.ravel() - delta_pos1.ravel()).astype("float32")

        /* "splitBBox.pyx":114
     *         assert delta_pos1.size == size
     *         checkpos1 = 1
     *         cpos1_inf = (pos1.ravel() - delta_pos1.ravel()).astype("float32")             # <<<<<<<<<<<<<<
     *         cpos1_sup = (pos1.ravel() + delta_pos1.ravel()).astype("float32")
     *         pos1_min = min(pos1Range)
     */
        __pyx_t_3 = PyObject_GetAttr(__pyx_v_pos1, __pyx_n_s__ravel); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __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 = 114; __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_delta_pos1, __pyx_n_s__ravel); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __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 = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_3 = PyNumber_Subtract(__pyx_t_1, __pyx_t_9); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_9 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__astype); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __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_Call(__pyx_t_9, ((PyObject *)__pyx_k_tuple_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__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 = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_t_18 = ((PyArrayObject *)__pyx_t_3);
        {
          __Pyx_BufFmt_StackElem __pyx_stack[1];
          __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_cpos1_inf.rcbuffer->pybuffer);
          __pyx_t_19 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_cpos1_inf.rcbuffer->pybuffer, (PyObject*)__pyx_t_18, &__Pyx_TypeInfo_nn___pyx_t_9splitBBox_DTYPE_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
          if (unlikely(__pyx_t_19 < 0)) {
            PyErr_Fetch(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22);
            if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_cpos1_inf.rcbuffer->pybuffer, (PyObject*)__pyx_v_cpos1_inf, &__Pyx_TypeInfo_nn___pyx_t_9splitBBox_DTYPE_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
              Py_XDECREF(__pyx_t_20); Py_XDECREF(__pyx_t_21); Py_XDECREF(__pyx_t_22);
              __Pyx_RaiseBufferFallbackError();
            } else {
              PyErr_Restore(__pyx_t_20, __pyx_t_21, __pyx_t_22);
            }
          }
          __pyx_pybuffernd_cpos1_inf.diminfo[0].strides = __pyx_pybuffernd_cpos1_inf.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_cpos1_inf.diminfo[0].shape = __pyx_pybuffernd_cpos1_inf.rcbuffer->pybuffer.shape[0];
          if (unlikely(__pyx_t_19 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        __pyx_t_18 = 0;
        __pyx_v_cpos1_inf = ((PyArrayObject *)__pyx_t_3);
        __pyx_t_3 = 0;

      /* "splitBBox.pyx":114
     *         assert delta_pos1.size == size
     *         checkpos1 = 1
     *         cpos1_inf = (pos1.ravel() - delta_pos1.ravel()).astype("float32")             # <<<<<<<<<<<<<<
     *         cpos1_sup = (pos1.ravel() + delta_pos1.ravel()).astype("float32")
     *         pos1_min = min(pos1Range)
     */
      __pyx_k_tuple_4 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_k_tuple_4);
      __Pyx_INCREF(((PyObject *)__pyx_n_s__float32));
      PyTuple_SET_ITEM(__pyx_k_tuple_4, 0, ((PyObject *)__pyx_n_s__float32));
      __Pyx_GIVEREF(((PyObject *)__pyx_n_s__float32));
      __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_4));

     115:         cpos1_sup = (pos1.ravel() + delta_pos1.ravel()).astype("float32")

        /* "splitBBox.pyx":115
     *         checkpos1 = 1
     *         cpos1_inf = (pos1.ravel() - delta_pos1.ravel()).astype("float32")
     *         cpos1_sup = (pos1.ravel() + delta_pos1.ravel()).astype("float32")             # <<<<<<<<<<<<<<
     *         pos1_min = min(pos1Range)
     *         pos1_maxin = max(pos1Range)
     */
        __pyx_t_3 = PyObject_GetAttr(__pyx_v_pos1, __pyx_n_s__ravel); 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_t_9 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __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_delta_pos1, __pyx_n_s__ravel); 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_t_1 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_3 = PyNumber_Add(__pyx_t_9, __pyx_t_1); 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_9); __pyx_t_9 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_t_1 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__astype); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __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_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_5), NULL); 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_1); __pyx_t_1 = 0;
        if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_t_23 = ((PyArrayObject *)__pyx_t_3);
        {
          __Pyx_BufFmt_StackElem __pyx_stack[1];
          __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_cpos1_sup.rcbuffer->pybuffer);
          __pyx_t_19 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_cpos1_sup.rcbuffer->pybuffer, (PyObject*)__pyx_t_23, &__Pyx_TypeInfo_nn___pyx_t_9splitBBox_DTYPE_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
          if (unlikely(__pyx_t_19 < 0)) {
            PyErr_Fetch(&__pyx_t_22, &__pyx_t_21, &__pyx_t_20);
            if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_cpos1_sup.rcbuffer->pybuffer, (PyObject*)__pyx_v_cpos1_sup, &__Pyx_TypeInfo_nn___pyx_t_9splitBBox_DTYPE_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
              Py_XDECREF(__pyx_t_22); Py_XDECREF(__pyx_t_21); Py_XDECREF(__pyx_t_20);
              __Pyx_RaiseBufferFallbackError();
            } else {
              PyErr_Restore(__pyx_t_22, __pyx_t_21, __pyx_t_20);
            }
          }
          __pyx_pybuffernd_cpos1_sup.diminfo[0].strides = __pyx_pybuffernd_cpos1_sup.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_cpos1_sup.diminfo[0].shape = __pyx_pybuffernd_cpos1_sup.rcbuffer->pybuffer.shape[0];
          if (unlikely(__pyx_t_19 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        __pyx_t_23 = 0;
        __pyx_v_cpos1_sup = ((PyArrayObject *)__pyx_t_3);
        __pyx_t_3 = 0;

      /* "splitBBox.pyx":115
     *         checkpos1 = 1
     *         cpos1_inf = (pos1.ravel() - delta_pos1.ravel()).astype("float32")
     *         cpos1_sup = (pos1.ravel() + delta_pos1.ravel()).astype("float32")             # <<<<<<<<<<<<<<
     *         pos1_min = min(pos1Range)
     *         pos1_maxin = max(pos1Range)
     */
      __pyx_k_tuple_5 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_k_tuple_5);
      __Pyx_INCREF(((PyObject *)__pyx_n_s__float32));
      PyTuple_SET_ITEM(__pyx_k_tuple_5, 0, ((PyObject *)__pyx_n_s__float32));
      __Pyx_GIVEREF(((PyObject *)__pyx_n_s__float32));
      __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_5));

     116:         pos1_min = min(pos1Range)

        /* "splitBBox.pyx":116
     *         cpos1_inf = (pos1.ravel() - delta_pos1.ravel()).astype("float32")
     *         cpos1_sup = (pos1.ravel() + delta_pos1.ravel()).astype("float32")
     *         pos1_min = min(pos1Range)             # <<<<<<<<<<<<<<
     *         pos1_maxin = max(pos1Range)
     *         pos1_max = pos1_maxin * (1 + numpy.finfo(numpy.float32).eps)
     */
        __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __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_1 = PyObject_Call(__pyx_builtin_min, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
        __pyx_t_17 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_17 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_v_pos1_min = __pyx_t_17;

     117:         pos1_maxin = max(pos1Range)

        /* "splitBBox.pyx":117
     *         cpos1_sup = (pos1.ravel() + delta_pos1.ravel()).astype("float32")
     *         pos1_min = min(pos1Range)
     *         pos1_maxin = max(pos1Range)             # <<<<<<<<<<<<<<
     *         pos1_max = pos1_maxin * (1 + numpy.finfo(numpy.float32).eps)
     *
     */
        __pyx_t_1 = PyTuple_New(1); 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_INCREF(__pyx_v_pos1Range);
        PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_pos1Range);
        __Pyx_GIVEREF(__pyx_v_pos1Range);
        __pyx_t_3 = PyObject_Call(__pyx_builtin_max, ((PyObject *)__pyx_t_1), 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(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
        __pyx_t_17 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_17 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_v_pos1_maxin = __pyx_t_17;

     118:         pos1_max = pos1_maxin * (1 + numpy.finfo(numpy.float32).eps)

        /* "splitBBox.pyx":118
     *         pos1_min = min(pos1Range)
     *         pos1_maxin = max(pos1Range)
     *         pos1_max = pos1_maxin * (1 + numpy.finfo(numpy.float32).eps)             # <<<<<<<<<<<<<<
     *
     *     cdef float dpos = (pos0_max - pos0_min) / (< float > (bins))
     */
        __pyx_t_3 = PyFloat_FromDouble(__pyx_v_pos1_maxin); 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_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_9 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__finfo); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_9);
        __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 = 118; __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 = 118; __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 = 118; __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 = PyObject_Call(__pyx_t_9, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
        __pyx_t_1 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__eps); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_4 = PyNumber_Add(__pyx_int_1, __pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_t_1 = PyNumber_Multiply(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_17 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_17 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_v_pos1_max = __pyx_t_17;
        goto __pyx_L8;
      }
      __pyx_L8:;

     119:

     120:     cdef float dpos = (pos0_max - pos0_min) / (< float > (bins))

      /* "splitBBox.pyx":120
     *         pos1_max = pos1_maxin * (1 + numpy.finfo(numpy.float32).eps)
     *
     *     cdef float dpos = (pos0_max - pos0_min) / (< float > (bins))             # <<<<<<<<<<<<<<
     *     cdef long   bin = 0
     *     cdef long   i, idx
     */
      __pyx_v_dpos = ((__pyx_v_pos0_max - __pyx_v_pos0_min) / ((float)__pyx_v_bins));

     121:     cdef long   bin = 0

      /* "splitBBox.pyx":121
     *
     *     cdef float dpos = (pos0_max - pos0_min) / (< float > (bins))
     *     cdef long   bin = 0             # <<<<<<<<<<<<<<
     *     cdef long   i, idx
     *     cdef long   bin0_max, bin0_min
     */
      __pyx_v_bin = 0;

     122:     cdef long   i, idx

     123:     cdef long   bin0_max, bin0_min

     124:     cdef double epsilon = 1e-10

      /* "splitBBox.pyx":124
     *     cdef long   i, idx
     *     cdef long   bin0_max, bin0_min
     *     cdef double epsilon = 1e-10             # <<<<<<<<<<<<<<
     *
     *     with nogil:
     */
      __pyx_v_epsilon = 1e-10;

     125:

     126:     with nogil:

      /* "splitBBox.pyx":126
     *     cdef double epsilon = 1e-10
     *
     *     with nogil:             # <<<<<<<<<<<<<<
     *         for i in range(bins):
     *                 outPos[i] = pos0_min + (0.5 +< float > i) * dpos
     */
      {
          #ifdef WITH_THREAD
          PyThreadState *_save = NULL;
          #endif
          Py_UNBLOCK_THREADS
          /*try:*/ {

          /* "splitBBox.pyx":126
     *     cdef double epsilon = 1e-10
     *
     *     with nogil:             # <<<<<<<<<<<<<<
     *         for i in range(bins):
     *                 outPos[i] = pos0_min + (0.5 +< float > i) * dpos
     */
          /*finally:*/ {
            Py_BLOCK_THREADS
          }
      }

     127:         for i in range(bins):

            /* "splitBBox.pyx":127
     *
     *     with nogil:
     *         for i in range(bins):             # <<<<<<<<<<<<<<
     *                 outPos[i] = pos0_min + (0.5 +< float > i) * dpos
     *
     */
            __pyx_t_2 = __pyx_v_bins;
            for (__pyx_t_24 = 0; __pyx_t_24 < __pyx_t_2; __pyx_t_24+=1) {
              __pyx_v_i = __pyx_t_24;

     128:                 outPos[i] = pos0_min + (0.5 +< float > i) * dpos

              /* "splitBBox.pyx":128
     *     with nogil:
     *         for i in range(bins):
     *                 outPos[i] = pos0_min + (0.5 +< float > i) * dpos             # <<<<<<<<<<<<<<
     *
     *         for idx in range(size):
     */
              __pyx_t_25 = __pyx_v_i;
              *__Pyx_BufPtrStrided1d(__pyx_t_9splitBBox_DTYPE_float32_t *, __pyx_pybuffernd_outPos.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_outPos.diminfo[0].strides) = (__pyx_v_pos0_min + ((0.5 + ((float)__pyx_v_i)) * __pyx_v_dpos));
            }

     129:

     130:         for idx in range(size):

            /* "splitBBox.pyx":130
     *                 outPos[i] = pos0_min + (0.5 +< float > i) * dpos
     *
     *         for idx in range(size):             # <<<<<<<<<<<<<<
     *             data = < double > cdata[idx]
     *             min0 = cpos0_inf[idx]
     */
            __pyx_t_2 = __pyx_v_size;
            for (__pyx_t_24 = 0; __pyx_t_24 < __pyx_t_2; __pyx_t_24+=1) {
              __pyx_v_idx = __pyx_t_24;

     131:             data = < double > cdata[idx]

              /* "splitBBox.pyx":131
     *
     *         for idx in range(size):
     *             data = < double > cdata[idx]             # <<<<<<<<<<<<<<
     *             min0 = cpos0_inf[idx]
     *             max0 = cpos0_sup[idx]
     */
              __pyx_t_26 = __pyx_v_idx;
              __pyx_v_data = ((double)(*__Pyx_BufPtrStrided1d(__pyx_t_9splitBBox_DTYPE_float64_t *, __pyx_pybuffernd_cdata.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_cdata.diminfo[0].strides)));

     132:             min0 = cpos0_inf[idx]

              /* "splitBBox.pyx":132
     *         for idx in range(size):
     *             data = < double > cdata[idx]
     *             min0 = cpos0_inf[idx]             # <<<<<<<<<<<<<<
     *             max0 = cpos0_sup[idx]
     *             if checkpos1:
     */
              __pyx_t_27 = __pyx_v_idx;
              __pyx_v_min0 = (*__Pyx_BufPtrStrided1d(__pyx_t_9splitBBox_DTYPE_float32_t *, __pyx_pybuffernd_cpos0_inf.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_cpos0_inf.diminfo[0].strides));

     133:             max0 = cpos0_sup[idx]

              /* "splitBBox.pyx":133
     *             data = < double > cdata[idx]
     *             min0 = cpos0_inf[idx]
     *             max0 = cpos0_sup[idx]             # <<<<<<<<<<<<<<
     *             if checkpos1:
     *                 if (cpos1_inf[idx] < pos1_min) or (cpos1_sup[idx] > pos1_max):
     */
              __pyx_t_28 = __pyx_v_idx;
              __pyx_v_max0 = (*__Pyx_BufPtrStrided1d(__pyx_t_9splitBBox_DTYPE_float32_t *, __pyx_pybuffernd_cpos0_sup.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_cpos0_sup.diminfo[0].strides));

     134:             if checkpos1:

              /* "splitBBox.pyx":134
     *             min0 = cpos0_inf[idx]
     *             max0 = cpos0_sup[idx]
     *             if checkpos1:             # <<<<<<<<<<<<<<
     *                 if (cpos1_inf[idx] < pos1_min) or (cpos1_sup[idx] > pos1_max):
     *                     continue
     */
              if (__pyx_v_checkpos1) {

     135:                 if (cpos1_inf[idx] < pos1_min) or (cpos1_sup[idx] > pos1_max):

                /* "splitBBox.pyx":135
     *             max0 = cpos0_sup[idx]
     *             if checkpos1:
     *                 if (cpos1_inf[idx] < pos1_min) or (cpos1_sup[idx] > pos1_max):             # <<<<<<<<<<<<<<
     *                     continue
     *
     */
                __pyx_t_29 = __pyx_v_idx;
                __pyx_t_15 = ((*__Pyx_BufPtrStrided1d(__pyx_t_9splitBBox_DTYPE_float32_t *, __pyx_pybuffernd_cpos1_inf.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_cpos1_inf.diminfo[0].strides)) < __pyx_v_pos1_min);
                if (!__pyx_t_15) {
                  __pyx_t_30 = __pyx_v_idx;
                  __pyx_t_16 = ((*__Pyx_BufPtrStrided1d(__pyx_t_9splitBBox_DTYPE_float32_t *, __pyx_pybuffernd_cpos1_sup.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_cpos1_sup.diminfo[0].strides)) > __pyx_v_pos1_max);
                  __pyx_t_5 = __pyx_t_16;
                } else {
                  __pyx_t_5 = __pyx_t_15;
                }
                if (__pyx_t_5) {

     136:                     continue

                  /* "splitBBox.pyx":136
     *             if checkpos1:
     *                 if (cpos1_inf[idx] < pos1_min) or (cpos1_sup[idx] > pos1_max):
     *                     continue             # <<<<<<<<<<<<<<
     *
     *             fbin0_min = getBinNr(min0, pos0_min, dpos)
     */
                  goto __pyx_L14_continue;
                  goto __pyx_L17;
                }
                __pyx_L17:;
                goto __pyx_L16;
              }
              __pyx_L16:;

     137:

     138:             fbin0_min = getBinNr(min0, pos0_min, dpos)

              /* "splitBBox.pyx":138
     *                     continue
     *
     *             fbin0_min = getBinNr(min0, pos0_min, dpos)             # <<<<<<<<<<<<<<
     *             fbin0_max = getBinNr(max0, pos0_min, dpos)
     *             bin0_min = < long > floor(fbin0_min)
     */
              __pyx_v_fbin0_min = __pyx_f_9splitBBox_getBinNr(__pyx_v_min0, __pyx_v_pos0_min, __pyx_v_dpos);

     139:             fbin0_max = getBinNr(max0, pos0_min, dpos)

              /* "splitBBox.pyx":139
     *
     *             fbin0_min = getBinNr(min0, pos0_min, dpos)
     *             fbin0_max = getBinNr(max0, pos0_min, dpos)             # <<<<<<<<<<<<<<
     *             bin0_min = < long > floor(fbin0_min)
     *             bin0_max = < long > floor(fbin0_max)
     */
              __pyx_v_fbin0_max = __pyx_f_9splitBBox_getBinNr(__pyx_v_max0, __pyx_v_pos0_min, __pyx_v_dpos);

     140:             bin0_min = < long > floor(fbin0_min)

              /* "splitBBox.pyx":140
     *             fbin0_min = getBinNr(min0, pos0_min, dpos)
     *             fbin0_max = getBinNr(max0, pos0_min, dpos)
     *             bin0_min = < long > floor(fbin0_min)             # <<<<<<<<<<<<<<
     *             bin0_max = < long > floor(fbin0_max)
     *
     */
              __pyx_v_bin0_min = ((long)floor(__pyx_v_fbin0_min));

     141:             bin0_max = < long > floor(fbin0_max)

              /* "splitBBox.pyx":141
     *             fbin0_max = getBinNr(max0, pos0_min, dpos)
     *             bin0_min = < long > floor(fbin0_min)
     *             bin0_max = < long > floor(fbin0_max)             # <<<<<<<<<<<<<<
     *
     *             if bin0_min == bin0_max:
     */
              __pyx_v_bin0_max = ((long)floor(__pyx_v_fbin0_max));

     142:

     143:             if bin0_min == bin0_max:

              /* "splitBBox.pyx":143
     *             bin0_max = < long > floor(fbin0_max)
     *
     *             if bin0_min == bin0_max:             # <<<<<<<<<<<<<<
     *                 #All pixel is within a single bin
     *                 outCount[bin0_min] += < double > 1.0
     */
              __pyx_t_5 = (__pyx_v_bin0_min == __pyx_v_bin0_max);
              if (__pyx_t_5) {

     144:                 #All pixel is within a single bin

     145:                 outCount[bin0_min] += < double > 1.0

                /* "splitBBox.pyx":145
     *             if bin0_min == bin0_max:
     *                 #All pixel is within a single bin
     *                 outCount[bin0_min] += < double > 1.0             # <<<<<<<<<<<<<<
     *                 outData[bin0_min] += < double > data
     *
     */
                __pyx_t_31 = __pyx_v_bin0_min;
                *__Pyx_BufPtrStrided1d(__pyx_t_9splitBBox_DTYPE_float64_t *, __pyx_pybuffernd_outCount.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_outCount.diminfo[0].strides) += ((double)1.0);

     146:                 outData[bin0_min] += < double > data

                /* "splitBBox.pyx":146
     *                 #All pixel is within a single bin
     *                 outCount[bin0_min] += < double > 1.0
     *                 outData[bin0_min] += < double > data             # <<<<<<<<<<<<<<
     *
     *             else: #we have pixel spliting.
     */
                __pyx_t_32 = __pyx_v_bin0_min;
                *__Pyx_BufPtrStrided1d(__pyx_t_9splitBBox_DTYPE_float64_t *, __pyx_pybuffernd_outData.rcbuffer->pybuffer.buf, __pyx_t_32, __pyx_pybuffernd_outData.diminfo[0].strides) += ((double)__pyx_v_data);
                goto __pyx_L18;
              }
              /*else*/ {

     147:

     148:             else: #we have pixel spliting.

     149:                 deltaA = 1.0 / (fbin0_max - fbin0_min)

                /* "splitBBox.pyx":149
     *
     *             else: #we have pixel spliting.
     *                 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));

     150:

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

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

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

                /* "splitBBox.pyx":152
     *
     *                 deltaL = < float > (bin0_min + 1) - fbin0_min
     *                 deltaR = fbin0_max - (< float > bin0_max)             # <<<<<<<<<<<<<<
     *
     *                 outCount[bin0_min] += < double > deltaA * deltaL
     */
                __pyx_v_deltaR = (__pyx_v_fbin0_max - ((float)__pyx_v_bin0_max));

     153:

     154:                 outCount[bin0_min] += < double > deltaA * deltaL

                /* "splitBBox.pyx":154
     *                 deltaR = fbin0_max - (< float > bin0_max)
     *
     *                 outCount[bin0_min] += < double > deltaA * deltaL             # <<<<<<<<<<<<<<
     *                 outData[bin0_min] += < double > data * deltaA * deltaL
     *
     */
                __pyx_t_33 = __pyx_v_bin0_min;
                *__Pyx_BufPtrStrided1d(__pyx_t_9splitBBox_DTYPE_float64_t *, __pyx_pybuffernd_outCount.rcbuffer->pybuffer.buf, __pyx_t_33, __pyx_pybuffernd_outCount.diminfo[0].strides) += (((double)__pyx_v_deltaA) * __pyx_v_deltaL);

     155:                 outData[bin0_min] += < double > data * deltaA * deltaL

                /* "splitBBox.pyx":155
     *
     *                 outCount[bin0_min] += < double > deltaA * deltaL
     *                 outData[bin0_min] += < double > data * deltaA * deltaL             # <<<<<<<<<<<<<<
     *
     *                 outCount[bin0_max] += < double > deltaA * deltaR
     */
                __pyx_t_34 = __pyx_v_bin0_min;
                *__Pyx_BufPtrStrided1d(__pyx_t_9splitBBox_DTYPE_float64_t *, __pyx_pybuffernd_outData.rcbuffer->pybuffer.buf, __pyx_t_34, __pyx_pybuffernd_outData.diminfo[0].strides) += ((((double)__pyx_v_data) * __pyx_v_deltaA) * __pyx_v_deltaL);

     156:

     157:                 outCount[bin0_max] += < double > deltaA * deltaR

                /* "splitBBox.pyx":157
     *                 outData[bin0_min] += < double > data * deltaA * deltaL
     *
     *                 outCount[bin0_max] += < double > deltaA * deltaR             # <<<<<<<<<<<<<<
     *                 outData[bin0_max] += < double > data * deltaA * deltaR
     *
     */
                __pyx_t_35 = __pyx_v_bin0_max;
                *__Pyx_BufPtrStrided1d(__pyx_t_9splitBBox_DTYPE_float64_t *, __pyx_pybuffernd_outCount.rcbuffer->pybuffer.buf, __pyx_t_35, __pyx_pybuffernd_outCount.diminfo[0].strides) += (((double)__pyx_v_deltaA) * __pyx_v_deltaR);

     158:                 outData[bin0_max] += < double > data * deltaA * deltaR

                /* "splitBBox.pyx":158
     *
     *                 outCount[bin0_max] += < double > deltaA * deltaR
     *                 outData[bin0_max] += < double > data * deltaA * deltaR             # <<<<<<<<<<<<<<
     *
     *                 if bin0_min + 1 < bin0_max:
     */
                __pyx_t_36 = __pyx_v_bin0_max;
                *__Pyx_BufPtrStrided1d(__pyx_t_9splitBBox_DTYPE_float64_t *, __pyx_pybuffernd_outData.rcbuffer->pybuffer.buf, __pyx_t_36, __pyx_pybuffernd_outData.diminfo[0].strides) += ((((double)__pyx_v_data) * __pyx_v_deltaA) * __pyx_v_deltaR);

     159:

     160:                 if bin0_min + 1 < bin0_max:

                /* "splitBBox.pyx":160
     *                 outData[bin0_max] += < double > data * deltaA * deltaR
     *
     *                 if bin0_min + 1 < bin0_max:             # <<<<<<<<<<<<<<
     *                     for i in range(bin0_min + 1, bin0_max):
     *                         outCount[i] += < double > deltaA
     */
                __pyx_t_5 = ((__pyx_v_bin0_min + 1) < __pyx_v_bin0_max);
                if (__pyx_t_5) {

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

                  /* "splitBBox.pyx":161
     *
     *                 if bin0_min + 1 < bin0_max:
     *                     for i in range(bin0_min + 1, bin0_max):             # <<<<<<<<<<<<<<
     *                         outCount[i] += < double > deltaA
     *                         outData[i] += data * < double > deltaA
     */
                  __pyx_t_37 = __pyx_v_bin0_max;
                  for (__pyx_t_38 = (__pyx_v_bin0_min + 1); __pyx_t_38 < __pyx_t_37; __pyx_t_38+=1) {
                    __pyx_v_i = __pyx_t_38;

     162:                         outCount[i] += < double > deltaA

                    /* "splitBBox.pyx":162
     *                 if bin0_min + 1 < bin0_max:
     *                     for i in range(bin0_min + 1, bin0_max):
     *                         outCount[i] += < double > deltaA             # <<<<<<<<<<<<<<
     *                         outData[i] += data * < double > deltaA
     *
     */
                    __pyx_t_39 = __pyx_v_i;
                    *__Pyx_BufPtrStrided1d(__pyx_t_9splitBBox_DTYPE_float64_t *, __pyx_pybuffernd_outCount.rcbuffer->pybuffer.buf, __pyx_t_39, __pyx_pybuffernd_outCount.diminfo[0].strides) += ((double)__pyx_v_deltaA);

     163:                         outData[i] += data * < double > deltaA

                    /* "splitBBox.pyx":163
     *                     for i in range(bin0_min + 1, bin0_max):
     *                         outCount[i] += < double > deltaA
     *                         outData[i] += data * < double > deltaA             # <<<<<<<<<<<<<<
     *
     *         for i in range(bins):
     */
                    __pyx_t_40 = __pyx_v_i;
                    *__Pyx_BufPtrStrided1d(__pyx_t_9splitBBox_DTYPE_float64_t *, __pyx_pybuffernd_outData.rcbuffer->pybuffer.buf, __pyx_t_40, __pyx_pybuffernd_outData.diminfo[0].strides) += (__pyx_v_data * ((double)__pyx_v_deltaA));
                  }
                  goto __pyx_L19;
                }
                __pyx_L19:;
              }
              __pyx_L18:;
              __pyx_L14_continue:;
            }

     164:

     165:         for i in range(bins):

            /* "splitBBox.pyx":165
     *                         outData[i] += data * < double > deltaA
     *
     *         for i in range(bins):             # <<<<<<<<<<<<<<
     *                 if outCount[i] > epsilon:
     *                     outMerge[i] = < float > (outData[i] / outCount[i])
     */
            __pyx_t_2 = __pyx_v_bins;
            for (__pyx_t_24 = 0; __pyx_t_24 < __pyx_t_2; __pyx_t_24+=1) {
              __pyx_v_i = __pyx_t_24;

     166:                 if outCount[i] > epsilon:

              /* "splitBBox.pyx":166
     *
     *         for i in range(bins):
     *                 if outCount[i] > epsilon:             # <<<<<<<<<<<<<<
     *                     outMerge[i] = < float > (outData[i] / outCount[i])
     *                 else:
     */
              __pyx_t_37 = __pyx_v_i;
              __pyx_t_5 = ((*__Pyx_BufPtrStrided1d(__pyx_t_9splitBBox_DTYPE_float64_t *, __pyx_pybuffernd_outCount.rcbuffer->pybuffer.buf, __pyx_t_37, __pyx_pybuffernd_outCount.diminfo[0].strides)) > __pyx_v_epsilon);
              if (__pyx_t_5) {

     167:                     outMerge[i] = < float > (outData[i] / outCount[i])

                /* "splitBBox.pyx":167
     *         for i in range(bins):
     *                 if outCount[i] > epsilon:
     *                     outMerge[i] = < float > (outData[i] / outCount[i])             # <<<<<<<<<<<<<<
     *                 else:
     *                     outMerge[i] = dummy
     */
                __pyx_t_38 = __pyx_v_i;
                __pyx_t_41 = __pyx_v_i;
                __pyx_t_42 = __pyx_v_i;
                *__Pyx_BufPtrStrided1d(__pyx_t_9splitBBox_DTYPE_float32_t *, __pyx_pybuffernd_outMerge.rcbuffer->pybuffer.buf, __pyx_t_42, __pyx_pybuffernd_outMerge.diminfo[0].strides) = ((float)((*__Pyx_BufPtrStrided1d(__pyx_t_9splitBBox_DTYPE_float64_t *, __pyx_pybuffernd_outData.rcbuffer->pybuffer.buf, __pyx_t_38, __pyx_pybuffernd_outData.diminfo[0].strides)) / (*__Pyx_BufPtrStrided1d(__pyx_t_9splitBBox_DTYPE_float64_t *, __pyx_pybuffernd_outCount.rcbuffer->pybuffer.buf, __pyx_t_41, __pyx_pybuffernd_outCount.diminfo[0].strides))));
                goto __pyx_L24;
              }
              /*else*/ {

     168:                 else:

     169:                     outMerge[i] = dummy

                /* "splitBBox.pyx":169
     *                     outMerge[i] = < float > (outData[i] / outCount[i])
     *                 else:
     *                     outMerge[i] = dummy             # <<<<<<<<<<<<<<
     *
     *     return  outPos, outMerge, outData, outCount
     */
                __pyx_t_43 = __pyx_v_i;
                *__Pyx_BufPtrStrided1d(__pyx_t_9splitBBox_DTYPE_float32_t *, __pyx_pybuffernd_outMerge.rcbuffer->pybuffer.buf, __pyx_t_43, __pyx_pybuffernd_outMerge.diminfo[0].strides) = __pyx_v_dummy;
              }
              __pyx_L24:;
            }
          }

     170:

     171:     return  outPos, outMerge, outData, outCount

      /* "splitBBox.pyx":171
     *                     outMerge[i] = dummy
     *
     *     return  outPos, outMerge, outData, outCount             # <<<<<<<<<<<<<<
     *
     *
     */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_INCREF(((PyObject *)__pyx_v_outPos));
      PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_outPos));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_outPos));
      __Pyx_INCREF(((PyObject *)__pyx_v_outMerge));
      PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_outMerge));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_outMerge));
      __Pyx_INCREF(((PyObject *)__pyx_v_outData));
      PyTuple_SET_ITEM(__pyx_t_1, 2, ((PyObject *)__pyx_v_outData));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_outData));
      __Pyx_INCREF(((PyObject *)__pyx_v_outCount));
      PyTuple_SET_ITEM(__pyx_t_1, 3, ((PyObject *)__pyx_v_outCount));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_outCount));
      __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_XDECREF(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_9);
      { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
        __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
        __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_outMerge.rcbuffer->pybuffer);
        __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_cpos0_inf.rcbuffer->pybuffer);
        __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_outPos.rcbuffer->pybuffer);
        __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_cpos0_sup.rcbuffer->pybuffer);
        __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_cpos1_sup.rcbuffer->pybuffer);
        __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_outCount.rcbuffer->pybuffer);
        __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_cdata.rcbuffer->pybuffer);
        __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_outData.rcbuffer->pybuffer);
        __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_cpos1_inf.rcbuffer->pybuffer);
      __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
      __Pyx_AddTraceback("splitBBox.histoBBox1d", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      goto __pyx_L2;
      __pyx_L0:;
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_outMerge.rcbuffer->pybuffer);
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_cpos0_inf.rcbuffer->pybuffer);
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_outPos.rcbuffer->pybuffer);
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_cpos0_sup.rcbuffer->pybuffer);
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_cpos1_sup.rcbuffer->pybuffer);
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_outCount.rcbuffer->pybuffer);
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_cdata.rcbuffer->pybuffer);
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_outData.rcbuffer->pybuffer);
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_cpos1_inf.rcbuffer->pybuffer);
      __pyx_L2:;
      __Pyx_XDECREF((PyObject *)__pyx_v_cdata);
      __Pyx_XDECREF((PyObject *)__pyx_v_cpos0_inf);
      __Pyx_XDECREF((PyObject *)__pyx_v_cpos0_sup);
      __Pyx_XDECREF((PyObject *)__pyx_v_cpos1_inf);
      __Pyx_XDECREF((PyObject *)__pyx_v_cpos1_sup);
      __Pyx_XDECREF((PyObject *)__pyx_v_outData);
      __Pyx_XDECREF((PyObject *)__pyx_v_outCount);
      __Pyx_XDECREF((PyObject *)__pyx_v_outMerge);
      __Pyx_XDECREF((PyObject *)__pyx_v_outPos);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

     172:

     173:

     174:

     175:

     176: @cython.cdivision(True)

     177: @cython.boundscheck(False)

     178: @cython.wraparound(False)

     179: def histoBBox2d(numpy.ndarray weights not None,

    /* "splitBBox.pyx":179
     * @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_9splitBBox_1histoBBox2d(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
    static char __pyx_doc_9splitBBox_1histoBBox2d[] = "\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 \n    @return 2theta, I, weighted histogram, unweighted histogram\n    @return  I, edges0, edges1, weighted histogram(2D), unweighted histogram (2D)\n    ";
    static PyMethodDef __pyx_mdef_9splitBBox_1histoBBox2d = {__Pyx_NAMESTR("histoBBox2d"), (PyCFunction)__pyx_pf_9splitBBox_1histoBBox2d, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_9splitBBox_1histoBBox2d)};
    static PyObject *__pyx_pf_9splitBBox_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;
      float __pyx_v_dummy;
      long __pyx_v_bins0;
      long __pyx_v_bins1;
      long __pyx_v_i;
      long __pyx_v_j;
      long __pyx_v_idx;
      long __pyx_v_size;
      PyArrayObject *__pyx_v_cdata = 0;
      PyArrayObject *__pyx_v_cpos0 = 0;
      PyArrayObject *__pyx_v_cdelta_pos0 = 0;
      PyArrayObject *__pyx_v_cpos0_inf = 0;
      PyArrayObject *__pyx_v_cpos0_sup = 0;
      PyArrayObject *__pyx_v_cpos1 = 0;
      PyArrayObject *__pyx_v_cdelta_pos1 = 0;
      PyArrayObject *__pyx_v_cpos1_inf = 0;
      PyArrayObject *__pyx_v_cpos1_sup = 0;
      PyArrayObject *__pyx_v_outData = 0;
      PyArrayObject *__pyx_v_outCount = 0;
      PyArrayObject *__pyx_v_outMerge = 0;
      PyArrayObject *__pyx_v_edges0 = 0;
      PyArrayObject *__pyx_v_edges1 = 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_tmp;
      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;
      long __pyx_v_bin0_max;
      long __pyx_v_bin0_min;
      long __pyx_v_bin1_max;
      long __pyx_v_bin1_min;
      double __pyx_v_epsilon;
      double __pyx_v_data;
      float __pyx_v_dpos0;
      float __pyx_v_dpos1;
      __Pyx_LocalBuf_ND __pyx_pybuffernd_outMerge;
      __Pyx_Buffer __pyx_pybuffer_outMerge;
      __Pyx_LocalBuf_ND __pyx_pybuffernd_cpos0_inf;
      __Pyx_Buffer __pyx_pybuffer_cpos0_inf;
      __Pyx_LocalBuf_ND __pyx_pybuffernd_cdelta_pos1;
      __Pyx_Buffer __pyx_pybuffer_cdelta_pos1;
      __Pyx_LocalBuf_ND __pyx_pybuffernd_cdelta_pos0;
      __Pyx_Buffer __pyx_pybuffer_cdelta_pos0;
      __Pyx_LocalBuf_ND __pyx_pybuffernd_edges0;
      __Pyx_Buffer __pyx_pybuffer_edges0;
      __Pyx_LocalBuf_ND __pyx_pybuffernd_cpos0_sup;
      __Pyx_Buffer __pyx_pybuffer_cpos0_sup;
      __Pyx_LocalBuf_ND __pyx_pybuffernd_edges1;
      __Pyx_Buffer __pyx_pybuffer_edges1;
      __Pyx_LocalBuf_ND __pyx_pybuffernd_cpos1_sup;
      __Pyx_Buffer __pyx_pybuffer_cpos1_sup;
      __Pyx_LocalBuf_ND __pyx_pybuffernd_outCount;
      __Pyx_Buffer __pyx_pybuffer_outCount;
      __Pyx_LocalBuf_ND __pyx_pybuffernd_cdata;
      __Pyx_Buffer __pyx_pybuffer_cdata;
      __Pyx_LocalBuf_ND __pyx_pybuffernd_cpos1;
      __Pyx_Buffer __pyx_pybuffer_cpos1;
      __Pyx_LocalBuf_ND __pyx_pybuffernd_cpos0;
      __Pyx_Buffer __pyx_pybuffer_cpos0;
      __Pyx_LocalBuf_ND __pyx_pybuffernd_outData;
      __Pyx_Buffer __pyx_pybuffer_outData;
      __Pyx_LocalBuf_ND __pyx_pybuffernd_cpos1_inf;
      __Pyx_Buffer __pyx_pybuffer_cpos1_inf;
      PyObject *__pyx_r = NULL;
      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,0};
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("histoBBox2d");
      __pyx_self = __pyx_self;
      {
        PyObject* values[9] = {0,0,0,0,0,0,0,0,0};

      /* "splitBBox.pyx":179
     * @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_27 = PyTuple_New(57); if (unlikely(!__pyx_k_tuple_27)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_k_tuple_27);
      __Pyx_INCREF(((PyObject *)__pyx_n_s__weights));
      PyTuple_SET_ITEM(__pyx_k_tuple_27, 0, ((PyObject *)__pyx_n_s__weights));
      __Pyx_GIVEREF(((PyObject *)__pyx_n_s__weights));
      __Pyx_INCREF(((PyObject *)__pyx_n_s__pos0));
      PyTuple_SET_ITEM(__pyx_k_tuple_27, 1, ((PyObject *)__pyx_n_s__pos0));
      __Pyx_GIVEREF(((PyObject *)__pyx_n_s__pos0));
      __Pyx_INCREF(((PyObject *)__pyx_n_s__delta_pos0));
      PyTuple_SET_ITEM(__pyx_k_tuple_27, 2, ((PyObject *)__pyx_n_s__delta_pos0));
      __Pyx_GIVEREF(((PyObject *)__pyx_n_s__delta_pos0));
      __Pyx_INCREF(((PyObject *)__pyx_n_s__pos1));
      PyTuple_SET_ITEM(__pyx_k_tuple_27, 3, ((PyObject *)__pyx_n_s__pos1));
      __Pyx_GIVEREF(((PyObject *)__pyx_n_s__pos1));
      __Pyx_INCREF(((PyObject *)__pyx_n_s__delta_pos1));
      PyTuple_SET_ITEM(__pyx_k_tuple_27, 4, ((PyObject *)__pyx_n_s__delta_pos1));
      __Pyx_GIVEREF(((PyObject *)__pyx_n_s__delta_pos1));
      __Pyx_INCREF(((PyObject *)__pyx_n_s__bins));
      PyTuple_SET_ITEM(__pyx_k_tuple_27, 5, ((PyObject *)__pyx_n_s__bins));
      __Pyx_GIVEREF(((PyObject *)__pyx_n_s__bins));
      __Pyx_INCREF(((PyObject *)__pyx_n_s__pos0Range));
      PyTuple_SET_ITEM(__pyx_k_tuple_27, 6, ((PyObject *)__pyx_n_s__pos0Range));
      __Pyx_GIVEREF(((PyObject *)__pyx_n_s__pos0Range));
      __Pyx_INCREF(((PyObject *)__pyx_n_s__pos1Range));
      PyTuple_SET_ITEM(__pyx_k_tuple_27, 7, ((PyObject *)__pyx_n_s__pos1Range));
      __Pyx_GIVEREF(((PyObject *)__pyx_n_s__pos1Range));
      __Pyx_INCREF(((PyObject *)__pyx_n_s__dummy));
      PyTuple_SET_ITEM(__pyx_k_tuple_27, 8, ((PyObject *)__pyx_n_s__dummy));
      __Pyx_GIVEREF(((PyObject *)__pyx_n_s__dummy));
      __Pyx_INCREF(((PyObject *)__pyx_n_s__bins0));
      PyTuple_SET_ITEM(__pyx_k_tuple_27, 9, ((PyObject *)__pyx_n_s__bins0));
      __Pyx_GIVEREF(((PyObject *)__pyx_n_s__bins0));
      __Pyx_INCREF(((PyObject *)__pyx_n_s__bins1));
      PyTuple_SET_ITEM(__pyx_k_tuple_27, 10, ((PyObject *)__pyx_n_s__bins1));
      __Pyx_GIVEREF(((PyObject *)__pyx_n_s__bins1));
      __Pyx_INCREF(((PyObject *)__pyx_n_s__i));
      PyTuple_SET_ITEM(__pyx_k_tuple_27, 11, ((PyObject *)__pyx_n_s__i));
      __Pyx_GIVEREF(((PyObject *)__pyx_n_s__i));
      __Pyx_INCREF(((PyObject *)__pyx_n_s__j));
      PyTuple_SET_ITEM(__pyx_k_tuple_27, 12, ((PyObject *)__pyx_n_s__j));
      __Pyx_GIVEREF(((PyObject *)__pyx_n_s__j));
      __Pyx_INCREF(((PyObject *)__pyx_n_s__idx));
      PyTuple_SET_ITEM(__pyx_k_tuple_27, 13, ((PyObject *)__pyx_n_s__idx));
      __Pyx_GIVEREF(((PyObject *)__pyx_n_s__idx));
      __Pyx_INCREF(((PyObject *)__pyx_n_s__size));
      PyTuple_SET_ITEM(__pyx_k_tuple_27, 14, ((PyObject *)__pyx_n_s__size));
      __Pyx_GIVEREF(((PyObject *)__pyx_n_s__size));
      __Pyx_INCREF(((PyObject *)__pyx_n_s__cdata));
      PyTuple_SET_ITEM(__pyx_k_tuple_27, 15, ((PyObject *)__pyx_n_s__cdata));
      __Pyx_GIVEREF(((PyObject *)__pyx_n_s__cdata));
      __Pyx_INCREF(((PyObject *)__pyx_n_s__cpos0));
      PyTuple_SET_ITEM(__pyx_k_tuple_27, 16, ((PyObject *)__pyx_n_s__cpos0));
      __Pyx_GIVEREF(((PyObject *)__pyx_n_s__cpos0));
      __Pyx_INCREF(((PyObject *)__pyx_n_s__cdelta_pos0));
      PyTuple_SET_ITEM(__pyx_k_tuple_27, 17, ((PyObject *)__pyx_n_s__cdelta_pos0));
      __Pyx_GIVEREF(((PyObject *)__pyx_n_s__cdelta_pos0));
      __Pyx_INCREF(((PyObject *)__pyx_n_s__cpos0_inf));
      PyTuple_SET_ITEM(__pyx_k_tuple_27, 18, ((PyObject *)__pyx_n_s__cpos0_inf));
      __Pyx_GIVEREF(((PyObject *)__pyx_n_s__cpos0_inf));
      __Pyx_INCREF(((PyObject *)__pyx_n_s__cpos0_sup));
      PyTuple_SET_ITEM(__pyx_k_tuple_27, 19, ((PyObject *)__pyx_n_s__cpos0_sup));
      __Pyx_GIVEREF(((PyObject *)__pyx_n_s__cpos0_sup));
      __Pyx_INCREF(((PyObject *)__pyx_n_s__cpos1));
      PyTuple_SET_ITEM(__pyx_k_tuple_27, 20, ((PyObject *)__pyx_n_s__cpos1));
      __Pyx_GIVEREF(((PyObject *)__pyx_n_s__cpos1));
      __Pyx_INCREF(((PyObject *)__pyx_n_s__cdelta_pos1));
      PyTuple_SET_ITEM(__pyx_k_tuple_27, 21, ((PyObject *)__pyx_n_s__cdelta_pos1));
      __Pyx_GIVEREF(((PyObject *)__pyx_n_s__cdelta_pos1));
      __Pyx_INCREF(((PyObject *)__pyx_n_s__cpos1_inf));
      PyTuple_SET_ITEM(__pyx_k_tuple_27, 22, ((PyObject *)__pyx_n_s__cpos1_inf));
      __Pyx_GIVEREF(((PyObject *)__pyx_n_s__cpos1_inf));
      __Pyx_INCREF(((PyObject *)__pyx_n_s__cpos1_sup));
      PyTuple_SET_ITEM(__pyx_k_tuple_27, 23, ((PyObject *)__pyx_n_s__cpos1_sup));
      __Pyx_GIVEREF(((PyObject *)__pyx_n_s__cpos1_sup));
      __Pyx_INCREF(((PyObject *)__pyx_n_s__outData));
      PyTuple_SET_ITEM(__pyx_k_tuple_27, 24, ((PyObject *)__pyx_n_s__outData));
      __Pyx_GIVEREF(((PyObject *)__pyx_n_s__outData));
      __Pyx_INCREF(((PyObject *)__pyx_n_s__outCount));
      PyTuple_SET_ITEM(__pyx_k_tuple_27, 25, ((PyObject *)__pyx_n_s__outCount));
      __Pyx_GIVEREF(((PyObject *)__pyx_n_s__outCount));
      __Pyx_INCREF(((PyObject *)__pyx_n_s__outMerge));
      PyTuple_SET_ITEM(__pyx_k_tuple_27, 26, ((PyObject *)__pyx_n_s__outMerge));
      __Pyx_GIVEREF(((PyObject *)__pyx_n_s__outMerge));
      __Pyx_INCREF(((PyObject *)__pyx_n_s__edges0));
      PyTuple_SET_ITEM(__pyx_k_tuple_27, 27, ((PyObject *)__pyx_n_s__edges0));
      __Pyx_GIVEREF(((PyObject *)__pyx_n_s__edges0));
      __Pyx_INCREF(((PyObject *)__pyx_n_s__edges1));
      PyTuple_SET_ITEM(__pyx_k_tuple_27, 28, ((PyObject *)__pyx_n_s__edges1));
      __Pyx_GIVEREF(((PyObject *)__pyx_n_s__edges1));
      __Pyx_INCREF(((PyObject *)__pyx_n_s__min0));
      PyTuple_SET_ITEM(__pyx_k_tuple_27, 29, ((PyObject *)__pyx_n_s__min0));
      __Pyx_GIVEREF(((PyObject *)__pyx_n_s__min0));
      __Pyx_INCREF(((PyObject *)__pyx_n_s__max0));
      PyTuple_SET_ITEM(__pyx_k_tuple_27, 30, ((PyObject *)__pyx_n_s__max0));
      __Pyx_GIVEREF(((PyObject *)__pyx_n_s__max0));
      __Pyx_INCREF(((PyObject *)__pyx_n_s__min1));
      PyTuple_SET_ITEM(__pyx_k_tuple_27, 31, ((PyObject *)__pyx_n_s__min1));
      __Pyx_GIVEREF(((PyObject *)__pyx_n_s__min1));
      __Pyx_INCREF(((PyObject *)__pyx_n_s__max1));
      PyTuple_SET_ITEM(__pyx_k_tuple_27, 32, ((PyObject *)__pyx_n_s__max1));
      __Pyx_GIVEREF(((PyObject *)__pyx_n_s__max1));
      __Pyx_INCREF(((PyObject *)__pyx_n_s__deltaR));
      PyTuple_SET_ITEM(__pyx_k_tuple_27, 33, ((PyObject *)__pyx_n_s__deltaR));
      __Pyx_GIVEREF(((PyObject *)__pyx_n_s__deltaR));
      __Pyx_INCREF(((PyObject *)__pyx_n_s__deltaL));
      PyTuple_SET_ITEM(__pyx_k_tuple_27, 34, ((PyObject *)__pyx_n_s__deltaL));
      __Pyx_GIVEREF(((PyObject *)__pyx_n_s__deltaL));
      __Pyx_INCREF(((PyObject *)__pyx_n_s__deltaU));
      PyTuple_SET_ITEM(__pyx_k_tuple_27, 35, ((PyObject *)__pyx_n_s__deltaU));
      __Pyx_GIVEREF(((PyObject *)__pyx_n_s__deltaU));
      __Pyx_INCREF(((PyObject *)__pyx_n_s__deltaD));
      PyTuple_SET_ITEM(__pyx_k_tuple_27, 36, ((PyObject *)__pyx_n_s__deltaD));
      __Pyx_GIVEREF(((PyObject *)__pyx_n_s__deltaD));
      __Pyx_INCREF(((PyObject *)__pyx_n_s__deltaA));
      PyTuple_SET_ITEM(__pyx_k_tuple_27, 37, ((PyObject *)__pyx_n_s__deltaA));
      __Pyx_GIVEREF(((PyObject *)__pyx_n_s__deltaA));
      __Pyx_INCREF(((PyObject *)__pyx_n_s__tmp));
      PyTuple_SET_ITEM(__pyx_k_tuple_27, 38, ((PyObject *)__pyx_n_s__tmp));
      __Pyx_GIVEREF(((PyObject *)__pyx_n_s__tmp));
      __Pyx_INCREF(((PyObject *)__pyx_n_s__pos0_min));
      PyTuple_SET_ITEM(__pyx_k_tuple_27, 39, ((PyObject *)__pyx_n_s__pos0_min));
      __Pyx_GIVEREF(((PyObject *)__pyx_n_s__pos0_min));
      __Pyx_INCREF(((PyObject *)__pyx_n_s__pos0_max));
      PyTuple_SET_ITEM(__pyx_k_tuple_27, 40, ((PyObject *)__pyx_n_s__pos0_max));
      __Pyx_GIVEREF(((PyObject *)__pyx_n_s__pos0_max));
      __Pyx_INCREF(((PyObject *)__pyx_n_s__pos1_min));
      PyTuple_SET_ITEM(__pyx_k_tuple_27, 41, ((PyObject *)__pyx_n_s__pos1_min));
      __Pyx_GIVEREF(((PyObject *)__pyx_n_s__pos1_min));
      __Pyx_INCREF(((PyObject *)__pyx_n_s__pos1_max));
      PyTuple_SET_ITEM(__pyx_k_tuple_27, 42, ((PyObject *)__pyx_n_s__pos1_max));
      __Pyx_GIVEREF(((PyObject *)__pyx_n_s__pos1_max));
      __Pyx_INCREF(((PyObject *)__pyx_n_s__pos0_maxin));
      PyTuple_SET_ITEM(__pyx_k_tuple_27, 43, ((PyObject *)__pyx_n_s__pos0_maxin));
      __Pyx_GIVEREF(((PyObject *)__pyx_n_s__pos0_maxin));
      __Pyx_INCREF(((PyObject *)__pyx_n_s__pos1_maxin));
      PyTuple_SET_ITEM(__pyx_k_tuple_27, 44, ((PyObject *)__pyx_n_s__pos1_maxin));
      __Pyx_GIVEREF(((PyObject *)__pyx_n_s__pos1_maxin));
      __Pyx_INCREF(((PyObject *)__pyx_n_s__fbin0_min));
      PyTuple_SET_ITEM(__pyx_k_tuple_27, 45, ((PyObject *)__pyx_n_s__fbin0_min));
      __Pyx_GIVEREF(((PyObject *)__pyx_n_s__fbin0_min));
      __Pyx_INCREF(((PyObject *)__pyx_n_s__fbin0_max));
      PyTuple_SET_ITEM(__pyx_k_tuple_27, 46, ((PyObject *)__pyx_n_s__fbin0_max));
      __Pyx_GIVEREF(((PyObject *)__pyx_n_s__fbin0_max));
      __Pyx_INCREF(((PyObject *)__pyx_n_s__fbin1_min));
      PyTuple_SET_ITEM(__pyx_k_tuple_27, 47, ((PyObject *)__pyx_n_s__fbin1_min));
      __Pyx_GIVEREF(((PyObject *)__pyx_n_s__fbin1_min));
      __Pyx_INCREF(((PyObject *)__pyx_n_s__fbin1_max));
      PyTuple_SET_ITEM(__pyx_k_tuple_27, 48, ((PyObject *)__pyx_n_s__fbin1_max));
      __Pyx_GIVEREF(((PyObject *)__pyx_n_s__fbin1_max));
      __Pyx_INCREF(((PyObject *)__pyx_n_s__bin0_max));
      PyTuple_SET_ITEM(__pyx_k_tuple_27, 49, ((PyObject *)__pyx_n_s__bin0_max));
      __Pyx_GIVEREF(((PyObject *)__pyx_n_s__bin0_max));
      __Pyx_INCREF(((PyObject *)__pyx_n_s__bin0_min));
      PyTuple_SET_ITEM(__pyx_k_tuple_27, 50, ((PyObject *)__pyx_n_s__bin0_min));
      __Pyx_GIVEREF(((PyObject *)__pyx_n_s__bin0_min));
      __Pyx_INCREF(((PyObject *)__pyx_n_s__bin1_max));
      PyTuple_SET_ITEM(__pyx_k_tuple_27, 51, ((PyObject *)__pyx_n_s__bin1_max));
      __Pyx_GIVEREF(((PyObject *)__pyx_n_s__bin1_max));
      __Pyx_INCREF(((PyObject *)__pyx_n_s__bin1_min));
      PyTuple_SET_ITEM(__pyx_k_tuple_27, 52, ((PyObject *)__pyx_n_s__bin1_min));
      __Pyx_GIVEREF(((PyObject *)__pyx_n_s__bin1_min));
      __Pyx_INCREF(((PyObject *)__pyx_n_s__epsilon));
      PyTuple_SET_ITEM(__pyx_k_tuple_27, 53, ((PyObject *)__pyx_n_s__epsilon));
      __Pyx_GIVEREF(((PyObject *)__pyx_n_s__epsilon));
      __Pyx_INCREF(((PyObject *)__pyx_n_s__data));
      PyTuple_SET_ITEM(__pyx_k_tuple_27, 54, ((PyObject *)__pyx_n_s__data));
      __Pyx_GIVEREF(((PyObject *)__pyx_n_s__data));
      __Pyx_INCREF(((PyObject *)__pyx_n_s__dpos0));
      PyTuple_SET_ITEM(__pyx_k_tuple_27, 55, ((PyObject *)__pyx_n_s__dpos0));
      __Pyx_GIVEREF(((PyObject *)__pyx_n_s__dpos0));
      __Pyx_INCREF(((PyObject *)__pyx_n_s__dpos1));
      PyTuple_SET_ITEM(__pyx_k_tuple_27, 56, ((PyObject *)__pyx_n_s__dpos1));
      __Pyx_GIVEREF(((PyObject *)__pyx_n_s__dpos1));
      __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_27));

      /* "splitBBox.pyx":179
     * @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_1 = PyCFunction_NewEx(&__pyx_mdef_9splitBBox_1histoBBox2d, NULL, __pyx_n_s__splitBBox); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      if (PyObject_SetAttr(__pyx_m, __pyx_n_s__histoBBox2d, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

     180:                 numpy.ndarray pos0 not None,

     181:                 numpy.ndarray delta_pos0 not None,

     182:                 numpy.ndarray pos1 not None,

     183:                 numpy.ndarray delta_pos1 not None,

     184:                 bins=(100, 36),

        /* "splitBBox.pyx":184
     *                 numpy.ndarray pos1 not None,
     *                 numpy.ndarray delta_pos1 not None,
     *                 bins=(100, 36),             # <<<<<<<<<<<<<<
     *                 pos0Range=None,
     *                 pos1Range=None,
     */
        values[5] = ((PyObject *)__pyx_k_tuple_6);

      /* "splitBBox.pyx":184
     *                 numpy.ndarray pos1 not None,
     *                 numpy.ndarray delta_pos1 not None,
     *                 bins=(100, 36),             # <<<<<<<<<<<<<<
     *                 pos0Range=None,
     *                 pos1Range=None,
     */
      __pyx_k_tuple_6 = PyTuple_New(2); if (unlikely(!__pyx_k_tuple_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_k_tuple_6);
      __Pyx_INCREF(__pyx_int_100);
      PyTuple_SET_ITEM(__pyx_k_tuple_6, 0, __pyx_int_100);
      __Pyx_GIVEREF(__pyx_int_100);
      __Pyx_INCREF(__pyx_int_36);
      PyTuple_SET_ITEM(__pyx_k_tuple_6, 1, __pyx_int_36);
      __Pyx_GIVEREF(__pyx_int_36);
      __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_6));

     185:                 pos0Range=None,

        /* "splitBBox.pyx":185
     *                 numpy.ndarray delta_pos1 not None,
     *                 bins=(100, 36),
     *                 pos0Range=None,             # <<<<<<<<<<<<<<
     *                 pos1Range=None,
     *                 float dummy=0.0):
     */
        values[6] = ((PyObject *)Py_None);

     186:                 pos1Range=None,

        /* "splitBBox.pyx":186
     *                 bins=(100, 36),
     *                 pos0Range=None,
     *                 pos1Range=None,             # <<<<<<<<<<<<<<
     *                 float dummy=0.0):
     *     """
     */
        values[7] = ((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  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:
            values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__weights);
            if (likely(values[0])) kw_args--;
            else goto __pyx_L5_argtuple_error;
            case  1:
            values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__pos0);
            if (likely(values[1])) kw_args--;
            else {
              __Pyx_RaiseArgtupleInvalid("histoBBox2d", 0, 5, 9, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
            }
            case  2:
            values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__delta_pos0);
            if (likely(values[2])) kw_args--;
            else {
              __Pyx_RaiseArgtupleInvalid("histoBBox2d", 0, 5, 9, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
            }
            case  3:
            values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__pos1);
            if (likely(values[3])) kw_args--;
            else {
              __Pyx_RaiseArgtupleInvalid("histoBBox2d", 0, 5, 9, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
            }
            case  4:
            values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__delta_pos1);
            if (likely(values[4])) kw_args--;
            else {
              __Pyx_RaiseArgtupleInvalid("histoBBox2d", 0, 5, 9, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __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--; }
            }
          }
          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 = 179; __pyx_clineno = __LINE__; goto __pyx_L3_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];
          if (values[8]) {
            __pyx_v_dummy = __pyx_PyFloat_AsDouble(values[8]); if (unlikely((__pyx_v_dummy == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
          } else {

     187:                 float dummy=0.0):

            /* "splitBBox.pyx":187
     *                 pos0Range=None,
     *                 pos1Range=None,
     *                 float dummy=0.0):             # <<<<<<<<<<<<<<
     *     """
     *     Calculate 2D histogram of pos0(tth),pos1(chi) weighted by weights
     */
            __pyx_v_dummy = ((float)0.0);
          }
        } else {
          switch (PyTuple_GET_SIZE(__pyx_args)) {
            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];
        if (values[8]) {
          __pyx_v_dummy = __pyx_PyFloat_AsDouble(values[8]); if (unlikely((__pyx_v_dummy == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        } else {
          __pyx_v_dummy = ((float)0.0);
        }
      }
      goto __pyx_L4_argument_unpacking_done;
      __pyx_L5_argtuple_error:;
      __Pyx_RaiseArgtupleInvalid("histoBBox2d", 0, 5, 9, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      __pyx_L3_error:;
      __Pyx_AddTraceback("splitBBox.histoBBox2d", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __Pyx_RefNannyFinishContext();
      return NULL;
      __pyx_L4_argument_unpacking_done:;
      __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_cdelta_pos0.pybuffer.buf = NULL;
      __pyx_pybuffer_cdelta_pos0.refcount = 0;
      __pyx_pybuffernd_cdelta_pos0.data = NULL;
      __pyx_pybuffernd_cdelta_pos0.rcbuffer = &__pyx_pybuffer_cdelta_pos0;
      __pyx_pybuffer_cpos0_inf.pybuffer.buf = NULL;
      __pyx_pybuffer_cpos0_inf.refcount = 0;
      __pyx_pybuffernd_cpos0_inf.data = NULL;
      __pyx_pybuffernd_cpos0_inf.rcbuffer = &__pyx_pybuffer_cpos0_inf;
      __pyx_pybuffer_cpos0_sup.pybuffer.buf = NULL;
      __pyx_pybuffer_cpos0_sup.refcount = 0;
      __pyx_pybuffernd_cpos0_sup.data = NULL;
      __pyx_pybuffernd_cpos0_sup.rcbuffer = &__pyx_pybuffer_cpos0_sup;
      __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_cdelta_pos1.pybuffer.buf = NULL;
      __pyx_pybuffer_cdelta_pos1.refcount = 0;
      __pyx_pybuffernd_cdelta_pos1.data = NULL;
      __pyx_pybuffernd_cdelta_pos1.rcbuffer = &__pyx_pybuffer_cdelta_pos1;
      __pyx_pybuffer_cpos1_inf.pybuffer.buf = NULL;
      __pyx_pybuffer_cpos1_inf.refcount = 0;
      __pyx_pybuffernd_cpos1_inf.data = NULL;
      __pyx_pybuffernd_cpos1_inf.rcbuffer = &__pyx_pybuffer_cpos1_inf;
      __pyx_pybuffer_cpos1_sup.pybuffer.buf = NULL;
      __pyx_pybuffer_cpos1_sup.refcount = 0;
      __pyx_pybuffernd_cpos1_sup.data = NULL;
      __pyx_pybuffernd_cpos1_sup.rcbuffer = &__pyx_pybuffer_cpos1_sup;
      __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_edges0.pybuffer.buf = NULL;
      __pyx_pybuffer_edges0.refcount = 0;
      __pyx_pybuffernd_edges0.data = NULL;
      __pyx_pybuffernd_edges0.rcbuffer = &__pyx_pybuffer_edges0;
      __pyx_pybuffer_edges1.pybuffer.buf = NULL;
      __pyx_pybuffer_edges1.refcount = 0;
      __pyx_pybuffernd_edges1.data = NULL;
      __pyx_pybuffernd_edges1.rcbuffer = &__pyx_pybuffer_edges1;
      if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_weights), __pyx_ptype_5numpy_ndarray, 0, "weights", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __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 = 180; __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 = 181; __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 = 182; __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 = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

     188:     """

     189:     Calculate 2D histogram of pos0(tth),pos1(chi) weighted by weights

     190:

     191:     Splitting is done on the pixel's bounding box like fit2D

     192:

     193:

     194:     @param weights: array with intensities

     195:     @param pos0: 1D array with pos0: tth or q_vect

     196:     @param delta_pos0: 1D array with delta pos0: max center-corner distance

     197:     @param pos1: 1D array with pos1: chi

     198:     @param delta_pos1: 1D array with max pos1: max center-corner distance, unused !

     199:     @param bins: number of output bins (tth=100, chi=36 by default)

     200:     @param pos0Range: minimum and maximum  of the 2th range

     201:     @param pos1Range: minimum and maximum  of the chi range

     202:     @param dummy: value for bins without pixels

     203:     @return 2theta, I, weighted histogram, unweighted histogram

     204:     @return  I, edges0, edges1, weighted histogram(2D), unweighted histogram (2D)

     205:     """

     206:

     207:     cdef long  bins0, bins1, i, j, idx

     208:     cdef long  size = weights.size

      /* "splitBBox.pyx":208
     *
     *     cdef long  bins0, bins1, i, j, idx
     *     cdef long  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 = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyInt_AsLong(__pyx_t_1); if (unlikely((__pyx_t_2 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v_size = __pyx_t_2;

     209:     assert pos0.size == size

      /* "splitBBox.pyx":209
     *     cdef long  bins0, bins1, i, j, idx
     *     cdef long  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 = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = PyInt_FromLong(__pyx_v_size); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __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); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __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_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 = 209; __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 = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      #endif

     210:     assert pos1.size == size

      /* "splitBBox.pyx":210
     *     cdef long  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 = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = PyInt_FromLong(__pyx_v_size); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __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); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_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 = 210; __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 = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      #endif

     211:     assert delta_pos0.size == size

      /* "splitBBox.pyx":211
     *     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 = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = PyInt_FromLong(__pyx_v_size); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __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); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __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_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 = 211; __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 = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      #endif

     212:     assert delta_pos1.size == size

      /* "splitBBox.pyx":212
     *     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 = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = PyInt_FromLong(__pyx_v_size); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __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); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_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 = 212; __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 = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      #endif

     213:     try:

      /* "splitBBox.pyx":213
     *     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:*/ {

     214:         bins0, bins1 = tuple(bins)

          /* "splitBBox.pyx":214
     *     assert delta_pos1.size == size
     *     try:
     *         bins0, bins1 = tuple(bins)             # <<<<<<<<<<<<<<
     *     except:
     *         bins0 = bins1 = < long > bins
     */
          __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L6_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 = 214; __pyx_clineno = __LINE__; goto __pyx_L6_error;}
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
          if (likely(PyTuple_CheckExact(__pyx_t_3))) {
            PyObject* sequence = __pyx_t_3;
            if (unlikely(PyTuple_GET_SIZE(sequence) != 2)) {
              if (PyTuple_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2);
              else __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(sequence));
              {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L6_error;}
            }
            __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);
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          } else {
            __Pyx_UnpackTupleError(__pyx_t_3, 2);
            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L6_error;}
          }
          __pyx_t_2 = __Pyx_PyInt_AsLong(__pyx_t_1); if (unlikely((__pyx_t_2 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L6_error;}
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __pyx_t_9 = __Pyx_PyInt_AsLong(__pyx_t_4); if (unlikely((__pyx_t_9 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L6_error;}
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __pyx_v_bins0 = __pyx_t_2;
          __pyx_v_bins1 = __pyx_t_9;
        }
        __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_L13_try_end;
        __pyx_L6_error:;
        __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;

     215:     except:

        /* "splitBBox.pyx":215
     *     try:
     *         bins0, bins1 = tuple(bins)
     *     except:             # <<<<<<<<<<<<<<
     *         bins0 = bins1 = < long > bins
     *     if bins0 <= 0:
     */
        /*except:*/ {
          __Pyx_AddTraceback("splitBBox.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 = 215; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;}
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_GOTREF(__pyx_t_1);

     216:         bins0 = bins1 = < long > bins

          /* "splitBBox.pyx":216
     *         bins0, bins1 = tuple(bins)
     *     except:
     *         bins0 = bins1 = < long > bins             # <<<<<<<<<<<<<<
     *     if bins0 <= 0:
     *         bins0 = 1
     */
          __pyx_t_9 = __Pyx_PyInt_AsLong(__pyx_v_bins); if (unlikely((__pyx_t_9 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;}
          __pyx_v_bins0 = ((long)__pyx_t_9);
          __pyx_v_bins1 = ((long)__pyx_t_9);
          __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_L7_exception_handled;
        }
        __pyx_L8_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_L7_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_L13_try_end:;
      }

     217:     if bins0 <= 0:

      /* "splitBBox.pyx":217
     *     except:
     *         bins0 = bins1 = < long > bins
     *     if bins0 <= 0:             # <<<<<<<<<<<<<<
     *         bins0 = 1
     *     if bins1 <= 0:
     */
      __pyx_t_5 = (__pyx_v_bins0 <= 0);
      if (__pyx_t_5) {

     218:         bins0 = 1

        /* "splitBBox.pyx":218
     *         bins0 = bins1 = < long > bins
     *     if bins0 <= 0:
     *         bins0 = 1             # <<<<<<<<<<<<<<
     *     if bins1 <= 0:
     *         bins1 = 1
     */
        __pyx_v_bins0 = 1;
        goto __pyx_L16;
      }
      __pyx_L16:;

     219:     if bins1 <= 0:

      /* "splitBBox.pyx":219
     *     if bins0 <= 0:
     *         bins0 = 1
     *     if bins1 <= 0:             # <<<<<<<<<<<<<<
     *         bins1 = 1
     *     cdef numpy.ndarray[DTYPE_float64_t, ndim = 1] cdata = weights.ravel().astype("float64")
     */
      __pyx_t_5 = (__pyx_v_bins1 <= 0);
      if (__pyx_t_5) {

     220:         bins1 = 1

        /* "splitBBox.pyx":220
     *         bins0 = 1
     *     if bins1 <= 0:
     *         bins1 = 1             # <<<<<<<<<<<<<<
     *     cdef numpy.ndarray[DTYPE_float64_t, ndim = 1] cdata = weights.ravel().astype("float64")
     *     cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cpos0 = pos0.ravel().astype("float32")
     */
        __pyx_v_bins1 = 1;
        goto __pyx_L17;
      }
      __pyx_L17:;

     221:     cdef numpy.ndarray[DTYPE_float64_t, ndim = 1] cdata = weights.ravel().astype("float64")

      /* "splitBBox.pyx":221
     *     if bins1 <= 0:
     *         bins1 = 1
     *     cdef numpy.ndarray[DTYPE_float64_t, ndim = 1] cdata = weights.ravel().astype("float64")             # <<<<<<<<<<<<<<
     *     cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cpos0 = pos0.ravel().astype("float32")
     *     cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cdelta_pos0 = delta_pos0.ravel().astype("float32")
     */
      __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 = 221; __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 = 221; __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_t_4, __pyx_n_s__astype); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_7), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_10 = ((PyArrayObject *)__pyx_t_4);
      {
        __Pyx_BufFmt_StackElem __pyx_stack[1];
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_cdata.rcbuffer->pybuffer, (PyObject*)__pyx_t_10, &__Pyx_TypeInfo_nn___pyx_t_9splitBBox_DTYPE_float64_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 = 221; __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_10 = 0;
      __pyx_v_cdata = ((PyArrayObject *)__pyx_t_4);
      __pyx_t_4 = 0;

      /* "splitBBox.pyx":221
     *     if bins1 <= 0:
     *         bins1 = 1
     *     cdef numpy.ndarray[DTYPE_float64_t, ndim = 1] cdata = weights.ravel().astype("float64")             # <<<<<<<<<<<<<<
     *     cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cpos0 = pos0.ravel().astype("float32")
     *     cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cdelta_pos0 = delta_pos0.ravel().astype("float32")
     */
      __pyx_k_tuple_7 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_k_tuple_7);
      __Pyx_INCREF(((PyObject *)__pyx_n_s__float64));
      PyTuple_SET_ITEM(__pyx_k_tuple_7, 0, ((PyObject *)__pyx_n_s__float64));
      __Pyx_GIVEREF(((PyObject *)__pyx_n_s__float64));
      __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_7));

     222:     cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cpos0 = pos0.ravel().astype("float32")

      /* "splitBBox.pyx":222
     *         bins1 = 1
     *     cdef numpy.ndarray[DTYPE_float64_t, ndim = 1] cdata = weights.ravel().astype("float64")
     *     cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cpos0 = pos0.ravel().astype("float32")             # <<<<<<<<<<<<<<
     *     cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cdelta_pos0 = delta_pos0.ravel().astype("float32")
     *     cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cpos0_inf = cpos0 - cdelta_pos0
     */
      __pyx_t_4 = PyObject_GetAttr(((PyObject *)__pyx_v_pos0), __pyx_n_s__ravel); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_1 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__astype); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __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_Call(__pyx_t_4, ((PyObject *)__pyx_k_tuple_8), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_11 = ((PyArrayObject *)__pyx_t_1);
      {
        __Pyx_BufFmt_StackElem __pyx_stack[1];
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_cpos0.rcbuffer->pybuffer, (PyObject*)__pyx_t_11, &__Pyx_TypeInfo_nn___pyx_t_9splitBBox_DTYPE_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 = 222; __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_11 = 0;
      __pyx_v_cpos0 = ((PyArrayObject *)__pyx_t_1);
      __pyx_t_1 = 0;

      /* "splitBBox.pyx":222
     *         bins1 = 1
     *     cdef numpy.ndarray[DTYPE_float64_t, ndim = 1] cdata = weights.ravel().astype("float64")
     *     cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cpos0 = pos0.ravel().astype("float32")             # <<<<<<<<<<<<<<
     *     cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cdelta_pos0 = delta_pos0.ravel().astype("float32")
     *     cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cpos0_inf = cpos0 - cdelta_pos0
     */
      __pyx_k_tuple_8 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_k_tuple_8);
      __Pyx_INCREF(((PyObject *)__pyx_n_s__float32));
      PyTuple_SET_ITEM(__pyx_k_tuple_8, 0, ((PyObject *)__pyx_n_s__float32));
      __Pyx_GIVEREF(((PyObject *)__pyx_n_s__float32));
      __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_8));

     223:     cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cdelta_pos0 = delta_pos0.ravel().astype("float32")

      /* "splitBBox.pyx":223
     *     cdef numpy.ndarray[DTYPE_float64_t, ndim = 1] cdata = weights.ravel().astype("float64")
     *     cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cpos0 = pos0.ravel().astype("float32")
     *     cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cdelta_pos0 = delta_pos0.ravel().astype("float32")             # <<<<<<<<<<<<<<
     *     cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cpos0_inf = cpos0 - cdelta_pos0
     *     cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cpos0_sup = cpos0 + cdelta_pos0
     */
      __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_delta_pos0), __pyx_n_s__ravel); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __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 = 223; __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_t_4, __pyx_n_s__astype); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_9), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_12 = ((PyArrayObject *)__pyx_t_4);
      {
        __Pyx_BufFmt_StackElem __pyx_stack[1];
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_cdelta_pos0.rcbuffer->pybuffer, (PyObject*)__pyx_t_12, &__Pyx_TypeInfo_nn___pyx_t_9splitBBox_DTYPE_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
          __pyx_v_cdelta_pos0 = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_cdelta_pos0.rcbuffer->pybuffer.buf = NULL;
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        } else {__pyx_pybuffernd_cdelta_pos0.diminfo[0].strides = __pyx_pybuffernd_cdelta_pos0.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_cdelta_pos0.diminfo[0].shape = __pyx_pybuffernd_cdelta_pos0.rcbuffer->pybuffer.shape[0];
        }
      }
      __pyx_t_12 = 0;
      __pyx_v_cdelta_pos0 = ((PyArrayObject *)__pyx_t_4);
      __pyx_t_4 = 0;

      /* "splitBBox.pyx":223
     *     cdef numpy.ndarray[DTYPE_float64_t, ndim = 1] cdata = weights.ravel().astype("float64")
     *     cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cpos0 = pos0.ravel().astype("float32")
     *     cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cdelta_pos0 = delta_pos0.ravel().astype("float32")             # <<<<<<<<<<<<<<
     *     cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cpos0_inf = cpos0 - cdelta_pos0
     *     cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cpos0_sup = cpos0 + cdelta_pos0
     */
      __pyx_k_tuple_9 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_k_tuple_9);
      __Pyx_INCREF(((PyObject *)__pyx_n_s__float32));
      PyTuple_SET_ITEM(__pyx_k_tuple_9, 0, ((PyObject *)__pyx_n_s__float32));
      __Pyx_GIVEREF(((PyObject *)__pyx_n_s__float32));
      __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_9));

     224:     cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cpos0_inf = cpos0 - cdelta_pos0

      /* "splitBBox.pyx":224
     *     cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cpos0 = pos0.ravel().astype("float32")
     *     cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cdelta_pos0 = delta_pos0.ravel().astype("float32")
     *     cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cpos0_inf = cpos0 - cdelta_pos0             # <<<<<<<<<<<<<<
     *     cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cpos0_sup = cpos0 + cdelta_pos0
     *     cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cpos1 = pos1.ravel().astype("float32")
     */
      __pyx_t_4 = PyNumber_Subtract(((PyObject *)__pyx_v_cpos0), ((PyObject *)__pyx_v_cdelta_pos0)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_13 = ((PyArrayObject *)__pyx_t_4);
      {
        __Pyx_BufFmt_StackElem __pyx_stack[1];
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_cpos0_inf.rcbuffer->pybuffer, (PyObject*)__pyx_t_13, &__Pyx_TypeInfo_nn___pyx_t_9splitBBox_DTYPE_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
          __pyx_v_cpos0_inf = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_cpos0_inf.rcbuffer->pybuffer.buf = NULL;
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        } else {__pyx_pybuffernd_cpos0_inf.diminfo[0].strides = __pyx_pybuffernd_cpos0_inf.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_cpos0_inf.diminfo[0].shape = __pyx_pybuffernd_cpos0_inf.rcbuffer->pybuffer.shape[0];
        }
      }
      __pyx_t_13 = 0;
      __pyx_v_cpos0_inf = ((PyArrayObject *)__pyx_t_4);
      __pyx_t_4 = 0;

     225:     cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cpos0_sup = cpos0 + cdelta_pos0

      /* "splitBBox.pyx":225
     *     cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cdelta_pos0 = delta_pos0.ravel().astype("float32")
     *     cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cpos0_inf = cpos0 - cdelta_pos0
     *     cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cpos0_sup = cpos0 + cdelta_pos0             # <<<<<<<<<<<<<<
     *     cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cpos1 = pos1.ravel().astype("float32")
     *     cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cdelta_pos1 = delta_pos1.ravel().astype("float32")
     */
      __pyx_t_4 = PyNumber_Add(((PyObject *)__pyx_v_cpos0), ((PyObject *)__pyx_v_cdelta_pos0)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_14 = ((PyArrayObject *)__pyx_t_4);
      {
        __Pyx_BufFmt_StackElem __pyx_stack[1];
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_cpos0_sup.rcbuffer->pybuffer, (PyObject*)__pyx_t_14, &__Pyx_TypeInfo_nn___pyx_t_9splitBBox_DTYPE_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
          __pyx_v_cpos0_sup = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_cpos0_sup.rcbuffer->pybuffer.buf = NULL;
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        } else {__pyx_pybuffernd_cpos0_sup.diminfo[0].strides = __pyx_pybuffernd_cpos0_sup.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_cpos0_sup.diminfo[0].shape = __pyx_pybuffernd_cpos0_sup.rcbuffer->pybuffer.shape[0];
        }
      }
      __pyx_t_14 = 0;
      __pyx_v_cpos0_sup = ((PyArrayObject *)__pyx_t_4);
      __pyx_t_4 = 0;

     226:     cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cpos1 = pos1.ravel().astype("float32")

      /* "splitBBox.pyx":226
     *     cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cpos0_inf = cpos0 - cdelta_pos0
     *     cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cpos0_sup = cpos0 + cdelta_pos0
     *     cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cpos1 = pos1.ravel().astype("float32")             # <<<<<<<<<<<<<<
     *     cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cdelta_pos1 = delta_pos1.ravel().astype("float32")
     *     cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cpos1_inf = cpos1 - cdelta_pos1
     */
      __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 = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_1 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__astype); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __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_Call(__pyx_t_4, ((PyObject *)__pyx_k_tuple_10), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_15 = ((PyArrayObject *)__pyx_t_1);
      {
        __Pyx_BufFmt_StackElem __pyx_stack[1];
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_cpos1.rcbuffer->pybuffer, (PyObject*)__pyx_t_15, &__Pyx_TypeInfo_nn___pyx_t_9splitBBox_DTYPE_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 = 226; __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_15 = 0;
      __pyx_v_cpos1 = ((PyArrayObject *)__pyx_t_1);
      __pyx_t_1 = 0;

      /* "splitBBox.pyx":226
     *     cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cpos0_inf = cpos0 - cdelta_pos0
     *     cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cpos0_sup = cpos0 + cdelta_pos0
     *     cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cpos1 = pos1.ravel().astype("float32")             # <<<<<<<<<<<<<<
     *     cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cdelta_pos1 = delta_pos1.ravel().astype("float32")
     *     cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cpos1_inf = cpos1 - cdelta_pos1
     */
      __pyx_k_tuple_10 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_k_tuple_10);
      __Pyx_INCREF(((PyObject *)__pyx_n_s__float32));
      PyTuple_SET_ITEM(__pyx_k_tuple_10, 0, ((PyObject *)__pyx_n_s__float32));
      __Pyx_GIVEREF(((PyObject *)__pyx_n_s__float32));
      __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_10));

     227:     cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cdelta_pos1 = delta_pos1.ravel().astype("float32")

      /* "splitBBox.pyx":227
     *     cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cpos0_sup = cpos0 + cdelta_pos0
     *     cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cpos1 = pos1.ravel().astype("float32")
     *     cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cdelta_pos1 = delta_pos1.ravel().astype("float32")             # <<<<<<<<<<<<<<
     *     cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cpos1_inf = cpos1 - cdelta_pos1
     *     cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cpos1_sup = cpos1 + cdelta_pos1
     */
      __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_delta_pos1), __pyx_n_s__ravel); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __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 = 227; __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_t_4, __pyx_n_s__astype); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_11), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __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_cdelta_pos1.rcbuffer->pybuffer, (PyObject*)__pyx_t_16, &__Pyx_TypeInfo_nn___pyx_t_9splitBBox_DTYPE_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
          __pyx_v_cdelta_pos1 = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_cdelta_pos1.rcbuffer->pybuffer.buf = NULL;
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        } else {__pyx_pybuffernd_cdelta_pos1.diminfo[0].strides = __pyx_pybuffernd_cdelta_pos1.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_cdelta_pos1.diminfo[0].shape = __pyx_pybuffernd_cdelta_pos1.rcbuffer->pybuffer.shape[0];
        }
      }
      __pyx_t_16 = 0;
      __pyx_v_cdelta_pos1 = ((PyArrayObject *)__pyx_t_4);
      __pyx_t_4 = 0;

      /* "splitBBox.pyx":227
     *     cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cpos0_sup = cpos0 + cdelta_pos0
     *     cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cpos1 = pos1.ravel().astype("float32")
     *     cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cdelta_pos1 = delta_pos1.ravel().astype("float32")             # <<<<<<<<<<<<<<
     *     cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cpos1_inf = cpos1 - cdelta_pos1
     *     cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cpos1_sup = cpos1 + cdelta_pos1
     */
      __pyx_k_tuple_11 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_k_tuple_11);
      __Pyx_INCREF(((PyObject *)__pyx_n_s__float32));
      PyTuple_SET_ITEM(__pyx_k_tuple_11, 0, ((PyObject *)__pyx_n_s__float32));
      __Pyx_GIVEREF(((PyObject *)__pyx_n_s__float32));
      __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_11));

     228:     cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cpos1_inf = cpos1 - cdelta_pos1

      /* "splitBBox.pyx":228
     *     cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cpos1 = pos1.ravel().astype("float32")
     *     cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cdelta_pos1 = delta_pos1.ravel().astype("float32")
     *     cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cpos1_inf = cpos1 - cdelta_pos1             # <<<<<<<<<<<<<<
     *     cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cpos1_sup = cpos1 + cdelta_pos1
     *     cdef numpy.ndarray[DTYPE_float64_t, ndim = 2] outData = numpy.zeros((bins0, bins1), dtype="float64")
     */
      __pyx_t_4 = PyNumber_Subtract(((PyObject *)__pyx_v_cpos1), ((PyObject *)__pyx_v_cdelta_pos1)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_17 = ((PyArrayObject *)__pyx_t_4);
      {
        __Pyx_BufFmt_StackElem __pyx_stack[1];
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_cpos1_inf.rcbuffer->pybuffer, (PyObject*)__pyx_t_17, &__Pyx_TypeInfo_nn___pyx_t_9splitBBox_DTYPE_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
          __pyx_v_cpos1_inf = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_cpos1_inf.rcbuffer->pybuffer.buf = NULL;
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        } else {__pyx_pybuffernd_cpos1_inf.diminfo[0].strides = __pyx_pybuffernd_cpos1_inf.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_cpos1_inf.diminfo[0].shape = __pyx_pybuffernd_cpos1_inf.rcbuffer->pybuffer.shape[0];
        }
      }
      __pyx_t_17 = 0;
      __pyx_v_cpos1_inf = ((PyArrayObject *)__pyx_t_4);
      __pyx_t_4 = 0;

     229:     cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cpos1_sup = cpos1 + cdelta_pos1

      /* "splitBBox.pyx":229
     *     cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cdelta_pos1 = delta_pos1.ravel().astype("float32")
     *     cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cpos1_inf = cpos1 - cdelta_pos1
     *     cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cpos1_sup = cpos1 + cdelta_pos1             # <<<<<<<<<<<<<<
     *     cdef numpy.ndarray[DTYPE_float64_t, ndim = 2] outData = numpy.zeros((bins0, bins1), dtype="float64")
     *     cdef numpy.ndarray[DTYPE_float64_t, ndim = 2] outCount = numpy.zeros((bins0, bins1), dtype="float64")
     */
      __pyx_t_4 = PyNumber_Add(((PyObject *)__pyx_v_cpos1), ((PyObject *)__pyx_v_cdelta_pos1)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_18 = ((PyArrayObject *)__pyx_t_4);
      {
        __Pyx_BufFmt_StackElem __pyx_stack[1];
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_cpos1_sup.rcbuffer->pybuffer, (PyObject*)__pyx_t_18, &__Pyx_TypeInfo_nn___pyx_t_9splitBBox_DTYPE_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
          __pyx_v_cpos1_sup = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_cpos1_sup.rcbuffer->pybuffer.buf = NULL;
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        } else {__pyx_pybuffernd_cpos1_sup.diminfo[0].strides = __pyx_pybuffernd_cpos1_sup.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_cpos1_sup.diminfo[0].shape = __pyx_pybuffernd_cpos1_sup.rcbuffer->pybuffer.shape[0];
        }
      }
      __pyx_t_18 = 0;
      __pyx_v_cpos1_sup = ((PyArrayObject *)__pyx_t_4);
      __pyx_t_4 = 0;

     230:     cdef numpy.ndarray[DTYPE_float64_t, ndim = 2] outData = numpy.zeros((bins0, bins1), dtype="float64")

      /* "splitBBox.pyx":230
     *     cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cpos1_inf = cpos1 - cdelta_pos1
     *     cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cpos1_sup = cpos1 + cdelta_pos1
     *     cdef numpy.ndarray[DTYPE_float64_t, ndim = 2] outData = numpy.zeros((bins0, bins1), dtype="float64")             # <<<<<<<<<<<<<<
     *     cdef numpy.ndarray[DTYPE_float64_t, ndim = 2] outCount = numpy.zeros((bins0, bins1), dtype="float64")
     *     cdef numpy.ndarray[DTYPE_float32_t, ndim = 2] outMerge = numpy.zeros((bins0, bins1), dtype="float32")
     */
      __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; __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 = 230; __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 = 230; __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 = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_19 = PyTuple_New(2); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_19);
      PyTuple_SET_ITEM(__pyx_t_19, 0, __pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_19, 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 = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_19));
      __Pyx_GIVEREF(((PyObject *)__pyx_t_19));
      __pyx_t_19 = 0;
      __pyx_t_19 = PyDict_New(); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_19));
      if (PyDict_SetItem(__pyx_t_19, ((PyObject *)__pyx_n_s__dtype), ((PyObject *)__pyx_n_s__float64)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), ((PyObject *)__pyx_t_19)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_19)); __pyx_t_19 = 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 = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_20 = ((PyArrayObject *)__pyx_t_4);
      {
        __Pyx_BufFmt_StackElem __pyx_stack[1];
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_outData.rcbuffer->pybuffer, (PyObject*)__pyx_t_20, &__Pyx_TypeInfo_nn___pyx_t_9splitBBox_DTYPE_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 = 230; __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_20 = 0;
      __pyx_v_outData = ((PyArrayObject *)__pyx_t_4);
      __pyx_t_4 = 0;

     231:     cdef numpy.ndarray[DTYPE_float64_t, ndim = 2] outCount = numpy.zeros((bins0, bins1), dtype="float64")

      /* "splitBBox.pyx":231
     *     cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cpos1_sup = cpos1 + cdelta_pos1
     *     cdef numpy.ndarray[DTYPE_float64_t, ndim = 2] outData = numpy.zeros((bins0, bins1), dtype="float64")
     *     cdef numpy.ndarray[DTYPE_float64_t, ndim = 2] outCount = numpy.zeros((bins0, bins1), dtype="float64")             # <<<<<<<<<<<<<<
     *     cdef numpy.ndarray[DTYPE_float32_t, ndim = 2] outMerge = numpy.zeros((bins0, bins1), dtype="float32")
     *     cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] edges0 = numpy.zeros(bins0, dtype="float32")
     */
      __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_19 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__zeros); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_19);
      __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 = 231; __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 = 231; __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 = 231; __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);
      PyTuple_SET_ITEM(__pyx_t_1, 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 = 231; __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 = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_1));
      if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__dtype), ((PyObject *)__pyx_n_s__float64)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_4 = PyObject_Call(__pyx_t_19, ((PyObject *)__pyx_t_3), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 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 = 231; __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_outCount.rcbuffer->pybuffer, (PyObject*)__pyx_t_21, &__Pyx_TypeInfo_nn___pyx_t_9splitBBox_DTYPE_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 = 231; __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_21 = 0;
      __pyx_v_outCount = ((PyArrayObject *)__pyx_t_4);
      __pyx_t_4 = 0;

     232:     cdef numpy.ndarray[DTYPE_float32_t, ndim = 2] outMerge = numpy.zeros((bins0, bins1), dtype="float32")

      /* "splitBBox.pyx":232
     *     cdef numpy.ndarray[DTYPE_float64_t, ndim = 2] outData = numpy.zeros((bins0, bins1), dtype="float64")
     *     cdef numpy.ndarray[DTYPE_float64_t, ndim = 2] outCount = numpy.zeros((bins0, bins1), dtype="float64")
     *     cdef numpy.ndarray[DTYPE_float32_t, ndim = 2] outMerge = numpy.zeros((bins0, bins1), dtype="float32")             # <<<<<<<<<<<<<<
     *     cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] edges0 = numpy.zeros(bins0, dtype="float32")
     *     cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] edges1 = numpy.zeros(bins1, dtype="float32")
     */
      __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; __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 = 232; __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 = 232; __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 = 232; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_19 = PyTuple_New(2); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_19);
      PyTuple_SET_ITEM(__pyx_t_19, 0, __pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_19, 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 = 232; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_19));
      __Pyx_GIVEREF(((PyObject *)__pyx_t_19));
      __pyx_t_19 = 0;
      __pyx_t_19 = PyDict_New(); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_19));
      if (PyDict_SetItem(__pyx_t_19, ((PyObject *)__pyx_n_s__dtype), ((PyObject *)__pyx_n_s__float32)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), ((PyObject *)__pyx_t_19)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_19)); __pyx_t_19 = 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 = 232; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_22 = ((PyArrayObject *)__pyx_t_4);
      {
        __Pyx_BufFmt_StackElem __pyx_stack[1];
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_outMerge.rcbuffer->pybuffer, (PyObject*)__pyx_t_22, &__Pyx_TypeInfo_nn___pyx_t_9splitBBox_DTYPE_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 = 232; __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_22 = 0;
      __pyx_v_outMerge = ((PyArrayObject *)__pyx_t_4);
      __pyx_t_4 = 0;

     233:     cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] edges0 = numpy.zeros(bins0, dtype="float32")

      /* "splitBBox.pyx":233
     *     cdef numpy.ndarray[DTYPE_float64_t, ndim = 2] outCount = numpy.zeros((bins0, bins1), dtype="float64")
     *     cdef numpy.ndarray[DTYPE_float32_t, ndim = 2] outMerge = numpy.zeros((bins0, bins1), dtype="float32")
     *     cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] edges0 = numpy.zeros(bins0, dtype="float32")             # <<<<<<<<<<<<<<
     *     cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] edges1 = numpy.zeros(bins1, dtype="float32")
     *
     */
      __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_19 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__zeros); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_19);
      __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 = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __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 = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_4));
      if (PyDict_SetItem(__pyx_t_4, ((PyObject *)__pyx_n_s__dtype), ((PyObject *)__pyx_n_s__float32)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_1 = PyObject_Call(__pyx_t_19, ((PyObject *)__pyx_t_3), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 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 = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_23 = ((PyArrayObject *)__pyx_t_1);
      {
        __Pyx_BufFmt_StackElem __pyx_stack[1];
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_edges0.rcbuffer->pybuffer, (PyObject*)__pyx_t_23, &__Pyx_TypeInfo_nn___pyx_t_9splitBBox_DTYPE_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
          __pyx_v_edges0 = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_edges0.rcbuffer->pybuffer.buf = NULL;
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        } else {__pyx_pybuffernd_edges0.diminfo[0].strides = __pyx_pybuffernd_edges0.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_edges0.diminfo[0].shape = __pyx_pybuffernd_edges0.rcbuffer->pybuffer.shape[0];
        }
      }
      __pyx_t_23 = 0;
      __pyx_v_edges0 = ((PyArrayObject *)__pyx_t_1);
      __pyx_t_1 = 0;

     234:     cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] edges1 = numpy.zeros(bins1, dtype="float32")

      /* "splitBBox.pyx":234
     *     cdef numpy.ndarray[DTYPE_float32_t, ndim = 2] outMerge = numpy.zeros((bins0, bins1), dtype="float32")
     *     cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] edges0 = numpy.zeros(bins0, dtype="float32")
     *     cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] edges1 = numpy.zeros(bins1, dtype="float32")             # <<<<<<<<<<<<<<
     *
     *     cdef float min0, max0, min1, max1, deltaR, deltaL, deltaU, deltaD, deltaA, tmp
     */
      __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 234; __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 = 234; __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_bins1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 234; __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 = 234; __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 = 234; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_1));
      if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__dtype), ((PyObject *)__pyx_n_s__float32)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_19 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_3), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_19);
      __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_19) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_19, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_24 = ((PyArrayObject *)__pyx_t_19);
      {
        __Pyx_BufFmt_StackElem __pyx_stack[1];
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_edges1.rcbuffer->pybuffer, (PyObject*)__pyx_t_24, &__Pyx_TypeInfo_nn___pyx_t_9splitBBox_DTYPE_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
          __pyx_v_edges1 = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_edges1.rcbuffer->pybuffer.buf = NULL;
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        } else {__pyx_pybuffernd_edges1.diminfo[0].strides = __pyx_pybuffernd_edges1.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_edges1.diminfo[0].shape = __pyx_pybuffernd_edges1.rcbuffer->pybuffer.shape[0];
        }
      }
      __pyx_t_24 = 0;
      __pyx_v_edges1 = ((PyArrayObject *)__pyx_t_19);
      __pyx_t_19 = 0;

     235:

     236:     cdef float min0, max0, min1, max1, deltaR, deltaL, deltaU, deltaD, deltaA, tmp

     237:     cdef float pos0_min, pos0_max, pos1_min, pos1_max, pos0_maxin, pos1_maxin

     238:     cdef float fbin0_min, fbin0_max, fbin1_min, fbin1_max

     239:     cdef long  bin0_max, bin0_min, bin1_max, bin1_min

     240:     cdef double epsilon = 1e-10

      /* "splitBBox.pyx":240
     *     cdef float fbin0_min, fbin0_max, fbin1_min, fbin1_max
     *     cdef long  bin0_max, bin0_min, bin1_max, bin1_min
     *     cdef double epsilon = 1e-10             # <<<<<<<<<<<<<<
     *     cdef double data
     *
     */
      __pyx_v_epsilon = 1e-10;

     241:     cdef double data

     242:

     243:     if pos0Range is not None and len(pos0Range) == 2:

      /* "splitBBox.pyx":243
     *     cdef double data
     *
     *     if pos0Range is not None and len(pos0Range) == 2:             # <<<<<<<<<<<<<<
     *         pos0_min = min(pos0Range)
     *         pos0_maxin = max(pos0Range)
     */
      __pyx_t_5 = (__pyx_v_pos0Range != Py_None);
      if (__pyx_t_5) {
        __pyx_t_25 = PyObject_Length(__pyx_v_pos0Range); if (unlikely(__pyx_t_25 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_t_26 = (__pyx_t_25 == 2);
        __pyx_t_27 = __pyx_t_26;
      } else {
        __pyx_t_27 = __pyx_t_5;
      }
      if (__pyx_t_27) {

     244:         pos0_min = min(pos0Range)

        /* "splitBBox.pyx":244
     *
     *     if pos0Range is not None and len(pos0Range) == 2:
     *         pos0_min = min(pos0Range)             # <<<<<<<<<<<<<<
     *         pos0_maxin = max(pos0Range)
     *     else:
     */
        __pyx_t_19 = PyTuple_New(1); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_19);
        __Pyx_INCREF(__pyx_v_pos0Range);
        PyTuple_SET_ITEM(__pyx_t_19, 0, __pyx_v_pos0Range);
        __Pyx_GIVEREF(__pyx_v_pos0Range);
        __pyx_t_1 = PyObject_Call(__pyx_builtin_min, ((PyObject *)__pyx_t_19), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(((PyObject *)__pyx_t_19)); __pyx_t_19 = 0;
        __pyx_t_28 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_28 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_v_pos0_min = __pyx_t_28;

     245:         pos0_maxin = max(pos0Range)

        /* "splitBBox.pyx":245
     *     if pos0Range is not None and len(pos0Range) == 2:
     *         pos0_min = min(pos0Range)
     *         pos0_maxin = max(pos0Range)             # <<<<<<<<<<<<<<
     *     else:
     *         pos0_min = max(0.0, cpos0_inf.min())
     */
        __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_INCREF(__pyx_v_pos0Range);
        PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_pos0Range);
        __Pyx_GIVEREF(__pyx_v_pos0Range);
        __pyx_t_19 = PyObject_Call(__pyx_builtin_max, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_19);
        __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
        __pyx_t_28 = __pyx_PyFloat_AsDouble(__pyx_t_19); if (unlikely((__pyx_t_28 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
        __pyx_v_pos0_maxin = __pyx_t_28;
        goto __pyx_L18;
      }
      /*else*/ {

     246:     else:

     247:         pos0_min = max(0.0, cpos0_inf.min())

        /* "splitBBox.pyx":247
     *         pos0_maxin = max(pos0Range)
     *     else:
     *         pos0_min = max(0.0, cpos0_inf.min())             # <<<<<<<<<<<<<<
     *         pos0_maxin = cpos0_sup.max()
     *     pos0_max = pos0_maxin * (1 + numpy.finfo(numpy.float32).eps)
     */
        __pyx_t_19 = PyObject_GetAttr(((PyObject *)__pyx_v_cpos0_inf), __pyx_n_s__min); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_19);
        __pyx_t_1 = PyObject_Call(__pyx_t_19, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
        __pyx_t_29 = 0.0;
        __pyx_t_3 = PyFloat_FromDouble(__pyx_t_29); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_4 = PyObject_RichCompare(__pyx_t_1, __pyx_t_3, Py_GT); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_27 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_27 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (__pyx_t_27) {
          __Pyx_INCREF(__pyx_t_1);
          __pyx_t_19 = __pyx_t_1;
        } else {
          __pyx_t_4 = PyFloat_FromDouble(__pyx_t_29); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_4);
          __pyx_t_19 = __pyx_t_4;
          __pyx_t_4 = 0;
        }
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_t_28 = __pyx_PyFloat_AsDouble(__pyx_t_19); if (unlikely((__pyx_t_28 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
        __pyx_v_pos0_min = __pyx_t_28;

     248:         pos0_maxin = cpos0_sup.max()

        /* "splitBBox.pyx":248
     *     else:
     *         pos0_min = max(0.0, cpos0_inf.min())
     *         pos0_maxin = cpos0_sup.max()             # <<<<<<<<<<<<<<
     *     pos0_max = pos0_maxin * (1 + numpy.finfo(numpy.float32).eps)
     *
     */
        __pyx_t_19 = PyObject_GetAttr(((PyObject *)__pyx_v_cpos0_sup), __pyx_n_s__max); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_19);
        __pyx_t_1 = PyObject_Call(__pyx_t_19, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
        __pyx_t_28 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_28 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_v_pos0_maxin = __pyx_t_28;
      }
      __pyx_L18:;

     249:     pos0_max = pos0_maxin * (1 + numpy.finfo(numpy.float32).eps)

      /* "splitBBox.pyx":249
     *         pos0_min = max(0.0, cpos0_inf.min())
     *         pos0_maxin = cpos0_sup.max()
     *     pos0_max = pos0_maxin * (1 + numpy.finfo(numpy.float32).eps)             # <<<<<<<<<<<<<<
     *
     *     if pos1Range is not None and len(pos1Range) > 1:
     */
      __pyx_t_1 = PyFloat_FromDouble(__pyx_v_pos0_maxin); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_19 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_19);
      __pyx_t_4 = PyObject_GetAttr(__pyx_t_19, __pyx_n_s__finfo); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
      __pyx_t_19 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_19);
      __pyx_t_3 = PyObject_GetAttr(__pyx_t_19, __pyx_n_s__float32); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
      __pyx_t_19 = PyTuple_New(1); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_19);
      PyTuple_SET_ITEM(__pyx_t_19, 0, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      __pyx_t_3 = 0;
      __pyx_t_3 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_19), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __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_19)); __pyx_t_19 = 0;
      __pyx_t_19 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__eps); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_19);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = PyNumber_Add(__pyx_int_1, __pyx_t_19); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
      __pyx_t_19 = PyNumber_Multiply(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_19);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_28 = __pyx_PyFloat_AsDouble(__pyx_t_19); if (unlikely((__pyx_t_28 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
      __pyx_v_pos0_max = __pyx_t_28;

     250:

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

      /* "splitBBox.pyx":251
     *     pos0_max = pos0_maxin * (1 + numpy.finfo(numpy.float32).eps)
     *
     *     if pos1Range is not None and len(pos1Range) > 1:             # <<<<<<<<<<<<<<
     *         pos1_min = min(pos1Range)
     *         pos1_maxin = max(pos1Range)
     */
      __pyx_t_27 = (__pyx_v_pos1Range != Py_None);
      if (__pyx_t_27) {
        __pyx_t_25 = PyObject_Length(__pyx_v_pos1Range); if (unlikely(__pyx_t_25 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_t_5 = (__pyx_t_25 > 1);
        __pyx_t_26 = __pyx_t_5;
      } else {
        __pyx_t_26 = __pyx_t_27;
      }
      if (__pyx_t_26) {

     252:         pos1_min = min(pos1Range)

        /* "splitBBox.pyx":252
     *
     *     if pos1Range is not None and len(pos1Range) > 1:
     *         pos1_min = min(pos1Range)             # <<<<<<<<<<<<<<
     *         pos1_maxin = max(pos1Range)
     *     else:
     */
        __pyx_t_19 = PyTuple_New(1); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_19);
        __Pyx_INCREF(__pyx_v_pos1Range);
        PyTuple_SET_ITEM(__pyx_t_19, 0, __pyx_v_pos1Range);
        __Pyx_GIVEREF(__pyx_v_pos1Range);
        __pyx_t_3 = PyObject_Call(__pyx_builtin_min, ((PyObject *)__pyx_t_19), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(((PyObject *)__pyx_t_19)); __pyx_t_19 = 0;
        __pyx_t_28 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_28 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_v_pos1_min = __pyx_t_28;

     253:         pos1_maxin = max(pos1Range)

        /* "splitBBox.pyx":253
     *     if pos1Range is not None and len(pos1Range) > 1:
     *         pos1_min = min(pos1Range)
     *         pos1_maxin = max(pos1Range)             # <<<<<<<<<<<<<<
     *     else:
     *         tmp = cdelta_pos1.min()
     */
        __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_INCREF(__pyx_v_pos1Range);
        PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_pos1Range);
        __Pyx_GIVEREF(__pyx_v_pos1Range);
        __pyx_t_19 = PyObject_Call(__pyx_builtin_max, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_19);
        __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
        __pyx_t_28 = __pyx_PyFloat_AsDouble(__pyx_t_19); if (unlikely((__pyx_t_28 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
        __pyx_v_pos1_maxin = __pyx_t_28;
        goto __pyx_L19;
      }
      /*else*/ {

     254:     else:

     255:         tmp = cdelta_pos1.min()

        /* "splitBBox.pyx":255
     *         pos1_maxin = max(pos1Range)
     *     else:
     *         tmp = cdelta_pos1.min()             # <<<<<<<<<<<<<<
     *         pos1_min = cpos1.min() - tmp
     *         pos1_maxin = cpos1.max() + tmp
     */
        __pyx_t_19 = PyObject_GetAttr(((PyObject *)__pyx_v_cdelta_pos1), __pyx_n_s__min); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_19);
        __pyx_t_3 = PyObject_Call(__pyx_t_19, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
        __pyx_t_28 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_28 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_v_tmp = __pyx_t_28;

     256:         pos1_min = cpos1.min() - tmp

        /* "splitBBox.pyx":256
     *     else:
     *         tmp = cdelta_pos1.min()
     *         pos1_min = cpos1.min() - tmp             # <<<<<<<<<<<<<<
     *         pos1_maxin = cpos1.max() + tmp
     *     pos1_max = pos1_maxin * (1 + numpy.finfo(numpy.float32).eps)
     */
        __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 = 256; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_19 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_19);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_3 = PyFloat_FromDouble(__pyx_v_tmp); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_1 = PyNumber_Subtract(__pyx_t_19, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_28 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_28 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_v_pos1_min = __pyx_t_28;

     257:         pos1_maxin = cpos1.max() + tmp

        /* "splitBBox.pyx":257
     *         tmp = cdelta_pos1.min()
     *         pos1_min = cpos1.min() - tmp
     *         pos1_maxin = cpos1.max() + tmp             # <<<<<<<<<<<<<<
     *     pos1_max = pos1_maxin * (1 + numpy.finfo(numpy.float32).eps)
     *
     */
        __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_cpos1), __pyx_n_s__max); 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_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_t_1 = PyFloat_FromDouble(__pyx_v_tmp); 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_t_19 = PyNumber_Add(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_19);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_t_28 = __pyx_PyFloat_AsDouble(__pyx_t_19); if (unlikely((__pyx_t_28 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
        __pyx_v_pos1_maxin = __pyx_t_28;
      }
      __pyx_L19:;

     258:     pos1_max = pos1_maxin * (1 + numpy.finfo(numpy.float32).eps)

      /* "splitBBox.pyx":258
     *         pos1_min = cpos1.min() - tmp
     *         pos1_maxin = cpos1.max() + tmp
     *     pos1_max = pos1_maxin * (1 + numpy.finfo(numpy.float32).eps)             # <<<<<<<<<<<<<<
     *
     *     cdef float dpos0 = (pos0_max - pos0_min) / (< float > (bins0))
     */
      __pyx_t_19 = PyFloat_FromDouble(__pyx_v_pos1_maxin); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_19);
      __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__finfo); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __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 = 258; __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 = 258; __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 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
      __pyx_t_1 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__eps); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = PyNumber_Add(__pyx_int_1, __pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyNumber_Multiply(__pyx_t_19, __pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_28 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_28 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v_pos1_max = __pyx_t_28;

     259:

     260:     cdef float dpos0 = (pos0_max - pos0_min) / (< float > (bins0))

      /* "splitBBox.pyx":260
     *     pos1_max = pos1_maxin * (1 + numpy.finfo(numpy.float32).eps)
     *
     *     cdef float dpos0 = (pos0_max - pos0_min) / (< float > (bins0))             # <<<<<<<<<<<<<<
     *     cdef float dpos1 = (pos1_max - pos1_min) / (< float > (bins1))
     *
     */
      __pyx_v_dpos0 = ((__pyx_v_pos0_max - __pyx_v_pos0_min) / ((float)__pyx_v_bins0));

     261:     cdef float dpos1 = (pos1_max - pos1_min) / (< float > (bins1))

      /* "splitBBox.pyx":261
     *
     *     cdef float dpos0 = (pos0_max - pos0_min) / (< float > (bins0))
     *     cdef float dpos1 = (pos1_max - pos1_min) / (< float > (bins1))             # <<<<<<<<<<<<<<
     *
     *     with nogil:
     */
      __pyx_v_dpos1 = ((__pyx_v_pos1_max - __pyx_v_pos1_min) / ((float)__pyx_v_bins1));

     262:

     263:     with nogil:

      /* "splitBBox.pyx":263
     *     cdef float dpos1 = (pos1_max - pos1_min) / (< float > (bins1))
     *
     *     with nogil:             # <<<<<<<<<<<<<<
     *         for i in range(bins0):
     *                 edges0[i] = pos0_min + (0.5 +< double > i) * dpos0
     */
      {
          #ifdef WITH_THREAD
          PyThreadState *_save = NULL;
          #endif
          Py_UNBLOCK_THREADS
          /*try:*/ {

          /* "splitBBox.pyx":263
     *     cdef float dpos1 = (pos1_max - pos1_min) / (< float > (bins1))
     *
     *     with nogil:             # <<<<<<<<<<<<<<
     *         for i in range(bins0):
     *                 edges0[i] = pos0_min + (0.5 +< double > i) * dpos0
     */
          /*finally:*/ {
            Py_BLOCK_THREADS
          }
      }

     264:         for i in range(bins0):

            /* "splitBBox.pyx":264
     *
     *     with nogil:
     *         for i in range(bins0):             # <<<<<<<<<<<<<<
     *                 edges0[i] = pos0_min + (0.5 +< double > i) * dpos0
     *         for i in range(bins1):
     */
            __pyx_t_9 = __pyx_v_bins0;
            for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_9; __pyx_t_2+=1) {
              __pyx_v_i = __pyx_t_2;

     265:                 edges0[i] = pos0_min + (0.5 +< double > i) * dpos0

              /* "splitBBox.pyx":265
     *     with nogil:
     *         for i in range(bins0):
     *                 edges0[i] = pos0_min + (0.5 +< double > i) * dpos0             # <<<<<<<<<<<<<<
     *         for i in range(bins1):
     *                 edges1[i] = pos1_min + (0.5 +< double > i) * dpos1
     */
              __pyx_t_30 = __pyx_v_i;
              *__Pyx_BufPtrStrided1d(__pyx_t_9splitBBox_DTYPE_float32_t *, __pyx_pybuffernd_edges0.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_edges0.diminfo[0].strides) = (__pyx_v_pos0_min + ((0.5 + ((double)__pyx_v_i)) * __pyx_v_dpos0));
            }

     266:         for i in range(bins1):

            /* "splitBBox.pyx":266
     *         for i in range(bins0):
     *                 edges0[i] = pos0_min + (0.5 +< double > i) * dpos0
     *         for i in range(bins1):             # <<<<<<<<<<<<<<
     *                 edges1[i] = pos1_min + (0.5 +< double > i) * dpos1
     *
     */
            __pyx_t_9 = __pyx_v_bins1;
            for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_9; __pyx_t_2+=1) {
              __pyx_v_i = __pyx_t_2;

     267:                 edges1[i] = pos1_min + (0.5 +< double > i) * dpos1

              /* "splitBBox.pyx":267
     *                 edges0[i] = pos0_min + (0.5 +< double > i) * dpos0
     *         for i in range(bins1):
     *                 edges1[i] = pos1_min + (0.5 +< double > i) * dpos1             # <<<<<<<<<<<<<<
     *
     *         for idx in range(size):
     */
              __pyx_t_31 = __pyx_v_i;
              *__Pyx_BufPtrStrided1d(__pyx_t_9splitBBox_DTYPE_float32_t *, __pyx_pybuffernd_edges1.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_edges1.diminfo[0].strides) = (__pyx_v_pos1_min + ((0.5 + ((double)__pyx_v_i)) * __pyx_v_dpos1));
            }

     268:

     269:         for idx in range(size):

            /* "splitBBox.pyx":269
     *                 edges1[i] = pos1_min + (0.5 +< double > i) * dpos1
     *
     *         for idx in range(size):             # <<<<<<<<<<<<<<
     *             data = cdata[idx]
     *             min0 = cpos0_inf[idx]
     */
            __pyx_t_9 = __pyx_v_size;
            for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_9; __pyx_t_2+=1) {
              __pyx_v_idx = __pyx_t_2;

     270:             data = cdata[idx]

              /* "splitBBox.pyx":270
     *
     *         for idx in range(size):
     *             data = cdata[idx]             # <<<<<<<<<<<<<<
     *             min0 = cpos0_inf[idx]
     *             max0 = cpos0_sup[idx]
     */
              __pyx_t_32 = __pyx_v_idx;
              __pyx_v_data = (*__Pyx_BufPtrStrided1d(__pyx_t_9splitBBox_DTYPE_float64_t *, __pyx_pybuffernd_cdata.rcbuffer->pybuffer.buf, __pyx_t_32, __pyx_pybuffernd_cdata.diminfo[0].strides));

     271:             min0 = cpos0_inf[idx]

              /* "splitBBox.pyx":271
     *         for idx in range(size):
     *             data = cdata[idx]
     *             min0 = cpos0_inf[idx]             # <<<<<<<<<<<<<<
     *             max0 = cpos0_sup[idx]
     *             min1 = cpos1_inf[idx]
     */
              __pyx_t_33 = __pyx_v_idx;
              __pyx_v_min0 = (*__Pyx_BufPtrStrided1d(__pyx_t_9splitBBox_DTYPE_float32_t *, __pyx_pybuffernd_cpos0_inf.rcbuffer->pybuffer.buf, __pyx_t_33, __pyx_pybuffernd_cpos0_inf.diminfo[0].strides));

     272:             max0 = cpos0_sup[idx]

              /* "splitBBox.pyx":272
     *             data = cdata[idx]
     *             min0 = cpos0_inf[idx]
     *             max0 = cpos0_sup[idx]             # <<<<<<<<<<<<<<
     *             min1 = cpos1_inf[idx]
     *             max1 = cpos1_sup[idx]
     */
              __pyx_t_34 = __pyx_v_idx;
              __pyx_v_max0 = (*__Pyx_BufPtrStrided1d(__pyx_t_9splitBBox_DTYPE_float32_t *, __pyx_pybuffernd_cpos0_sup.rcbuffer->pybuffer.buf, __pyx_t_34, __pyx_pybuffernd_cpos0_sup.diminfo[0].strides));

     273:             min1 = cpos1_inf[idx]

              /* "splitBBox.pyx":273
     *             min0 = cpos0_inf[idx]
     *             max0 = cpos0_sup[idx]
     *             min1 = cpos1_inf[idx]             # <<<<<<<<<<<<<<
     *             max1 = cpos1_sup[idx]
     *
     */
              __pyx_t_35 = __pyx_v_idx;
              __pyx_v_min1 = (*__Pyx_BufPtrStrided1d(__pyx_t_9splitBBox_DTYPE_float32_t *, __pyx_pybuffernd_cpos1_inf.rcbuffer->pybuffer.buf, __pyx_t_35, __pyx_pybuffernd_cpos1_inf.diminfo[0].strides));

     274:             max1 = cpos1_sup[idx]

              /* "splitBBox.pyx":274
     *             max0 = cpos0_sup[idx]
     *             min1 = cpos1_inf[idx]
     *             max1 = cpos1_sup[idx]             # <<<<<<<<<<<<<<
     *
     *             if (max0 < pos0_min) or (max1 < pos1_min) or (min0 > pos0_maxin) or (min1 > pos1_maxin) :
     */
              __pyx_t_36 = __pyx_v_idx;
              __pyx_v_max1 = (*__Pyx_BufPtrStrided1d(__pyx_t_9splitBBox_DTYPE_float32_t *, __pyx_pybuffernd_cpos1_sup.rcbuffer->pybuffer.buf, __pyx_t_36, __pyx_pybuffernd_cpos1_sup.diminfo[0].strides));

     275:

     276:             if (max0 < pos0_min) or (max1 < pos1_min) or (min0 > pos0_maxin) or (min1 > pos1_maxin) :

              /* "splitBBox.pyx":276
     *             max1 = cpos1_sup[idx]
     *
     *             if (max0 < pos0_min) or (max1 < pos1_min) or (min0 > pos0_maxin) or (min1 > pos1_maxin) :             # <<<<<<<<<<<<<<
     *                 continue
     *
     */
              __pyx_t_26 = (__pyx_v_max0 < __pyx_v_pos0_min);
              if (!__pyx_t_26) {
                __pyx_t_27 = (__pyx_v_max1 < __pyx_v_pos1_min);
                if (!__pyx_t_27) {
                  __pyx_t_5 = (__pyx_v_min0 > __pyx_v_pos0_maxin);
                  if (!__pyx_t_5) {
                    __pyx_t_37 = (__pyx_v_min1 > __pyx_v_pos1_maxin);
                    __pyx_t_38 = __pyx_t_37;
                  } else {
                    __pyx_t_38 = __pyx_t_5;
                  }
                  __pyx_t_5 = __pyx_t_38;
                } else {
                  __pyx_t_5 = __pyx_t_27;
                }
                __pyx_t_27 = __pyx_t_5;
              } else {
                __pyx_t_27 = __pyx_t_26;
              }
              if (__pyx_t_27) {

     277:                 continue

                /* "splitBBox.pyx":277
     *
     *             if (max0 < pos0_min) or (max1 < pos1_min) or (min0 > pos0_maxin) or (min1 > pos1_maxin) :
     *                 continue             # <<<<<<<<<<<<<<
     *
     *             if min0 < pos0_min:
     */
                goto __pyx_L27_continue;
                goto __pyx_L29;
              }
              __pyx_L29:;

     278:

     279:             if min0 < pos0_min:

              /* "splitBBox.pyx":279
     *                 continue
     *
     *             if min0 < pos0_min:             # <<<<<<<<<<<<<<
     *                 min0 = pos0_min
     *             if min1 < pos1_min:
     */
              __pyx_t_27 = (__pyx_v_min0 < __pyx_v_pos0_min);
              if (__pyx_t_27) {

     280:                 min0 = pos0_min

                /* "splitBBox.pyx":280
     *
     *             if min0 < pos0_min:
     *                 min0 = pos0_min             # <<<<<<<<<<<<<<
     *             if min1 < pos1_min:
     *                 min1 = pos1_min
     */
                __pyx_v_min0 = __pyx_v_pos0_min;
                goto __pyx_L30;
              }
              __pyx_L30:;

     281:             if min1 < pos1_min:

              /* "splitBBox.pyx":281
     *             if min0 < pos0_min:
     *                 min0 = pos0_min
     *             if min1 < pos1_min:             # <<<<<<<<<<<<<<
     *                 min1 = pos1_min
     *             if max0 > pos0_maxin:
     */
              __pyx_t_27 = (__pyx_v_min1 < __pyx_v_pos1_min);
              if (__pyx_t_27) {

     282:                 min1 = pos1_min

                /* "splitBBox.pyx":282
     *                 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_L31;
              }
              __pyx_L31:;

     283:             if max0 > pos0_maxin:

              /* "splitBBox.pyx":283
     *             if min1 < pos1_min:
     *                 min1 = pos1_min
     *             if max0 > pos0_maxin:             # <<<<<<<<<<<<<<
     *                 max0 = pos0_maxin
     *             if max1 > pos1_maxin:
     */
              __pyx_t_27 = (__pyx_v_max0 > __pyx_v_pos0_maxin);
              if (__pyx_t_27) {

     284:                 max0 = pos0_maxin

                /* "splitBBox.pyx":284
     *                 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_L32;
              }
              __pyx_L32:;

     285:             if max1 > pos1_maxin:

              /* "splitBBox.pyx":285
     *             if max0 > pos0_maxin:
     *                 max0 = pos0_maxin
     *             if max1 > pos1_maxin:             # <<<<<<<<<<<<<<
     *                 max1 = pos1_maxin
     *
     */
              __pyx_t_27 = (__pyx_v_max1 > __pyx_v_pos1_maxin);
              if (__pyx_t_27) {

     286:                 max1 = pos1_maxin

                /* "splitBBox.pyx":286
     *                 max0 = pos0_maxin
     *             if max1 > pos1_maxin:
     *                 max1 = pos1_maxin             # <<<<<<<<<<<<<<
     *
     *
     */
                __pyx_v_max1 = __pyx_v_pos1_maxin;
                goto __pyx_L33;
              }
              __pyx_L33:;

     287:

     288:

     289:             fbin0_min = getBinNr(min0, pos0_min, dpos0)

              /* "splitBBox.pyx":289
     *
     *
     *             fbin0_min = getBinNr(min0, pos0_min, dpos0)             # <<<<<<<<<<<<<<
     *             fbin0_max = getBinNr(max0, pos0_min, dpos0)
     *             fbin1_min = getBinNr(min1, pos1_min, dpos1)
     */
              __pyx_v_fbin0_min = __pyx_f_9splitBBox_getBinNr(__pyx_v_min0, __pyx_v_pos0_min, __pyx_v_dpos0);

     290:             fbin0_max = getBinNr(max0, pos0_min, dpos0)

              /* "splitBBox.pyx":290
     *
     *             fbin0_min = getBinNr(min0, pos0_min, dpos0)
     *             fbin0_max = getBinNr(max0, pos0_min, dpos0)             # <<<<<<<<<<<<<<
     *             fbin1_min = getBinNr(min1, pos1_min, dpos1)
     *             fbin1_max = getBinNr(max1, pos1_min, dpos1)
     */
              __pyx_v_fbin0_max = __pyx_f_9splitBBox_getBinNr(__pyx_v_max0, __pyx_v_pos0_min, __pyx_v_dpos0);

     291:             fbin1_min = getBinNr(min1, pos1_min, dpos1)

              /* "splitBBox.pyx":291
     *             fbin0_min = getBinNr(min0, pos0_min, dpos0)
     *             fbin0_max = getBinNr(max0, pos0_min, dpos0)
     *             fbin1_min = getBinNr(min1, pos1_min, dpos1)             # <<<<<<<<<<<<<<
     *             fbin1_max = getBinNr(max1, pos1_min, dpos1)
     *
     */
              __pyx_v_fbin1_min = __pyx_f_9splitBBox_getBinNr(__pyx_v_min1, __pyx_v_pos1_min, __pyx_v_dpos1);

     292:             fbin1_max = getBinNr(max1, pos1_min, dpos1)

              /* "splitBBox.pyx":292
     *             fbin0_max = getBinNr(max0, pos0_min, dpos0)
     *             fbin1_min = getBinNr(min1, pos1_min, dpos1)
     *             fbin1_max = getBinNr(max1, pos1_min, dpos1)             # <<<<<<<<<<<<<<
     *
     *             bin0_min = < long > floor(fbin0_min)
     */
              __pyx_v_fbin1_max = __pyx_f_9splitBBox_getBinNr(__pyx_v_max1, __pyx_v_pos1_min, __pyx_v_dpos1);

     293:

     294:             bin0_min = < long > floor(fbin0_min)

              /* "splitBBox.pyx":294
     *             fbin1_max = getBinNr(max1, pos1_min, dpos1)
     *
     *             bin0_min = < long > floor(fbin0_min)             # <<<<<<<<<<<<<<
     *             bin0_max = < long > floor(fbin0_max)
     *             bin1_min = < long > floor(fbin1_min)
     */
              __pyx_v_bin0_min = ((long)floor(__pyx_v_fbin0_min));

     295:             bin0_max = < long > floor(fbin0_max)

              /* "splitBBox.pyx":295
     *
     *             bin0_min = < long > floor(fbin0_min)
     *             bin0_max = < long > floor(fbin0_max)             # <<<<<<<<<<<<<<
     *             bin1_min = < long > floor(fbin1_min)
     *             bin1_max = < long > floor(fbin1_max)
     */
              __pyx_v_bin0_max = ((long)floor(__pyx_v_fbin0_max));

     296:             bin1_min = < long > floor(fbin1_min)

              /* "splitBBox.pyx":296
     *             bin0_min = < long > floor(fbin0_min)
     *             bin0_max = < long > floor(fbin0_max)
     *             bin1_min = < long > floor(fbin1_min)             # <<<<<<<<<<<<<<
     *             bin1_max = < long > floor(fbin1_max)
     *
     */
              __pyx_v_bin1_min = ((long)floor(__pyx_v_fbin1_min));

     297:             bin1_max = < long > floor(fbin1_max)

              /* "splitBBox.pyx":297
     *             bin0_max = < long > floor(fbin0_max)
     *             bin1_min = < long > floor(fbin1_min)
     *             bin1_max = < long > floor(fbin1_max)             # <<<<<<<<<<<<<<
     *
     *
     */
              __pyx_v_bin1_max = ((long)floor(__pyx_v_fbin1_max));

     298:

     299:

     300:             if bin0_min == bin0_max:

              /* "splitBBox.pyx":300
     *
     *
     *             if bin0_min == bin0_max:             # <<<<<<<<<<<<<<
     *                 if bin1_min == bin1_max:
     *                     #All pixel is within a single bin
     */
              __pyx_t_27 = (__pyx_v_bin0_min == __pyx_v_bin0_max);
              if (__pyx_t_27) {

     301:                 if bin1_min == bin1_max:

                /* "splitBBox.pyx":301
     *
     *             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_27 = (__pyx_v_bin1_min == __pyx_v_bin1_max);
                if (__pyx_t_27) {

     302:                     #All pixel is within a single bin

     303:                     outCount[bin0_min, bin1_min] += 1.0

                  /* "splitBBox.pyx":303
     *                 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_39 = __pyx_v_bin0_min;
                  __pyx_t_40 = __pyx_v_bin1_min;
                  *__Pyx_BufPtrStrided2d(__pyx_t_9splitBBox_DTYPE_float64_t *, __pyx_pybuffernd_outCount.rcbuffer->pybuffer.buf, __pyx_t_39, __pyx_pybuffernd_outCount.diminfo[0].strides, __pyx_t_40, __pyx_pybuffernd_outCount.diminfo[1].strides) += 1.0;

     304:                     outData[bin0_min, bin1_min] += data

                  /* "splitBBox.pyx":304
     *                     #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_41 = __pyx_v_bin0_min;
                  __pyx_t_42 = __pyx_v_bin1_min;
                  *__Pyx_BufPtrStrided2d(__pyx_t_9splitBBox_DTYPE_float64_t *, __pyx_pybuffernd_outData.rcbuffer->pybuffer.buf, __pyx_t_41, __pyx_pybuffernd_outData.diminfo[0].strides, __pyx_t_42, __pyx_pybuffernd_outData.diminfo[1].strides) += __pyx_v_data;
                  goto __pyx_L35;
                }
                /*else*/ {

     305:                 else:

     306:                     #spread on more than 2 bins

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

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

     308:                     deltaU = fbin1_max - (< double > bin1_max)

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

     309:                     deltaA = 1.0 / (fbin1_max - fbin1_min)

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

     310:

     311:                     outCount[bin0_min, bin1_min] += < double > deltaA * deltaD

                  /* "splitBBox.pyx":311
     *                     deltaA = 1.0 / (fbin1_max - fbin1_min)
     *
     *                     outCount[bin0_min, bin1_min] += < double > deltaA * deltaD             # <<<<<<<<<<<<<<
     *                     outData[bin0_min, bin1_min] += data * deltaA * deltaD
     *
     */
                  __pyx_t_43 = __pyx_v_bin0_min;
                  __pyx_t_44 = __pyx_v_bin1_min;
                  *__Pyx_BufPtrStrided2d(__pyx_t_9splitBBox_DTYPE_float64_t *, __pyx_pybuffernd_outCount.rcbuffer->pybuffer.buf, __pyx_t_43, __pyx_pybuffernd_outCount.diminfo[0].strides, __pyx_t_44, __pyx_pybuffernd_outCount.diminfo[1].strides) += (((double)__pyx_v_deltaA) * __pyx_v_deltaD);

     312:                     outData[bin0_min, bin1_min] += data * deltaA * deltaD

                  /* "splitBBox.pyx":312
     *
     *                     outCount[bin0_min, bin1_min] += < double > deltaA * deltaD
     *                     outData[bin0_min, bin1_min] += data * deltaA * deltaD             # <<<<<<<<<<<<<<
     *
     *                     outCount[bin0_min, bin1_max] += < double > deltaA * deltaU
     */
                  __pyx_t_45 = __pyx_v_bin0_min;
                  __pyx_t_46 = __pyx_v_bin1_min;
                  *__Pyx_BufPtrStrided2d(__pyx_t_9splitBBox_DTYPE_float64_t *, __pyx_pybuffernd_outData.rcbuffer->pybuffer.buf, __pyx_t_45, __pyx_pybuffernd_outData.diminfo[0].strides, __pyx_t_46, __pyx_pybuffernd_outData.diminfo[1].strides) += ((__pyx_v_data * __pyx_v_deltaA) * __pyx_v_deltaD);

     313:

     314:                     outCount[bin0_min, bin1_max] += < double > deltaA * deltaU

                  /* "splitBBox.pyx":314
     *                     outData[bin0_min, bin1_min] += data * deltaA * deltaD
     *
     *                     outCount[bin0_min, bin1_max] += < double > deltaA * deltaU             # <<<<<<<<<<<<<<
     *                     outData[bin0_min, bin1_max] += data * deltaA * deltaU
     *                     for j in range(bin1_min + 1, bin1_max):
     */
                  __pyx_t_47 = __pyx_v_bin0_min;
                  __pyx_t_48 = __pyx_v_bin1_max;
                  *__Pyx_BufPtrStrided2d(__pyx_t_9splitBBox_DTYPE_float64_t *, __pyx_pybuffernd_outCount.rcbuffer->pybuffer.buf, __pyx_t_47, __pyx_pybuffernd_outCount.diminfo[0].strides, __pyx_t_48, __pyx_pybuffernd_outCount.diminfo[1].strides) += (((double)__pyx_v_deltaA) * __pyx_v_deltaU);

     315:                     outData[bin0_min, bin1_max] += data * deltaA * deltaU

                  /* "splitBBox.pyx":315
     *
     *                     outCount[bin0_min, bin1_max] += < double > deltaA * deltaU
     *                     outData[bin0_min, bin1_max] += data * deltaA * deltaU             # <<<<<<<<<<<<<<
     *                     for j in range(bin1_min + 1, bin1_max):
     *                         outCount[bin0_min, j] += < double > deltaA
     */
                  __pyx_t_49 = __pyx_v_bin0_min;
                  __pyx_t_50 = __pyx_v_bin1_max;
                  *__Pyx_BufPtrStrided2d(__pyx_t_9splitBBox_DTYPE_float64_t *, __pyx_pybuffernd_outData.rcbuffer->pybuffer.buf, __pyx_t_49, __pyx_pybuffernd_outData.diminfo[0].strides, __pyx_t_50, __pyx_pybuffernd_outData.diminfo[1].strides) += ((__pyx_v_data * __pyx_v_deltaA) * __pyx_v_deltaU);

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

                  /* "splitBBox.pyx":316
     *                     outCount[bin0_min, bin1_max] += < double > deltaA * deltaU
     *                     outData[bin0_min, bin1_max] += data * deltaA * deltaU
     *                     for j in range(bin1_min + 1, bin1_max):             # <<<<<<<<<<<<<<
     *                         outCount[bin0_min, j] += < double > deltaA
     *                         outData[bin0_min, j] += data * deltaA
     */
                  __pyx_t_51 = __pyx_v_bin1_max;
                  for (__pyx_t_52 = (__pyx_v_bin1_min + 1); __pyx_t_52 < __pyx_t_51; __pyx_t_52+=1) {
                    __pyx_v_j = __pyx_t_52;

     317:                         outCount[bin0_min, j] += < double > deltaA

                    /* "splitBBox.pyx":317
     *                     outData[bin0_min, bin1_max] += data * deltaA * deltaU
     *                     for j in range(bin1_min + 1, bin1_max):
     *                         outCount[bin0_min, j] += < double > deltaA             # <<<<<<<<<<<<<<
     *                         outData[bin0_min, j] += data * deltaA
     *
     */
                    __pyx_t_53 = __pyx_v_bin0_min;
                    __pyx_t_54 = __pyx_v_j;
                    *__Pyx_BufPtrStrided2d(__pyx_t_9splitBBox_DTYPE_float64_t *, __pyx_pybuffernd_outCount.rcbuffer->pybuffer.buf, __pyx_t_53, __pyx_pybuffernd_outCount.diminfo[0].strides, __pyx_t_54, __pyx_pybuffernd_outCount.diminfo[1].strides) += ((double)__pyx_v_deltaA);

     318:                         outData[bin0_min, j] += data * deltaA

                    /* "splitBBox.pyx":318
     *                     for j in range(bin1_min + 1, bin1_max):
     *                         outCount[bin0_min, j] += < double > deltaA
     *                         outData[bin0_min, j] += data * deltaA             # <<<<<<<<<<<<<<
     *
     *             else: #spread on more than 2 bins in dim 0
     */
                    __pyx_t_55 = __pyx_v_bin0_min;
                    __pyx_t_56 = __pyx_v_j;
                    *__Pyx_BufPtrStrided2d(__pyx_t_9splitBBox_DTYPE_float64_t *, __pyx_pybuffernd_outData.rcbuffer->pybuffer.buf, __pyx_t_55, __pyx_pybuffernd_outData.diminfo[0].strides, __pyx_t_56, __pyx_pybuffernd_outData.diminfo[1].strides) += (__pyx_v_data * __pyx_v_deltaA);
                  }
                }
                __pyx_L35:;
                goto __pyx_L34;
              }
              /*else*/ {

     319:

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

     321:                 if bin1_min == bin1_max:

                /* "splitBBox.pyx":321
     *
     *             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_27 = (__pyx_v_bin1_min == __pyx_v_bin1_max);
                if (__pyx_t_27) {

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

     323:                     deltaA = 1.0 / (fbin0_max - fbin0_min)

                  /* "splitBBox.pyx":323
     *                 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] += < double > deltaA * deltaL
     */
                  __pyx_v_deltaA = (1.0 / (__pyx_v_fbin0_max - __pyx_v_fbin0_min));

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

                  /* "splitBBox.pyx":324
     *                     #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] += < double > deltaA * deltaL
     *                     outData[bin0_min, bin1_min] += < double > data * deltaA * deltaL
     */
                  __pyx_v_deltaL = (((float)(__pyx_v_bin0_min + 1)) - __pyx_v_fbin0_min);

     325:                     outCount[bin0_min, bin1_min] += < double > deltaA * deltaL

                  /* "splitBBox.pyx":325
     *                     deltaA = 1.0 / (fbin0_max - fbin0_min)
     *                     deltaL = (< float > (bin0_min + 1)) - fbin0_min
     *                     outCount[bin0_min, bin1_min] += < double > deltaA * deltaL             # <<<<<<<<<<<<<<
     *                     outData[bin0_min, bin1_min] += < double > data * deltaA * deltaL
     *                     deltaR = fbin0_max - (< float > bin0_max)
     */
                  __pyx_t_51 = __pyx_v_bin0_min;
                  __pyx_t_52 = __pyx_v_bin1_min;
                  *__Pyx_BufPtrStrided2d(__pyx_t_9splitBBox_DTYPE_float64_t *, __pyx_pybuffernd_outCount.rcbuffer->pybuffer.buf, __pyx_t_51, __pyx_pybuffernd_outCount.diminfo[0].strides, __pyx_t_52, __pyx_pybuffernd_outCount.diminfo[1].strides) += (((double)__pyx_v_deltaA) * __pyx_v_deltaL);

     326:                     outData[bin0_min, bin1_min] += < double > data * deltaA * deltaL

                  /* "splitBBox.pyx":326
     *                     deltaL = (< float > (bin0_min + 1)) - fbin0_min
     *                     outCount[bin0_min, bin1_min] += < double > deltaA * deltaL
     *                     outData[bin0_min, bin1_min] += < double > data * deltaA * deltaL             # <<<<<<<<<<<<<<
     *                     deltaR = fbin0_max - (< float > bin0_max)
     *                     outCount[bin0_max, bin1_min] += < double > deltaA * deltaR
     */
                  __pyx_t_57 = __pyx_v_bin0_min;
                  __pyx_t_58 = __pyx_v_bin1_min;
                  *__Pyx_BufPtrStrided2d(__pyx_t_9splitBBox_DTYPE_float64_t *, __pyx_pybuffernd_outData.rcbuffer->pybuffer.buf, __pyx_t_57, __pyx_pybuffernd_outData.diminfo[0].strides, __pyx_t_58, __pyx_pybuffernd_outData.diminfo[1].strides) += ((((double)__pyx_v_data) * __pyx_v_deltaA) * __pyx_v_deltaL);

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

                  /* "splitBBox.pyx":327
     *                     outCount[bin0_min, bin1_min] += < double > deltaA * deltaL
     *                     outData[bin0_min, bin1_min] += < double > data * deltaA * deltaL
     *                     deltaR = fbin0_max - (< float > bin0_max)             # <<<<<<<<<<<<<<
     *                     outCount[bin0_max, bin1_min] += < double > deltaA * deltaR
     *                     outData[bin0_max, bin1_min] += < double > data * deltaA * deltaR
     */
                  __pyx_v_deltaR = (__pyx_v_fbin0_max - ((float)__pyx_v_bin0_max));

     328:                     outCount[bin0_max, bin1_min] += < double > deltaA * deltaR

                  /* "splitBBox.pyx":328
     *                     outData[bin0_min, bin1_min] += < double > data * deltaA * deltaL
     *                     deltaR = fbin0_max - (< float > bin0_max)
     *                     outCount[bin0_max, bin1_min] += < double > deltaA * deltaR             # <<<<<<<<<<<<<<
     *                     outData[bin0_max, bin1_min] += < double > data * deltaA * deltaR
     *                     for i in range(bin0_min + 1, bin0_max):
     */
                  __pyx_t_59 = __pyx_v_bin0_max;
                  __pyx_t_60 = __pyx_v_bin1_min;
                  *__Pyx_BufPtrStrided2d(__pyx_t_9splitBBox_DTYPE_float64_t *, __pyx_pybuffernd_outCount.rcbuffer->pybuffer.buf, __pyx_t_59, __pyx_pybuffernd_outCount.diminfo[0].strides, __pyx_t_60, __pyx_pybuffernd_outCount.diminfo[1].strides) += (((double)__pyx_v_deltaA) * __pyx_v_deltaR);

     329:                     outData[bin0_max, bin1_min] += < double > data * deltaA * deltaR

                  /* "splitBBox.pyx":329
     *                     deltaR = fbin0_max - (< float > bin0_max)
     *                     outCount[bin0_max, bin1_min] += < double > deltaA * deltaR
     *                     outData[bin0_max, bin1_min] += < double > data * deltaA * deltaR             # <<<<<<<<<<<<<<
     *                     for i in range(bin0_min + 1, bin0_max):
     *                             outCount[i, bin1_min] += < double > deltaA
     */
                  __pyx_t_61 = __pyx_v_bin0_max;
                  __pyx_t_62 = __pyx_v_bin1_min;
                  *__Pyx_BufPtrStrided2d(__pyx_t_9splitBBox_DTYPE_float64_t *, __pyx_pybuffernd_outData.rcbuffer->pybuffer.buf, __pyx_t_61, __pyx_pybuffernd_outData.diminfo[0].strides, __pyx_t_62, __pyx_pybuffernd_outData.diminfo[1].strides) += ((((double)__pyx_v_data) * __pyx_v_deltaA) * __pyx_v_deltaR);

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

                  /* "splitBBox.pyx":330
     *                     outCount[bin0_max, bin1_min] += < double > deltaA * deltaR
     *                     outData[bin0_max, bin1_min] += < double > data * deltaA * deltaR
     *                     for i in range(bin0_min + 1, bin0_max):             # <<<<<<<<<<<<<<
     *                             outCount[i, bin1_min] += < double > deltaA
     *                             outData[i, bin1_min] += < double > data * deltaA
     */
                  __pyx_t_63 = __pyx_v_bin0_max;
                  for (__pyx_t_64 = (__pyx_v_bin0_min + 1); __pyx_t_64 < __pyx_t_63; __pyx_t_64+=1) {
                    __pyx_v_i = __pyx_t_64;

     331:                             outCount[i, bin1_min] += < double > deltaA

                    /* "splitBBox.pyx":331
     *                     outData[bin0_max, bin1_min] += < double > data * deltaA * deltaR
     *                     for i in range(bin0_min + 1, bin0_max):
     *                             outCount[i, bin1_min] += < double > deltaA             # <<<<<<<<<<<<<<
     *                             outData[i, bin1_min] += < double > data * deltaA
     *                 else:
     */
                    __pyx_t_65 = __pyx_v_i;
                    __pyx_t_66 = __pyx_v_bin1_min;
                    *__Pyx_BufPtrStrided2d(__pyx_t_9splitBBox_DTYPE_float64_t *, __pyx_pybuffernd_outCount.rcbuffer->pybuffer.buf, __pyx_t_65, __pyx_pybuffernd_outCount.diminfo[0].strides, __pyx_t_66, __pyx_pybuffernd_outCount.diminfo[1].strides) += ((double)__pyx_v_deltaA);

     332:                             outData[i, bin1_min] += < double > data * deltaA

                    /* "splitBBox.pyx":332
     *                     for i in range(bin0_min + 1, bin0_max):
     *                             outCount[i, bin1_min] += < double > deltaA
     *                             outData[i, bin1_min] += < double > data * deltaA             # <<<<<<<<<<<<<<
     *                 else:
     *                     #spread on n pix in dim0 and m pixel in dim1:
     */
                    __pyx_t_67 = __pyx_v_i;
                    __pyx_t_68 = __pyx_v_bin1_min;
                    *__Pyx_BufPtrStrided2d(__pyx_t_9splitBBox_DTYPE_float64_t *, __pyx_pybuffernd_outData.rcbuffer->pybuffer.buf, __pyx_t_67, __pyx_pybuffernd_outData.diminfo[0].strides, __pyx_t_68, __pyx_pybuffernd_outData.diminfo[1].strides) += (((double)__pyx_v_data) * __pyx_v_deltaA);
                  }
                  goto __pyx_L38;
                }
                /*else*/ {

     333:                 else:

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

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

                  /* "splitBBox.pyx":335
     *                 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);

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

                  /* "splitBBox.pyx":336
     *                     #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));

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

                  /* "splitBBox.pyx":337
     *                     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);

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

                  /* "splitBBox.pyx":338
     *                     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));

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

                  /* "splitBBox.pyx":339
     *                     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] += < double > deltaA * deltaL * deltaD
     */
                  __pyx_v_deltaA = ((1.0 / (__pyx_v_fbin0_max - __pyx_v_fbin0_min)) / (__pyx_v_fbin1_max - __pyx_v_fbin1_min));

     340:

     341:                     outCount[bin0_min, bin1_min] += < double > deltaA * deltaL * deltaD

                  /* "splitBBox.pyx":341
     *                     deltaA = 1.0 / (fbin0_max - fbin0_min) / (fbin1_max - fbin1_min)
     *
     *                     outCount[bin0_min, bin1_min] += < double > deltaA * deltaL * deltaD             # <<<<<<<<<<<<<<
     *                     outData[bin0_min, bin1_min] += < double > data * deltaA * deltaL * deltaD
     *
     */
                  __pyx_t_63 = __pyx_v_bin0_min;
                  __pyx_t_64 = __pyx_v_bin1_min;
                  *__Pyx_BufPtrStrided2d(__pyx_t_9splitBBox_DTYPE_float64_t *, __pyx_pybuffernd_outCount.rcbuffer->pybuffer.buf, __pyx_t_63, __pyx_pybuffernd_outCount.diminfo[0].strides, __pyx_t_64, __pyx_pybuffernd_outCount.diminfo[1].strides) += ((((double)__pyx_v_deltaA) * __pyx_v_deltaL) * __pyx_v_deltaD);

     342:                     outData[bin0_min, bin1_min] += < double > data * deltaA * deltaL * deltaD

                  /* "splitBBox.pyx":342
     *
     *                     outCount[bin0_min, bin1_min] += < double > deltaA * deltaL * deltaD
     *                     outData[bin0_min, bin1_min] += < double > data * deltaA * deltaL * deltaD             # <<<<<<<<<<<<<<
     *
     *                     outCount[bin0_min, bin1_max] += < double > deltaA * deltaL * deltaU
     */
                  __pyx_t_69 = __pyx_v_bin0_min;
                  __pyx_t_70 = __pyx_v_bin1_min;
                  *__Pyx_BufPtrStrided2d(__pyx_t_9splitBBox_DTYPE_float64_t *, __pyx_pybuffernd_outData.rcbuffer->pybuffer.buf, __pyx_t_69, __pyx_pybuffernd_outData.diminfo[0].strides, __pyx_t_70, __pyx_pybuffernd_outData.diminfo[1].strides) += (((((double)__pyx_v_data) * __pyx_v_deltaA) * __pyx_v_deltaL) * __pyx_v_deltaD);

     343:

     344:                     outCount[bin0_min, bin1_max] += < double > deltaA * deltaL * deltaU

                  /* "splitBBox.pyx":344
     *                     outData[bin0_min, bin1_min] += < double > data * deltaA * deltaL * deltaD
     *
     *                     outCount[bin0_min, bin1_max] += < double > deltaA * deltaL * deltaU             # <<<<<<<<<<<<<<
     *                     outData[bin0_min, bin1_max] += < double > data * deltaA * deltaL * deltaU
     *
     */
                  __pyx_t_71 = __pyx_v_bin0_min;
                  __pyx_t_72 = __pyx_v_bin1_max;
                  *__Pyx_BufPtrStrided2d(__pyx_t_9splitBBox_DTYPE_float64_t *, __pyx_pybuffernd_outCount.rcbuffer->pybuffer.buf, __pyx_t_71, __pyx_pybuffernd_outCount.diminfo[0].strides, __pyx_t_72, __pyx_pybuffernd_outCount.diminfo[1].strides) += ((((double)__pyx_v_deltaA) * __pyx_v_deltaL) * __pyx_v_deltaU);

     345:                     outData[bin0_min, bin1_max] += < double > data * deltaA * deltaL * deltaU

                  /* "splitBBox.pyx":345
     *
     *                     outCount[bin0_min, bin1_max] += < double > deltaA * deltaL * deltaU
     *                     outData[bin0_min, bin1_max] += < double > data * deltaA * deltaL * deltaU             # <<<<<<<<<<<<<<
     *
     *                     outCount[bin0_max, bin1_min] += < double > deltaA * deltaR * deltaD
     */
                  __pyx_t_73 = __pyx_v_bin0_min;
                  __pyx_t_74 = __pyx_v_bin1_max;
                  *__Pyx_BufPtrStrided2d(__pyx_t_9splitBBox_DTYPE_float64_t *, __pyx_pybuffernd_outData.rcbuffer->pybuffer.buf, __pyx_t_73, __pyx_pybuffernd_outData.diminfo[0].strides, __pyx_t_74, __pyx_pybuffernd_outData.diminfo[1].strides) += (((((double)__pyx_v_data) * __pyx_v_deltaA) * __pyx_v_deltaL) * __pyx_v_deltaU);

     346:

     347:                     outCount[bin0_max, bin1_min] += < double > deltaA * deltaR * deltaD

                  /* "splitBBox.pyx":347
     *                     outData[bin0_min, bin1_max] += < double > data * deltaA * deltaL * deltaU
     *
     *                     outCount[bin0_max, bin1_min] += < double > deltaA * deltaR * deltaD             # <<<<<<<<<<<<<<
     *                     outData[bin0_max, bin1_min] += < double > data * deltaA * deltaR * deltaD
     *
     */
                  __pyx_t_75 = __pyx_v_bin0_max;
                  __pyx_t_76 = __pyx_v_bin1_min;
                  *__Pyx_BufPtrStrided2d(__pyx_t_9splitBBox_DTYPE_float64_t *, __pyx_pybuffernd_outCount.rcbuffer->pybuffer.buf, __pyx_t_75, __pyx_pybuffernd_outCount.diminfo[0].strides, __pyx_t_76, __pyx_pybuffernd_outCount.diminfo[1].strides) += ((((double)__pyx_v_deltaA) * __pyx_v_deltaR) * __pyx_v_deltaD);

     348:                     outData[bin0_max, bin1_min] += < double > data * deltaA * deltaR * deltaD

                  /* "splitBBox.pyx":348
     *
     *                     outCount[bin0_max, bin1_min] += < double > deltaA * deltaR * deltaD
     *                     outData[bin0_max, bin1_min] += < double > data * deltaA * deltaR * deltaD             # <<<<<<<<<<<<<<
     *
     *                     outCount[bin0_max, bin1_max] += < double > deltaA * deltaR * deltaU
     */
                  __pyx_t_77 = __pyx_v_bin0_max;
                  __pyx_t_78 = __pyx_v_bin1_min;
                  *__Pyx_BufPtrStrided2d(__pyx_t_9splitBBox_DTYPE_float64_t *, __pyx_pybuffernd_outData.rcbuffer->pybuffer.buf, __pyx_t_77, __pyx_pybuffernd_outData.diminfo[0].strides, __pyx_t_78, __pyx_pybuffernd_outData.diminfo[1].strides) += (((((double)__pyx_v_data) * __pyx_v_deltaA) * __pyx_v_deltaR) * __pyx_v_deltaD);

     349:

     350:                     outCount[bin0_max, bin1_max] += < double > deltaA * deltaR * deltaU

                  /* "splitBBox.pyx":350
     *                     outData[bin0_max, bin1_min] += < double > data * deltaA * deltaR * deltaD
     *
     *                     outCount[bin0_max, bin1_max] += < double > deltaA * deltaR * deltaU             # <<<<<<<<<<<<<<
     *                     outData[bin0_max, bin1_max] += < double > data * deltaA * deltaR * deltaU
     *                     for i in range(bin0_min + 1, bin0_max):
     */
                  __pyx_t_79 = __pyx_v_bin0_max;
                  __pyx_t_80 = __pyx_v_bin1_max;
                  *__Pyx_BufPtrStrided2d(__pyx_t_9splitBBox_DTYPE_float64_t *, __pyx_pybuffernd_outCount.rcbuffer->pybuffer.buf, __pyx_t_79, __pyx_pybuffernd_outCount.diminfo[0].strides, __pyx_t_80, __pyx_pybuffernd_outCount.diminfo[1].strides) += ((((double)__pyx_v_deltaA) * __pyx_v_deltaR) * __pyx_v_deltaU);

     351:                     outData[bin0_max, bin1_max] += < double > data * deltaA * deltaR * deltaU

                  /* "splitBBox.pyx":351
     *
     *                     outCount[bin0_max, bin1_max] += < double > deltaA * deltaR * deltaU
     *                     outData[bin0_max, bin1_max] += < double > data * deltaA * deltaR * deltaU             # <<<<<<<<<<<<<<
     *                     for i in range(bin0_min + 1, bin0_max):
     *                             outCount[i, bin1_min] += < double > deltaA * deltaD
     */
                  __pyx_t_81 = __pyx_v_bin0_max;
                  __pyx_t_82 = __pyx_v_bin1_max;
                  *__Pyx_BufPtrStrided2d(__pyx_t_9splitBBox_DTYPE_float64_t *, __pyx_pybuffernd_outData.rcbuffer->pybuffer.buf, __pyx_t_81, __pyx_pybuffernd_outData.diminfo[0].strides, __pyx_t_82, __pyx_pybuffernd_outData.diminfo[1].strides) += (((((double)__pyx_v_data) * __pyx_v_deltaA) * __pyx_v_deltaR) * __pyx_v_deltaU);

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

                  /* "splitBBox.pyx":352
     *                     outCount[bin0_max, bin1_max] += < double > deltaA * deltaR * deltaU
     *                     outData[bin0_max, bin1_max] += < double > data * deltaA * deltaR * deltaU
     *                     for i in range(bin0_min + 1, bin0_max):             # <<<<<<<<<<<<<<
     *                             outCount[i, bin1_min] += < double > deltaA * deltaD
     *                             outData[i, bin1_min] += < double > data * deltaA * deltaD
     */
                  __pyx_t_83 = __pyx_v_bin0_max;
                  for (__pyx_t_84 = (__pyx_v_bin0_min + 1); __pyx_t_84 < __pyx_t_83; __pyx_t_84+=1) {
                    __pyx_v_i = __pyx_t_84;

     353:                             outCount[i, bin1_min] += < double > deltaA * deltaD

                    /* "splitBBox.pyx":353
     *                     outData[bin0_max, bin1_max] += < double > data * deltaA * deltaR * deltaU
     *                     for i in range(bin0_min + 1, bin0_max):
     *                             outCount[i, bin1_min] += < double > deltaA * deltaD             # <<<<<<<<<<<<<<
     *                             outData[i, bin1_min] += < double > data * deltaA * deltaD
     *                             for j in range(bin1_min + 1, bin1_max):
     */
                    __pyx_t_85 = __pyx_v_i;
                    __pyx_t_86 = __pyx_v_bin1_min;
                    *__Pyx_BufPtrStrided2d(__pyx_t_9splitBBox_DTYPE_float64_t *, __pyx_pybuffernd_outCount.rcbuffer->pybuffer.buf, __pyx_t_85, __pyx_pybuffernd_outCount.diminfo[0].strides, __pyx_t_86, __pyx_pybuffernd_outCount.diminfo[1].strides) += (((double)__pyx_v_deltaA) * __pyx_v_deltaD);

     354:                             outData[i, bin1_min] += < double > data * deltaA * deltaD

                    /* "splitBBox.pyx":354
     *                     for i in range(bin0_min + 1, bin0_max):
     *                             outCount[i, bin1_min] += < double > deltaA * deltaD
     *                             outData[i, bin1_min] += < double > data * deltaA * deltaD             # <<<<<<<<<<<<<<
     *                             for j in range(bin1_min + 1, bin1_max):
     *                                 outCount[i, j] += < double > deltaA
     */
                    __pyx_t_87 = __pyx_v_i;
                    __pyx_t_88 = __pyx_v_bin1_min;
                    *__Pyx_BufPtrStrided2d(__pyx_t_9splitBBox_DTYPE_float64_t *, __pyx_pybuffernd_outData.rcbuffer->pybuffer.buf, __pyx_t_87, __pyx_pybuffernd_outData.diminfo[0].strides, __pyx_t_88, __pyx_pybuffernd_outData.diminfo[1].strides) += ((((double)__pyx_v_data) * __pyx_v_deltaA) * __pyx_v_deltaD);

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

                    /* "splitBBox.pyx":355
     *                             outCount[i, bin1_min] += < double > deltaA * deltaD
     *                             outData[i, bin1_min] += < double > data * deltaA * deltaD
     *                             for j in range(bin1_min + 1, bin1_max):             # <<<<<<<<<<<<<<
     *                                 outCount[i, j] += < double > deltaA
     *                                 outData[i, j] += < double > data * deltaA
     */
                    __pyx_t_89 = __pyx_v_bin1_max;
                    for (__pyx_t_90 = (__pyx_v_bin1_min + 1); __pyx_t_90 < __pyx_t_89; __pyx_t_90+=1) {
                      __pyx_v_j = __pyx_t_90;

     356:                                 outCount[i, j] += < double > deltaA

                      /* "splitBBox.pyx":356
     *                             outData[i, bin1_min] += < double > data * deltaA * deltaD
     *                             for j in range(bin1_min + 1, bin1_max):
     *                                 outCount[i, j] += < double > deltaA             # <<<<<<<<<<<<<<
     *                                 outData[i, j] += < double > data * deltaA
     *                             outCount[i, bin1_max] += < double > deltaA * deltaU
     */
                      __pyx_t_91 = __pyx_v_i;
                      __pyx_t_92 = __pyx_v_j;
                      *__Pyx_BufPtrStrided2d(__pyx_t_9splitBBox_DTYPE_float64_t *, __pyx_pybuffernd_outCount.rcbuffer->pybuffer.buf, __pyx_t_91, __pyx_pybuffernd_outCount.diminfo[0].strides, __pyx_t_92, __pyx_pybuffernd_outCount.diminfo[1].strides) += ((double)__pyx_v_deltaA);

     357:                                 outData[i, j] += < double > data * deltaA

                      /* "splitBBox.pyx":357
     *                             for j in range(bin1_min + 1, bin1_max):
     *                                 outCount[i, j] += < double > deltaA
     *                                 outData[i, j] += < double > data * deltaA             # <<<<<<<<<<<<<<
     *                             outCount[i, bin1_max] += < double > deltaA * deltaU
     *                             outData[i, bin1_max] += < double > data * deltaA * deltaU
     */
                      __pyx_t_93 = __pyx_v_i;
                      __pyx_t_94 = __pyx_v_j;
                      *__Pyx_BufPtrStrided2d(__pyx_t_9splitBBox_DTYPE_float64_t *, __pyx_pybuffernd_outData.rcbuffer->pybuffer.buf, __pyx_t_93, __pyx_pybuffernd_outData.diminfo[0].strides, __pyx_t_94, __pyx_pybuffernd_outData.diminfo[1].strides) += (((double)__pyx_v_data) * __pyx_v_deltaA);
                    }

     358:                             outCount[i, bin1_max] += < double > deltaA * deltaU

                    /* "splitBBox.pyx":358
     *                                 outCount[i, j] += < double > deltaA
     *                                 outData[i, j] += < double > data * deltaA
     *                             outCount[i, bin1_max] += < double > deltaA * deltaU             # <<<<<<<<<<<<<<
     *                             outData[i, bin1_max] += < double > data * deltaA * deltaU
     *                     for j in range(bin1_min + 1, bin1_max):
     */
                    __pyx_t_89 = __pyx_v_i;
                    __pyx_t_90 = __pyx_v_bin1_max;
                    *__Pyx_BufPtrStrided2d(__pyx_t_9splitBBox_DTYPE_float64_t *, __pyx_pybuffernd_outCount.rcbuffer->pybuffer.buf, __pyx_t_89, __pyx_pybuffernd_outCount.diminfo[0].strides, __pyx_t_90, __pyx_pybuffernd_outCount.diminfo[1].strides) += (((double)__pyx_v_deltaA) * __pyx_v_deltaU);

     359:                             outData[i, bin1_max] += < double > data * deltaA * deltaU

                    /* "splitBBox.pyx":359
     *                                 outData[i, j] += < double > data * deltaA
     *                             outCount[i, bin1_max] += < double > deltaA * deltaU
     *                             outData[i, bin1_max] += < double > data * deltaA * deltaU             # <<<<<<<<<<<<<<
     *                     for j in range(bin1_min + 1, bin1_max):
     *                             outCount[bin0_min, j] += < double > deltaA * deltaL
     */
                    __pyx_t_95 = __pyx_v_i;
                    __pyx_t_96 = __pyx_v_bin1_max;
                    *__Pyx_BufPtrStrided2d(__pyx_t_9splitBBox_DTYPE_float64_t *, __pyx_pybuffernd_outData.rcbuffer->pybuffer.buf, __pyx_t_95, __pyx_pybuffernd_outData.diminfo[0].strides, __pyx_t_96, __pyx_pybuffernd_outData.diminfo[1].strides) += ((((double)__pyx_v_data) * __pyx_v_deltaA) * __pyx_v_deltaU);
                  }

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

                  /* "splitBBox.pyx":360
     *                             outCount[i, bin1_max] += < double > deltaA * deltaU
     *                             outData[i, bin1_max] += < double > data * deltaA * deltaU
     *                     for j in range(bin1_min + 1, bin1_max):             # <<<<<<<<<<<<<<
     *                             outCount[bin0_min, j] += < double > deltaA * deltaL
     *                             outData[bin0_min, j] += < double > data * deltaA * deltaL
     */
                  __pyx_t_83 = __pyx_v_bin1_max;
                  for (__pyx_t_84 = (__pyx_v_bin1_min + 1); __pyx_t_84 < __pyx_t_83; __pyx_t_84+=1) {
                    __pyx_v_j = __pyx_t_84;

     361:                             outCount[bin0_min, j] += < double > deltaA * deltaL

                    /* "splitBBox.pyx":361
     *                             outData[i, bin1_max] += < double > data * deltaA * deltaU
     *                     for j in range(bin1_min + 1, bin1_max):
     *                             outCount[bin0_min, j] += < double > deltaA * deltaL             # <<<<<<<<<<<<<<
     *                             outData[bin0_min, j] += < double > data * deltaA * deltaL
     *
     */
                    __pyx_t_97 = __pyx_v_bin0_min;
                    __pyx_t_98 = __pyx_v_j;
                    *__Pyx_BufPtrStrided2d(__pyx_t_9splitBBox_DTYPE_float64_t *, __pyx_pybuffernd_outCount.rcbuffer->pybuffer.buf, __pyx_t_97, __pyx_pybuffernd_outCount.diminfo[0].strides, __pyx_t_98, __pyx_pybuffernd_outCount.diminfo[1].strides) += (((double)__pyx_v_deltaA) * __pyx_v_deltaL);

     362:                             outData[bin0_min, j] += < double > data * deltaA * deltaL

                    /* "splitBBox.pyx":362
     *                     for j in range(bin1_min + 1, bin1_max):
     *                             outCount[bin0_min, j] += < double > deltaA * deltaL
     *                             outData[bin0_min, j] += < double > data * deltaA * deltaL             # <<<<<<<<<<<<<<
     *
     *                             outCount[bin0_max, j] += < double > deltaA * deltaR
     */
                    __pyx_t_99 = __pyx_v_bin0_min;
                    __pyx_t_100 = __pyx_v_j;
                    *__Pyx_BufPtrStrided2d(__pyx_t_9splitBBox_DTYPE_float64_t *, __pyx_pybuffernd_outData.rcbuffer->pybuffer.buf, __pyx_t_99, __pyx_pybuffernd_outData.diminfo[0].strides, __pyx_t_100, __pyx_pybuffernd_outData.diminfo[1].strides) += ((((double)__pyx_v_data) * __pyx_v_deltaA) * __pyx_v_deltaL);

     363:

     364:                             outCount[bin0_max, j] += < double > deltaA * deltaR

                    /* "splitBBox.pyx":364
     *                             outData[bin0_min, j] += < double > data * deltaA * deltaL
     *
     *                             outCount[bin0_max, j] += < double > deltaA * deltaR             # <<<<<<<<<<<<<<
     *                             outData[bin0_max, j] += < double > data * deltaA * deltaR
     *
     */
                    __pyx_t_101 = __pyx_v_bin0_max;
                    __pyx_t_102 = __pyx_v_j;
                    *__Pyx_BufPtrStrided2d(__pyx_t_9splitBBox_DTYPE_float64_t *, __pyx_pybuffernd_outCount.rcbuffer->pybuffer.buf, __pyx_t_101, __pyx_pybuffernd_outCount.diminfo[0].strides, __pyx_t_102, __pyx_pybuffernd_outCount.diminfo[1].strides) += (((double)__pyx_v_deltaA) * __pyx_v_deltaR);

     365:                             outData[bin0_max, j] += < double > data * deltaA * deltaR

                    /* "splitBBox.pyx":365
     *
     *                             outCount[bin0_max, j] += < double > deltaA * deltaR
     *                             outData[bin0_max, j] += < double > data * deltaA * deltaR             # <<<<<<<<<<<<<<
     *
     *         for i in range(bins0):
     */
                    __pyx_t_103 = __pyx_v_bin0_max;
                    __pyx_t_104 = __pyx_v_j;
                    *__Pyx_BufPtrStrided2d(__pyx_t_9splitBBox_DTYPE_float64_t *, __pyx_pybuffernd_outData.rcbuffer->pybuffer.buf, __pyx_t_103, __pyx_pybuffernd_outData.diminfo[0].strides, __pyx_t_104, __pyx_pybuffernd_outData.diminfo[1].strides) += ((((double)__pyx_v_data) * __pyx_v_deltaA) * __pyx_v_deltaR);
                  }
                }
                __pyx_L38:;
              }
              __pyx_L34:;
              __pyx_L27_continue:;
            }

     366:

     367:         for i in range(bins0):

            /* "splitBBox.pyx":367
     *                             outData[bin0_max, j] += < double > data * deltaA * deltaR
     *
     *         for i in range(bins0):             # <<<<<<<<<<<<<<
     *             for j in range(bins1):
     *                 if outCount[i, j] > epsilon:
     */
            __pyx_t_9 = __pyx_v_bins0;
            for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_9; __pyx_t_2+=1) {
              __pyx_v_i = __pyx_t_2;

     368:             for j in range(bins1):

              /* "splitBBox.pyx":368
     *
     *         for i in range(bins0):
     *             for j in range(bins1):             # <<<<<<<<<<<<<<
     *                 if outCount[i, j] > epsilon:
     *                     outMerge[i, j] = outData[i, j] / outCount[i, j]
     */
              __pyx_t_83 = __pyx_v_bins1;
              for (__pyx_t_84 = 0; __pyx_t_84 < __pyx_t_83; __pyx_t_84+=1) {
                __pyx_v_j = __pyx_t_84;

     369:                 if outCount[i, j] > epsilon:

                /* "splitBBox.pyx":369
     *         for i in range(bins0):
     *             for j in range(bins1):
     *                 if outCount[i, j] > epsilon:             # <<<<<<<<<<<<<<
     *                     outMerge[i, j] = outData[i, j] / outCount[i, j]
     *                 else:
     */
                __pyx_t_105 = __pyx_v_i;
                __pyx_t_106 = __pyx_v_j;
                __pyx_t_27 = ((*__Pyx_BufPtrStrided2d(__pyx_t_9splitBBox_DTYPE_float64_t *, __pyx_pybuffernd_outCount.rcbuffer->pybuffer.buf, __pyx_t_105, __pyx_pybuffernd_outCount.diminfo[0].strides, __pyx_t_106, __pyx_pybuffernd_outCount.diminfo[1].strides)) > __pyx_v_epsilon);
                if (__pyx_t_27) {

     370:                     outMerge[i, j] = outData[i, j] / outCount[i, j]

                  /* "splitBBox.pyx":370
     *             for j in range(bins1):
     *                 if outCount[i, j] > epsilon:
     *                     outMerge[i, j] = outData[i, j] / outCount[i, j]             # <<<<<<<<<<<<<<
     *                 else:
     *                     outMerge[i, j] = dummy
     */
                  __pyx_t_107 = __pyx_v_i;
                  __pyx_t_108 = __pyx_v_j;
                  __pyx_t_109 = __pyx_v_i;
                  __pyx_t_110 = __pyx_v_j;
                  __pyx_t_111 = __pyx_v_i;
                  __pyx_t_112 = __pyx_v_j;
                  *__Pyx_BufPtrStrided2d(__pyx_t_9splitBBox_DTYPE_float32_t *, __pyx_pybuffernd_outMerge.rcbuffer->pybuffer.buf, __pyx_t_111, __pyx_pybuffernd_outMerge.diminfo[0].strides, __pyx_t_112, __pyx_pybuffernd_outMerge.diminfo[1].strides) = ((*__Pyx_BufPtrStrided2d(__pyx_t_9splitBBox_DTYPE_float64_t *, __pyx_pybuffernd_outData.rcbuffer->pybuffer.buf, __pyx_t_107, __pyx_pybuffernd_outData.diminfo[0].strides, __pyx_t_108, __pyx_pybuffernd_outData.diminfo[1].strides)) / (*__Pyx_BufPtrStrided2d(__pyx_t_9splitBBox_DTYPE_float64_t *, __pyx_pybuffernd_outCount.rcbuffer->pybuffer.buf, __pyx_t_109, __pyx_pybuffernd_outCount.diminfo[0].strides, __pyx_t_110, __pyx_pybuffernd_outCount.diminfo[1].strides)));
                  goto __pyx_L51;
                }
                /*else*/ {

     371:                 else:

     372:                     outMerge[i, j] = dummy

                  /* "splitBBox.pyx":372
     *                     outMerge[i, j] = outData[i, j] / outCount[i, j]
     *                 else:
     *                     outMerge[i, j] = dummy             # <<<<<<<<<<<<<<
     *     return outMerge.T, edges0, edges1, outData.T, outCount.T
     *
     */
                  __pyx_t_113 = __pyx_v_i;
                  __pyx_t_114 = __pyx_v_j;
                  *__Pyx_BufPtrStrided2d(__pyx_t_9splitBBox_DTYPE_float32_t *, __pyx_pybuffernd_outMerge.rcbuffer->pybuffer.buf, __pyx_t_113, __pyx_pybuffernd_outMerge.diminfo[0].strides, __pyx_t_114, __pyx_pybuffernd_outMerge.diminfo[1].strides) = __pyx_v_dummy;
                }
                __pyx_L51:;
              }
            }
          }

     373:     return outMerge.T, edges0, edges1, outData.T, outCount.T

      /* "splitBBox.pyx":373
     *                 else:
     *                     outMerge[i, j] = dummy
     *     return outMerge.T, edges0, edges1, outData.T, outCount.T             # <<<<<<<<<<<<<<
     *
     */
      __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 = 373; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_4 = PyObject_GetAttr(((PyObject *)__pyx_v_outData), __pyx_n_s__T); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_19 = PyObject_GetAttr(((PyObject *)__pyx_v_outCount), __pyx_n_s__T); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_19);
      __pyx_t_3 = PyTuple_New(5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 373; __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_INCREF(((PyObject *)__pyx_v_edges0));
      PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_v_edges0));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_edges0));
      __Pyx_INCREF(((PyObject *)__pyx_v_edges1));
      PyTuple_SET_ITEM(__pyx_t_3, 2, ((PyObject *)__pyx_v_edges1));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_edges1));
      PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_3, 4, __pyx_t_19);
      __Pyx_GIVEREF(__pyx_t_19);
      __pyx_t_1 = 0;
      __pyx_t_4 = 0;
      __pyx_t_19 = 0;
      __pyx_r = ((PyObject *)__pyx_t_3);
      __pyx_t_3 = 0;
      goto __pyx_L0;

      __pyx_r = Py_None; __Pyx_INCREF(Py_None);
      goto __pyx_L0;
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_19);
      { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
        __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
        __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_outMerge.rcbuffer->pybuffer);
        __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_cpos0_inf.rcbuffer->pybuffer);
        __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_cdelta_pos1.rcbuffer->pybuffer);
        __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_cdelta_pos0.rcbuffer->pybuffer);
        __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_edges0.rcbuffer->pybuffer);
        __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_cpos0_sup.rcbuffer->pybuffer);
        __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_edges1.rcbuffer->pybuffer);
        __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_cpos1_sup.rcbuffer->pybuffer);
        __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_outCount.rcbuffer->pybuffer);
        __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_cdata.rcbuffer->pybuffer);
        __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_cpos1.rcbuffer->pybuffer);
        __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_cpos0.rcbuffer->pybuffer);
        __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_outData.rcbuffer->pybuffer);
        __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_cpos1_inf.rcbuffer->pybuffer);
      __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
      __Pyx_AddTraceback("splitBBox.histoBBox2d", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      goto __pyx_L2;
      __pyx_L0:;
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_outMerge.rcbuffer->pybuffer);
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_cpos0_inf.rcbuffer->pybuffer);
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_cdelta_pos1.rcbuffer->pybuffer);
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_cdelta_pos0.rcbuffer->pybuffer);
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_edges0.rcbuffer->pybuffer);
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_cpos0_sup.rcbuffer->pybuffer);
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_edges1.rcbuffer->pybuffer);
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_cpos1_sup.rcbuffer->pybuffer);
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_outCount.rcbuffer->pybuffer);
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_cdata.rcbuffer->pybuffer);
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_cpos1.rcbuffer->pybuffer);
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_cpos0.rcbuffer->pybuffer);
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_outData.rcbuffer->pybuffer);
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_cpos1_inf.rcbuffer->pybuffer);
      __pyx_L2:;
      __Pyx_XDECREF((PyObject *)__pyx_v_cdata);
      __Pyx_XDECREF((PyObject *)__pyx_v_cpos0);
      __Pyx_XDECREF((PyObject *)__pyx_v_cdelta_pos0);
      __Pyx_XDECREF((PyObject *)__pyx_v_cpos0_inf);
      __Pyx_XDECREF((PyObject *)__pyx_v_cpos0_sup);
      __Pyx_XDECREF((PyObject *)__pyx_v_cpos1);
      __Pyx_XDECREF((PyObject *)__pyx_v_cdelta_pos1);
      __Pyx_XDECREF((PyObject *)__pyx_v_cpos1_inf);
      __Pyx_XDECREF((PyObject *)__pyx_v_cpos1_sup);
      __Pyx_XDECREF((PyObject *)__pyx_v_outData);
      __Pyx_XDECREF((PyObject *)__pyx_v_outCount);
      __Pyx_XDECREF((PyObject *)__pyx_v_outMerge);
      __Pyx_XDECREF((PyObject *)__pyx_v_edges0);
      __Pyx_XDECREF((PyObject *)__pyx_v_edges1);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

     374: