From e7158d79a26d4daff4ad09ffa9375ab3fb321379 Mon Sep 17 00:00:00 2001 From: Jerome Kieffer Date: Tue, 23 Oct 2012 17:43:24 +0200 Subject: [PATCH] v0.7.7: limit memory footprint (LUT is huge) reset integrator only if needed. --- pyFAI-src/__init__.py | 2 +- pyFAI-src/azimuthalIntegrator.py | 53 +- src/splitBBoxLUT.c | 121 +- src/splitBBoxLUT.html | 8352 ++++++++++++++++++++++++++++++ src/splitBBoxLUT.pyx | 8 +- 5 files changed, 8448 insertions(+), 88 deletions(-) create mode 100644 src/splitBBoxLUT.html diff --git a/pyFAI-src/__init__.py b/pyFAI-src/__init__.py index 24971e2c..6adcd72c 100644 --- a/pyFAI-src/__init__.py +++ b/pyFAI-src/__init__.py @@ -1,4 +1,4 @@ -version = "0.7.6" +version = "0.7.7" import sys, logging logging.basicConfig() diff --git a/pyFAI-src/azimuthalIntegrator.py b/pyFAI-src/azimuthalIntegrator.py index d87b8cd0..a783e7d3 100755 --- a/pyFAI-src/azimuthalIntegrator.py +++ b/pyFAI-src/azimuthalIntegrator.py @@ -557,24 +557,28 @@ class AzimuthalIntegrator(Geometry): dummy=dummy, delta_dummy=delta_dummy) with self._lut_sem: + reset = None if self._lut_integrator is None: self._lut_integrator = self.setup_LUT(shape, nbPt, mask, tthRange, chiRange) - safe = False - if safe: - if (mask is not None) and self._lut_integrator.check_mask: - self._lut_integrator = self.setup_LUT(shape, nbPt, mask, tthRange, chiRange) - elif (mask is None) and (not self._lut_integrator.check_mask): - self._lut_integrator = self.setup_LUT(shape, nbPt, mask, tthRange, chiRange) + reset = "init" + elif safe: + if (mask is not None) and (not self._lut_integrator.check_mask): + reset = "Mask1" + elif (mask is None) and (self._lut_integrator.check_mask): + reset = "Mask2" elif (mask is not None) and (self._lut_integrator.mask_checksum != hashlib.md5(mask).hexdigest()): - self._lut_integrator = self.setup_LUT(shape, nbPt, mask, tthRange, chiRange) + reset = "Mask changed" if (tthRange is None) and (self._lut_integrator.pos0Range is not None): - self._lut_integrator = self.setup_LUT(shape, nbPt, mask, tthRange, chiRange) + reset = "tthRange1" elif (tthRange is not None) and self._lut_integrator.pos0Range != (numpy.deg2rad(min(tthRange)), numpy.deg2rad(max(tthRange)) * (1.0 + numpy.finfo(numpy.float32).eps)): - self._lut_integrator = self.setup_LUT(shape, nbPt, mask, tthRange, chiRange) + reset = "tthRange2" if (chiRange is None) and (self._lut_integrator.pos1Range is not None): - self._lut_integrator = self.setup_LUT(shape, nbPt, mask, tthRange, chiRange) + reset = "chiRange1" elif (chiRange is not None) and self._lut_integrator.pos1Range != (numpy.deg2rad(min(chiRange)), numpy.deg2rad(max(chiRange)) * (1.0 + numpy.finfo(numpy.float32).eps)): - self._lut_integrator = self.setup_LUT(shape, nbPt, mask, tthRange, chiRange) + reset = "chiRange2" + if reset: + logger.debug("xrpd_LUT: Resetting integrator because %s" % reset) + self._lut_integrator = self.setup_LUT(shape, nbPt, mask, tthRange, chiRange) if correctSolidAngle: solid_angle_array = self.solidAngleArray(shape) else: @@ -634,24 +638,27 @@ class AzimuthalIntegrator(Geometry): tthAxis, I, a, b = self._lut_integrator.integrate(data,) with self._lut_sem: + reset = None if self._lut_integrator is None: - self._lut_integrator = self.setup_LUT(shape, nbPt, mask, tthRange, chiRange) - safe = False - if safe: - if (mask is not None) and self._lut_integrator.check_mask: - self._lut_integrator = self.setup_LUT(shape, nbPt, mask, tthRange, chiRange) - elif (mask is None) and (not self._lut_integrator.check_mask): - self._lut_integrator = self.setup_LUT(shape, nbPt, mask, tthRange, chiRange) + reset = "init" + elif safe: + if (mask is not None) and (not self._lut_integrator.check_mask): + reset = "Mask1" + elif (mask is None) and (self._lut_integrator.check_mask): + reset = "Mask2" elif (mask is not None) and (self._lut_integrator.mask_checksum != hashlib.md5(mask).hexdigest()): - self._lut_integrator = self.setup_LUT(shape, nbPt, mask, tthRange, chiRange) + reset = "Mask-changed" if (tthRange is None) and (self._lut_integrator.pos0Range is not None): - self._lut_integrator = self.setup_LUT(shape, nbPt, mask, tthRange, chiRange) + reset = "tthrange1" elif self._lut_integrator.pos0Range != (numpy.deg2rad(min(tthRange)), numpy.deg2rad(max(tthRange)) * (1.0 + numpy.finfo(numpy.float32).eps)): - self._lut_integrator = self.setup_LUT(shape, nbPt, mask, tthRange, chiRange) + reset = "tthrange2" if (chiRange is None) and (self._lut_integrator.pos1Range is not None): - self._lut_integrator = self.setup_LUT(shape, nbPt, mask, tthRange, chiRange) + reset = "chirange1" elif self._lut_integrator.pos1Range != (numpy.deg2rad(min(chiRange)), numpy.deg2rad(max(chiRange)) * (1.0 + numpy.finfo(numpy.float32).eps)): - self._lut_integrator = self.setup_LUT(shape, nbPt, mask, tthRange, chiRange) + reset = "chirange2" + if reset: + logger.debug("xrpd_LUT_OCL: Resetting integrator because of %s" % reset) + self._lut_integrator = self.setup_LUT(shape, nbPt, mask, tthRange, chiRange) tthAxis = self._lut_integrator.outPos with self._ocl_lut_sem: if self._ocl_lut_integr is None: diff --git a/src/splitBBoxLUT.c b/src/splitBBoxLUT.c index 4c0f1e97..f9a73bca 100644 --- a/src/splitBBoxLUT.c +++ b/src/splitBBoxLUT.c @@ -1,4 +1,4 @@ -/* Generated by Cython 0.17 on Fri Oct 19 16:07:57 2012 */ +/* Generated by Cython 0.17 on Tue Oct 23 17:24:02 2012 */ #define PY_SSIZE_T_CLEAN #include "Python.h" @@ -2214,6 +2214,8 @@ static PyObject *__pyx_pf_12splitBBoxLUT_11HistoBBox1d___init__(CYTHON_UNUSED Py PyArrayObject *__pyx_v_outPos = 0; PyObject *__pyx_v_pos0_maxin = NULL; PyObject *__pyx_v_pos1_maxin = NULL; + PyObject *__pyx_v_lut_idx = NULL; + PyObject *__pyx_v_lut_coef = NULL; __Pyx_LocalBuf_ND __pyx_pybuffernd_outPos; __Pyx_Buffer __pyx_pybuffer_outPos; PyObject *__pyx_r = NULL; @@ -3070,7 +3072,7 @@ static PyObject *__pyx_pf_12splitBBoxLUT_11HistoBBox1d___init__(CYTHON_UNUSED Py * self.mask_checksum=None * delta = (self.pos0_max - pos0_min) / (bins) # <<<<<<<<<<<<<< * self.delta = delta - * self.lut_max_idx, self.lut_idx, self.lut_coef = self.calc_lut() + * self.lut_max_idx, lut_idx, lut_coef = self.calc_lut() */ __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__pos0_max); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); @@ -3094,7 +3096,7 @@ static PyObject *__pyx_pf_12splitBBoxLUT_11HistoBBox1d___init__(CYTHON_UNUSED Py * self.mask_checksum=None * delta = (self.pos0_max - pos0_min) / (bins) * self.delta = delta # <<<<<<<<<<<<<< - * self.lut_max_idx, self.lut_idx, self.lut_coef = self.calc_lut() + * self.lut_max_idx, lut_idx, lut_coef = self.calc_lut() * ######################################################################## */ __pyx_t_1 = PyFloat_FromDouble(__pyx_v_delta); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -3105,7 +3107,7 @@ static PyObject *__pyx_pf_12splitBBoxLUT_11HistoBBox1d___init__(CYTHON_UNUSED Py /* "splitBBoxLUT.pyx":111 * delta = (self.pos0_max - pos0_min) / (bins) * self.delta = delta - * self.lut_max_idx, self.lut_idx, self.lut_coef = self.calc_lut() # <<<<<<<<<<<<<< + * self.lut_max_idx, lut_idx, lut_coef = self.calc_lut() # <<<<<<<<<<<<<< * ######################################################################## * # Linspace has been discareded becaus it does calculation in double precision and all others are done in single */ @@ -3171,10 +3173,10 @@ static PyObject *__pyx_pf_12splitBBoxLUT_11HistoBBox1d___init__(CYTHON_UNUSED Py } if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__lut_max_idx, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__lut_idx, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__lut_coef, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_lut_idx = __pyx_t_4; + __pyx_t_4 = 0; + __pyx_v_lut_coef = __pyx_t_3; + __pyx_t_3 = 0; /* "splitBBoxLUT.pyx":116 * #self.outPos = numpy.linspace(self.pos0_min+0.5*delta,self.pos0_max-0.5*delta, self.bins) @@ -3217,7 +3219,7 @@ static PyObject *__pyx_pf_12splitBBoxLUT_11HistoBBox1d___init__(CYTHON_UNUSED Py * for i in prange(bins,nogil=True, schedule="static"): * outPos[i] = pos0_min + (0.5 +< float > i) * delta # <<<<<<<<<<<<<< * self.outPos = outPos - * self.lut = numpy.recarray(shape=self.lut_coef.shape,dtype=[("idx",numpy.uint32),("coef",numpy.float32)]) + * self.lut = numpy.recarray(shape=lut_coef.shape,dtype=[("idx",numpy.uint32),("coef",numpy.float32)]) */ __pyx_t_16 = __pyx_v_i; if (__pyx_t_16 < 0) __pyx_t_16 += __pyx_pybuffernd_outPos.diminfo[0].shape; @@ -3251,17 +3253,17 @@ static PyObject *__pyx_pf_12splitBBoxLUT_11HistoBBox1d___init__(CYTHON_UNUSED Py * for i in prange(bins,nogil=True, schedule="static"): * outPos[i] = pos0_min + (0.5 +< float > i) * delta * self.outPos = outPos # <<<<<<<<<<<<<< - * self.lut = numpy.recarray(shape=self.lut_coef.shape,dtype=[("idx",numpy.uint32),("coef",numpy.float32)]) - * self.lut.coef = self.lut_coef + * self.lut = numpy.recarray(shape=lut_coef.shape,dtype=[("idx",numpy.uint32),("coef",numpy.float32)]) + * self.lut.coef = lut_coef */ if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__outPos, ((PyObject *)__pyx_v_outPos)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "splitBBoxLUT.pyx":119 * outPos[i] = pos0_min + (0.5 +< float > i) * delta * self.outPos = outPos - * self.lut = numpy.recarray(shape=self.lut_coef.shape,dtype=[("idx",numpy.uint32),("coef",numpy.float32)]) # <<<<<<<<<<<<<< - * self.lut.coef = self.lut_coef - * self.lut.idx = self.lut_idx + * self.lut = numpy.recarray(shape=lut_coef.shape,dtype=[("idx",numpy.uint32),("coef",numpy.float32)]) # <<<<<<<<<<<<<< + * self.lut.coef = lut_coef + * self.lut.idx = lut_idx */ __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); @@ -3270,47 +3272,44 @@ static PyObject *__pyx_pf_12splitBBoxLUT_11HistoBBox1d___init__(CYTHON_UNUSED Py __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_5)); - __pyx_t_4 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__lut_coef); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_GetAttr(__pyx_v_lut_coef, __pyx_n_s__shape); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_t_5, ((PyObject *)__pyx_n_s__shape), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PyDict_SetItem(__pyx_t_5, ((PyObject *)__pyx_n_s__shape), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __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 = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__uint32); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __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(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_INCREF(((PyObject *)__pyx_n_s__idx)); - PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_n_s__idx)); - __Pyx_GIVEREF(((PyObject *)__pyx_n_s__idx)); - PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_4); - __Pyx_GIVEREF(__pyx_t_4); - __pyx_t_4 = 0; __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_2 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__float32); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__uint32); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(((PyObject *)__pyx_n_s__idx)); + PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_n_s__idx)); + __Pyx_GIVEREF(((PyObject *)__pyx_n_s__idx)); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1); + __Pyx_GIVEREF(__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 = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__float32); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)__pyx_n_s__coef)); - PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_n_s__coef)); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_n_s__coef)); __Pyx_GIVEREF(((PyObject *)__pyx_n_s__coef)); - PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyList_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - PyList_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_t_1)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_1)); - PyList_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_t_4)); + PyList_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_t_4)); __Pyx_GIVEREF(((PyObject *)__pyx_t_4)); - __pyx_t_1 = 0; + PyList_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_t_1)); + __Pyx_GIVEREF(((PyObject *)__pyx_t_1)); __pyx_t_4 = 0; + __pyx_t_1 = 0; if (PyDict_SetItem(__pyx_t_5, ((PyObject *)__pyx_n_s__dtype), ((PyObject *)__pyx_t_2)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -3322,32 +3321,26 @@ static PyObject *__pyx_pf_12splitBBoxLUT_11HistoBBox1d___init__(CYTHON_UNUSED Py /* "splitBBoxLUT.pyx":120 * self.outPos = outPos - * self.lut = numpy.recarray(shape=self.lut_coef.shape,dtype=[("idx",numpy.uint32),("coef",numpy.float32)]) - * self.lut.coef = self.lut_coef # <<<<<<<<<<<<<< - * self.lut.idx = self.lut_idx + * self.lut = numpy.recarray(shape=lut_coef.shape,dtype=[("idx",numpy.uint32),("coef",numpy.float32)]) + * self.lut.coef = lut_coef # <<<<<<<<<<<<<< + * self.lut.idx = lut_idx * */ - __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__lut_coef); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__lut); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__lut); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - if (PyObject_SetAttr(__pyx_t_5, __pyx_n_s__coef, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetAttr(__pyx_t_2, __pyx_n_s__coef, __pyx_v_lut_coef) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "splitBBoxLUT.pyx":121 - * self.lut = numpy.recarray(shape=self.lut_coef.shape,dtype=[("idx",numpy.uint32),("coef",numpy.float32)]) - * self.lut.coef = self.lut_coef - * self.lut.idx = self.lut_idx # <<<<<<<<<<<<<< + * self.lut = numpy.recarray(shape=lut_coef.shape,dtype=[("idx",numpy.uint32),("coef",numpy.float32)]) + * self.lut.coef = lut_coef + * self.lut.idx = lut_idx # <<<<<<<<<<<<<< * * @cython.cdivision(True) */ - __pyx_t_5 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__lut_idx); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__lut); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - if (PyObject_SetAttr(__pyx_t_2, __pyx_n_s__idx, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyObject_SetAttr(__pyx_t_2, __pyx_n_s__idx, __pyx_v_lut_idx) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = Py_None; __Pyx_INCREF(Py_None); @@ -3371,6 +3364,8 @@ static PyObject *__pyx_pf_12splitBBoxLUT_11HistoBBox1d___init__(CYTHON_UNUSED Py __Pyx_XDECREF((PyObject *)__pyx_v_outPos); __Pyx_XDECREF(__pyx_v_pos0_maxin); __Pyx_XDECREF(__pyx_v_pos1_maxin); + __Pyx_XDECREF(__pyx_v_lut_idx); + __Pyx_XDECREF(__pyx_v_lut_coef); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; @@ -6148,17 +6143,17 @@ static PyObject *__pyx_pf_12splitBBoxLUT_11HistoBBox1d_4integrate(CYTHON_UNUSED #endif /* _OPENMP */ { #ifdef _OPENMP - #pragma omp for lastprivate(__pyx_v_sum_count) lastprivate(__pyx_v_idx) lastprivate(__pyx_v_coef) lastprivate(__pyx_v_data) firstprivate(__pyx_v_i) lastprivate(__pyx_v_i) lastprivate(__pyx_v_sum_data) lastprivate(__pyx_v_j) schedule(guided) + #pragma omp for lastprivate(__pyx_v_sum_count) lastprivate(__pyx_v_sum_data) lastprivate(__pyx_v_coef) lastprivate(__pyx_v_data) firstprivate(__pyx_v_i) lastprivate(__pyx_v_i) lastprivate(__pyx_v_idx) lastprivate(__pyx_v_j) schedule(guided) #endif /* _OPENMP */ for (__pyx_t_15 = 0; __pyx_t_15 < __pyx_t_10; __pyx_t_15++){ { __pyx_v_i = 0 + 1 * __pyx_t_15; /* Initialize private variables to invalid values */ __pyx_v_sum_count = ((double)__PYX_NAN); - __pyx_v_idx = ((int)0xbad0bad0); + __pyx_v_sum_data = ((double)__PYX_NAN); __pyx_v_coef = ((float)__PYX_NAN); __pyx_v_data = ((float)__PYX_NAN); - __pyx_v_sum_data = ((double)__PYX_NAN); + __pyx_v_idx = ((int)0xbad0bad0); __pyx_v_j = ((int)0xbad0bad0); /* "splitBBoxLUT.pyx":311 @@ -22712,7 +22707,7 @@ static int __Pyx_InitCachedConstants(void) { * pos0, * delta_pos0, */ - __pyx_k_tuple_46 = PyTuple_New(18); if (unlikely(!__pyx_k_tuple_46)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_k_tuple_46 = PyTuple_New(20); if (unlikely(!__pyx_k_tuple_46)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_k_tuple_46); __Pyx_INCREF(((PyObject *)__pyx_n_s__self)); PyTuple_SET_ITEM(__pyx_k_tuple_46, 0, ((PyObject *)__pyx_n_s__self)); @@ -22768,8 +22763,14 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_INCREF(((PyObject *)__pyx_n_s__pos1_maxin)); PyTuple_SET_ITEM(__pyx_k_tuple_46, 17, ((PyObject *)__pyx_n_s__pos1_maxin)); __Pyx_GIVEREF(((PyObject *)__pyx_n_s__pos1_maxin)); + __Pyx_INCREF(((PyObject *)__pyx_n_s__lut_idx)); + PyTuple_SET_ITEM(__pyx_k_tuple_46, 18, ((PyObject *)__pyx_n_s__lut_idx)); + __Pyx_GIVEREF(((PyObject *)__pyx_n_s__lut_idx)); + __Pyx_INCREF(((PyObject *)__pyx_n_s__lut_coef)); + PyTuple_SET_ITEM(__pyx_k_tuple_46, 19, ((PyObject *)__pyx_n_s__lut_coef)); + __Pyx_GIVEREF(((PyObject *)__pyx_n_s__lut_coef)); __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_46)); - __pyx_k_codeobj_47 = (PyObject*)__Pyx_PyCode_New(10, 0, 18, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_46, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_48, __pyx_n_s____init__, 50, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_47)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_k_codeobj_47 = (PyObject*)__Pyx_PyCode_New(10, 0, 20, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_46, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_48, __pyx_n_s____init__, 50, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_47)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "splitBBoxLUT.pyx":126 * @cython.boundscheck(False) diff --git a/src/splitBBoxLUT.html b/src/splitBBoxLUT.html new file mode 100644 index 00000000..32bed858 --- /dev/null +++ b/src/splitBBoxLUT.html @@ -0,0 +1,8352 @@ + + + + + + + + + +

Generated by Cython 0.17 on Tue Oct 23 17:24:02 2012 +

Raw output: splitBBoxLUT.c +

 1: #!/usr/bin/env python
+
+  /* "splitBBoxLUT.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: import hashlib
+
+  /* "splitBBoxLUT.pyx":29
+ * #
+ * import cython
+ * import hashlib             # <<<<<<<<<<<<<<
+ * from cython.parallel import prange
+ * import numpy
+ */
+  __pyx_t_1 = __Pyx_Import(((PyObject *)__pyx_n_s__hashlib), 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_1);
+  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__hashlib, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
 30: from cython.parallel import prange
+
 31: import numpy
+
+  /* "splitBBoxLUT.pyx":31
+ * import hashlib
+ * from cython.parallel import prange
+ * import numpy             # <<<<<<<<<<<<<<
+ * cimport numpy
+ * from libc.math cimport fabs
+ */
+  __pyx_t_1 = __Pyx_Import(((PyObject *)__pyx_n_s__numpy), 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __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 = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
 32: cimport numpy
+
 33: from libc.math cimport fabs
+
 34: cdef struct lut_point:
+
+/* "splitBBoxLUT.pyx":34
+ * cimport numpy
+ * from libc.math cimport fabs
+ * cdef struct lut_point:             # <<<<<<<<<<<<<<
+ *     numpy.uint32_t idx
+ *     numpy.float32_t coef
+ */
+struct __pyx_t_12splitBBoxLUT_lut_point {
+  __pyx_t_5numpy_uint32_t idx;
+  __pyx_t_5numpy_float32_t coef;
+};
+
 35:     numpy.uint32_t idx
+
 36:     numpy.float32_t coef
+
 37: 
+
 38: @cython.cdivision(True)
+
 39: cdef float getBinNr( float x0, float pos0_min, float delta) nogil:
+
+/* "splitBBoxLUT.pyx":39
+ * 
+ * @cython.cdivision(True)
+ * cdef float getBinNr( float x0, float pos0_min, float delta) nogil:             # <<<<<<<<<<<<<<
+ *     """
+ *     calculate the bin number for any point
+ */
+
+static float __pyx_f_12splitBBoxLUT_getBinNr(float __pyx_v_x0, float __pyx_v_pos0_min, float __pyx_v_delta) {
+  float __pyx_r;
+
 40:     """
+
 41:     calculate the bin number for any point
+
 42:     param x0: current position
+
 43:     param pos0_min: position minimum
+
 44:     param delta: bin width
+
 45:     """
+
 46:     return (x0 - pos0_min) / delta
+
+  /* "splitBBoxLUT.pyx":46
+ *     param delta: bin width
+ *     """
+ *     return (x0 - pos0_min) / delta             # <<<<<<<<<<<<<<
+ * 
+ * class HistoBBox1d(object):
+ */
+  __pyx_r = ((__pyx_v_x0 - __pyx_v_pos0_min) / __pyx_v_delta);
+  goto __pyx_L0;
+
+  __pyx_r = 0;
+  __pyx_L0:;
+  return __pyx_r;
+}
+
 47: 
+
 48: class HistoBBox1d(object):
+
+  /* "splitBBoxLUT.pyx":48
+ *     return (x0 - pos0_min) / delta
+ * 
+ * class HistoBBox1d(object):             # <<<<<<<<<<<<<<
+ *     @cython.boundscheck(False)
+ *     def __init__(self,
+ */
+  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
+
+  /* "splitBBoxLUT.pyx":48
+ *     return (x0 - pos0_min) / delta
+ * 
+ * class HistoBBox1d(object):             # <<<<<<<<<<<<<<
+ *     @cython.boundscheck(False)
+ *     def __init__(self,
+ */
+  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_INCREF(__pyx_builtin_object);
+  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_builtin_object);
+  __Pyx_GIVEREF(__pyx_builtin_object);
+  __pyx_t_3 = __Pyx_CreateClass(((PyObject *)__pyx_t_2), ((PyObject *)__pyx_t_1), __pyx_n_s__HistoBBox1d, __pyx_n_s__splitBBoxLUT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_3);
+  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
+  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__HistoBBox1d, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
+
 49:     @cython.boundscheck(False)
+
 50:     def __init__(self,
+
+/* "splitBBoxLUT.pyx":50
+ * class HistoBBox1d(object):
+ *     @cython.boundscheck(False)
+ *     def __init__(self,             # <<<<<<<<<<<<<<
+ *                  pos0,
+ *                  delta_pos0,
+ */
+
+static PyObject *__pyx_pf_12splitBBoxLUT_11HistoBBox1d_6__defaults__(CYTHON_UNUSED PyObject *__pyx_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__defaults__", 0);
+  __Pyx_XDECREF(__pyx_r);
+
+  /* "splitBBoxLUT.pyx":50
+ * class HistoBBox1d(object):
+ *     @cython.boundscheck(False)
+ *     def __init__(self,             # <<<<<<<<<<<<<<
+ *                  pos0,
+ *                  delta_pos0,
+ */
+  __pyx_t_2 = PyTuple_New(7); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_INCREF(((PyObject *)Py_None));
+  PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)Py_None));
+  __Pyx_GIVEREF(((PyObject *)Py_None));
+  __Pyx_INCREF(((PyObject *)Py_None));
+  PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)Py_None));
+  __Pyx_GIVEREF(((PyObject *)Py_None));
+  PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_1);
+  __Pyx_GIVEREF(__pyx_t_1);
+  __Pyx_INCREF(((PyObject *)Py_None));
+  PyTuple_SET_ITEM(__pyx_t_2, 3, ((PyObject *)Py_None));
+  __Pyx_GIVEREF(((PyObject *)Py_None));
+  __Pyx_INCREF(((PyObject *)Py_None));
+  PyTuple_SET_ITEM(__pyx_t_2, 4, ((PyObject *)Py_None));
+  __Pyx_GIVEREF(((PyObject *)Py_None));
+  __Pyx_INCREF(((PyObject *)Py_None));
+  PyTuple_SET_ITEM(__pyx_t_2, 5, ((PyObject *)Py_None));
+  __Pyx_GIVEREF(((PyObject *)Py_None));
+  __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_allow_pos0_neg);
+  PyTuple_SET_ITEM(__pyx_t_2, 6, __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_allow_pos0_neg);
+  __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_allow_pos0_neg);
+  __pyx_t_1 = 0;
+  __pyx_r = ((PyObject *)__pyx_t_2);
+  __pyx_t_2 = 0;
+  goto __pyx_L0;
+
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_AddTraceback("splitBBoxLUT.HistoBBox1d.__defaults__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_12splitBBoxLUT_11HistoBBox1d_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyMethodDef __pyx_mdef_12splitBBoxLUT_11HistoBBox1d_1__init__ = {__Pyx_NAMESTR("__init__"), (PyCFunction)__pyx_pw_12splitBBoxLUT_11HistoBBox1d_1__init__, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
+static PyObject *__pyx_pw_12splitBBoxLUT_11HistoBBox1d_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_self = 0;
+  PyObject *__pyx_v_pos0 = 0;
+  PyObject *__pyx_v_delta_pos0 = 0;
+  PyObject *__pyx_v_pos1 = 0;
+  PyObject *__pyx_v_delta_pos1 = 0;
+  int __pyx_v_bins;
+  PyObject *__pyx_v_pos0Range = 0;
+  PyObject *__pyx_v_pos1Range = 0;
+  PyObject *__pyx_v_mask = 0;
+  CYTHON_UNUSED PyObject *__pyx_v_allow_pos0_neg = 0;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__self,&__pyx_n_s__pos0,&__pyx_n_s__delta_pos0,&__pyx_n_s__pos1,&__pyx_n_s__delta_pos1,&__pyx_n_s__bins,&__pyx_n_s__pos0Range,&__pyx_n_s__pos1Range,&__pyx_n_s__mask,&__pyx_n_s__allow_pos0_neg,0};
+    PyObject* values[10] = {0,0,0,0,0,0,0,0,0,0};
+    __pyx_defaults *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self);
+    values[3] = ((PyObject *)((PyObject *)Py_None));
+    values[4] = ((PyObject *)((PyObject *)Py_None));
+    values[6] = ((PyObject *)((PyObject *)Py_None));
+    values[7] = ((PyObject *)((PyObject *)Py_None));
+    values[8] = ((PyObject *)((PyObject *)Py_None));
+    values[9] = __pyx_dynamic_args->__pyx_arg_allow_pos0_neg;
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
+        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
+        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
+        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
+        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
+        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
+        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__self)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+        case  1:
+        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__pos0)) != 0)) kw_args--;
+        else {
+          __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 10, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+        }
+        case  2:
+        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__delta_pos0)) != 0)) kw_args--;
+        else {
+          __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 10, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+        }
+        case  3:
+        if (kw_args > 0) {
+          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__pos1);
+          if (value) { values[3] = value; kw_args--; }
+        }
+        case  4:
+        if (kw_args > 0) {
+          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__delta_pos1);
+          if (value) { values[4] = value; kw_args--; }
+        }
+        case  5:
+        if (kw_args > 0) {
+          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__bins);
+          if (value) { values[5] = value; kw_args--; }
+        }
+        case  6:
+        if (kw_args > 0) {
+          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__pos0Range);
+          if (value) { values[6] = value; kw_args--; }
+        }
+        case  7:
+        if (kw_args > 0) {
+          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__pos1Range);
+          if (value) { values[7] = value; kw_args--; }
+        }
+        case  8:
+        if (kw_args > 0) {
+          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__mask);
+          if (value) { values[8] = value; kw_args--; }
+        }
+        case  9:
+        if (kw_args > 0) {
+          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__allow_pos0_neg);
+          if (value) { values[9] = value; kw_args--; }
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+      }
+    } else {
+      switch (PyTuple_GET_SIZE(__pyx_args)) {
+        case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
+        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
+        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
+        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
+        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
+        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
+        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+    }
+    __pyx_v_self = values[0];
+    __pyx_v_pos0 = values[1];
+    __pyx_v_delta_pos0 = values[2];
+    __pyx_v_pos1 = values[3];
+    __pyx_v_delta_pos1 = values[4];
+    if (values[5]) {
+      __pyx_v_bins = __Pyx_PyInt_AsInt(values[5]); if (unlikely((__pyx_v_bins == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+    } else {
+      __pyx_v_bins = ((int)((int)100));
+    }
+    __pyx_v_pos0Range = values[6];
+    __pyx_v_pos1Range = values[7];
+    __pyx_v_mask = values[8];
+    __pyx_v_allow_pos0_neg = values[9];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 10, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("splitBBoxLUT.HistoBBox1d.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_12splitBBoxLUT_11HistoBBox1d___init__(__pyx_self, __pyx_v_self, __pyx_v_pos0, __pyx_v_delta_pos0, __pyx_v_pos1, __pyx_v_delta_pos1, __pyx_v_bins, __pyx_v_pos0Range, __pyx_v_pos1Range, __pyx_v_mask, __pyx_v_allow_pos0_neg);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_12splitBBoxLUT_11HistoBBox1d___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_pos0, PyObject *__pyx_v_delta_pos0, PyObject *__pyx_v_pos1, PyObject *__pyx_v_delta_pos1, int __pyx_v_bins, PyObject *__pyx_v_pos0Range, PyObject *__pyx_v_pos1Range, PyObject *__pyx_v_mask, CYTHON_UNUSED PyObject *__pyx_v_allow_pos0_neg) {
+  float __pyx_v_delta;
+  float __pyx_v_pos0_min;
+  int __pyx_v_i;
+  PyArrayObject *__pyx_v_outPos = 0;
+  PyObject *__pyx_v_pos0_maxin = NULL;
+  PyObject *__pyx_v_pos1_maxin = NULL;
+  PyObject *__pyx_v_lut_idx = NULL;
+  PyObject *__pyx_v_lut_coef = NULL;
+  __Pyx_LocalBuf_ND __pyx_pybuffernd_outPos;
+  __Pyx_Buffer __pyx_pybuffer_outPos;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__init__", 0);
+  __pyx_pybuffer_outPos.pybuffer.buf = NULL;
+  __pyx_pybuffer_outPos.refcount = 0;
+  __pyx_pybuffernd_outPos.data = NULL;
+  __pyx_pybuffernd_outPos.rcbuffer = &__pyx_pybuffer_outPos;
+
+  /* "splitBBoxLUT.pyx":50
+ * class HistoBBox1d(object):
+ *     @cython.boundscheck(False)
+ *     def __init__(self,             # <<<<<<<<<<<<<<
+ *                  pos0,
+ *                  delta_pos0,
+ */
+  __pyx_k_tuple_46 = PyTuple_New(20); if (unlikely(!__pyx_k_tuple_46)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_k_tuple_46);
+  __Pyx_INCREF(((PyObject *)__pyx_n_s__self));
+  PyTuple_SET_ITEM(__pyx_k_tuple_46, 0, ((PyObject *)__pyx_n_s__self));
+  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__self));
+  __Pyx_INCREF(((PyObject *)__pyx_n_s__pos0));
+  PyTuple_SET_ITEM(__pyx_k_tuple_46, 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_46, 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_46, 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_46, 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_46, 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_46, 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_46, 7, ((PyObject *)__pyx_n_s__pos1Range));
+  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__pos1Range));
+  __Pyx_INCREF(((PyObject *)__pyx_n_s__mask));
+  PyTuple_SET_ITEM(__pyx_k_tuple_46, 8, ((PyObject *)__pyx_n_s__mask));
+  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__mask));
+  __Pyx_INCREF(((PyObject *)__pyx_n_s__allow_pos0_neg));
+  PyTuple_SET_ITEM(__pyx_k_tuple_46, 9, ((PyObject *)__pyx_n_s__allow_pos0_neg));
+  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__allow_pos0_neg));
+  __Pyx_INCREF(((PyObject *)__pyx_n_s__delta));
+  PyTuple_SET_ITEM(__pyx_k_tuple_46, 10, ((PyObject *)__pyx_n_s__delta));
+  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__delta));
+  __Pyx_INCREF(((PyObject *)__pyx_n_s__pos0_min));
+  PyTuple_SET_ITEM(__pyx_k_tuple_46, 11, ((PyObject *)__pyx_n_s__pos0_min));
+  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__pos0_min));
+  __Pyx_INCREF(((PyObject *)__pyx_n_s__min0));
+  PyTuple_SET_ITEM(__pyx_k_tuple_46, 12, ((PyObject *)__pyx_n_s__min0));
+  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__min0));
+  __Pyx_INCREF(((PyObject *)__pyx_n_s__i));
+  PyTuple_SET_ITEM(__pyx_k_tuple_46, 13, ((PyObject *)__pyx_n_s__i));
+  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__i));
+  __Pyx_INCREF(((PyObject *)__pyx_n_s__size));
+  PyTuple_SET_ITEM(__pyx_k_tuple_46, 14, ((PyObject *)__pyx_n_s__size));
+  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__size));
+  __Pyx_INCREF(((PyObject *)__pyx_n_s__outPos));
+  PyTuple_SET_ITEM(__pyx_k_tuple_46, 15, ((PyObject *)__pyx_n_s__outPos));
+  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__outPos));
+  __Pyx_INCREF(((PyObject *)__pyx_n_s__pos0_maxin));
+  PyTuple_SET_ITEM(__pyx_k_tuple_46, 16, ((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_46, 17, ((PyObject *)__pyx_n_s__pos1_maxin));
+  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__pos1_maxin));
+  __Pyx_INCREF(((PyObject *)__pyx_n_s__lut_idx));
+  PyTuple_SET_ITEM(__pyx_k_tuple_46, 18, ((PyObject *)__pyx_n_s__lut_idx));
+  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__lut_idx));
+  __Pyx_INCREF(((PyObject *)__pyx_n_s__lut_coef));
+  PyTuple_SET_ITEM(__pyx_k_tuple_46, 19, ((PyObject *)__pyx_n_s__lut_coef));
+  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__lut_coef));
+  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_46));
+
+  /* "splitBBoxLUT.pyx":50
+ * class HistoBBox1d(object):
+ *     @cython.boundscheck(False)
+ *     def __init__(self,             # <<<<<<<<<<<<<<
+ *                  pos0,
+ *                  delta_pos0,
+ */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_12splitBBoxLUT_11HistoBBox1d_1__init__, 0, NULL, __pyx_n_s__splitBBoxLUT, ((PyObject *)__pyx_k_codeobj_47)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_2);
+  if (!__Pyx_CyFunction_InitDefaults(__pyx_t_2, sizeof(__pyx_defaults), 1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_k_codeobj_47 = (PyObject*)__Pyx_PyCode_New(10, 0, 20, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_46, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_48, __pyx_n_s____init__, 50, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_47)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+
 51:                  pos0,
+
 52:                  delta_pos0,
+
 53:                  pos1=None,
+
 54:                  delta_pos1=None,
+
 55:                  int bins=100,
+
+  /* "splitBBoxLUT.pyx":55
+ *                  pos1=None,
+ *                  delta_pos1=None,
+ *                  int bins=100,             # <<<<<<<<<<<<<<
+ *                  pos0Range=None,
+ *                  pos1Range=None,
+ */
+  __pyx_t_1 = PyInt_FromLong(((int)100)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_1);
+
 56:                  pos0Range=None,
+
 57:                  pos1Range=None,
+
 58:                  mask=None,
+
 59:                  allow_pos0_neg=False
+
+  /* "splitBBoxLUT.pyx":59
+ *                  pos1Range=None,
+ *                  mask=None,
+ *                  allow_pos0_neg=False             # <<<<<<<<<<<<<<
+ *                  ):
+ * 
+ */
+  __pyx_t_3 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_3);
+  __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_t_2)->__pyx_arg_allow_pos0_neg = __pyx_t_3;
+  __Pyx_GIVEREF(__pyx_t_3);
+  __pyx_t_3 = 0;
+  __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_2, __pyx_pf_12splitBBoxLUT_11HistoBBox1d_6__defaults__);
+  if (PyObject_SetItem(__pyx_t_1, __pyx_n_s____init__, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
 60:                  ):
+
 61: 
+
 62:         cdef float delta, pos0_min, min0
+
 63:         cdef int i, size
+
 64:         cdef numpy.ndarray[numpy.float32_t, ndim = 1] outPos = numpy.empty(bins,dtype=numpy.float32)
+
+  /* "splitBBoxLUT.pyx":64
+ *         cdef float delta, pos0_min, min0
+ *         cdef int i, size
+ *         cdef numpy.ndarray[numpy.float32_t, ndim = 1] outPos = numpy.empty(bins,dtype=numpy.float32)             # <<<<<<<<<<<<<<
+ *         self.size = pos0.size
+ *         assert delta_pos0.size == self.size
+ */
+  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_2);
+  __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 = 64; __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 = 64; __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 = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
+  __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_4);
+  __pyx_t_5 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__float32); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_5);
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__dtype), __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+  __pyx_t_5 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_3), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_5);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
+  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
+  if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_6 = ((PyArrayObject *)__pyx_t_5);
+  {
+    __Pyx_BufFmt_StackElem __pyx_stack[1];
+    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_outPos.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_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 = 64; __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_6 = 0;
+  __pyx_v_outPos = ((PyArrayObject *)__pyx_t_5);
+  __pyx_t_5 = 0;
+
 65:         self.size = pos0.size
+
+  /* "splitBBoxLUT.pyx":65
+ *         cdef int i, size
+ *         cdef numpy.ndarray[numpy.float32_t, ndim = 1] outPos = numpy.empty(bins,dtype=numpy.float32)
+ *         self.size = pos0.size             # <<<<<<<<<<<<<<
+ *         assert delta_pos0.size == self.size
+ *         self.bins = bins
+ */
+  __pyx_t_5 = PyObject_GetAttr(__pyx_v_pos0, __pyx_n_s__size); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_5);
+  if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__size, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+
 66:         assert delta_pos0.size == self.size
+
+  /* "splitBBoxLUT.pyx":66
+ *         cdef numpy.ndarray[numpy.float32_t, ndim = 1] outPos = numpy.empty(bins,dtype=numpy.float32)
+ *         self.size = pos0.size
+ *         assert delta_pos0.size == self.size             # <<<<<<<<<<<<<<
+ *         self.bins = bins
+ *         self.lut_size = 0
+ */
+  #ifndef CYTHON_WITHOUT_ASSERTIONS
+  __pyx_t_5 = PyObject_GetAttr(__pyx_v_delta_pos0, __pyx_n_s__size); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_5);
+  __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__size); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_3 = PyObject_RichCompare(__pyx_t_5, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  if (unlikely(!__pyx_t_7)) {
+    PyErr_SetNone(PyExc_AssertionError);
+    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  }
+  #endif
+
 67:         self.bins = bins
+
+  /* "splitBBoxLUT.pyx":67
+ *         self.size = pos0.size
+ *         assert delta_pos0.size == self.size
+ *         self.bins = bins             # <<<<<<<<<<<<<<
+ *         self.lut_size = 0
+ *         self.cpos0 = numpy.ascontiguousarray(pos0.ravel(), dtype=numpy.float32)
+ */
+  __pyx_t_3 = PyInt_FromLong(__pyx_v_bins); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_3);
+  if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__bins, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+
 68:         self.lut_size = 0
+
+  /* "splitBBoxLUT.pyx":68
+ *         assert delta_pos0.size == self.size
+ *         self.bins = bins
+ *         self.lut_size = 0             # <<<<<<<<<<<<<<
+ *         self.cpos0 = numpy.ascontiguousarray(pos0.ravel(), dtype=numpy.float32)
+ *         self.dpos0 = numpy.ascontiguousarray(delta_pos0.ravel(), dtype=numpy.float32)
+ */
+  if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__lut_size, __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+
 69:         self.cpos0 = numpy.ascontiguousarray(pos0.ravel(), dtype=numpy.float32)
+
+  /* "splitBBoxLUT.pyx":69
+ *         self.bins = bins
+ *         self.lut_size = 0
+ *         self.cpos0 = numpy.ascontiguousarray(pos0.ravel(), dtype=numpy.float32)             # <<<<<<<<<<<<<<
+ *         self.dpos0 = numpy.ascontiguousarray(delta_pos0.ravel(), dtype=numpy.float32)
+ *         self.cpos0_sup = self.cpos0 + self.dpos0
+ */
+  __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_3);
+  __pyx_t_1 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__ascontiguousarray); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __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_pos0, __pyx_n_s__ravel); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_3);
+  __pyx_t_5 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_5);
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_3);
+  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5);
+  __Pyx_GIVEREF(__pyx_t_5);
+  __pyx_t_5 = 0;
+  __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(((PyObject *)__pyx_t_5));
+  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_4 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__float32); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_4);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  if (PyDict_SetItem(__pyx_t_5, ((PyObject *)__pyx_n_s__dtype), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __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_5)); __pyx_t_5 = 0;
+  if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__cpos0, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+
 70:         self.dpos0 = numpy.ascontiguousarray(delta_pos0.ravel(), dtype=numpy.float32)
+
+  /* "splitBBoxLUT.pyx":70
+ *         self.lut_size = 0
+ *         self.cpos0 = numpy.ascontiguousarray(pos0.ravel(), dtype=numpy.float32)
+ *         self.dpos0 = numpy.ascontiguousarray(delta_pos0.ravel(), dtype=numpy.float32)             # <<<<<<<<<<<<<<
+ *         self.cpos0_sup = self.cpos0 + self.dpos0
+ *         self.cpos0_inf = self.cpos0 - self.dpos0
+ */
+  __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_4);
+  __pyx_t_5 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__ascontiguousarray); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_5);
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  __pyx_t_4 = PyObject_GetAttr(__pyx_v_delta_pos0, __pyx_n_s__ravel); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_4);
+  __pyx_t_3 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_3);
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __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 = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(((PyObject *)__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 = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__float32); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__dtype), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_2 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
+  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
+  if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__dpos0, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
 71:         self.cpos0_sup = self.cpos0 + self.dpos0
+
+  /* "splitBBoxLUT.pyx":71
+ *         self.cpos0 = numpy.ascontiguousarray(pos0.ravel(), dtype=numpy.float32)
+ *         self.dpos0 = numpy.ascontiguousarray(delta_pos0.ravel(), dtype=numpy.float32)
+ *         self.cpos0_sup = self.cpos0 + self.dpos0             # <<<<<<<<<<<<<<
+ *         self.cpos0_inf = self.cpos0 - self.dpos0
+ *         self.pos0_max = (self.cpos0_sup).max()
+ */
+  __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__cpos0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__dpos0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_3);
+  __pyx_t_4 = PyNumber_Add(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_4);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__cpos0_sup, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+
 72:         self.cpos0_inf = self.cpos0 - self.dpos0
+
+  /* "splitBBoxLUT.pyx":72
+ *         self.dpos0 = numpy.ascontiguousarray(delta_pos0.ravel(), dtype=numpy.float32)
+ *         self.cpos0_sup = self.cpos0 + self.dpos0
+ *         self.cpos0_inf = self.cpos0 - self.dpos0             # <<<<<<<<<<<<<<
+ *         self.pos0_max = (self.cpos0_sup).max()
+ *         pos0_min = (self.cpos0_inf).min()
+ */
+  __pyx_t_4 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__cpos0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_4);
+  __pyx_t_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__dpos0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_3);
+  __pyx_t_2 = PyNumber_Subtract(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__cpos0_inf, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
 73:         self.pos0_max = (self.cpos0_sup).max()
+
+  /* "splitBBoxLUT.pyx":73
+ *         self.cpos0_sup = self.cpos0 + self.dpos0
+ *         self.cpos0_inf = self.cpos0 - self.dpos0
+ *         self.pos0_max = (self.cpos0_sup).max()             # <<<<<<<<<<<<<<
+ *         pos0_min = (self.cpos0_inf).min()
+ *         self.pos0_min = pos0_min
+ */
+  __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__cpos0_sup); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__max); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_3);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__pos0_max, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
 74:         pos0_min = (self.cpos0_inf).min()
+
+  /* "splitBBoxLUT.pyx":74
+ *         self.cpos0_inf = self.cpos0 - self.dpos0
+ *         self.pos0_max = (self.cpos0_sup).max()
+ *         pos0_min = (self.cpos0_inf).min()             # <<<<<<<<<<<<<<
+ *         self.pos0_min = pos0_min
+ *         self.pos0Range = pos0Range
+ */
+  __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__cpos0_inf); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__min); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_3);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  __pyx_t_8 = __pyx_PyFloat_AsFloat(__pyx_t_2); if (unlikely((__pyx_t_8 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_v_pos0_min = __pyx_t_8;
+
 75:         self.pos0_min = pos0_min
+
+  /* "splitBBoxLUT.pyx":75
+ *         self.pos0_max = (self.cpos0_sup).max()
+ *         pos0_min = (self.cpos0_inf).min()
+ *         self.pos0_min = pos0_min             # <<<<<<<<<<<<<<
+ *         self.pos0Range = pos0Range
+ *         self.pos1Range = pos1Range
+ */
+  __pyx_t_2 = PyFloat_FromDouble(__pyx_v_pos0_min); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__pos0_min, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
 76:         self.pos0Range = pos0Range
+
+  /* "splitBBoxLUT.pyx":76
+ *         pos0_min = (self.cpos0_inf).min()
+ *         self.pos0_min = pos0_min
+ *         self.pos0Range = pos0Range             # <<<<<<<<<<<<<<
+ *         self.pos1Range = pos1Range
+ *         if pos0Range is not None and len(pos0Range) > 1:
+ */
+  if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__pos0Range, __pyx_v_pos0Range) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+
 77:         self.pos1Range = pos1Range
+
+  /* "splitBBoxLUT.pyx":77
+ *         self.pos0_min = pos0_min
+ *         self.pos0Range = pos0Range
+ *         self.pos1Range = pos1Range             # <<<<<<<<<<<<<<
+ *         if pos0Range is not None and len(pos0Range) > 1:
+ *             self.pos0_min = min(pos0Range)
+ */
+  if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__pos1Range, __pyx_v_pos1Range) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+
 78:         if pos0Range is not None and len(pos0Range) > 1:
+
+  /* "splitBBoxLUT.pyx":78
+ *         self.pos0Range = pos0Range
+ *         self.pos1Range = pos1Range
+ *         if pos0Range is not None and len(pos0Range) > 1:             # <<<<<<<<<<<<<<
+ *             self.pos0_min = min(pos0Range)
+ *             pos0_maxin = max(pos0Range)
+ */
+  __pyx_t_7 = (__pyx_v_pos0Range != Py_None);
+  if (__pyx_t_7) {
+    __pyx_t_9 = PyObject_Length(__pyx_v_pos0Range); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_10 = (__pyx_t_9 > 1);
+    __pyx_t_11 = __pyx_t_10;
+  } else {
+    __pyx_t_11 = __pyx_t_7;
+  }
+  if (__pyx_t_11) {
+
 79:             self.pos0_min = min(pos0Range)
+
+    /* "splitBBoxLUT.pyx":79
+ *         self.pos1Range = pos1Range
+ *         if pos0Range is not None and len(pos0Range) > 1:
+ *             self.pos0_min = min(pos0Range)             # <<<<<<<<<<<<<<
+ *             pos0_maxin = max(pos0Range)
+ *         else:
+ */
+    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_2);
+    __Pyx_INCREF(__pyx_v_pos0Range);
+    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_pos0Range);
+    __Pyx_GIVEREF(__pyx_v_pos0Range);
+    __pyx_t_3 = PyObject_Call(__pyx_builtin_min, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
+    if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__pos0_min, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+
 80:             pos0_maxin = max(pos0Range)
+
+    /* "splitBBoxLUT.pyx":80
+ *         if pos0Range is not None and len(pos0Range) > 1:
+ *             self.pos0_min = min(pos0Range)
+ *             pos0_maxin = max(pos0Range)             # <<<<<<<<<<<<<<
+ *         else:
+ *             pos0_maxin = self.pos0_max
+ */
+    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __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_2 = PyObject_Call(__pyx_builtin_max, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_2);
+    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
+    __pyx_v_pos0_maxin = __pyx_t_2;
+    __pyx_t_2 = 0;
+    goto __pyx_L3;
+  }
+  /*else*/ {
+
 81:         else:
+
 82:             pos0_maxin = self.pos0_max
+
+    /* "splitBBoxLUT.pyx":82
+ *             pos0_maxin = max(pos0Range)
+ *         else:
+ *             pos0_maxin = self.pos0_max             # <<<<<<<<<<<<<<
+ *         if self.pos0_min < 0:# and not allow_pos0_neg:
+ *             self.pos0_min = pos0_min = 0
+ */
+    __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__pos0_max); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_v_pos0_maxin = __pyx_t_2;
+    __pyx_t_2 = 0;
+  }
+  __pyx_L3:;
+
 83:         if self.pos0_min < 0:# and not allow_pos0_neg:
+
+  /* "splitBBoxLUT.pyx":83
+ *         else:
+ *             pos0_maxin = self.pos0_max
+ *         if self.pos0_min < 0:# and not allow_pos0_neg:             # <<<<<<<<<<<<<<
+ *             self.pos0_min = pos0_min = 0
+ *         self.pos0_max = pos0_maxin * (1.0 + numpy.finfo(numpy.float32).eps)
+ */
+  __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__pos0_min); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  if (__pyx_t_11) {
+
 84:             self.pos0_min = pos0_min = 0
+
+    /* "splitBBoxLUT.pyx":84
+ *             pos0_maxin = self.pos0_max
+ *         if self.pos0_min < 0:# and not allow_pos0_neg:
+ *             self.pos0_min = pos0_min = 0             # <<<<<<<<<<<<<<
+ *         self.pos0_max = pos0_maxin * (1.0 + numpy.finfo(numpy.float32).eps)
+ * 
+ */
+    __pyx_t_3 = PyInt_FromLong(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_3);
+    if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__pos0_min, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __pyx_v_pos0_min = 0;
+    goto __pyx_L4;
+  }
+  __pyx_L4:;
+
 85:         self.pos0_max = pos0_maxin * (1.0 + numpy.finfo(numpy.float32).eps)
+
+  /* "splitBBoxLUT.pyx":85
+ *         if self.pos0_min < 0:# and not allow_pos0_neg:
+ *             self.pos0_min = pos0_min = 0
+ *         self.pos0_max = pos0_maxin * (1.0 + numpy.finfo(numpy.float32).eps)             # <<<<<<<<<<<<<<
+ * 
+ *         if pos1Range is not None and len(pos1Range) > 1:
+ */
+  __pyx_t_3 = PyFloat_FromDouble(1.0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_3);
+  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_4 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__finfo); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_4);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_5 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__float32); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_5);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_2);
+  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_5);
+  __Pyx_GIVEREF(__pyx_t_5);
+  __pyx_t_5 = 0;
+  __pyx_t_5 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_5);
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
+  __pyx_t_2 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__eps); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+  __pyx_t_5 = PyNumber_Add(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_5);
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_2 = PyNumber_Multiply(__pyx_v_pos0_maxin, __pyx_t_5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+  if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__pos0_max, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
 86: 
+
 87:         if pos1Range is not None and len(pos1Range) > 1:
+
+  /* "splitBBoxLUT.pyx":87
+ *         self.pos0_max = pos0_maxin * (1.0 + numpy.finfo(numpy.float32).eps)
+ * 
+ *         if pos1Range is not None and len(pos1Range) > 1:             # <<<<<<<<<<<<<<
+ *             assert pos1.size == self.size
+ *             assert delta_pos1.size == self.size
+ */
+  __pyx_t_11 = (__pyx_v_pos1Range != Py_None);
+  if (__pyx_t_11) {
+    __pyx_t_9 = PyObject_Length(__pyx_v_pos1Range); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_7 = (__pyx_t_9 > 1);
+    __pyx_t_10 = __pyx_t_7;
+  } else {
+    __pyx_t_10 = __pyx_t_11;
+  }
+  if (__pyx_t_10) {
+
 88:             assert pos1.size == self.size
+
+    /* "splitBBoxLUT.pyx":88
+ * 
+ *         if pos1Range is not None and len(pos1Range) > 1:
+ *             assert pos1.size == self.size             # <<<<<<<<<<<<<<
+ *             assert delta_pos1.size == self.size
+ *             self.check_pos1 = 1
+ */
+    #ifndef CYTHON_WITHOUT_ASSERTIONS
+    __pyx_t_2 = PyObject_GetAttr(__pyx_v_pos1, __pyx_n_s__size); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_t_5 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__size); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_5);
+    __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    if (unlikely(!__pyx_t_10)) {
+      PyErr_SetNone(PyExc_AssertionError);
+      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    }
+    #endif
+
 89:             assert delta_pos1.size == self.size
+
+    /* "splitBBoxLUT.pyx":89
+ *         if pos1Range is not None and len(pos1Range) > 1:
+ *             assert pos1.size == self.size
+ *             assert delta_pos1.size == self.size             # <<<<<<<<<<<<<<
+ *             self.check_pos1 = 1
+ *             self.cpos1_min = numpy.ascontiguousarray((pos1-delta_pos1).ravel(), dtype=numpy.float32)
+ */
+    #ifndef CYTHON_WITHOUT_ASSERTIONS
+    __pyx_t_3 = PyObject_GetAttr(__pyx_v_delta_pos1, __pyx_n_s__size); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_3);
+    __pyx_t_5 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__size); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_5);
+    __pyx_t_2 = PyObject_RichCompare(__pyx_t_3, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    if (unlikely(!__pyx_t_10)) {
+      PyErr_SetNone(PyExc_AssertionError);
+      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    }
+    #endif
+
 90:             self.check_pos1 = 1
+
+    /* "splitBBoxLUT.pyx":90
+ *             assert pos1.size == self.size
+ *             assert delta_pos1.size == self.size
+ *             self.check_pos1 = 1             # <<<<<<<<<<<<<<
+ *             self.cpos1_min = numpy.ascontiguousarray((pos1-delta_pos1).ravel(), dtype=numpy.float32)
+ *             self.cpos1_max = numpy.ascontiguousarray((pos1+delta_pos1).ravel(), dtype=numpy.float32)
+ */
+    if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__check_pos1, __pyx_int_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+
 91:             self.cpos1_min = numpy.ascontiguousarray((pos1-delta_pos1).ravel(), dtype=numpy.float32)
+
+    /* "splitBBoxLUT.pyx":91
+ *             assert delta_pos1.size == self.size
+ *             self.check_pos1 = 1
+ *             self.cpos1_min = numpy.ascontiguousarray((pos1-delta_pos1).ravel(), dtype=numpy.float32)             # <<<<<<<<<<<<<<
+ *             self.cpos1_max = numpy.ascontiguousarray((pos1+delta_pos1).ravel(), dtype=numpy.float32)
+ *             self.pos1_min = min(pos1Range)
+ */
+    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_t_5 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__ascontiguousarray); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_5);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __pyx_t_2 = PyNumber_Subtract(__pyx_v_pos1, __pyx_v_delta_pos1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__ravel); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_2);
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_3);
+    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
+    __Pyx_GIVEREF(__pyx_t_2);
+    __pyx_t_2 = 0;
+    __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
+    __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_4);
+    __pyx_t_1 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__float32); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__dtype), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __pyx_t_1 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_3), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
+    __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
+    if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__cpos1_min, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
 92:             self.cpos1_max = numpy.ascontiguousarray((pos1+delta_pos1).ravel(), dtype=numpy.float32)
+
+    /* "splitBBoxLUT.pyx":92
+ *             self.check_pos1 = 1
+ *             self.cpos1_min = numpy.ascontiguousarray((pos1-delta_pos1).ravel(), dtype=numpy.float32)
+ *             self.cpos1_max = numpy.ascontiguousarray((pos1+delta_pos1).ravel(), dtype=numpy.float32)             # <<<<<<<<<<<<<<
+ *             self.pos1_min = min(pos1Range)
+ *             pos1_maxin = max(pos1Range)
+ */
+    __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); 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_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__ascontiguousarray); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_2);
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __pyx_t_1 = PyNumber_Add(__pyx_v_pos1, __pyx_v_delta_pos1); 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_t_3 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__ravel); 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_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __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 = 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 = PyTuple_New(1); 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);
+    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 = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(((PyObject *)__pyx_t_1));
+    __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_5);
+    __pyx_t_4 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__float32); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_4);
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__dtype), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_3), ((PyObject *)__pyx_t_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);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
+    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
+    if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__cpos1_max, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+
 93:             self.pos1_min = min(pos1Range)
+
+    /* "splitBBoxLUT.pyx":93
+ *             self.cpos1_min = numpy.ascontiguousarray((pos1-delta_pos1).ravel(), dtype=numpy.float32)
+ *             self.cpos1_max = numpy.ascontiguousarray((pos1+delta_pos1).ravel(), dtype=numpy.float32)
+ *             self.pos1_min = min(pos1Range)             # <<<<<<<<<<<<<<
+ *             pos1_maxin = max(pos1Range)
+ *             self.pos1_max = pos1_maxin * (1 + numpy.finfo(numpy.float32).eps)
+ */
+    __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);
+    __Pyx_INCREF(__pyx_v_pos1Range);
+    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_pos1Range);
+    __Pyx_GIVEREF(__pyx_v_pos1Range);
+    __pyx_t_1 = PyObject_Call(__pyx_builtin_min, ((PyObject *)__pyx_t_4), NULL); 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(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
+    if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__pos1_min, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
 94:             pos1_maxin = max(pos1Range)
+
+    /* "splitBBoxLUT.pyx":94
+ *             self.cpos1_max = numpy.ascontiguousarray((pos1+delta_pos1).ravel(), dtype=numpy.float32)
+ *             self.pos1_min = min(pos1Range)
+ *             pos1_maxin = max(pos1Range)             # <<<<<<<<<<<<<<
+ *             self.pos1_max = pos1_maxin * (1 + numpy.finfo(numpy.float32).eps)
+ *         else:
+ */
+    __pyx_t_1 = PyTuple_New(1); 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_INCREF(__pyx_v_pos1Range);
+    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_pos1Range);
+    __Pyx_GIVEREF(__pyx_v_pos1Range);
+    __pyx_t_4 = PyObject_Call(__pyx_builtin_max, ((PyObject *)__pyx_t_1), NULL); 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);
+    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
+    __pyx_v_pos1_maxin = __pyx_t_4;
+    __pyx_t_4 = 0;
+
 95:             self.pos1_max = pos1_maxin * (1 + numpy.finfo(numpy.float32).eps)
+
+    /* "splitBBoxLUT.pyx":95
+ *             self.pos1_min = min(pos1Range)
+ *             pos1_maxin = max(pos1Range)
+ *             self.pos1_max = pos1_maxin * (1 + numpy.finfo(numpy.float32).eps)             # <<<<<<<<<<<<<<
+ *         else:
+ *             self.check_pos1 = 0
+ */
+    __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); 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);
+    __pyx_t_1 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__finfo); 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_4); __pyx_t_4 = 0;
+    __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); 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);
+    __pyx_t_3 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__float32); 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_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 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 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_4), NULL); 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_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
+    __pyx_t_4 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__eps); 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);
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __pyx_t_3 = PyNumber_Add(__pyx_int_1, __pyx_t_4); 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_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __pyx_t_4 = PyNumber_Multiply(__pyx_v_pos1_maxin, __pyx_t_3); 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);
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__pos1_max, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    goto __pyx_L5;
+  }
+  /*else*/ {
+
 96:         else:
+
 97:             self.check_pos1 = 0
+
+    /* "splitBBoxLUT.pyx":97
+ *             self.pos1_max = pos1_maxin * (1 + numpy.finfo(numpy.float32).eps)
+ *         else:
+ *             self.check_pos1 = 0             # <<<<<<<<<<<<<<
+ *             self.cpos1_min = None
+ *             self.pos1_max = None
+ */
+    if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__check_pos1, __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+
 98:             self.cpos1_min = None
+
+    /* "splitBBoxLUT.pyx":98
+ *         else:
+ *             self.check_pos1 = 0
+ *             self.cpos1_min = None             # <<<<<<<<<<<<<<
+ *             self.pos1_max = None
+ * 
+ */
+    if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__cpos1_min, Py_None) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+
 99:             self.pos1_max = None
+
+    /* "splitBBoxLUT.pyx":99
+ *             self.check_pos1 = 0
+ *             self.cpos1_min = None
+ *             self.pos1_max = None             # <<<<<<<<<<<<<<
+ * 
+ *         if  mask is not None:
+ */
+    if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__pos1_max, Py_None) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  }
+  __pyx_L5:;
+
 100: 
+
 101:         if  mask is not None:
+
+  /* "splitBBoxLUT.pyx":101
+ *             self.pos1_max = None
+ * 
+ *         if  mask is not None:             # <<<<<<<<<<<<<<
+ *             assert mask.size == self.size
+ *             self.check_mask = 1
+ */
+  __pyx_t_10 = (__pyx_v_mask != Py_None);
+  if (__pyx_t_10) {
+
 102:             assert mask.size == self.size
+
+    /* "splitBBoxLUT.pyx":102
+ * 
+ *         if  mask is not None:
+ *             assert mask.size == self.size             # <<<<<<<<<<<<<<
+ *             self.check_mask = 1
+ *             self.cmask = numpy.ascontiguousarray(mask.ravel(), dtype=numpy.int8)
+ */
+    #ifndef CYTHON_WITHOUT_ASSERTIONS
+    __pyx_t_4 = PyObject_GetAttr(__pyx_v_mask, __pyx_n_s__size); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_4);
+    __pyx_t_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__size); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_3);
+    __pyx_t_1 = PyObject_RichCompare(__pyx_t_4, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    if (unlikely(!__pyx_t_10)) {
+      PyErr_SetNone(PyExc_AssertionError);
+      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    }
+    #endif
+
 103:             self.check_mask = 1
+
+    /* "splitBBoxLUT.pyx":103
+ *         if  mask is not None:
+ *             assert mask.size == self.size
+ *             self.check_mask = 1             # <<<<<<<<<<<<<<
+ *             self.cmask = numpy.ascontiguousarray(mask.ravel(), dtype=numpy.int8)
+ *             self.mask_checksum = hashlib.md5(mask).hexdigest()
+ */
+    if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__check_mask, __pyx_int_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+
 104:             self.cmask = numpy.ascontiguousarray(mask.ravel(), dtype=numpy.int8)
+
+    /* "splitBBoxLUT.pyx":104
+ *             assert mask.size == self.size
+ *             self.check_mask = 1
+ *             self.cmask = numpy.ascontiguousarray(mask.ravel(), dtype=numpy.int8)             # <<<<<<<<<<<<<<
+ *             self.mask_checksum = hashlib.md5(mask).hexdigest()
+ *         else:
+ */
+    __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_1);
+    __pyx_t_3 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__ascontiguousarray); 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_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __pyx_t_1 = PyObject_GetAttr(__pyx_v_mask, __pyx_n_s__ravel); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __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 = 104; __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 = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_1);
+    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4);
+    __Pyx_GIVEREF(__pyx_t_4);
+    __pyx_t_4 = 0;
+    __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(((PyObject *)__pyx_t_4));
+    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_t_5 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__int8); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_5);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    if (PyDict_SetItem(__pyx_t_4, ((PyObject *)__pyx_n_s__dtype), __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    __pyx_t_5 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_1), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_5);
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
+    __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
+    if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__cmask, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+
 105:             self.mask_checksum = hashlib.md5(mask).hexdigest()
+
+    /* "splitBBoxLUT.pyx":105
+ *             self.check_mask = 1
+ *             self.cmask = numpy.ascontiguousarray(mask.ravel(), dtype=numpy.int8)
+ *             self.mask_checksum = hashlib.md5(mask).hexdigest()             # <<<<<<<<<<<<<<
+ *         else:
+ *             self.check_mask = 0
+ */
+    __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__hashlib); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_5);
+    __pyx_t_4 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__md5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_4);
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_5);
+    __Pyx_INCREF(__pyx_v_mask);
+    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_mask);
+    __Pyx_GIVEREF(__pyx_v_mask);
+    __pyx_t_1 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
+    __pyx_t_5 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__hexdigest); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_5);
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __pyx_t_1 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__mask_checksum, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    goto __pyx_L6;
+  }
+  /*else*/ {
+
 106:         else:
+
 107:             self.check_mask = 0
+
+    /* "splitBBoxLUT.pyx":107
+ *             self.mask_checksum = hashlib.md5(mask).hexdigest()
+ *         else:
+ *             self.check_mask = 0             # <<<<<<<<<<<<<<
+ *             self.mask_checksum=None
+ *         delta = (self.pos0_max - pos0_min) / (bins)
+ */
+    if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__check_mask, __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+
 108:             self.mask_checksum=None
+
+    /* "splitBBoxLUT.pyx":108
+ *         else:
+ *             self.check_mask = 0
+ *             self.mask_checksum=None             # <<<<<<<<<<<<<<
+ *         delta = (self.pos0_max - pos0_min) / (bins)
+ *         self.delta = delta
+ */
+    if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__mask_checksum, Py_None) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  }
+  __pyx_L6:;
+
 109:         delta = (self.pos0_max - pos0_min) / (bins)
+
+  /* "splitBBoxLUT.pyx":109
+ *             self.check_mask = 0
+ *             self.mask_checksum=None
+ *         delta = (self.pos0_max - pos0_min) / (bins)             # <<<<<<<<<<<<<<
+ *         self.delta = delta
+ *         self.lut_max_idx, lut_idx, lut_coef = self.calc_lut()
+ */
+  __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__pos0_max); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_5 = PyFloat_FromDouble(__pyx_v_pos0_min); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_5);
+  __pyx_t_4 = PyNumber_Subtract(__pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __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_5); __pyx_t_5 = 0;
+  __pyx_t_5 = PyInt_FromLong(__pyx_v_bins); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_5);
+  __pyx_t_1 = __Pyx_PyNumber_Divide(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __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_5); __pyx_t_5 = 0;
+  __pyx_t_8 = __pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_8 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_v_delta = __pyx_t_8;
+
 110:         self.delta = delta
+
+  /* "splitBBoxLUT.pyx":110
+ *             self.mask_checksum=None
+ *         delta = (self.pos0_max - pos0_min) / (bins)
+ *         self.delta = delta             # <<<<<<<<<<<<<<
+ *         self.lut_max_idx, lut_idx, lut_coef = self.calc_lut()
+ *         ########################################################################
+ */
+  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_delta); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_1);
+  if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__delta, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
 111:         self.lut_max_idx, lut_idx, lut_coef = self.calc_lut()
+
+  /* "splitBBoxLUT.pyx":111
+ *         delta = (self.pos0_max - pos0_min) / (bins)
+ *         self.delta = delta
+ *         self.lut_max_idx, lut_idx, lut_coef = self.calc_lut()             # <<<<<<<<<<<<<<
+ *         ########################################################################
+ *         # Linspace has been discareded becaus it does calculation in double precision and all others are done in single
+ */
+  __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__calc_lut); 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_5 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_5);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  if ((likely(PyTuple_CheckExact(__pyx_t_5))) || (PyList_CheckExact(__pyx_t_5))) {
+    PyObject* sequence = __pyx_t_5;
+    #if CYTHON_COMPILING_IN_CPYTHON
+    Py_ssize_t size = Py_SIZE(sequence);
+    #else
+    Py_ssize_t size = PySequence_Size(sequence);
+    #endif
+    if (unlikely(size != 3)) {
+      if (size > 3) __Pyx_RaiseTooManyValuesError(3);
+      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
+      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    }
+    #if CYTHON_COMPILING_IN_CPYTHON
+    if (likely(PyTuple_CheckExact(sequence))) {
+      __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); 
+      __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); 
+      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 2); 
+    } else {
+      __pyx_t_1 = PyList_GET_ITEM(sequence, 0); 
+      __pyx_t_4 = PyList_GET_ITEM(sequence, 1); 
+      __pyx_t_3 = PyList_GET_ITEM(sequence, 2); 
+    }
+    __Pyx_INCREF(__pyx_t_1);
+    __Pyx_INCREF(__pyx_t_4);
+    __Pyx_INCREF(__pyx_t_3);
+    #else
+    __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_3 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    #endif
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+  } else
+  {
+    Py_ssize_t index = -1;
+    __pyx_t_2 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_2);
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    __pyx_t_12 = Py_TYPE(__pyx_t_2)->tp_iternext;
+    index = 0; __pyx_t_1 = __pyx_t_12(__pyx_t_2); if (unlikely(!__pyx_t_1)) goto __pyx_L7_unpacking_failed;
+    __Pyx_GOTREF(__pyx_t_1);
+    index = 1; __pyx_t_4 = __pyx_t_12(__pyx_t_2); if (unlikely(!__pyx_t_4)) goto __pyx_L7_unpacking_failed;
+    __Pyx_GOTREF(__pyx_t_4);
+    index = 2; __pyx_t_3 = __pyx_t_12(__pyx_t_2); if (unlikely(!__pyx_t_3)) goto __pyx_L7_unpacking_failed;
+    __Pyx_GOTREF(__pyx_t_3);
+    if (__Pyx_IternextUnpackEndCheck(__pyx_t_12(__pyx_t_2), 3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_12 = NULL;
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    goto __pyx_L8_unpacking_done;
+    __pyx_L7_unpacking_failed:;
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __pyx_t_12 = NULL;
+    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
+    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_L8_unpacking_done:;
+  }
+  if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__lut_max_idx, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_v_lut_idx = __pyx_t_4;
+  __pyx_t_4 = 0;
+  __pyx_v_lut_coef = __pyx_t_3;
+  __pyx_t_3 = 0;
+
 112:         ########################################################################
+
 113:         # Linspace has been discareded becaus it does calculation in double precision and all others are done in single
+
 114:         #self.outPos = numpy.linspace(self.pos0_min+0.5*delta,self.pos0_max-0.5*delta, self.bins)
+
 115:         ########################################################################
+
 116:         for i in prange(bins,nogil=True, schedule="static"):
+
+  /* "splitBBoxLUT.pyx":116
+ *         #self.outPos = numpy.linspace(self.pos0_min+0.5*delta,self.pos0_max-0.5*delta, self.bins)
+ *         ########################################################################
+ *         for i in prange(bins,nogil=True, schedule="static"):             # <<<<<<<<<<<<<<
+ *             outPos[i] = pos0_min + (<float>0.5 +< float > i) * delta
+ *         self.outPos = outPos
+ */
+  {
+      #ifdef WITH_THREAD
+      PyThreadState *_save = NULL;
+      #endif
+      Py_UNBLOCK_THREADS
+      /*try:*/ {
+        __pyx_t_13 = __pyx_v_bins;
+        if (1 == 0) abort();
+        {
+            #if ((defined(__APPLE__) || defined(__OSX__)) && (defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))))
+                #undef likely
+                #undef unlikely
+                #define likely(x)   (x)
+                #define unlikely(x) (x)
+            #endif
+            __pyx_t_15 = (__pyx_t_13 - 0) / 1;
+            if (__pyx_t_15 > 0)
+            {
+                #ifdef _OPENMP
+                #pragma omp parallel
+                #endif /* _OPENMP */
+                {
+                    #ifdef _OPENMP
+                    #pragma omp for firstprivate(__pyx_v_i) lastprivate(__pyx_v_i) schedule(static)
+                    #endif /* _OPENMP */
+                    for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_15; __pyx_t_14++){
+                        {
+                            __pyx_v_i = 0 + 1 * __pyx_t_14;
+
+      /* "splitBBoxLUT.pyx":116
+ *         #self.outPos = numpy.linspace(self.pos0_min+0.5*delta,self.pos0_max-0.5*delta, self.bins)
+ *         ########################################################################
+ *         for i in prange(bins,nogil=True, schedule="static"):             # <<<<<<<<<<<<<<
+ *             outPos[i] = pos0_min + (<float>0.5 +< float > i) * delta
+ *         self.outPos = outPos
+ */
+      /*finally:*/ {
+        Py_BLOCK_THREADS
+      }
+  }
+
 117:             outPos[i] = pos0_min + (<float>0.5 +< float > i) * delta
+
+                            /* "splitBBoxLUT.pyx":117
+ *         ########################################################################
+ *         for i in prange(bins,nogil=True, schedule="static"):
+ *             outPos[i] = pos0_min + (<float>0.5 +< float > i) * delta             # <<<<<<<<<<<<<<
+ *         self.outPos = outPos
+ *         self.lut = numpy.recarray(shape=lut_coef.shape,dtype=[("idx",numpy.uint32),("coef",numpy.float32)])
+ */
+                            __pyx_t_16 = __pyx_v_i;
+                            if (__pyx_t_16 < 0) __pyx_t_16 += __pyx_pybuffernd_outPos.diminfo[0].shape;
+                            *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_outPos.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_outPos.diminfo[0].strides) = (__pyx_v_pos0_min + ((((float)0.5) + ((float)__pyx_v_i)) * __pyx_v_delta));
+                        }
+                    }
+                }
+            }
+        }
+        #if ((defined(__APPLE__) || defined(__OSX__)) && (defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))))
+            #undef likely
+            #undef unlikely
+            #define likely(x)   __builtin_expect(!!(x), 1)
+            #define unlikely(x) __builtin_expect(!!(x), 0)
+        #endif
+      }
+
 118:         self.outPos = outPos
+
+  /* "splitBBoxLUT.pyx":118
+ *         for i in prange(bins,nogil=True, schedule="static"):
+ *             outPos[i] = pos0_min + (<float>0.5 +< float > i) * delta
+ *         self.outPos = outPos             # <<<<<<<<<<<<<<
+ *         self.lut = numpy.recarray(shape=lut_coef.shape,dtype=[("idx",numpy.uint32),("coef",numpy.float32)])
+ *         self.lut.coef = lut_coef
+ */
+  if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__outPos, ((PyObject *)__pyx_v_outPos)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+
 119:         self.lut = numpy.recarray(shape=lut_coef.shape,dtype=[("idx",numpy.uint32),("coef",numpy.float32)])
+
+  /* "splitBBoxLUT.pyx":119
+ *             outPos[i] = pos0_min + (<float>0.5 +< float > i) * delta
+ *         self.outPos = outPos
+ *         self.lut = numpy.recarray(shape=lut_coef.shape,dtype=[("idx",numpy.uint32),("coef",numpy.float32)])             # <<<<<<<<<<<<<<
+ *         self.lut.coef = lut_coef
+ *         self.lut.idx = lut_idx
+ */
+  __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_5);
+  __pyx_t_3 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__recarray); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_3);
+  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+  __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(((PyObject *)__pyx_t_5));
+  __pyx_t_4 = PyObject_GetAttr(__pyx_v_lut_coef, __pyx_n_s__shape); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_4);
+  if (PyDict_SetItem(__pyx_t_5, ((PyObject *)__pyx_n_s__shape), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_4);
+  __pyx_t_1 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__uint32); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_4);
+  __Pyx_INCREF(((PyObject *)__pyx_n_s__idx));
+  PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_n_s__idx));
+  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__idx));
+  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1);
+  __Pyx_GIVEREF(__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 = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__float32); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_INCREF(((PyObject *)__pyx_n_s__coef));
+  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_n_s__coef));
+  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__coef));
+  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2);
+  __Pyx_GIVEREF(__pyx_t_2);
+  __pyx_t_2 = 0;
+  __pyx_t_2 = PyList_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_2);
+  PyList_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_t_4));
+  __Pyx_GIVEREF(((PyObject *)__pyx_t_4));
+  PyList_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_t_1));
+  __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
+  __pyx_t_4 = 0;
+  __pyx_t_1 = 0;
+  if (PyDict_SetItem(__pyx_t_5, ((PyObject *)__pyx_n_s__dtype), ((PyObject *)__pyx_t_2)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
+  __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
+  if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__lut, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
 120:         self.lut.coef = lut_coef
+
+  /* "splitBBoxLUT.pyx":120
+ *         self.outPos = outPos
+ *         self.lut = numpy.recarray(shape=lut_coef.shape,dtype=[("idx",numpy.uint32),("coef",numpy.float32)])
+ *         self.lut.coef = lut_coef             # <<<<<<<<<<<<<<
+ *         self.lut.idx = lut_idx
+ * 
+ */
+  __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__lut); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyObject_SetAttr(__pyx_t_2, __pyx_n_s__coef, __pyx_v_lut_coef) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
 121:         self.lut.idx = lut_idx
+
+  /* "splitBBoxLUT.pyx":121
+ *         self.lut = numpy.recarray(shape=lut_coef.shape,dtype=[("idx",numpy.uint32),("coef",numpy.float32)])
+ *         self.lut.coef = lut_coef
+ *         self.lut.idx = lut_idx             # <<<<<<<<<<<<<<
+ * 
+ *     @cython.cdivision(True)
+ */
+  __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__lut); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyObject_SetAttr(__pyx_t_2, __pyx_n_s__idx, __pyx_v_lut_idx) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_5);
+  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
+    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
+    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_outPos.rcbuffer->pybuffer);
+  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
+  __Pyx_AddTraceback("splitBBoxLUT.HistoBBox1d.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  goto __pyx_L2;
+  __pyx_L0:;
+  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_outPos.rcbuffer->pybuffer);
+  __pyx_L2:;
+  __Pyx_XDECREF((PyObject *)__pyx_v_outPos);
+  __Pyx_XDECREF(__pyx_v_pos0_maxin);
+  __Pyx_XDECREF(__pyx_v_pos1_maxin);
+  __Pyx_XDECREF(__pyx_v_lut_idx);
+  __Pyx_XDECREF(__pyx_v_lut_coef);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_12splitBBoxLUT_11HistoBBox1d_3calc_lut(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
+static char __pyx_doc_12splitBBoxLUT_11HistoBBox1d_2calc_lut[] = "calculate the max number of elements in the LUT";
+static PyMethodDef __pyx_mdef_12splitBBoxLUT_11HistoBBox1d_3calc_lut = {__Pyx_NAMESTR("calc_lut"), (PyCFunction)__pyx_pw_12splitBBoxLUT_11HistoBBox1d_3calc_lut, METH_O, __Pyx_DOCSTR(__pyx_doc_12splitBBoxLUT_11HistoBBox1d_2calc_lut)};
+static PyObject *__pyx_pw_12splitBBoxLUT_11HistoBBox1d_3calc_lut(PyObject *__pyx_self, PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("calc_lut (wrapper)", 0);
+  __pyx_r = __pyx_pf_12splitBBoxLUT_11HistoBBox1d_2calc_lut(__pyx_self, ((PyObject *)__pyx_v_self));
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
 122: 
+
 123:     @cython.cdivision(True)
+
 124:     @cython.boundscheck(False)
+
 125:     @cython.wraparound(False)
+
 126:     def calc_lut(self):
+
+/* "splitBBoxLUT.pyx":126
+ *     @cython.boundscheck(False)
+ *     @cython.wraparound(False)
+ *     def calc_lut(self):             # <<<<<<<<<<<<<<
+ *         'calculate the max number of elements in the LUT'
+ *         cdef float delta=self.delta, pos0_min=self.pos0_min, pos1_min, pos1_max, min0, max0, fbin0_min, fbin0_max, deltaL, deltaR, deltaA
+ */
+
+static PyObject *__pyx_pf_12splitBBoxLUT_11HistoBBox1d_2calc_lut(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
+  float __pyx_v_delta;
+  float __pyx_v_pos0_min;
+  float __pyx_v_pos1_min;
+  float __pyx_v_pos1_max;
+  float __pyx_v_min0;
+  float __pyx_v_max0;
+  float __pyx_v_fbin0_min;
+  float __pyx_v_fbin0_max;
+  float __pyx_v_deltaL;
+  float __pyx_v_deltaR;
+  float __pyx_v_deltaA;
+  int __pyx_v_bin0_min;
+  int __pyx_v_bin0_max;
+  int __pyx_v_bins;
+  int __pyx_v_lut_size;
+  int __pyx_v_i;
+  int __pyx_v_size;
+  __pyx_t_5numpy_uint32_t __pyx_v_k;
+  __pyx_t_5numpy_uint32_t __pyx_v_idx;
+  int __pyx_v_check_mask;
+  int __pyx_v_check_pos1;
+  PyArrayObject *__pyx_v_outMax = 0;
+  __Pyx_memviewslice __pyx_v_cpos0_sup = { 0, 0, { 0 }, { 0 }, { 0 } };
+  __Pyx_memviewslice __pyx_v_cpos0_inf = { 0, 0, { 0 }, { 0 }, { 0 } };
+  __Pyx_memviewslice __pyx_v_cpos1_min = { 0, 0, { 0 }, { 0 }, { 0 } };
+  __Pyx_memviewslice __pyx_v_cpos1_max = { 0, 0, { 0 }, { 0 }, { 0 } };
+  PyArrayObject *__pyx_v_max_idx = 0;
+  PyArrayObject *__pyx_v_lut_idx = 0;
+  PyArrayObject *__pyx_v_lut_coef = 0;
+  __Pyx_memviewslice __pyx_v_cmask = { 0, 0, { 0 }, { 0 }, { 0 } };
+  __Pyx_LocalBuf_ND __pyx_pybuffernd_lut_coef;
+  __Pyx_Buffer __pyx_pybuffer_lut_coef;
+  __Pyx_LocalBuf_ND __pyx_pybuffernd_lut_idx;
+  __Pyx_Buffer __pyx_pybuffer_lut_idx;
+  __Pyx_LocalBuf_ND __pyx_pybuffernd_max_idx;
+  __Pyx_Buffer __pyx_pybuffer_max_idx;
+  __Pyx_LocalBuf_ND __pyx_pybuffernd_outMax;
+  __Pyx_Buffer __pyx_pybuffer_outMax;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("calc_lut", 0);
+  __pyx_pybuffer_outMax.pybuffer.buf = NULL;
+  __pyx_pybuffer_outMax.refcount = 0;
+  __pyx_pybuffernd_outMax.data = NULL;
+  __pyx_pybuffernd_outMax.rcbuffer = &__pyx_pybuffer_outMax;
+  __pyx_pybuffer_max_idx.pybuffer.buf = NULL;
+  __pyx_pybuffer_max_idx.refcount = 0;
+  __pyx_pybuffernd_max_idx.data = NULL;
+  __pyx_pybuffernd_max_idx.rcbuffer = &__pyx_pybuffer_max_idx;
+  __pyx_pybuffer_lut_idx.pybuffer.buf = NULL;
+  __pyx_pybuffer_lut_idx.refcount = 0;
+  __pyx_pybuffernd_lut_idx.data = NULL;
+  __pyx_pybuffernd_lut_idx.rcbuffer = &__pyx_pybuffer_lut_idx;
+  __pyx_pybuffer_lut_coef.pybuffer.buf = NULL;
+  __pyx_pybuffer_lut_coef.refcount = 0;
+  __pyx_pybuffernd_lut_coef.data = NULL;
+  __pyx_pybuffernd_lut_coef.rcbuffer = &__pyx_pybuffer_lut_coef;
+
+  /* "splitBBoxLUT.pyx":126
+ *     @cython.boundscheck(False)
+ *     @cython.wraparound(False)
+ *     def calc_lut(self):             # <<<<<<<<<<<<<<
+ *         'calculate the max number of elements in the LUT'
+ *         cdef float delta=self.delta, pos0_min=self.pos0_min, pos1_min, pos1_max, min0, max0, fbin0_min, fbin0_max, deltaL, deltaR, deltaA
+ */
+  __pyx_k_tuple_49 = PyTuple_New(31); if (unlikely(!__pyx_k_tuple_49)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_k_tuple_49);
+  __Pyx_INCREF(((PyObject *)__pyx_n_s__self));
+  PyTuple_SET_ITEM(__pyx_k_tuple_49, 0, ((PyObject *)__pyx_n_s__self));
+  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__self));
+  __Pyx_INCREF(((PyObject *)__pyx_n_s__delta));
+  PyTuple_SET_ITEM(__pyx_k_tuple_49, 1, ((PyObject *)__pyx_n_s__delta));
+  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__delta));
+  __Pyx_INCREF(((PyObject *)__pyx_n_s__pos0_min));
+  PyTuple_SET_ITEM(__pyx_k_tuple_49, 2, ((PyObject *)__pyx_n_s__pos0_min));
+  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__pos0_min));
+  __Pyx_INCREF(((PyObject *)__pyx_n_s__pos1_min));
+  PyTuple_SET_ITEM(__pyx_k_tuple_49, 3, ((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_49, 4, ((PyObject *)__pyx_n_s__pos1_max));
+  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__pos1_max));
+  __Pyx_INCREF(((PyObject *)__pyx_n_s__min0));
+  PyTuple_SET_ITEM(__pyx_k_tuple_49, 5, ((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_49, 6, ((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_49, 7, ((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_49, 8, ((PyObject *)__pyx_n_s__fbin0_max));
+  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__fbin0_max));
+  __Pyx_INCREF(((PyObject *)__pyx_n_s__deltaL));
+  PyTuple_SET_ITEM(__pyx_k_tuple_49, 9, ((PyObject *)__pyx_n_s__deltaL));
+  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__deltaL));
+  __Pyx_INCREF(((PyObject *)__pyx_n_s__deltaR));
+  PyTuple_SET_ITEM(__pyx_k_tuple_49, 10, ((PyObject *)__pyx_n_s__deltaR));
+  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__deltaR));
+  __Pyx_INCREF(((PyObject *)__pyx_n_s__deltaA));
+  PyTuple_SET_ITEM(__pyx_k_tuple_49, 11, ((PyObject *)__pyx_n_s__deltaA));
+  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__deltaA));
+  __Pyx_INCREF(((PyObject *)__pyx_n_s__bin0_min));
+  PyTuple_SET_ITEM(__pyx_k_tuple_49, 12, ((PyObject *)__pyx_n_s__bin0_min));
+  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__bin0_min));
+  __Pyx_INCREF(((PyObject *)__pyx_n_s__bin0_max));
+  PyTuple_SET_ITEM(__pyx_k_tuple_49, 13, ((PyObject *)__pyx_n_s__bin0_max));
+  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__bin0_max));
+  __Pyx_INCREF(((PyObject *)__pyx_n_s__bins));
+  PyTuple_SET_ITEM(__pyx_k_tuple_49, 14, ((PyObject *)__pyx_n_s__bins));
+  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__bins));
+  __Pyx_INCREF(((PyObject *)__pyx_n_s__lut_size));
+  PyTuple_SET_ITEM(__pyx_k_tuple_49, 15, ((PyObject *)__pyx_n_s__lut_size));
+  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__lut_size));
+  __Pyx_INCREF(((PyObject *)__pyx_n_s__i));
+  PyTuple_SET_ITEM(__pyx_k_tuple_49, 16, ((PyObject *)__pyx_n_s__i));
+  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__i));
+  __Pyx_INCREF(((PyObject *)__pyx_n_s__size));
+  PyTuple_SET_ITEM(__pyx_k_tuple_49, 17, ((PyObject *)__pyx_n_s__size));
+  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__size));
+  __Pyx_INCREF(((PyObject *)__pyx_n_s__k));
+  PyTuple_SET_ITEM(__pyx_k_tuple_49, 18, ((PyObject *)__pyx_n_s__k));
+  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__k));
+  __Pyx_INCREF(((PyObject *)__pyx_n_s__idx));
+  PyTuple_SET_ITEM(__pyx_k_tuple_49, 19, ((PyObject *)__pyx_n_s__idx));
+  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__idx));
+  __Pyx_INCREF(((PyObject *)__pyx_n_s__check_mask));
+  PyTuple_SET_ITEM(__pyx_k_tuple_49, 20, ((PyObject *)__pyx_n_s__check_mask));
+  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__check_mask));
+  __Pyx_INCREF(((PyObject *)__pyx_n_s__check_pos1));
+  PyTuple_SET_ITEM(__pyx_k_tuple_49, 21, ((PyObject *)__pyx_n_s__check_pos1));
+  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__check_pos1));
+  __Pyx_INCREF(((PyObject *)__pyx_n_s__outMax));
+  PyTuple_SET_ITEM(__pyx_k_tuple_49, 22, ((PyObject *)__pyx_n_s__outMax));
+  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__outMax));
+  __Pyx_INCREF(((PyObject *)__pyx_n_s__cpos0_sup));
+  PyTuple_SET_ITEM(__pyx_k_tuple_49, 23, ((PyObject *)__pyx_n_s__cpos0_sup));
+  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__cpos0_sup));
+  __Pyx_INCREF(((PyObject *)__pyx_n_s__cpos0_inf));
+  PyTuple_SET_ITEM(__pyx_k_tuple_49, 24, ((PyObject *)__pyx_n_s__cpos0_inf));
+  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__cpos0_inf));
+  __Pyx_INCREF(((PyObject *)__pyx_n_s__cpos1_min));
+  PyTuple_SET_ITEM(__pyx_k_tuple_49, 25, ((PyObject *)__pyx_n_s__cpos1_min));
+  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__cpos1_min));
+  __Pyx_INCREF(((PyObject *)__pyx_n_s__cpos1_max));
+  PyTuple_SET_ITEM(__pyx_k_tuple_49, 26, ((PyObject *)__pyx_n_s__cpos1_max));
+  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__cpos1_max));
+  __Pyx_INCREF(((PyObject *)__pyx_n_s__max_idx));
+  PyTuple_SET_ITEM(__pyx_k_tuple_49, 27, ((PyObject *)__pyx_n_s__max_idx));
+  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__max_idx));
+  __Pyx_INCREF(((PyObject *)__pyx_n_s__lut_idx));
+  PyTuple_SET_ITEM(__pyx_k_tuple_49, 28, ((PyObject *)__pyx_n_s__lut_idx));
+  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__lut_idx));
+  __Pyx_INCREF(((PyObject *)__pyx_n_s__lut_coef));
+  PyTuple_SET_ITEM(__pyx_k_tuple_49, 29, ((PyObject *)__pyx_n_s__lut_coef));
+  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__lut_coef));
+  __Pyx_INCREF(((PyObject *)__pyx_n_s__cmask));
+  PyTuple_SET_ITEM(__pyx_k_tuple_49, 30, ((PyObject *)__pyx_n_s__cmask));
+  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__cmask));
+  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_49));
+
+  /* "splitBBoxLUT.pyx":126
+ *     @cython.boundscheck(False)
+ *     @cython.wraparound(False)
+ *     def calc_lut(self):             # <<<<<<<<<<<<<<
+ *         'calculate the max number of elements in the LUT'
+ *         cdef float delta=self.delta, pos0_min=self.pos0_min, pos1_min, pos1_max, min0, max0, fbin0_min, fbin0_max, deltaL, deltaR, deltaA
+ */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_12splitBBoxLUT_11HistoBBox1d_3calc_lut, 0, NULL, __pyx_n_s__splitBBoxLUT, ((PyObject *)__pyx_k_codeobj_50)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyObject_SetItem(__pyx_t_1, __pyx_n_s__calc_lut, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_k_codeobj_50 = (PyObject*)__Pyx_PyCode_New(1, 0, 31, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_49, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_48, __pyx_n_s__calc_lut, 126, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_50)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+
 127:         'calculate the max number of elements in the LUT'
+
 128:         cdef float delta=self.delta, pos0_min=self.pos0_min, pos1_min, pos1_max, min0, max0, fbin0_min, fbin0_max, deltaL, deltaR, deltaA
+
+  /* "splitBBoxLUT.pyx":128
+ *     def calc_lut(self):
+ *         'calculate the max number of elements in the LUT'
+ *         cdef float delta=self.delta, pos0_min=self.pos0_min, pos1_min, pos1_max, min0, max0, fbin0_min, fbin0_max, deltaL, deltaR, deltaA             # <<<<<<<<<<<<<<
+ *         cdef int bin0_min, bin0_max, bins = self.bins, lut_size, i, size
+ *         cdef numpy.uint32_t k,idx #same as numpy.uint32
+ */
+  __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__delta); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = __pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_2 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_v_delta = __pyx_t_2;
+  __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__pos0_min); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = __pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_2 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_v_pos0_min = __pyx_t_2;
+
 129:         cdef int bin0_min, bin0_max, bins = self.bins, lut_size, i, size
+
+  /* "splitBBoxLUT.pyx":129
+ *         'calculate the max number of elements in the LUT'
+ *         cdef float delta=self.delta, pos0_min=self.pos0_min, pos1_min, pos1_max, min0, max0, fbin0_min, fbin0_max, deltaL, deltaR, deltaA
+ *         cdef int bin0_min, bin0_max, bins = self.bins, lut_size, i, size             # <<<<<<<<<<<<<<
+ *         cdef numpy.uint32_t k,idx #same as numpy.uint32
+ *         cdef bint check_mask, check_pos1
+ */
+  __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__bins); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_3 = __Pyx_PyInt_AsInt(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_v_bins = __pyx_t_3;
+
 130:         cdef numpy.uint32_t k,idx #same as numpy.uint32
+
 131:         cdef bint check_mask, check_pos1
+
 132:         cdef numpy.ndarray[numpy.int_t, ndim = 1] outMax = numpy.zeros(self.bins, dtype=numpy.int)
+
+  /* "splitBBoxLUT.pyx":132
+ *         cdef numpy.uint32_t k,idx #same as numpy.uint32
+ *         cdef bint check_mask, check_pos1
+ *         cdef numpy.ndarray[numpy.int_t, ndim = 1] outMax = numpy.zeros(self.bins, dtype=numpy.int)             # <<<<<<<<<<<<<<
+ *         cdef float[:] cpos0_sup = self.cpos0_sup
+ *         cdef float[:] cpos0_inf = self.cpos0_inf
+ */
+  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __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 = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_4);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__bins); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_5);
+  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1);
+  __Pyx_GIVEREF(__pyx_t_1);
+  __pyx_t_1 = 0;
+  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
+  __pyx_t_6 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_6);
+  __pyx_t_7 = PyObject_GetAttr(__pyx_t_6, __pyx_n_s__int); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_7);
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__dtype), __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  __pyx_t_7 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_5), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_7);
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
+  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
+  if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_8 = ((PyArrayObject *)__pyx_t_7);
+  {
+    __Pyx_BufFmt_StackElem __pyx_stack[1];
+    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_outMax.rcbuffer->pybuffer, (PyObject*)__pyx_t_8, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
+      __pyx_v_outMax = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_outMax.rcbuffer->pybuffer.buf = NULL;
+      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    } else {__pyx_pybuffernd_outMax.diminfo[0].strides = __pyx_pybuffernd_outMax.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_outMax.diminfo[0].shape = __pyx_pybuffernd_outMax.rcbuffer->pybuffer.shape[0];
+    }
+  }
+  __pyx_t_8 = 0;
+  __pyx_v_outMax = ((PyArrayObject *)__pyx_t_7);
+  __pyx_t_7 = 0;
+
 133:         cdef float[:] cpos0_sup = self.cpos0_sup
+
+  /* "splitBBoxLUT.pyx":133
+ *         cdef bint check_mask, check_pos1
+ *         cdef numpy.ndarray[numpy.int_t, ndim = 1] outMax = numpy.zeros(self.bins, dtype=numpy.int)
+ *         cdef float[:] cpos0_sup = self.cpos0_sup             # <<<<<<<<<<<<<<
+ *         cdef float[:] cpos0_inf = self.cpos0_inf
+ *         cdef float[:] cpos1_min, cpos1_max
+ */
+  __pyx_t_7 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__cpos0_sup); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_7);
+  __pyx_t_9 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(__pyx_t_7);
+  if (unlikely(!__pyx_t_9.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  __pyx_v_cpos0_sup = __pyx_t_9;
+  __pyx_t_9.memview = NULL;
+  __pyx_t_9.data = NULL;
+
 134:         cdef float[:] cpos0_inf = self.cpos0_inf
+
+  /* "splitBBoxLUT.pyx":134
+ *         cdef numpy.ndarray[numpy.int_t, ndim = 1] outMax = numpy.zeros(self.bins, dtype=numpy.int)
+ *         cdef float[:] cpos0_sup = self.cpos0_sup
+ *         cdef float[:] cpos0_inf = self.cpos0_inf             # <<<<<<<<<<<<<<
+ *         cdef float[:] cpos1_min, cpos1_max
+ *         cdef numpy.ndarray[numpy.uint32_t, ndim = 1] max_idx = numpy.zeros(bins, dtype=numpy.uint32)
+ */
+  __pyx_t_7 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__cpos0_inf); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_7);
+  __pyx_t_10 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(__pyx_t_7);
+  if (unlikely(!__pyx_t_10.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  __pyx_v_cpos0_inf = __pyx_t_10;
+  __pyx_t_10.memview = NULL;
+  __pyx_t_10.data = NULL;
+
 135:         cdef float[:] cpos1_min, cpos1_max
+
 136:         cdef numpy.ndarray[numpy.uint32_t, ndim = 1] max_idx = numpy.zeros(bins, dtype=numpy.uint32)
+
+  /* "splitBBoxLUT.pyx":136
+ *         cdef float[:] cpos0_inf = self.cpos0_inf
+ *         cdef float[:] cpos1_min, cpos1_max
+ *         cdef numpy.ndarray[numpy.uint32_t, ndim = 1] max_idx = numpy.zeros(bins, dtype=numpy.uint32)             # <<<<<<<<<<<<<<
+ *         cdef numpy.ndarray[numpy.uint32_t, ndim = 2] lut_idx
+ *         cdef numpy.ndarray[numpy.float32_t, ndim = 2] lut_coef
+ */
+  __pyx_t_7 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_7);
+  __pyx_t_1 = PyObject_GetAttr(__pyx_t_7, __pyx_n_s__zeros); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  __pyx_t_7 = PyInt_FromLong(__pyx_v_bins); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_7);
+  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_5);
+  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_7);
+  __Pyx_GIVEREF(__pyx_t_7);
+  __pyx_t_7 = 0;
+  __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(((PyObject *)__pyx_t_7));
+  __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_4);
+  __pyx_t_6 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__uint32); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_6);
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  if (PyDict_SetItem(__pyx_t_7, ((PyObject *)__pyx_n_s__dtype), __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  __pyx_t_6 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_5), ((PyObject *)__pyx_t_7)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_6);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
+  __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
+  if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_11 = ((PyArrayObject *)__pyx_t_6);
+  {
+    __Pyx_BufFmt_StackElem __pyx_stack[1];
+    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_max_idx.rcbuffer->pybuffer, (PyObject*)__pyx_t_11, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
+      __pyx_v_max_idx = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_max_idx.rcbuffer->pybuffer.buf = NULL;
+      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    } else {__pyx_pybuffernd_max_idx.diminfo[0].strides = __pyx_pybuffernd_max_idx.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_max_idx.diminfo[0].shape = __pyx_pybuffernd_max_idx.rcbuffer->pybuffer.shape[0];
+    }
+  }
+  __pyx_t_11 = 0;
+  __pyx_v_max_idx = ((PyArrayObject *)__pyx_t_6);
+  __pyx_t_6 = 0;
+
 137:         cdef numpy.ndarray[numpy.uint32_t, ndim = 2] lut_idx
+
 138:         cdef numpy.ndarray[numpy.float32_t, ndim = 2] lut_coef
+
 139:         cdef numpy.int8_t[:] cmask
+
 140:         size = self.size
+
+  /* "splitBBoxLUT.pyx":140
+ *         cdef numpy.ndarray[numpy.float32_t, ndim = 2] lut_coef
+ *         cdef numpy.int8_t[:] cmask
+ *         size = self.size             # <<<<<<<<<<<<<<
+ *         if self.check_mask:
+ *             cmask = self.cmask
+ */
+  __pyx_t_6 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__size); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_6);
+  __pyx_t_3 = __Pyx_PyInt_AsInt(__pyx_t_6); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  __pyx_v_size = __pyx_t_3;
+
 141:         if self.check_mask:
+
+  /* "splitBBoxLUT.pyx":141
+ *         cdef numpy.int8_t[:] cmask
+ *         size = self.size
+ *         if self.check_mask:             # <<<<<<<<<<<<<<
+ *             cmask = self.cmask
+ *             check_mask = 1
+ */
+  __pyx_t_6 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__check_mask); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_6);
+  __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  if (__pyx_t_12) {
+
 142:             cmask = self.cmask
+
+    /* "splitBBoxLUT.pyx":142
+ *         size = self.size
+ *         if self.check_mask:
+ *             cmask = self.cmask             # <<<<<<<<<<<<<<
+ *             check_mask = 1
+ *         else:
+ */
+    __pyx_t_6 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__cmask); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_6);
+    __pyx_t_13 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int8_t(__pyx_t_6);
+    if (unlikely(!__pyx_t_13.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+    __pyx_v_cmask = __pyx_t_13;
+    __pyx_t_13.memview = NULL;
+    __pyx_t_13.data = NULL;
+
 143:             check_mask = 1
+
+    /* "splitBBoxLUT.pyx":143
+ *         if self.check_mask:
+ *             cmask = self.cmask
+ *             check_mask = 1             # <<<<<<<<<<<<<<
+ *         else:
+ *             check_mask = 0
+ */
+    __pyx_v_check_mask = 1;
+    goto __pyx_L3;
+  }
+  /*else*/ {
+
 144:         else:
+
 145:             check_mask = 0
+
+    /* "splitBBoxLUT.pyx":145
+ *             check_mask = 1
+ *         else:
+ *             check_mask = 0             # <<<<<<<<<<<<<<
+ * 
+ *         if self.check_pos1:
+ */
+    __pyx_v_check_mask = 0;
+  }
+  __pyx_L3:;
+
 146: 
+
 147:         if self.check_pos1:
+
+  /* "splitBBoxLUT.pyx":147
+ *             check_mask = 0
+ * 
+ *         if self.check_pos1:             # <<<<<<<<<<<<<<
+ *             check_pos1 = 1
+ *             cpos1_min = self.cpos1_min
+ */
+  __pyx_t_6 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__check_pos1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_6);
+  __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  if (__pyx_t_12) {
+
 148:             check_pos1 = 1
+
+    /* "splitBBoxLUT.pyx":148
+ * 
+ *         if self.check_pos1:
+ *             check_pos1 = 1             # <<<<<<<<<<<<<<
+ *             cpos1_min = self.cpos1_min
+ *             cpos1_max = self.cpos1_max
+ */
+    __pyx_v_check_pos1 = 1;
+
 149:             cpos1_min = self.cpos1_min
+
+    /* "splitBBoxLUT.pyx":149
+ *         if self.check_pos1:
+ *             check_pos1 = 1
+ *             cpos1_min = self.cpos1_min             # <<<<<<<<<<<<<<
+ *             cpos1_max = self.cpos1_max
+ *             pos1_max = self.pos1_max
+ */
+    __pyx_t_6 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__cpos1_min); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_6);
+    __pyx_t_14 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(__pyx_t_6);
+    if (unlikely(!__pyx_t_14.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+    __pyx_v_cpos1_min = __pyx_t_14;
+    __pyx_t_14.memview = NULL;
+    __pyx_t_14.data = NULL;
+
 150:             cpos1_max = self.cpos1_max
+
+    /* "splitBBoxLUT.pyx":150
+ *             check_pos1 = 1
+ *             cpos1_min = self.cpos1_min
+ *             cpos1_max = self.cpos1_max             # <<<<<<<<<<<<<<
+ *             pos1_max = self.pos1_max
+ *             pos1_min = self.pos1_min
+ */
+    __pyx_t_6 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__cpos1_max); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_6);
+    __pyx_t_14 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(__pyx_t_6);
+    if (unlikely(!__pyx_t_14.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+    __pyx_v_cpos1_max = __pyx_t_14;
+    __pyx_t_14.memview = NULL;
+    __pyx_t_14.data = NULL;
+
 151:             pos1_max = self.pos1_max
+
+    /* "splitBBoxLUT.pyx":151
+ *             cpos1_min = self.cpos1_min
+ *             cpos1_max = self.cpos1_max
+ *             pos1_max = self.pos1_max             # <<<<<<<<<<<<<<
+ *             pos1_min = self.pos1_min
+ *         else:
+ */
+    __pyx_t_6 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__pos1_max); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_6);
+    __pyx_t_2 = __pyx_PyFloat_AsFloat(__pyx_t_6); if (unlikely((__pyx_t_2 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+    __pyx_v_pos1_max = __pyx_t_2;
+
 152:             pos1_min = self.pos1_min
+
+    /* "splitBBoxLUT.pyx":152
+ *             cpos1_max = self.cpos1_max
+ *             pos1_max = self.pos1_max
+ *             pos1_min = self.pos1_min             # <<<<<<<<<<<<<<
+ *         else:
+ *             check_pos1 = 0
+ */
+    __pyx_t_6 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__pos1_min); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_6);
+    __pyx_t_2 = __pyx_PyFloat_AsFloat(__pyx_t_6); if (unlikely((__pyx_t_2 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+    __pyx_v_pos1_min = __pyx_t_2;
+    goto __pyx_L4;
+  }
+  /*else*/ {
+
 153:         else:
+
 154:             check_pos1 = 0
+
+    /* "splitBBoxLUT.pyx":154
+ *             pos1_min = self.pos1_min
+ *         else:
+ *             check_pos1 = 0             # <<<<<<<<<<<<<<
+ * #NOGIL
+ *         with nogil:
+ */
+    __pyx_v_check_pos1 = 0;
+  }
+  __pyx_L4:;
+
 155: #NOGIL
+
 156:         with nogil:
+
+  /* "splitBBoxLUT.pyx":156
+ *             check_pos1 = 0
+ * #NOGIL
+ *         with nogil:             # <<<<<<<<<<<<<<
+ *             for idx in range(size):
+ *                 if (check_mask) and (cmask[idx]):
+ */
+  {
+      #ifdef WITH_THREAD
+      PyThreadState *_save = NULL;
+      #endif
+      Py_UNBLOCK_THREADS
+      /*try:*/ {
+
+      /* "splitBBoxLUT.pyx":156
+ *             check_pos1 = 0
+ * #NOGIL
+ *         with nogil:             # <<<<<<<<<<<<<<
+ *             for idx in range(size):
+ *                 if (check_mask) and (cmask[idx]):
+ */
+      /*finally:*/ {
+        int __pyx_why;
+        __pyx_why = 0; goto __pyx_L7;
+        __pyx_L6: __pyx_why = 4; goto __pyx_L7;
+        __pyx_L7:;
+        Py_BLOCK_THREADS
+        switch (__pyx_why) {
+          case 4: goto __pyx_L1_error;
+        }
+      }
+  }
+
 157:             for idx in range(size):
+
+        /* "splitBBoxLUT.pyx":157
+ * #NOGIL
+ *         with nogil:
+ *             for idx in range(size):             # <<<<<<<<<<<<<<
+ *                 if (check_mask) and (cmask[idx]):
+ *                     continue
+ */
+        __pyx_t_3 = __pyx_v_size;
+        for (__pyx_t_15 = 0; __pyx_t_15 < __pyx_t_3; __pyx_t_15+=1) {
+          __pyx_v_idx = __pyx_t_15;
+
 158:                 if (check_mask) and (cmask[idx]):
+
+          /* "splitBBoxLUT.pyx":158
+ *         with nogil:
+ *             for idx in range(size):
+ *                 if (check_mask) and (cmask[idx]):             # <<<<<<<<<<<<<<
+ *                     continue
+ * 
+ */
+          __pyx_t_12 = __pyx_v_check_mask;
+          if (__pyx_t_12) {
+            if (unlikely(!__pyx_v_cmask.memview)) { __Pyx_RaiseUnboundMemoryviewSliceNogil("cmask"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L6;} }
+            __pyx_t_16 = __pyx_v_idx;
+            __pyx_t_17 = (*((__pyx_t_5numpy_int8_t *) ( /* dim=0 */ (__pyx_v_cmask.data + __pyx_t_16 * __pyx_v_cmask.strides[0]) )));
+          } else {
+            __pyx_t_17 = __pyx_t_12;
+          }
+          if (__pyx_t_17) {
+
 159:                     continue
+
+            /* "splitBBoxLUT.pyx":159
+ *             for idx in range(size):
+ *                 if (check_mask) and (cmask[idx]):
+ *                     continue             # <<<<<<<<<<<<<<
+ * 
+ *                 min0 = cpos0_inf[idx]
+ */
+            goto __pyx_L8_continue;
+            goto __pyx_L10;
+          }
+          __pyx_L10:;
+
 160: 
+
 161:                 min0 = cpos0_inf[idx]
+
+          /* "splitBBoxLUT.pyx":161
+ *                     continue
+ * 
+ *                 min0 = cpos0_inf[idx]             # <<<<<<<<<<<<<<
+ *                 max0 = cpos0_sup[idx]
+ * 
+ */
+          __pyx_t_18 = __pyx_v_idx;
+          __pyx_v_min0 = (*((float *) ( /* dim=0 */ (__pyx_v_cpos0_inf.data + __pyx_t_18 * __pyx_v_cpos0_inf.strides[0]) )));
+
 162:                 max0 = cpos0_sup[idx]
+
+          /* "splitBBoxLUT.pyx":162
+ * 
+ *                 min0 = cpos0_inf[idx]
+ *                 max0 = cpos0_sup[idx]             # <<<<<<<<<<<<<<
+ * 
+ *                 if check_pos1 and ((cpos1_max[idx] < pos1_min) or (cpos1_min[idx] > pos1_max)):
+ */
+          __pyx_t_19 = __pyx_v_idx;
+          __pyx_v_max0 = (*((float *) ( /* dim=0 */ (__pyx_v_cpos0_sup.data + __pyx_t_19 * __pyx_v_cpos0_sup.strides[0]) )));
+
 163: 
+
 164:                 if check_pos1 and ((cpos1_max[idx] < pos1_min) or (cpos1_min[idx] > pos1_max)):
+
+          /* "splitBBoxLUT.pyx":164
+ *                 max0 = cpos0_sup[idx]
+ * 
+ *                 if check_pos1 and ((cpos1_max[idx] < pos1_min) or (cpos1_min[idx] > pos1_max)):             # <<<<<<<<<<<<<<
+ *                     continue
+ * 
+ */
+          if (__pyx_v_check_pos1) {
+            if (unlikely(!__pyx_v_cpos1_max.memview)) { __Pyx_RaiseUnboundMemoryviewSliceNogil("cpos1_max"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L6;} }
+            __pyx_t_20 = __pyx_v_idx;
+            __pyx_t_17 = ((*((float *) ( /* dim=0 */ (__pyx_v_cpos1_max.data + __pyx_t_20 * __pyx_v_cpos1_max.strides[0]) ))) < __pyx_v_pos1_min);
+            if (!__pyx_t_17) {
+              if (unlikely(!__pyx_v_cpos1_min.memview)) { __Pyx_RaiseUnboundMemoryviewSliceNogil("cpos1_min"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L6;} }
+              __pyx_t_21 = __pyx_v_idx;
+              __pyx_t_12 = ((*((float *) ( /* dim=0 */ (__pyx_v_cpos1_min.data + __pyx_t_21 * __pyx_v_cpos1_min.strides[0]) ))) > __pyx_v_pos1_max);
+              __pyx_t_22 = __pyx_t_12;
+            } else {
+              __pyx_t_22 = __pyx_t_17;
+            }
+            __pyx_t_17 = __pyx_t_22;
+          } else {
+            __pyx_t_17 = __pyx_v_check_pos1;
+          }
+          if (__pyx_t_17) {
+
 165:                     continue
+
+            /* "splitBBoxLUT.pyx":165
+ * 
+ *                 if check_pos1 and ((cpos1_max[idx] < pos1_min) or (cpos1_min[idx] > pos1_max)):
+ *                     continue             # <<<<<<<<<<<<<<
+ * 
+ *                 fbin0_min = getBinNr(min0, pos0_min, delta)
+ */
+            goto __pyx_L8_continue;
+            goto __pyx_L11;
+          }
+          __pyx_L11:;
+
 166: 
+
 167:                 fbin0_min = getBinNr(min0, pos0_min, delta)
+
+          /* "splitBBoxLUT.pyx":167
+ *                     continue
+ * 
+ *                 fbin0_min = getBinNr(min0, pos0_min, delta)             # <<<<<<<<<<<<<<
+ *                 fbin0_max = getBinNr(max0, pos0_min, delta)
+ *                 bin0_min = < int > fbin0_min
+ */
+          __pyx_v_fbin0_min = __pyx_f_12splitBBoxLUT_getBinNr(__pyx_v_min0, __pyx_v_pos0_min, __pyx_v_delta);
+
 168:                 fbin0_max = getBinNr(max0, pos0_min, delta)
+
+          /* "splitBBoxLUT.pyx":168
+ * 
+ *                 fbin0_min = getBinNr(min0, pos0_min, delta)
+ *                 fbin0_max = getBinNr(max0, pos0_min, delta)             # <<<<<<<<<<<<<<
+ *                 bin0_min = < int > fbin0_min
+ *                 bin0_max = < int > fbin0_max
+ */
+          __pyx_v_fbin0_max = __pyx_f_12splitBBoxLUT_getBinNr(__pyx_v_max0, __pyx_v_pos0_min, __pyx_v_delta);
+
 169:                 bin0_min = < int > fbin0_min
+
+          /* "splitBBoxLUT.pyx":169
+ *                 fbin0_min = getBinNr(min0, pos0_min, delta)
+ *                 fbin0_max = getBinNr(max0, pos0_min, delta)
+ *                 bin0_min = < int > fbin0_min             # <<<<<<<<<<<<<<
+ *                 bin0_max = < int > fbin0_max
+ * 
+ */
+          __pyx_v_bin0_min = ((int)__pyx_v_fbin0_min);
+
 170:                 bin0_max = < int > fbin0_max
+
+          /* "splitBBoxLUT.pyx":170
+ *                 fbin0_max = getBinNr(max0, pos0_min, delta)
+ *                 bin0_min = < int > fbin0_min
+ *                 bin0_max = < int > fbin0_max             # <<<<<<<<<<<<<<
+ * 
+ *                 if (bin0_max < 0) or (bin0_min >= bins):
+ */
+          __pyx_v_bin0_max = ((int)__pyx_v_fbin0_max);
+
 171: 
+
 172:                 if (bin0_max < 0) or (bin0_min >= bins):
+
+          /* "splitBBoxLUT.pyx":172
+ *                 bin0_max = < int > fbin0_max
+ * 
+ *                 if (bin0_max < 0) or (bin0_min >= bins):             # <<<<<<<<<<<<<<
+ *                     continue
+ *                 if bin0_max >= bins :
+ */
+          __pyx_t_17 = (__pyx_v_bin0_max < 0);
+          if (!__pyx_t_17) {
+            __pyx_t_22 = (__pyx_v_bin0_min >= __pyx_v_bins);
+            __pyx_t_12 = __pyx_t_22;
+          } else {
+            __pyx_t_12 = __pyx_t_17;
+          }
+          if (__pyx_t_12) {
+
 173:                     continue
+
+            /* "splitBBoxLUT.pyx":173
+ * 
+ *                 if (bin0_max < 0) or (bin0_min >= bins):
+ *                     continue             # <<<<<<<<<<<<<<
+ *                 if bin0_max >= bins :
+ *                     bin0_max = bins - 1
+ */
+            goto __pyx_L8_continue;
+            goto __pyx_L12;
+          }
+          __pyx_L12:;
+
 174:                 if bin0_max >= bins :
+
+          /* "splitBBoxLUT.pyx":174
+ *                 if (bin0_max < 0) or (bin0_min >= bins):
+ *                     continue
+ *                 if bin0_max >= bins :             # <<<<<<<<<<<<<<
+ *                     bin0_max = bins - 1
+ *                 if  bin0_min < 0:
+ */
+          __pyx_t_12 = (__pyx_v_bin0_max >= __pyx_v_bins);
+          if (__pyx_t_12) {
+
 175:                     bin0_max = bins - 1
+
+            /* "splitBBoxLUT.pyx":175
+ *                     continue
+ *                 if bin0_max >= bins :
+ *                     bin0_max = bins - 1             # <<<<<<<<<<<<<<
+ *                 if  bin0_min < 0:
+ *                     bin0_min = 0
+ */
+            __pyx_v_bin0_max = (__pyx_v_bins - 1);
+            goto __pyx_L13;
+          }
+          __pyx_L13:;
+
 176:                 if  bin0_min < 0:
+
+          /* "splitBBoxLUT.pyx":176
+ *                 if bin0_max >= bins :
+ *                     bin0_max = bins - 1
+ *                 if  bin0_min < 0:             # <<<<<<<<<<<<<<
+ *                     bin0_min = 0
+ * 
+ */
+          __pyx_t_12 = (__pyx_v_bin0_min < 0);
+          if (__pyx_t_12) {
+
 177:                     bin0_min = 0
+
+            /* "splitBBoxLUT.pyx":177
+ *                     bin0_max = bins - 1
+ *                 if  bin0_min < 0:
+ *                     bin0_min = 0             # <<<<<<<<<<<<<<
+ * 
+ *                 if bin0_min == bin0_max:
+ */
+            __pyx_v_bin0_min = 0;
+            goto __pyx_L14;
+          }
+          __pyx_L14:;
+
 178: 
+
 179:                 if bin0_min == bin0_max:
+
+          /* "splitBBoxLUT.pyx":179
+ *                     bin0_min = 0
+ * 
+ *                 if bin0_min == bin0_max:             # <<<<<<<<<<<<<<
+ *                     #All pixel is within a single bin
+ *                     outMax[bin0_min] += 1
+ */
+          __pyx_t_12 = (__pyx_v_bin0_min == __pyx_v_bin0_max);
+          if (__pyx_t_12) {
+
 180:                     #All pixel is within a single bin
+
 181:                     outMax[bin0_min] += 1
+
+            /* "splitBBoxLUT.pyx":181
+ *                 if bin0_min == bin0_max:
+ *                     #All pixel is within a single bin
+ *                     outMax[bin0_min] += 1             # <<<<<<<<<<<<<<
+ * 
+ *                 else: #we have pixel spliting.
+ */
+            __pyx_t_23 = __pyx_v_bin0_min;
+            *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int_t *, __pyx_pybuffernd_outMax.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_outMax.diminfo[0].strides) += 1;
+            goto __pyx_L15;
+          }
+          /*else*/ {
+
 182: 
+
 183:                 else: #we have pixel spliting.
+
 184:                     for i in range(bin0_min, bin0_max + 1):
+
+            /* "splitBBoxLUT.pyx":184
+ * 
+ *                 else: #we have pixel spliting.
+ *                     for i in range(bin0_min, bin0_max + 1):             # <<<<<<<<<<<<<<
+ *                         outMax[i] += 1
+ * 
+ */
+            __pyx_t_24 = (__pyx_v_bin0_max + 1);
+            for (__pyx_t_25 = __pyx_v_bin0_min; __pyx_t_25 < __pyx_t_24; __pyx_t_25+=1) {
+              __pyx_v_i = __pyx_t_25;
+
 185:                         outMax[i] += 1
+
+              /* "splitBBoxLUT.pyx":185
+ *                 else: #we have pixel spliting.
+ *                     for i in range(bin0_min, bin0_max + 1):
+ *                         outMax[i] += 1             # <<<<<<<<<<<<<<
+ * 
+ *         lut_size = outMax.max()
+ */
+              __pyx_t_26 = __pyx_v_i;
+              *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int_t *, __pyx_pybuffernd_outMax.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_outMax.diminfo[0].strides) += 1;
+            }
+          }
+          __pyx_L15:;
+          __pyx_L8_continue:;
+        }
+      }
+
 186: 
+
 187:         lut_size = outMax.max()
+
+  /* "splitBBoxLUT.pyx":187
+ *                         outMax[i] += 1
+ * 
+ *         lut_size = outMax.max()             # <<<<<<<<<<<<<<
+ *         self.lut_size = lut_size
+ * 
+ */
+  __pyx_t_6 = PyObject_GetAttr(((PyObject *)__pyx_v_outMax), __pyx_n_s__max); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_6);
+  __pyx_t_7 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_7);
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  __pyx_t_3 = __Pyx_PyInt_AsInt(__pyx_t_7); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  __pyx_v_lut_size = __pyx_t_3;
+
 188:         self.lut_size = lut_size
+
+  /* "splitBBoxLUT.pyx":188
+ * 
+ *         lut_size = outMax.max()
+ *         self.lut_size = lut_size             # <<<<<<<<<<<<<<
+ * 
+ *         lut_idx = numpy.zeros((bins, lut_size), dtype=numpy.uint32)
+ */
+  __pyx_t_7 = PyInt_FromLong(__pyx_v_lut_size); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_7);
+  if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__lut_size, __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+
 189: 
+
 190:         lut_idx = numpy.zeros((bins, lut_size), dtype=numpy.uint32)
+
+  /* "splitBBoxLUT.pyx":190
+ *         self.lut_size = lut_size
+ * 
+ *         lut_idx = numpy.zeros((bins, lut_size), dtype=numpy.uint32)             # <<<<<<<<<<<<<<
+ *         lut_coef = numpy.zeros((self.bins, self.lut_size), dtype=numpy.float32)
+ * 
+ */
+  __pyx_t_7 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_7);
+  __pyx_t_6 = PyObject_GetAttr(__pyx_t_7, __pyx_n_s__zeros); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_6);
+  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  __pyx_t_7 = PyInt_FromLong(__pyx_v_bins); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_7);
+  __pyx_t_5 = PyInt_FromLong(__pyx_v_lut_size); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_5);
+  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_1);
+  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_7);
+  __Pyx_GIVEREF(__pyx_t_7);
+  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_5);
+  __Pyx_GIVEREF(__pyx_t_5);
+  __pyx_t_7 = 0;
+  __pyx_t_5 = 0;
+  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_5);
+  PyTuple_SET_ITEM(__pyx_t_5, 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 = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
+  __pyx_t_7 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_7);
+  __pyx_t_4 = PyObject_GetAttr(__pyx_t_7, __pyx_n_s__uint32); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_4);
+  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__dtype), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  __pyx_t_4 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_t_5), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_4);
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
+  __Pyx_DECREF(((PyObject *)__pyx_t_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 = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_27 = ((PyArrayObject *)__pyx_t_4);
+  {
+    __Pyx_BufFmt_StackElem __pyx_stack[1];
+    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lut_idx.rcbuffer->pybuffer);
+    __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_lut_idx.rcbuffer->pybuffer, (PyObject*)__pyx_t_27, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack);
+    if (unlikely(__pyx_t_3 < 0)) {
+      PyErr_Fetch(&__pyx_t_28, &__pyx_t_29, &__pyx_t_30);
+      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_lut_idx.rcbuffer->pybuffer, (PyObject*)__pyx_v_lut_idx, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {
+        Py_XDECREF(__pyx_t_28); Py_XDECREF(__pyx_t_29); Py_XDECREF(__pyx_t_30);
+        __Pyx_RaiseBufferFallbackError();
+      } else {
+        PyErr_Restore(__pyx_t_28, __pyx_t_29, __pyx_t_30);
+      }
+    }
+    __pyx_pybuffernd_lut_idx.diminfo[0].strides = __pyx_pybuffernd_lut_idx.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_lut_idx.diminfo[0].shape = __pyx_pybuffernd_lut_idx.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_lut_idx.diminfo[1].strides = __pyx_pybuffernd_lut_idx.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_lut_idx.diminfo[1].shape = __pyx_pybuffernd_lut_idx.rcbuffer->pybuffer.shape[1];
+    if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  }
+  __pyx_t_27 = 0;
+  __pyx_v_lut_idx = ((PyArrayObject *)__pyx_t_4);
+  __pyx_t_4 = 0;
+
 191:         lut_coef = numpy.zeros((self.bins, self.lut_size), dtype=numpy.float32)
+
+  /* "splitBBoxLUT.pyx":191
+ * 
+ *         lut_idx = numpy.zeros((bins, lut_size), dtype=numpy.uint32)
+ *         lut_coef = numpy.zeros((self.bins, self.lut_size), dtype=numpy.float32)             # <<<<<<<<<<<<<<
+ * 
+ *         #NOGIL
+ */
+  __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __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 = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  __pyx_t_4 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__bins); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_4);
+  __pyx_t_5 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__lut_size); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_5);
+  __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_6);
+  PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4);
+  __Pyx_GIVEREF(__pyx_t_4);
+  PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_5);
+  __Pyx_GIVEREF(__pyx_t_5);
+  __pyx_t_4 = 0;
+  __pyx_t_5 = 0;
+  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_5);
+  PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_t_6));
+  __Pyx_GIVEREF(((PyObject *)__pyx_t_6));
+  __pyx_t_6 = 0;
+  __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(((PyObject *)__pyx_t_6));
+  __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_4);
+  __pyx_t_7 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__float32); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_7);
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  if (PyDict_SetItem(__pyx_t_6, ((PyObject *)__pyx_n_s__dtype), __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  __pyx_t_7 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_5), ((PyObject *)__pyx_t_6)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_7);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
+  __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
+  if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_31 = ((PyArrayObject *)__pyx_t_7);
+  {
+    __Pyx_BufFmt_StackElem __pyx_stack[1];
+    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lut_coef.rcbuffer->pybuffer);
+    __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_lut_coef.rcbuffer->pybuffer, (PyObject*)__pyx_t_31, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack);
+    if (unlikely(__pyx_t_3 < 0)) {
+      PyErr_Fetch(&__pyx_t_30, &__pyx_t_29, &__pyx_t_28);
+      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_lut_coef.rcbuffer->pybuffer, (PyObject*)__pyx_v_lut_coef, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {
+        Py_XDECREF(__pyx_t_30); Py_XDECREF(__pyx_t_29); Py_XDECREF(__pyx_t_28);
+        __Pyx_RaiseBufferFallbackError();
+      } else {
+        PyErr_Restore(__pyx_t_30, __pyx_t_29, __pyx_t_28);
+      }
+    }
+    __pyx_pybuffernd_lut_coef.diminfo[0].strides = __pyx_pybuffernd_lut_coef.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_lut_coef.diminfo[0].shape = __pyx_pybuffernd_lut_coef.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_lut_coef.diminfo[1].strides = __pyx_pybuffernd_lut_coef.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_lut_coef.diminfo[1].shape = __pyx_pybuffernd_lut_coef.rcbuffer->pybuffer.shape[1];
+    if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  }
+  __pyx_t_31 = 0;
+  __pyx_v_lut_coef = ((PyArrayObject *)__pyx_t_7);
+  __pyx_t_7 = 0;
+
 192: 
+
 193:         #NOGIL
+
 194:         with nogil:
+
+  /* "splitBBoxLUT.pyx":194
+ * 
+ *         #NOGIL
+ *         with nogil:             # <<<<<<<<<<<<<<
+ *             for idx in range(size):
+ *                 if (check_mask) and (cmask[idx]):
+ */
+  {
+      #ifdef WITH_THREAD
+      PyThreadState *_save = NULL;
+      #endif
+      Py_UNBLOCK_THREADS
+      /*try:*/ {
+
+      /* "splitBBoxLUT.pyx":194
+ * 
+ *         #NOGIL
+ *         with nogil:             # <<<<<<<<<<<<<<
+ *             for idx in range(size):
+ *                 if (check_mask) and (cmask[idx]):
+ */
+      /*finally:*/ {
+        int __pyx_why;
+        __pyx_why = 0; goto __pyx_L21;
+        __pyx_L20: __pyx_why = 4; goto __pyx_L21;
+        __pyx_L21:;
+        Py_BLOCK_THREADS
+        switch (__pyx_why) {
+          case 4: goto __pyx_L1_error;
+        }
+      }
+  }
+
 195:             for idx in range(size):
+
+        /* "splitBBoxLUT.pyx":195
+ *         #NOGIL
+ *         with nogil:
+ *             for idx in range(size):             # <<<<<<<<<<<<<<
+ *                 if (check_mask) and (cmask[idx]):
+ *                     continue
+ */
+        __pyx_t_3 = __pyx_v_size;
+        for (__pyx_t_15 = 0; __pyx_t_15 < __pyx_t_3; __pyx_t_15+=1) {
+          __pyx_v_idx = __pyx_t_15;
+
 196:                 if (check_mask) and (cmask[idx]):
+
+          /* "splitBBoxLUT.pyx":196
+ *         with nogil:
+ *             for idx in range(size):
+ *                 if (check_mask) and (cmask[idx]):             # <<<<<<<<<<<<<<
+ *                     continue
+ * 
+ */
+          __pyx_t_12 = __pyx_v_check_mask;
+          if (__pyx_t_12) {
+            if (unlikely(!__pyx_v_cmask.memview)) { __Pyx_RaiseUnboundMemoryviewSliceNogil("cmask"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L20;} }
+            __pyx_t_32 = __pyx_v_idx;
+            __pyx_t_17 = (*((__pyx_t_5numpy_int8_t *) ( /* dim=0 */ (__pyx_v_cmask.data + __pyx_t_32 * __pyx_v_cmask.strides[0]) )));
+          } else {
+            __pyx_t_17 = __pyx_t_12;
+          }
+          if (__pyx_t_17) {
+
 197:                     continue
+
+            /* "splitBBoxLUT.pyx":197
+ *             for idx in range(size):
+ *                 if (check_mask) and (cmask[idx]):
+ *                     continue             # <<<<<<<<<<<<<<
+ * 
+ *                 min0 = cpos0_inf[idx]
+ */
+            goto __pyx_L22_continue;
+            goto __pyx_L24;
+          }
+          __pyx_L24:;
+
 198: 
+
 199:                 min0 = cpos0_inf[idx]
+
+          /* "splitBBoxLUT.pyx":199
+ *                     continue
+ * 
+ *                 min0 = cpos0_inf[idx]             # <<<<<<<<<<<<<<
+ *                 max0 = cpos0_sup[idx]
+ * 
+ */
+          __pyx_t_33 = __pyx_v_idx;
+          __pyx_v_min0 = (*((float *) ( /* dim=0 */ (__pyx_v_cpos0_inf.data + __pyx_t_33 * __pyx_v_cpos0_inf.strides[0]) )));
+
 200:                 max0 = cpos0_sup[idx]
+
+          /* "splitBBoxLUT.pyx":200
+ * 
+ *                 min0 = cpos0_inf[idx]
+ *                 max0 = cpos0_sup[idx]             # <<<<<<<<<<<<<<
+ * 
+ *                 if check_pos1 and ((cpos1_max[idx] < pos1_min) or (cpos1_min[idx] > pos1_max)):
+ */
+          __pyx_t_34 = __pyx_v_idx;
+          __pyx_v_max0 = (*((float *) ( /* dim=0 */ (__pyx_v_cpos0_sup.data + __pyx_t_34 * __pyx_v_cpos0_sup.strides[0]) )));
+
 201: 
+
 202:                 if check_pos1 and ((cpos1_max[idx] < pos1_min) or (cpos1_min[idx] > pos1_max)):
+
+          /* "splitBBoxLUT.pyx":202
+ *                 max0 = cpos0_sup[idx]
+ * 
+ *                 if check_pos1 and ((cpos1_max[idx] < pos1_min) or (cpos1_min[idx] > pos1_max)):             # <<<<<<<<<<<<<<
+ *                         continue
+ * 
+ */
+          if (__pyx_v_check_pos1) {
+            if (unlikely(!__pyx_v_cpos1_max.memview)) { __Pyx_RaiseUnboundMemoryviewSliceNogil("cpos1_max"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L20;} }
+            __pyx_t_35 = __pyx_v_idx;
+            __pyx_t_17 = ((*((float *) ( /* dim=0 */ (__pyx_v_cpos1_max.data + __pyx_t_35 * __pyx_v_cpos1_max.strides[0]) ))) < __pyx_v_pos1_min);
+            if (!__pyx_t_17) {
+              if (unlikely(!__pyx_v_cpos1_min.memview)) { __Pyx_RaiseUnboundMemoryviewSliceNogil("cpos1_min"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L20;} }
+              __pyx_t_36 = __pyx_v_idx;
+              __pyx_t_12 = ((*((float *) ( /* dim=0 */ (__pyx_v_cpos1_min.data + __pyx_t_36 * __pyx_v_cpos1_min.strides[0]) ))) > __pyx_v_pos1_max);
+              __pyx_t_22 = __pyx_t_12;
+            } else {
+              __pyx_t_22 = __pyx_t_17;
+            }
+            __pyx_t_17 = __pyx_t_22;
+          } else {
+            __pyx_t_17 = __pyx_v_check_pos1;
+          }
+          if (__pyx_t_17) {
+
 203:                         continue
+
+            /* "splitBBoxLUT.pyx":203
+ * 
+ *                 if check_pos1 and ((cpos1_max[idx] < pos1_min) or (cpos1_min[idx] > pos1_max)):
+ *                         continue             # <<<<<<<<<<<<<<
+ * 
+ *                 fbin0_min = getBinNr(min0, pos0_min, delta)
+ */
+            goto __pyx_L22_continue;
+            goto __pyx_L25;
+          }
+          __pyx_L25:;
+
 204: 
+
 205:                 fbin0_min = getBinNr(min0, pos0_min, delta)
+
+          /* "splitBBoxLUT.pyx":205
+ *                         continue
+ * 
+ *                 fbin0_min = getBinNr(min0, pos0_min, delta)             # <<<<<<<<<<<<<<
+ *                 fbin0_max = getBinNr(max0, pos0_min, delta)
+ *                 bin0_min = < int > fbin0_min
+ */
+          __pyx_v_fbin0_min = __pyx_f_12splitBBoxLUT_getBinNr(__pyx_v_min0, __pyx_v_pos0_min, __pyx_v_delta);
+
 206:                 fbin0_max = getBinNr(max0, pos0_min, delta)
+
+          /* "splitBBoxLUT.pyx":206
+ * 
+ *                 fbin0_min = getBinNr(min0, pos0_min, delta)
+ *                 fbin0_max = getBinNr(max0, pos0_min, delta)             # <<<<<<<<<<<<<<
+ *                 bin0_min = < int > fbin0_min
+ *                 bin0_max = < int > fbin0_max
+ */
+          __pyx_v_fbin0_max = __pyx_f_12splitBBoxLUT_getBinNr(__pyx_v_max0, __pyx_v_pos0_min, __pyx_v_delta);
+
 207:                 bin0_min = < int > fbin0_min
+
+          /* "splitBBoxLUT.pyx":207
+ *                 fbin0_min = getBinNr(min0, pos0_min, delta)
+ *                 fbin0_max = getBinNr(max0, pos0_min, delta)
+ *                 bin0_min = < int > fbin0_min             # <<<<<<<<<<<<<<
+ *                 bin0_max = < int > fbin0_max
+ * 
+ */
+          __pyx_v_bin0_min = ((int)__pyx_v_fbin0_min);
+
 208:                 bin0_max = < int > fbin0_max
+
+          /* "splitBBoxLUT.pyx":208
+ *                 fbin0_max = getBinNr(max0, pos0_min, delta)
+ *                 bin0_min = < int > fbin0_min
+ *                 bin0_max = < int > fbin0_max             # <<<<<<<<<<<<<<
+ * 
+ *                 if (bin0_max < 0) or (bin0_min >= bins):
+ */
+          __pyx_v_bin0_max = ((int)__pyx_v_fbin0_max);
+
 209: 
+
 210:                 if (bin0_max < 0) or (bin0_min >= bins):
+
+          /* "splitBBoxLUT.pyx":210
+ *                 bin0_max = < int > fbin0_max
+ * 
+ *                 if (bin0_max < 0) or (bin0_min >= bins):             # <<<<<<<<<<<<<<
+ *                     continue
+ *                 if bin0_max >= bins :
+ */
+          __pyx_t_17 = (__pyx_v_bin0_max < 0);
+          if (!__pyx_t_17) {
+            __pyx_t_22 = (__pyx_v_bin0_min >= __pyx_v_bins);
+            __pyx_t_12 = __pyx_t_22;
+          } else {
+            __pyx_t_12 = __pyx_t_17;
+          }
+          if (__pyx_t_12) {
+
 211:                     continue
+
+            /* "splitBBoxLUT.pyx":211
+ * 
+ *                 if (bin0_max < 0) or (bin0_min >= bins):
+ *                     continue             # <<<<<<<<<<<<<<
+ *                 if bin0_max >= bins :
+ *                     bin0_max = bins - 1
+ */
+            goto __pyx_L22_continue;
+            goto __pyx_L26;
+          }
+          __pyx_L26:;
+
 212:                 if bin0_max >= bins :
+
+          /* "splitBBoxLUT.pyx":212
+ *                 if (bin0_max < 0) or (bin0_min >= bins):
+ *                     continue
+ *                 if bin0_max >= bins :             # <<<<<<<<<<<<<<
+ *                     bin0_max = bins - 1
+ *                 if  bin0_min < 0:
+ */
+          __pyx_t_12 = (__pyx_v_bin0_max >= __pyx_v_bins);
+          if (__pyx_t_12) {
+
 213:                     bin0_max = bins - 1
+
+            /* "splitBBoxLUT.pyx":213
+ *                     continue
+ *                 if bin0_max >= bins :
+ *                     bin0_max = bins - 1             # <<<<<<<<<<<<<<
+ *                 if  bin0_min < 0:
+ *                     bin0_min = 0
+ */
+            __pyx_v_bin0_max = (__pyx_v_bins - 1);
+            goto __pyx_L27;
+          }
+          __pyx_L27:;
+
 214:                 if  bin0_min < 0:
+
+          /* "splitBBoxLUT.pyx":214
+ *                 if bin0_max >= bins :
+ *                     bin0_max = bins - 1
+ *                 if  bin0_min < 0:             # <<<<<<<<<<<<<<
+ *                     bin0_min = 0
+ * 
+ */
+          __pyx_t_12 = (__pyx_v_bin0_min < 0);
+          if (__pyx_t_12) {
+
 215:                     bin0_min = 0
+
+            /* "splitBBoxLUT.pyx":215
+ *                     bin0_max = bins - 1
+ *                 if  bin0_min < 0:
+ *                     bin0_min = 0             # <<<<<<<<<<<<<<
+ * 
+ *                 if bin0_min == bin0_max:
+ */
+            __pyx_v_bin0_min = 0;
+            goto __pyx_L28;
+          }
+          __pyx_L28:;
+
 216: 
+
 217:                 if bin0_min == bin0_max:
+
+          /* "splitBBoxLUT.pyx":217
+ *                     bin0_min = 0
+ * 
+ *                 if bin0_min == bin0_max:             # <<<<<<<<<<<<<<
+ *                     #All pixel is within a single bin
+ *                     k = max_idx[bin0_min]
+ */
+          __pyx_t_12 = (__pyx_v_bin0_min == __pyx_v_bin0_max);
+          if (__pyx_t_12) {
+
 218:                     #All pixel is within a single bin
+
 219:                     k = max_idx[bin0_min]
+
+            /* "splitBBoxLUT.pyx":219
+ *                 if bin0_min == bin0_max:
+ *                     #All pixel is within a single bin
+ *                     k = max_idx[bin0_min]             # <<<<<<<<<<<<<<
+ *                     lut_idx[bin0_min, k] = idx
+ *                     lut_coef[bin0_min, k] = 1.0
+ */
+            __pyx_t_25 = __pyx_v_bin0_min;
+            __pyx_v_k = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint32_t *, __pyx_pybuffernd_max_idx.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_max_idx.diminfo[0].strides));
+
 220:                     lut_idx[bin0_min, k] = idx
+
+            /* "splitBBoxLUT.pyx":220
+ *                     #All pixel is within a single bin
+ *                     k = max_idx[bin0_min]
+ *                     lut_idx[bin0_min, k] = idx             # <<<<<<<<<<<<<<
+ *                     lut_coef[bin0_min, k] = 1.0
+ *                     max_idx[bin0_min] = k + 1
+ */
+            __pyx_t_37 = __pyx_v_bin0_min;
+            __pyx_t_38 = __pyx_v_k;
+            *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_uint32_t *, __pyx_pybuffernd_lut_idx.rcbuffer->pybuffer.buf, __pyx_t_37, __pyx_pybuffernd_lut_idx.diminfo[0].strides, __pyx_t_38, __pyx_pybuffernd_lut_idx.diminfo[1].strides) = __pyx_v_idx;
+
 221:                     lut_coef[bin0_min, k] = 1.0
+
+            /* "splitBBoxLUT.pyx":221
+ *                     k = max_idx[bin0_min]
+ *                     lut_idx[bin0_min, k] = idx
+ *                     lut_coef[bin0_min, k] = 1.0             # <<<<<<<<<<<<<<
+ *                     max_idx[bin0_min] = k + 1
+ *                 else: #we have pixel splitting.
+ */
+            __pyx_t_39 = __pyx_v_bin0_min;
+            __pyx_t_40 = __pyx_v_k;
+            *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_lut_coef.rcbuffer->pybuffer.buf, __pyx_t_39, __pyx_pybuffernd_lut_coef.diminfo[0].strides, __pyx_t_40, __pyx_pybuffernd_lut_coef.diminfo[1].strides) = 1.0;
+
 222:                     max_idx[bin0_min] = k + 1
+
+            /* "splitBBoxLUT.pyx":222
+ *                     lut_idx[bin0_min, k] = idx
+ *                     lut_coef[bin0_min, k] = 1.0
+ *                     max_idx[bin0_min] = k + 1             # <<<<<<<<<<<<<<
+ *                 else: #we have pixel splitting.
+ *                     deltaA = 1.0 / (fbin0_max - fbin0_min)
+ */
+            __pyx_t_41 = __pyx_v_bin0_min;
+            *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint32_t *, __pyx_pybuffernd_max_idx.rcbuffer->pybuffer.buf, __pyx_t_41, __pyx_pybuffernd_max_idx.diminfo[0].strides) = (__pyx_v_k + 1);
+            goto __pyx_L29;
+          }
+          /*else*/ {
+
 223:                 else: #we have pixel splitting.
+
 224:                     deltaA = 1.0 / (fbin0_max - fbin0_min)
+
+            /* "splitBBoxLUT.pyx":224
+ *                     max_idx[bin0_min] = k + 1
+ *                 else: #we have pixel splitting.
+ *                     deltaA = 1.0 / (fbin0_max - fbin0_min)             # <<<<<<<<<<<<<<
+ * 
+ *                     deltaL = (bin0_min + 1) - fbin0_min
+ */
+            __pyx_v_deltaA = (1.0 / (__pyx_v_fbin0_max - __pyx_v_fbin0_min));
+
 225: 
+
 226:                     deltaL = (bin0_min + 1) - fbin0_min
+
+            /* "splitBBoxLUT.pyx":226
+ *                     deltaA = 1.0 / (fbin0_max - fbin0_min)
+ * 
+ *                     deltaL = (bin0_min + 1) - fbin0_min             # <<<<<<<<<<<<<<
+ *                     deltaR = fbin0_max - (bin0_max)
+ * 
+ */
+            __pyx_v_deltaL = ((__pyx_v_bin0_min + 1) - __pyx_v_fbin0_min);
+
 227:                     deltaR = fbin0_max - (bin0_max)
+
+            /* "splitBBoxLUT.pyx":227
+ * 
+ *                     deltaL = (bin0_min + 1) - fbin0_min
+ *                     deltaR = fbin0_max - (bin0_max)             # <<<<<<<<<<<<<<
+ * 
+ *                     k = max_idx[bin0_min]
+ */
+            __pyx_v_deltaR = (__pyx_v_fbin0_max - __pyx_v_bin0_max);
+
 228: 
+
 229:                     k = max_idx[bin0_min]
+
+            /* "splitBBoxLUT.pyx":229
+ *                     deltaR = fbin0_max - (bin0_max)
+ * 
+ *                     k = max_idx[bin0_min]             # <<<<<<<<<<<<<<
+ *                     lut_idx[bin0_min, k] = idx
+ *                     lut_coef[bin0_min, k] = (deltaA * deltaL)
+ */
+            __pyx_t_42 = __pyx_v_bin0_min;
+            __pyx_v_k = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint32_t *, __pyx_pybuffernd_max_idx.rcbuffer->pybuffer.buf, __pyx_t_42, __pyx_pybuffernd_max_idx.diminfo[0].strides));
+
 230:                     lut_idx[bin0_min, k] = idx
+
+            /* "splitBBoxLUT.pyx":230
+ * 
+ *                     k = max_idx[bin0_min]
+ *                     lut_idx[bin0_min, k] = idx             # <<<<<<<<<<<<<<
+ *                     lut_coef[bin0_min, k] = (deltaA * deltaL)
+ *                     max_idx[bin0_min] = k + 1
+ */
+            __pyx_t_43 = __pyx_v_bin0_min;
+            __pyx_t_44 = __pyx_v_k;
+            *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_uint32_t *, __pyx_pybuffernd_lut_idx.rcbuffer->pybuffer.buf, __pyx_t_43, __pyx_pybuffernd_lut_idx.diminfo[0].strides, __pyx_t_44, __pyx_pybuffernd_lut_idx.diminfo[1].strides) = __pyx_v_idx;
+
 231:                     lut_coef[bin0_min, k] = (deltaA * deltaL)
+
+            /* "splitBBoxLUT.pyx":231
+ *                     k = max_idx[bin0_min]
+ *                     lut_idx[bin0_min, k] = idx
+ *                     lut_coef[bin0_min, k] = (deltaA * deltaL)             # <<<<<<<<<<<<<<
+ *                     max_idx[bin0_min] = k + 1
+ * 
+ */
+            __pyx_t_45 = __pyx_v_bin0_min;
+            __pyx_t_46 = __pyx_v_k;
+            *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_lut_coef.rcbuffer->pybuffer.buf, __pyx_t_45, __pyx_pybuffernd_lut_coef.diminfo[0].strides, __pyx_t_46, __pyx_pybuffernd_lut_coef.diminfo[1].strides) = (__pyx_v_deltaA * __pyx_v_deltaL);
+
 232:                     max_idx[bin0_min] = k + 1
+
+            /* "splitBBoxLUT.pyx":232
+ *                     lut_idx[bin0_min, k] = idx
+ *                     lut_coef[bin0_min, k] = (deltaA * deltaL)
+ *                     max_idx[bin0_min] = k + 1             # <<<<<<<<<<<<<<
+ * 
+ *                     k = max_idx[bin0_max]
+ */
+            __pyx_t_47 = __pyx_v_bin0_min;
+            *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint32_t *, __pyx_pybuffernd_max_idx.rcbuffer->pybuffer.buf, __pyx_t_47, __pyx_pybuffernd_max_idx.diminfo[0].strides) = (__pyx_v_k + 1);
+
 233: 
+
 234:                     k = max_idx[bin0_max]
+
+            /* "splitBBoxLUT.pyx":234
+ *                     max_idx[bin0_min] = k + 1
+ * 
+ *                     k = max_idx[bin0_max]             # <<<<<<<<<<<<<<
+ *                     lut_idx[bin0_max, k] = idx
+ *                     lut_coef[bin0_max, k] = (deltaA * deltaR)
+ */
+            __pyx_t_48 = __pyx_v_bin0_max;
+            __pyx_v_k = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint32_t *, __pyx_pybuffernd_max_idx.rcbuffer->pybuffer.buf, __pyx_t_48, __pyx_pybuffernd_max_idx.diminfo[0].strides));
+
 235:                     lut_idx[bin0_max, k] = idx
+
+            /* "splitBBoxLUT.pyx":235
+ * 
+ *                     k = max_idx[bin0_max]
+ *                     lut_idx[bin0_max, k] = idx             # <<<<<<<<<<<<<<
+ *                     lut_coef[bin0_max, k] = (deltaA * deltaR)
+ *                     max_idx[bin0_max] = k + 1
+ */
+            __pyx_t_49 = __pyx_v_bin0_max;
+            __pyx_t_50 = __pyx_v_k;
+            *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_uint32_t *, __pyx_pybuffernd_lut_idx.rcbuffer->pybuffer.buf, __pyx_t_49, __pyx_pybuffernd_lut_idx.diminfo[0].strides, __pyx_t_50, __pyx_pybuffernd_lut_idx.diminfo[1].strides) = __pyx_v_idx;
+
 236:                     lut_coef[bin0_max, k] = (deltaA * deltaR)
+
+            /* "splitBBoxLUT.pyx":236
+ *                     k = max_idx[bin0_max]
+ *                     lut_idx[bin0_max, k] = idx
+ *                     lut_coef[bin0_max, k] = (deltaA * deltaR)             # <<<<<<<<<<<<<<
+ *                     max_idx[bin0_max] = k + 1
+ * 
+ */
+            __pyx_t_51 = __pyx_v_bin0_max;
+            __pyx_t_52 = __pyx_v_k;
+            *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_lut_coef.rcbuffer->pybuffer.buf, __pyx_t_51, __pyx_pybuffernd_lut_coef.diminfo[0].strides, __pyx_t_52, __pyx_pybuffernd_lut_coef.diminfo[1].strides) = (__pyx_v_deltaA * __pyx_v_deltaR);
+
 237:                     max_idx[bin0_max] = k + 1
+
+            /* "splitBBoxLUT.pyx":237
+ *                     lut_idx[bin0_max, k] = idx
+ *                     lut_coef[bin0_max, k] = (deltaA * deltaR)
+ *                     max_idx[bin0_max] = k + 1             # <<<<<<<<<<<<<<
+ * 
+ *                     if bin0_min + 1 < bin0_max:
+ */
+            __pyx_t_53 = __pyx_v_bin0_max;
+            *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint32_t *, __pyx_pybuffernd_max_idx.rcbuffer->pybuffer.buf, __pyx_t_53, __pyx_pybuffernd_max_idx.diminfo[0].strides) = (__pyx_v_k + 1);
+
 238: 
+
 239:                     if bin0_min + 1 < bin0_max:
+
+            /* "splitBBoxLUT.pyx":239
+ *                     max_idx[bin0_max] = k + 1
+ * 
+ *                     if bin0_min + 1 < bin0_max:             # <<<<<<<<<<<<<<
+ *                         for i in range(bin0_min + 1, bin0_max):
+ *                             k = max_idx[i]
+ */
+            __pyx_t_12 = ((__pyx_v_bin0_min + 1) < __pyx_v_bin0_max);
+            if (__pyx_t_12) {
+
 240:                         for i in range(bin0_min + 1, bin0_max):
+
+              /* "splitBBoxLUT.pyx":240
+ * 
+ *                     if bin0_min + 1 < bin0_max:
+ *                         for i in range(bin0_min + 1, bin0_max):             # <<<<<<<<<<<<<<
+ *                             k = max_idx[i]
+ *                             lut_idx[i, k] = idx
+ */
+              __pyx_t_54 = __pyx_v_bin0_max;
+              for (__pyx_t_55 = (__pyx_v_bin0_min + 1); __pyx_t_55 < __pyx_t_54; __pyx_t_55+=1) {
+                __pyx_v_i = __pyx_t_55;
+
 241:                             k = max_idx[i]
+
+                /* "splitBBoxLUT.pyx":241
+ *                     if bin0_min + 1 < bin0_max:
+ *                         for i in range(bin0_min + 1, bin0_max):
+ *                             k = max_idx[i]             # <<<<<<<<<<<<<<
+ *                             lut_idx[i, k] = idx
+ *                             lut_coef[i, k] = (deltaA)
+ */
+                __pyx_t_56 = __pyx_v_i;
+                __pyx_v_k = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint32_t *, __pyx_pybuffernd_max_idx.rcbuffer->pybuffer.buf, __pyx_t_56, __pyx_pybuffernd_max_idx.diminfo[0].strides));
+
 242:                             lut_idx[i, k] = idx
+
+                /* "splitBBoxLUT.pyx":242
+ *                         for i in range(bin0_min + 1, bin0_max):
+ *                             k = max_idx[i]
+ *                             lut_idx[i, k] = idx             # <<<<<<<<<<<<<<
+ *                             lut_coef[i, k] = (deltaA)
+ *                             max_idx[i] = k + 1
+ */
+                __pyx_t_57 = __pyx_v_i;
+                __pyx_t_58 = __pyx_v_k;
+                *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_uint32_t *, __pyx_pybuffernd_lut_idx.rcbuffer->pybuffer.buf, __pyx_t_57, __pyx_pybuffernd_lut_idx.diminfo[0].strides, __pyx_t_58, __pyx_pybuffernd_lut_idx.diminfo[1].strides) = __pyx_v_idx;
+
 243:                             lut_coef[i, k] = (deltaA)
+
+                /* "splitBBoxLUT.pyx":243
+ *                             k = max_idx[i]
+ *                             lut_idx[i, k] = idx
+ *                             lut_coef[i, k] = (deltaA)             # <<<<<<<<<<<<<<
+ *                             max_idx[i] = k + 1
+ *         return max_idx, lut_idx, lut_coef
+ */
+                __pyx_t_59 = __pyx_v_i;
+                __pyx_t_60 = __pyx_v_k;
+                *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_lut_coef.rcbuffer->pybuffer.buf, __pyx_t_59, __pyx_pybuffernd_lut_coef.diminfo[0].strides, __pyx_t_60, __pyx_pybuffernd_lut_coef.diminfo[1].strides) = __pyx_v_deltaA;
+
 244:                             max_idx[i] = k + 1
+
+                /* "splitBBoxLUT.pyx":244
+ *                             lut_idx[i, k] = idx
+ *                             lut_coef[i, k] = (deltaA)
+ *                             max_idx[i] = k + 1             # <<<<<<<<<<<<<<
+ *         return max_idx, lut_idx, lut_coef
+ * 
+ */
+                __pyx_t_61 = __pyx_v_i;
+                *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint32_t *, __pyx_pybuffernd_max_idx.rcbuffer->pybuffer.buf, __pyx_t_61, __pyx_pybuffernd_max_idx.diminfo[0].strides) = (__pyx_v_k + 1);
+              }
+              goto __pyx_L30;
+            }
+            __pyx_L30:;
+          }
+          __pyx_L29:;
+          __pyx_L22_continue:;
+        }
+      }
+
 245:         return max_idx, lut_idx, lut_coef
+
+  /* "splitBBoxLUT.pyx":245
+ *                             lut_coef[i, k] = (deltaA)
+ *                             max_idx[i] = k + 1
+ *         return max_idx, lut_idx, lut_coef             # <<<<<<<<<<<<<<
+ * 
+ * 
+ */
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_7);
+  __Pyx_INCREF(((PyObject *)__pyx_v_max_idx));
+  PyTuple_SET_ITEM(__pyx_t_7, 0, ((PyObject *)__pyx_v_max_idx));
+  __Pyx_GIVEREF(((PyObject *)__pyx_v_max_idx));
+  __Pyx_INCREF(((PyObject *)__pyx_v_lut_idx));
+  PyTuple_SET_ITEM(__pyx_t_7, 1, ((PyObject *)__pyx_v_lut_idx));
+  __Pyx_GIVEREF(((PyObject *)__pyx_v_lut_idx));
+  __Pyx_INCREF(((PyObject *)__pyx_v_lut_coef));
+  PyTuple_SET_ITEM(__pyx_t_7, 2, ((PyObject *)__pyx_v_lut_coef));
+  __Pyx_GIVEREF(((PyObject *)__pyx_v_lut_coef));
+  __pyx_r = ((PyObject *)__pyx_t_7);
+  __pyx_t_7 = 0;
+  goto __pyx_L0;
+
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_XDECREF(__pyx_t_6);
+  __Pyx_XDECREF(__pyx_t_7);
+  __PYX_XDEC_MEMVIEW(&__pyx_t_9, 1);
+  __PYX_XDEC_MEMVIEW(&__pyx_t_10, 1);
+  __PYX_XDEC_MEMVIEW(&__pyx_t_13, 1);
+  __PYX_XDEC_MEMVIEW(&__pyx_t_14, 1);
+  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
+    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
+    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lut_coef.rcbuffer->pybuffer);
+    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lut_idx.rcbuffer->pybuffer);
+    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_max_idx.rcbuffer->pybuffer);
+    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_outMax.rcbuffer->pybuffer);
+  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
+  __Pyx_AddTraceback("splitBBoxLUT.HistoBBox1d.calc_lut", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  goto __pyx_L2;
+  __pyx_L0:;
+  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lut_coef.rcbuffer->pybuffer);
+  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lut_idx.rcbuffer->pybuffer);
+  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_max_idx.rcbuffer->pybuffer);
+  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_outMax.rcbuffer->pybuffer);
+  __pyx_L2:;
+  __Pyx_XDECREF((PyObject *)__pyx_v_outMax);
+  __PYX_XDEC_MEMVIEW(&__pyx_v_cpos0_sup, 1);
+  __PYX_XDEC_MEMVIEW(&__pyx_v_cpos0_inf, 1);
+  __PYX_XDEC_MEMVIEW(&__pyx_v_cpos1_min, 1);
+  __PYX_XDEC_MEMVIEW(&__pyx_v_cpos1_max, 1);
+  __Pyx_XDECREF((PyObject *)__pyx_v_max_idx);
+  __Pyx_XDECREF((PyObject *)__pyx_v_lut_idx);
+  __Pyx_XDECREF((PyObject *)__pyx_v_lut_coef);
+  __PYX_XDEC_MEMVIEW(&__pyx_v_cmask, 1);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_12splitBBoxLUT_11HistoBBox1d_5integrate(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyMethodDef __pyx_mdef_12splitBBoxLUT_11HistoBBox1d_5integrate = {__Pyx_NAMESTR("integrate"), (PyCFunction)__pyx_pw_12splitBBoxLUT_11HistoBBox1d_5integrate, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
+static PyObject *__pyx_pw_12splitBBoxLUT_11HistoBBox1d_5integrate(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_self = 0;
+  PyObject *__pyx_v_weights = 0;
+  PyObject *__pyx_v_dummy = 0;
+  PyObject *__pyx_v_delta_dummy = 0;
+  PyObject *__pyx_v_dark = 0;
+  PyObject *__pyx_v_flat = 0;
+  PyObject *__pyx_v_solidAngle = 0;
+  PyObject *__pyx_v_polarization = 0;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("integrate (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__self,&__pyx_n_s__weights,&__pyx_n_s__dummy,&__pyx_n_s__delta_dummy,&__pyx_n_s__dark,&__pyx_n_s__flat,&__pyx_n_s__solidAngle,&__pyx_n_s__polarization,0};
+    PyObject* values[8] = {0,0,0,0,0,0,0,0};
+
 246: 
+
 247: 
+
 248:     @cython.cdivision(True)
+
 249:     @cython.boundscheck(False)
+
 250:     @cython.wraparound(False)
+
 251:     def integrate(self, weights, dummy=None, delta_dummy=None, dark=None, flat=None, solidAngle=None, polarization=None):
+
+    /* "splitBBoxLUT.pyx":251
+ *     @cython.boundscheck(False)
+ *     @cython.wraparound(False)
+ *     def integrate(self, weights, dummy=None, delta_dummy=None, dark=None, flat=None, solidAngle=None, polarization=None):             # <<<<<<<<<<<<<<
+ *         cdef int i, j, idx, bins, lut_size, size
+ *         cdef double sum_data, sum_count, epsilon
+ */
+    values[2] = ((PyObject *)((PyObject *)Py_None));
+    values[3] = ((PyObject *)((PyObject *)Py_None));
+    values[4] = ((PyObject *)((PyObject *)Py_None));
+    values[5] = ((PyObject *)((PyObject *)Py_None));
+    values[6] = ((PyObject *)((PyObject *)Py_None));
+    values[7] = ((PyObject *)((PyObject *)Py_None));
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
+        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
+        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
+        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
+        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__self)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+        case  1:
+        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__weights)) != 0)) kw_args--;
+        else {
+          __Pyx_RaiseArgtupleInvalid("integrate", 0, 2, 8, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+        }
+        case  2:
+        if (kw_args > 0) {
+          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__dummy);
+          if (value) { values[2] = value; kw_args--; }
+        }
+        case  3:
+        if (kw_args > 0) {
+          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__delta_dummy);
+          if (value) { values[3] = value; kw_args--; }
+        }
+        case  4:
+        if (kw_args > 0) {
+          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__dark);
+          if (value) { values[4] = value; kw_args--; }
+        }
+        case  5:
+        if (kw_args > 0) {
+          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__flat);
+          if (value) { values[5] = value; kw_args--; }
+        }
+        case  6:
+        if (kw_args > 0) {
+          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__solidAngle);
+          if (value) { values[6] = value; kw_args--; }
+        }
+        case  7:
+        if (kw_args > 0) {
+          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__polarization);
+          if (value) { values[7] = value; kw_args--; }
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "integrate") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+      }
+    } else {
+      switch (PyTuple_GET_SIZE(__pyx_args)) {
+        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
+        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
+        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
+        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
+        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+    }
+    __pyx_v_self = values[0];
+    __pyx_v_weights = values[1];
+    __pyx_v_dummy = values[2];
+    __pyx_v_delta_dummy = values[3];
+    __pyx_v_dark = values[4];
+    __pyx_v_flat = values[5];
+    __pyx_v_solidAngle = values[6];
+    __pyx_v_polarization = values[7];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("integrate", 0, 2, 8, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("splitBBoxLUT.HistoBBox1d.integrate", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_12splitBBoxLUT_11HistoBBox1d_4integrate(__pyx_self, __pyx_v_self, __pyx_v_weights, __pyx_v_dummy, __pyx_v_delta_dummy, __pyx_v_dark, __pyx_v_flat, __pyx_v_solidAngle, __pyx_v_polarization);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_12splitBBoxLUT_11HistoBBox1d_4integrate(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_weights, PyObject *__pyx_v_dummy, PyObject *__pyx_v_delta_dummy, PyObject *__pyx_v_dark, PyObject *__pyx_v_flat, PyObject *__pyx_v_solidAngle, PyObject *__pyx_v_polarization) {
+  int __pyx_v_i;
+  int __pyx_v_j;
+  int __pyx_v_idx;
+  CYTHON_UNUSED int __pyx_v_bins;
+  int __pyx_v_lut_size;
+  int __pyx_v_size;
+  double __pyx_v_sum_data;
+  double __pyx_v_sum_count;
+  double __pyx_v_epsilon;
+  float __pyx_v_data;
+  float __pyx_v_coef;
+  float __pyx_v_cdummy;
+  float __pyx_v_cddummy;
+  int __pyx_v_check_dummy;
+  int __pyx_v_do_dark;
+  int __pyx_v_do_flat;
+  int __pyx_v_do_polarization;
+  int __pyx_v_do_solidAngle;
+  PyArrayObject *__pyx_v_outData = 0;
+  PyArrayObject *__pyx_v_outCount = 0;
+  PyArrayObject *__pyx_v_outMerge = 0;
+  __Pyx_memviewslice __pyx_v_lut = { 0, 0, { 0 }, { 0 }, { 0 } };
+  __Pyx_memviewslice __pyx_v_cdata = { 0, 0, { 0 }, { 0 }, { 0 } };
+  __Pyx_memviewslice __pyx_v_tdata = { 0, 0, { 0 }, { 0 }, { 0 } };
+  __Pyx_memviewslice __pyx_v_cflat = { 0, 0, { 0 }, { 0 }, { 0 } };
+  __Pyx_memviewslice __pyx_v_cdark = { 0, 0, { 0 }, { 0 }, { 0 } };
+  __Pyx_memviewslice __pyx_v_csolidAngle = { 0, 0, { 0 }, { 0 }, { 0 } };
+  __Pyx_memviewslice __pyx_v_cpolarization = { 0, 0, { 0 }, { 0 }, { 0 } };
+  CYTHON_UNUSED long __pyx_v_do_dummy;
+  CYTHON_UNUSED int __pyx_v_do_polatization;
+  __Pyx_LocalBuf_ND __pyx_pybuffernd_outCount;
+  __Pyx_Buffer __pyx_pybuffer_outCount;
+  __Pyx_LocalBuf_ND __pyx_pybuffernd_outData;
+  __Pyx_Buffer __pyx_pybuffer_outData;
+  __Pyx_LocalBuf_ND __pyx_pybuffernd_outMerge;
+  __Pyx_Buffer __pyx_pybuffer_outMerge;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("integrate", 0);
+  __pyx_pybuffer_outData.pybuffer.buf = NULL;
+  __pyx_pybuffer_outData.refcount = 0;
+  __pyx_pybuffernd_outData.data = NULL;
+  __pyx_pybuffernd_outData.rcbuffer = &__pyx_pybuffer_outData;
+  __pyx_pybuffer_outCount.pybuffer.buf = NULL;
+  __pyx_pybuffer_outCount.refcount = 0;
+  __pyx_pybuffernd_outCount.data = NULL;
+  __pyx_pybuffernd_outCount.rcbuffer = &__pyx_pybuffer_outCount;
+  __pyx_pybuffer_outMerge.pybuffer.buf = NULL;
+  __pyx_pybuffer_outMerge.refcount = 0;
+  __pyx_pybuffernd_outMerge.data = NULL;
+  __pyx_pybuffernd_outMerge.rcbuffer = &__pyx_pybuffer_outMerge;
+
+  /* "splitBBoxLUT.pyx":251
+ *     @cython.boundscheck(False)
+ *     @cython.wraparound(False)
+ *     def integrate(self, weights, dummy=None, delta_dummy=None, dark=None, flat=None, solidAngle=None, polarization=None):             # <<<<<<<<<<<<<<
+ *         cdef int i, j, idx, bins, lut_size, size
+ *         cdef double sum_data, sum_count, epsilon
+ */
+  __pyx_k_tuple_51 = PyTuple_New(38); if (unlikely(!__pyx_k_tuple_51)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_k_tuple_51);
+  __Pyx_INCREF(((PyObject *)__pyx_n_s__self));
+  PyTuple_SET_ITEM(__pyx_k_tuple_51, 0, ((PyObject *)__pyx_n_s__self));
+  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__self));
+  __Pyx_INCREF(((PyObject *)__pyx_n_s__weights));
+  PyTuple_SET_ITEM(__pyx_k_tuple_51, 1, ((PyObject *)__pyx_n_s__weights));
+  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__weights));
+  __Pyx_INCREF(((PyObject *)__pyx_n_s__dummy));
+  PyTuple_SET_ITEM(__pyx_k_tuple_51, 2, ((PyObject *)__pyx_n_s__dummy));
+  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__dummy));
+  __Pyx_INCREF(((PyObject *)__pyx_n_s__delta_dummy));
+  PyTuple_SET_ITEM(__pyx_k_tuple_51, 3, ((PyObject *)__pyx_n_s__delta_dummy));
+  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__delta_dummy));
+  __Pyx_INCREF(((PyObject *)__pyx_n_s__dark));
+  PyTuple_SET_ITEM(__pyx_k_tuple_51, 4, ((PyObject *)__pyx_n_s__dark));
+  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__dark));
+  __Pyx_INCREF(((PyObject *)__pyx_n_s__flat));
+  PyTuple_SET_ITEM(__pyx_k_tuple_51, 5, ((PyObject *)__pyx_n_s__flat));
+  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__flat));
+  __Pyx_INCREF(((PyObject *)__pyx_n_s__solidAngle));
+  PyTuple_SET_ITEM(__pyx_k_tuple_51, 6, ((PyObject *)__pyx_n_s__solidAngle));
+  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__solidAngle));
+  __Pyx_INCREF(((PyObject *)__pyx_n_s__polarization));
+  PyTuple_SET_ITEM(__pyx_k_tuple_51, 7, ((PyObject *)__pyx_n_s__polarization));
+  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__polarization));
+  __Pyx_INCREF(((PyObject *)__pyx_n_s__i));
+  PyTuple_SET_ITEM(__pyx_k_tuple_51, 8, ((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_51, 9, ((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_51, 10, ((PyObject *)__pyx_n_s__idx));
+  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__idx));
+  __Pyx_INCREF(((PyObject *)__pyx_n_s__bins));
+  PyTuple_SET_ITEM(__pyx_k_tuple_51, 11, ((PyObject *)__pyx_n_s__bins));
+  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__bins));
+  __Pyx_INCREF(((PyObject *)__pyx_n_s__lut_size));
+  PyTuple_SET_ITEM(__pyx_k_tuple_51, 12, ((PyObject *)__pyx_n_s__lut_size));
+  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__lut_size));
+  __Pyx_INCREF(((PyObject *)__pyx_n_s__size));
+  PyTuple_SET_ITEM(__pyx_k_tuple_51, 13, ((PyObject *)__pyx_n_s__size));
+  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__size));
+  __Pyx_INCREF(((PyObject *)__pyx_n_s__sum_data));
+  PyTuple_SET_ITEM(__pyx_k_tuple_51, 14, ((PyObject *)__pyx_n_s__sum_data));
+  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__sum_data));
+  __Pyx_INCREF(((PyObject *)__pyx_n_s__sum_count));
+  PyTuple_SET_ITEM(__pyx_k_tuple_51, 15, ((PyObject *)__pyx_n_s__sum_count));
+  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__sum_count));
+  __Pyx_INCREF(((PyObject *)__pyx_n_s__epsilon));
+  PyTuple_SET_ITEM(__pyx_k_tuple_51, 16, ((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_51, 17, ((PyObject *)__pyx_n_s__data));
+  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__data));
+  __Pyx_INCREF(((PyObject *)__pyx_n_s__coef));
+  PyTuple_SET_ITEM(__pyx_k_tuple_51, 18, ((PyObject *)__pyx_n_s__coef));
+  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__coef));
+  __Pyx_INCREF(((PyObject *)__pyx_n_s__cdummy));
+  PyTuple_SET_ITEM(__pyx_k_tuple_51, 19, ((PyObject *)__pyx_n_s__cdummy));
+  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__cdummy));
+  __Pyx_INCREF(((PyObject *)__pyx_n_s__cddummy));
+  PyTuple_SET_ITEM(__pyx_k_tuple_51, 20, ((PyObject *)__pyx_n_s__cddummy));
+  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__cddummy));
+  __Pyx_INCREF(((PyObject *)__pyx_n_s__check_dummy));
+  PyTuple_SET_ITEM(__pyx_k_tuple_51, 21, ((PyObject *)__pyx_n_s__check_dummy));
+  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__check_dummy));
+  __Pyx_INCREF(((PyObject *)__pyx_n_s__do_dark));
+  PyTuple_SET_ITEM(__pyx_k_tuple_51, 22, ((PyObject *)__pyx_n_s__do_dark));
+  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__do_dark));
+  __Pyx_INCREF(((PyObject *)__pyx_n_s__do_flat));
+  PyTuple_SET_ITEM(__pyx_k_tuple_51, 23, ((PyObject *)__pyx_n_s__do_flat));
+  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__do_flat));
+  __Pyx_INCREF(((PyObject *)__pyx_n_s__do_polarization));
+  PyTuple_SET_ITEM(__pyx_k_tuple_51, 24, ((PyObject *)__pyx_n_s__do_polarization));
+  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__do_polarization));
+  __Pyx_INCREF(((PyObject *)__pyx_n_s__do_solidAngle));
+  PyTuple_SET_ITEM(__pyx_k_tuple_51, 25, ((PyObject *)__pyx_n_s__do_solidAngle));
+  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__do_solidAngle));
+  __Pyx_INCREF(((PyObject *)__pyx_n_s__outData));
+  PyTuple_SET_ITEM(__pyx_k_tuple_51, 26, ((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_51, 27, ((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_51, 28, ((PyObject *)__pyx_n_s__outMerge));
+  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__outMerge));
+  __Pyx_INCREF(((PyObject *)__pyx_n_s__lut));
+  PyTuple_SET_ITEM(__pyx_k_tuple_51, 29, ((PyObject *)__pyx_n_s__lut));
+  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__lut));
+  __Pyx_INCREF(((PyObject *)__pyx_n_s__cdata));
+  PyTuple_SET_ITEM(__pyx_k_tuple_51, 30, ((PyObject *)__pyx_n_s__cdata));
+  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__cdata));
+  __Pyx_INCREF(((PyObject *)__pyx_n_s__tdata));
+  PyTuple_SET_ITEM(__pyx_k_tuple_51, 31, ((PyObject *)__pyx_n_s__tdata));
+  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__tdata));
+  __Pyx_INCREF(((PyObject *)__pyx_n_s__cflat));
+  PyTuple_SET_ITEM(__pyx_k_tuple_51, 32, ((PyObject *)__pyx_n_s__cflat));
+  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__cflat));
+  __Pyx_INCREF(((PyObject *)__pyx_n_s__cdark));
+  PyTuple_SET_ITEM(__pyx_k_tuple_51, 33, ((PyObject *)__pyx_n_s__cdark));
+  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__cdark));
+  __Pyx_INCREF(((PyObject *)__pyx_n_s__csolidAngle));
+  PyTuple_SET_ITEM(__pyx_k_tuple_51, 34, ((PyObject *)__pyx_n_s__csolidAngle));
+  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__csolidAngle));
+  __Pyx_INCREF(((PyObject *)__pyx_n_s__cpolarization));
+  PyTuple_SET_ITEM(__pyx_k_tuple_51, 35, ((PyObject *)__pyx_n_s__cpolarization));
+  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__cpolarization));
+  __Pyx_INCREF(((PyObject *)__pyx_n_s__do_dummy));
+  PyTuple_SET_ITEM(__pyx_k_tuple_51, 36, ((PyObject *)__pyx_n_s__do_dummy));
+  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__do_dummy));
+  __Pyx_INCREF(((PyObject *)__pyx_n_s__do_polatization));
+  PyTuple_SET_ITEM(__pyx_k_tuple_51, 37, ((PyObject *)__pyx_n_s__do_polatization));
+  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__do_polatization));
+  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_51));
+  __pyx_k_codeobj_52 = (PyObject*)__Pyx_PyCode_New(8, 0, 38, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_51, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_48, __pyx_n_s__integrate, 251, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_52)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+
+  /* "splitBBoxLUT.pyx":251
+ *     @cython.boundscheck(False)
+ *     @cython.wraparound(False)
+ *     def integrate(self, weights, dummy=None, delta_dummy=None, dark=None, flat=None, solidAngle=None, polarization=None):             # <<<<<<<<<<<<<<
+ *         cdef int i, j, idx, bins, lut_size, size
+ *         cdef double sum_data, sum_count, epsilon
+ */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_12splitBBoxLUT_11HistoBBox1d_5integrate, 0, NULL, __pyx_n_s__splitBBoxLUT, ((PyObject *)__pyx_k_codeobj_52)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, ((PyObject *)__pyx_k_tuple_53));
+  if (PyObject_SetItem(__pyx_t_1, __pyx_n_s__integrate, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_k_tuple_53 = PyTuple_New(6); if (unlikely(!__pyx_k_tuple_53)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_k_tuple_53);
+  __Pyx_INCREF(((PyObject *)Py_None));
+  PyTuple_SET_ITEM(__pyx_k_tuple_53, 0, ((PyObject *)Py_None));
+  __Pyx_GIVEREF(((PyObject *)Py_None));
+  __Pyx_INCREF(((PyObject *)Py_None));
+  PyTuple_SET_ITEM(__pyx_k_tuple_53, 1, ((PyObject *)Py_None));
+  __Pyx_GIVEREF(((PyObject *)Py_None));
+  __Pyx_INCREF(((PyObject *)Py_None));
+  PyTuple_SET_ITEM(__pyx_k_tuple_53, 2, ((PyObject *)Py_None));
+  __Pyx_GIVEREF(((PyObject *)Py_None));
+  __Pyx_INCREF(((PyObject *)Py_None));
+  PyTuple_SET_ITEM(__pyx_k_tuple_53, 3, ((PyObject *)Py_None));
+  __Pyx_GIVEREF(((PyObject *)Py_None));
+  __Pyx_INCREF(((PyObject *)Py_None));
+  PyTuple_SET_ITEM(__pyx_k_tuple_53, 4, ((PyObject *)Py_None));
+  __Pyx_GIVEREF(((PyObject *)Py_None));
+  __Pyx_INCREF(((PyObject *)Py_None));
+  PyTuple_SET_ITEM(__pyx_k_tuple_53, 5, ((PyObject *)Py_None));
+  __Pyx_GIVEREF(((PyObject *)Py_None));
+  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_53));
+
 252:         cdef int i, j, idx, bins, lut_size, size
+
 253:         cdef double sum_data, sum_count, epsilon
+
 254:         cdef float data, coef, cdummy, cddummy
+
 255:         cdef bint check_dummy=False, do_dark=False, do_flat=False, do_polarization=False, do_solidAngle=False
+
+  /* "splitBBoxLUT.pyx":255
+ *         cdef double sum_data, sum_count, epsilon
+ *         cdef float data, coef, cdummy, cddummy
+ *         cdef bint check_dummy=False, do_dark=False, do_flat=False, do_polarization=False, do_solidAngle=False             # <<<<<<<<<<<<<<
+ *         cdef numpy.ndarray[numpy.float64_t, ndim = 1] outData = numpy.zeros(self.bins, dtype=numpy.float64)
+ *         cdef numpy.ndarray[numpy.float64_t, ndim = 1] outCount = numpy.zeros(self.bins, dtype=numpy.float64)
+ */
+  __pyx_v_check_dummy = 0;
+  __pyx_v_do_dark = 0;
+  __pyx_v_do_flat = 0;
+  __pyx_v_do_polarization = 0;
+  __pyx_v_do_solidAngle = 0;
+
 256:         cdef numpy.ndarray[numpy.float64_t, ndim = 1] outData = numpy.zeros(self.bins, dtype=numpy.float64)
+
+  /* "splitBBoxLUT.pyx":256
+ *         cdef float data, coef, cdummy, cddummy
+ *         cdef bint check_dummy=False, do_dark=False, do_flat=False, do_polarization=False, do_solidAngle=False
+ *         cdef numpy.ndarray[numpy.float64_t, ndim = 1] outData = numpy.zeros(self.bins, dtype=numpy.float64)             # <<<<<<<<<<<<<<
+ *         cdef numpy.ndarray[numpy.float64_t, ndim = 1] outCount = numpy.zeros(self.bins, dtype=numpy.float64)
+ *         cdef numpy.ndarray[numpy.float32_t, ndim = 1] outMerge = numpy.zeros(self.bins, dtype=numpy.float32)
+ */
+  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__zeros); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__bins); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 256; __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 = 256; __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 = 256; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
+  __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_4);
+  __pyx_t_5 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__float64); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_5);
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__dtype), __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+  __pyx_t_5 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_3), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_5);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
+  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
+  if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_6 = ((PyArrayObject *)__pyx_t_5);
+  {
+    __Pyx_BufFmt_StackElem __pyx_stack[1];
+    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_outData.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
+      __pyx_v_outData = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_outData.rcbuffer->pybuffer.buf = NULL;
+      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 256; __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_6 = 0;
+  __pyx_v_outData = ((PyArrayObject *)__pyx_t_5);
+  __pyx_t_5 = 0;
+
 257:         cdef numpy.ndarray[numpy.float64_t, ndim = 1] outCount = numpy.zeros(self.bins, dtype=numpy.float64)
+
+  /* "splitBBoxLUT.pyx":257
+ *         cdef bint check_dummy=False, do_dark=False, do_flat=False, do_polarization=False, do_solidAngle=False
+ *         cdef numpy.ndarray[numpy.float64_t, ndim = 1] outData = numpy.zeros(self.bins, dtype=numpy.float64)
+ *         cdef numpy.ndarray[numpy.float64_t, ndim = 1] outCount = numpy.zeros(self.bins, dtype=numpy.float64)             # <<<<<<<<<<<<<<
+ *         cdef numpy.ndarray[numpy.float32_t, ndim = 1] outMerge = numpy.zeros(self.bins, dtype=numpy.float32)
+ *         cdef lut_point[:,:] lut = self.lut
+ */
+  __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_5);
+  __pyx_t_1 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__zeros); 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_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+  __pyx_t_5 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__bins); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_5);
+  __pyx_t_3 = PyTuple_New(1); 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);
+  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5);
+  __Pyx_GIVEREF(__pyx_t_5);
+  __pyx_t_5 = 0;
+  __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(((PyObject *)__pyx_t_5));
+  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_4 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__float64); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_4);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  if (PyDict_SetItem(__pyx_t_5, ((PyObject *)__pyx_n_s__dtype), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __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_5)); __pyx_t_5 = 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 = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_7 = ((PyArrayObject *)__pyx_t_4);
+  {
+    __Pyx_BufFmt_StackElem __pyx_stack[1];
+    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_outCount.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
+      __pyx_v_outCount = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_outCount.rcbuffer->pybuffer.buf = NULL;
+      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __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_7 = 0;
+  __pyx_v_outCount = ((PyArrayObject *)__pyx_t_4);
+  __pyx_t_4 = 0;
+
 258:         cdef numpy.ndarray[numpy.float32_t, ndim = 1] outMerge = numpy.zeros(self.bins, dtype=numpy.float32)
+
+  /* "splitBBoxLUT.pyx":258
+ *         cdef numpy.ndarray[numpy.float64_t, ndim = 1] outData = numpy.zeros(self.bins, dtype=numpy.float64)
+ *         cdef numpy.ndarray[numpy.float64_t, ndim = 1] outCount = numpy.zeros(self.bins, dtype=numpy.float64)
+ *         cdef numpy.ndarray[numpy.float32_t, ndim = 1] outMerge = numpy.zeros(self.bins, dtype=numpy.float32)             # <<<<<<<<<<<<<<
+ *         cdef lut_point[:,:] lut = self.lut
+ *         cdef float[:] cdata, tdata, cflat, cdark, csolidAngle, cpolarization
+ */
+  __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); 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_t_5 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__zeros); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_5);
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  __pyx_t_4 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__bins); 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_t_3 = PyTuple_New(1); 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);
+  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 = 258; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
+  __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_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__float32); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  if (PyDict_SetItem(__pyx_t_4, ((PyObject *)__pyx_n_s__dtype), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_2 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_3), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
+  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
+  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_8 = ((PyArrayObject *)__pyx_t_2);
+  {
+    __Pyx_BufFmt_StackElem __pyx_stack[1];
+    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_outMerge.rcbuffer->pybuffer, (PyObject*)__pyx_t_8, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
+      __pyx_v_outMerge = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_outMerge.rcbuffer->pybuffer.buf = NULL;
+      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __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_8 = 0;
+  __pyx_v_outMerge = ((PyArrayObject *)__pyx_t_2);
+  __pyx_t_2 = 0;
+
 259:         cdef lut_point[:,:] lut = self.lut
+
+  /* "splitBBoxLUT.pyx":259
+ *         cdef numpy.ndarray[numpy.float64_t, ndim = 1] outCount = numpy.zeros(self.bins, dtype=numpy.float64)
+ *         cdef numpy.ndarray[numpy.float32_t, ndim = 1] outMerge = numpy.zeros(self.bins, dtype=numpy.float32)
+ *         cdef lut_point[:,:] lut = self.lut             # <<<<<<<<<<<<<<
+ *         cdef float[:] cdata, tdata, cflat, cdark, csolidAngle, cpolarization
+ *         size = self.size
+ */
+  __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__lut); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_9 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn_struct___pyx_t_12splitBBoxLUT_lut_point(__pyx_t_2);
+  if (unlikely(!__pyx_t_9.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_v_lut = __pyx_t_9;
+  __pyx_t_9.memview = NULL;
+  __pyx_t_9.data = NULL;
+
 260:         cdef float[:] cdata, tdata, cflat, cdark, csolidAngle, cpolarization
+
 261:         size = self.size
+
+  /* "splitBBoxLUT.pyx":261
+ *         cdef lut_point[:,:] lut = self.lut
+ *         cdef float[:] cdata, tdata, cflat, cdark, csolidAngle, cpolarization
+ *         size = self.size             # <<<<<<<<<<<<<<
+ *         assert size == weights.size
+ *         epsilon = 1e-10
+ */
+  __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__size); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_10 = __Pyx_PyInt_AsInt(__pyx_t_2); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_v_size = __pyx_t_10;
+
 262:         assert size == weights.size
+
+  /* "splitBBoxLUT.pyx":262
+ *         cdef float[:] cdata, tdata, cflat, cdark, csolidAngle, cpolarization
+ *         size = self.size
+ *         assert size == weights.size             # <<<<<<<<<<<<<<
+ *         epsilon = 1e-10
+ *         bins = self.bins
+ */
+  #ifndef CYTHON_WITHOUT_ASSERTIONS
+  __pyx_t_2 = PyInt_FromLong(__pyx_v_size); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_4 = PyObject_GetAttr(__pyx_v_weights, __pyx_n_s__size); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_4);
+  __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  if (unlikely(!__pyx_t_11)) {
+    PyErr_SetNone(PyExc_AssertionError);
+    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  }
+  #endif
+
 263:         epsilon = 1e-10
+
+  /* "splitBBoxLUT.pyx":263
+ *         size = self.size
+ *         assert size == weights.size
+ *         epsilon = 1e-10             # <<<<<<<<<<<<<<
+ *         bins = self.bins
+ *         lut_size = self.lut_size
+ */
+  __pyx_v_epsilon = 1e-10;
+
 264:         bins = self.bins
+
+  /* "splitBBoxLUT.pyx":264
+ *         assert size == weights.size
+ *         epsilon = 1e-10
+ *         bins = self.bins             # <<<<<<<<<<<<<<
+ *         lut_size = self.lut_size
+ * 
+ */
+  __pyx_t_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__bins); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_3);
+  __pyx_t_10 = __Pyx_PyInt_AsInt(__pyx_t_3); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  __pyx_v_bins = __pyx_t_10;
+
 265:         lut_size = self.lut_size
+
+  /* "splitBBoxLUT.pyx":265
+ *         epsilon = 1e-10
+ *         bins = self.bins
+ *         lut_size = self.lut_size             # <<<<<<<<<<<<<<
+ * 
+ *         if dummy is not None:
+ */
+  __pyx_t_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__lut_size); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 265; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_3);
+  __pyx_t_10 = __Pyx_PyInt_AsInt(__pyx_t_3); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 265; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  __pyx_v_lut_size = __pyx_t_10;
+
 266: 
+
 267:         if dummy is not None:
+
+  /* "splitBBoxLUT.pyx":267
+ *         lut_size = self.lut_size
+ * 
+ *         if dummy is not None:             # <<<<<<<<<<<<<<
+ *             do_dummy = 1
+ *             cdummy =  float(dummy)
+ */
+  __pyx_t_11 = (__pyx_v_dummy != Py_None);
+  if (__pyx_t_11) {
+
 268:             do_dummy = 1
+
+    /* "splitBBoxLUT.pyx":268
+ * 
+ *         if dummy is not None:
+ *             do_dummy = 1             # <<<<<<<<<<<<<<
+ *             cdummy =  float(dummy)
+ *             if delta_dummy is None:
+ */
+    __pyx_v_do_dummy = 1;
+
 269:             cdummy =  float(dummy)
+
+    /* "splitBBoxLUT.pyx":269
+ *         if dummy is not None:
+ *             do_dummy = 1
+ *             cdummy =  float(dummy)             # <<<<<<<<<<<<<<
+ *             if delta_dummy is None:
+ *                 cddummy = 0.0
+ */
+    __pyx_t_12 = __Pyx_PyObject_AsDouble(__pyx_v_dummy); if (unlikely(__pyx_t_12 == ((double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 269; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_v_cdummy = __pyx_t_12;
+
 270:             if delta_dummy is None:
+
+    /* "splitBBoxLUT.pyx":270
+ *             do_dummy = 1
+ *             cdummy =  float(dummy)
+ *             if delta_dummy is None:             # <<<<<<<<<<<<<<
+ *                 cddummy = 0.0
+ *             else:
+ */
+    __pyx_t_11 = (__pyx_v_delta_dummy == Py_None);
+    if (__pyx_t_11) {
+
 271:                 cddummy = 0.0
+
+      /* "splitBBoxLUT.pyx":271
+ *             cdummy =  float(dummy)
+ *             if delta_dummy is None:
+ *                 cddummy = 0.0             # <<<<<<<<<<<<<<
+ *             else:
+ *                 cddummy = float(delta_dummy)
+ */
+      __pyx_v_cddummy = 0.0;
+      goto __pyx_L4;
+    }
+    /*else*/ {
+
 272:             else:
+
 273:                 cddummy = float(delta_dummy)
+
+      /* "splitBBoxLUT.pyx":273
+ *                 cddummy = 0.0
+ *             else:
+ *                 cddummy = float(delta_dummy)             # <<<<<<<<<<<<<<
+ * 
+ *         if flat is not None:
+ */
+      __pyx_t_12 = __Pyx_PyObject_AsDouble(__pyx_v_delta_dummy); if (unlikely(__pyx_t_12 == ((double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 273; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_v_cddummy = __pyx_t_12;
+    }
+    __pyx_L4:;
+    goto __pyx_L3;
+  }
+  __pyx_L3:;
+
 274: 
+
 275:         if flat is not None:
+
+  /* "splitBBoxLUT.pyx":275
+ *                 cddummy = float(delta_dummy)
+ * 
+ *         if flat is not None:             # <<<<<<<<<<<<<<
+ *             do_flat = True
+ *             assert flat.size == size
+ */
+  __pyx_t_11 = (__pyx_v_flat != Py_None);
+  if (__pyx_t_11) {
+
 276:             do_flat = True
+
+    /* "splitBBoxLUT.pyx":276
+ * 
+ *         if flat is not None:
+ *             do_flat = True             # <<<<<<<<<<<<<<
+ *             assert flat.size == size
+ *             cflat = numpy.ascontiguousarray(flat.ravel(), dtype=numpy.float32)
+ */
+    __pyx_v_do_flat = 1;
+
 277:             assert flat.size == size
+
+    /* "splitBBoxLUT.pyx":277
+ *         if flat is not None:
+ *             do_flat = True
+ *             assert flat.size == size             # <<<<<<<<<<<<<<
+ *             cflat = numpy.ascontiguousarray(flat.ravel(), dtype=numpy.float32)
+ *         if dark is not None:
+ */
+    #ifndef CYTHON_WITHOUT_ASSERTIONS
+    __pyx_t_3 = PyObject_GetAttr(__pyx_v_flat, __pyx_n_s__size); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_3);
+    __pyx_t_4 = PyInt_FromLong(__pyx_v_size); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_4);
+    __pyx_t_2 = PyObject_RichCompare(__pyx_t_3, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    if (unlikely(!__pyx_t_11)) {
+      PyErr_SetNone(PyExc_AssertionError);
+      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    }
+    #endif
+
 278:             cflat = numpy.ascontiguousarray(flat.ravel(), dtype=numpy.float32)
+
+    /* "splitBBoxLUT.pyx":278
+ *             do_flat = True
+ *             assert flat.size == size
+ *             cflat = numpy.ascontiguousarray(flat.ravel(), dtype=numpy.float32)             # <<<<<<<<<<<<<<
+ *         if dark is not None:
+ *             do_dark = True
+ */
+    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_t_4 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__ascontiguousarray); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_4);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __pyx_t_2 = PyObject_GetAttr(__pyx_v_flat, __pyx_n_s__ravel); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_2);
+    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
+    __Pyx_GIVEREF(__pyx_t_3);
+    __pyx_t_3 = 0;
+    __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
+    __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_5);
+    __pyx_t_1 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__float32); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__dtype), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __pyx_t_1 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_2), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 278; __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_2)); __pyx_t_2 = 0;
+    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
+    __pyx_t_13 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(__pyx_t_1);
+    if (unlikely(!__pyx_t_13.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __pyx_v_cflat = __pyx_t_13;
+    __pyx_t_13.memview = NULL;
+    __pyx_t_13.data = NULL;
+    goto __pyx_L5;
+  }
+  __pyx_L5:;
+
 279:         if dark is not None:
+
+  /* "splitBBoxLUT.pyx":279
+ *             assert flat.size == size
+ *             cflat = numpy.ascontiguousarray(flat.ravel(), dtype=numpy.float32)
+ *         if dark is not None:             # <<<<<<<<<<<<<<
+ *             do_dark = True
+ *             assert dark.size == size
+ */
+  __pyx_t_11 = (__pyx_v_dark != Py_None);
+  if (__pyx_t_11) {
+
 280:             do_dark = True
+
+    /* "splitBBoxLUT.pyx":280
+ *             cflat = numpy.ascontiguousarray(flat.ravel(), dtype=numpy.float32)
+ *         if dark is not None:
+ *             do_dark = True             # <<<<<<<<<<<<<<
+ *             assert dark.size == size
+ *             cdark = numpy.ascontiguousarray(dark.ravel(), dtype=numpy.float32)
+ */
+    __pyx_v_do_dark = 1;
+
 281:             assert dark.size == size
+
+    /* "splitBBoxLUT.pyx":281
+ *         if dark is not None:
+ *             do_dark = True
+ *             assert dark.size == size             # <<<<<<<<<<<<<<
+ *             cdark = numpy.ascontiguousarray(dark.ravel(), dtype=numpy.float32)
+ *         if solidAngle is not None:
+ */
+    #ifndef CYTHON_WITHOUT_ASSERTIONS
+    __pyx_t_1 = PyObject_GetAttr(__pyx_v_dark, __pyx_n_s__size); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 281; __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 = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_3);
+    __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    if (unlikely(!__pyx_t_11)) {
+      PyErr_SetNone(PyExc_AssertionError);
+      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    }
+    #endif
+
 282:             cdark = numpy.ascontiguousarray(dark.ravel(), dtype=numpy.float32)
+
+    /* "splitBBoxLUT.pyx":282
+ *             do_dark = True
+ *             assert dark.size == size
+ *             cdark = numpy.ascontiguousarray(dark.ravel(), dtype=numpy.float32)             # <<<<<<<<<<<<<<
+ *         if solidAngle is not None:
+ *             do_solidAngle = True
+ */
+    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__ascontiguousarray); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __pyx_t_2 = PyObject_GetAttr(__pyx_v_dark, __pyx_n_s__ravel); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_2);
+    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
+    __Pyx_GIVEREF(__pyx_t_1);
+    __pyx_t_1 = 0;
+    __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(((PyObject *)__pyx_t_1));
+    __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_4);
+    __pyx_t_5 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__float32); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_5);
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__dtype), __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    __pyx_t_5 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_2), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_5);
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
+    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
+    __pyx_t_13 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(__pyx_t_5);
+    if (unlikely(!__pyx_t_13.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    __pyx_v_cdark = __pyx_t_13;
+    __pyx_t_13.memview = NULL;
+    __pyx_t_13.data = NULL;
+    goto __pyx_L6;
+  }
+  __pyx_L6:;
+
 283:         if solidAngle is not None:
+
+  /* "splitBBoxLUT.pyx":283
+ *             assert dark.size == size
+ *             cdark = numpy.ascontiguousarray(dark.ravel(), dtype=numpy.float32)
+ *         if solidAngle is not None:             # <<<<<<<<<<<<<<
+ *             do_solidAngle = True
+ *             assert solidAngle.size == size
+ */
+  __pyx_t_11 = (__pyx_v_solidAngle != Py_None);
+  if (__pyx_t_11) {
+
 284:             do_solidAngle = True
+
+    /* "splitBBoxLUT.pyx":284
+ *             cdark = numpy.ascontiguousarray(dark.ravel(), dtype=numpy.float32)
+ *         if solidAngle is not None:
+ *             do_solidAngle = True             # <<<<<<<<<<<<<<
+ *             assert solidAngle.size == size
+ *             csolidAngle = numpy.ascontiguousarray(solidAngle.ravel(), dtype=numpy.float32)
+ */
+    __pyx_v_do_solidAngle = 1;
+
 285:             assert solidAngle.size == size
+
+    /* "splitBBoxLUT.pyx":285
+ *         if solidAngle is not None:
+ *             do_solidAngle = True
+ *             assert solidAngle.size == size             # <<<<<<<<<<<<<<
+ *             csolidAngle = numpy.ascontiguousarray(solidAngle.ravel(), dtype=numpy.float32)
+ *         if polarization is not None:
+ */
+    #ifndef CYTHON_WITHOUT_ASSERTIONS
+    __pyx_t_5 = PyObject_GetAttr(__pyx_v_solidAngle, __pyx_n_s__size); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_5);
+    __pyx_t_1 = PyInt_FromLong(__pyx_v_size); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_1);
+    __pyx_t_2 = PyObject_RichCompare(__pyx_t_5, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    if (unlikely(!__pyx_t_11)) {
+      PyErr_SetNone(PyExc_AssertionError);
+      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    }
+    #endif
+
 286:             csolidAngle = numpy.ascontiguousarray(solidAngle.ravel(), dtype=numpy.float32)
+
+    /* "splitBBoxLUT.pyx":286
+ *             do_solidAngle = True
+ *             assert solidAngle.size == size
+ *             csolidAngle = numpy.ascontiguousarray(solidAngle.ravel(), dtype=numpy.float32)             # <<<<<<<<<<<<<<
+ *         if polarization is not None:
+ *             do_polatization = True
+ */
+    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 286; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__ascontiguousarray); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 286; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __pyx_t_2 = PyObject_GetAttr(__pyx_v_solidAngle, __pyx_n_s__ravel); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 286; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_t_5 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 286; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_5);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 286; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_2);
+    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_5);
+    __Pyx_GIVEREF(__pyx_t_5);
+    __pyx_t_5 = 0;
+    __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 286; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(((PyObject *)__pyx_t_5));
+    __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 286; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_3);
+    __pyx_t_4 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__float32); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 286; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_4);
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    if (PyDict_SetItem(__pyx_t_5, ((PyObject *)__pyx_n_s__dtype), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 286; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 286; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_4);
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
+    __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
+    __pyx_t_13 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(__pyx_t_4);
+    if (unlikely(!__pyx_t_13.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 286; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __pyx_v_csolidAngle = __pyx_t_13;
+    __pyx_t_13.memview = NULL;
+    __pyx_t_13.data = NULL;
+    goto __pyx_L7;
+  }
+  __pyx_L7:;
+
 287:         if polarization is not None:
+
+  /* "splitBBoxLUT.pyx":287
+ *             assert solidAngle.size == size
+ *             csolidAngle = numpy.ascontiguousarray(solidAngle.ravel(), dtype=numpy.float32)
+ *         if polarization is not None:             # <<<<<<<<<<<<<<
+ *             do_polatization = True
+ *             assert polarization.size == size
+ */
+  __pyx_t_11 = (__pyx_v_polarization != Py_None);
+  if (__pyx_t_11) {
+
 288:             do_polatization = True
+
+    /* "splitBBoxLUT.pyx":288
+ *             csolidAngle = numpy.ascontiguousarray(solidAngle.ravel(), dtype=numpy.float32)
+ *         if polarization is not None:
+ *             do_polatization = True             # <<<<<<<<<<<<<<
+ *             assert polarization.size == size
+ *             cpolarization = numpy.ascontiguousarray(polarization.ravel(), dtype=numpy.float32)
+ */
+    __pyx_v_do_polatization = 1;
+
 289:             assert polarization.size == size
+
+    /* "splitBBoxLUT.pyx":289
+ *         if polarization is not None:
+ *             do_polatization = True
+ *             assert polarization.size == size             # <<<<<<<<<<<<<<
+ *             cpolarization = numpy.ascontiguousarray(polarization.ravel(), dtype=numpy.float32)
+ * 
+ */
+    #ifndef CYTHON_WITHOUT_ASSERTIONS
+    __pyx_t_4 = PyObject_GetAttr(__pyx_v_polarization, __pyx_n_s__size); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 289; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_4);
+    __pyx_t_5 = PyInt_FromLong(__pyx_v_size); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 289; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_5);
+    __pyx_t_2 = PyObject_RichCompare(__pyx_t_4, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 289; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 289; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    if (unlikely(!__pyx_t_11)) {
+      PyErr_SetNone(PyExc_AssertionError);
+      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 289; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    }
+    #endif
+
 290:             cpolarization = numpy.ascontiguousarray(polarization.ravel(), dtype=numpy.float32)
+
+    /* "splitBBoxLUT.pyx":290
+ *             do_polatization = True
+ *             assert polarization.size == size
+ *             cpolarization = numpy.ascontiguousarray(polarization.ravel(), dtype=numpy.float32)             # <<<<<<<<<<<<<<
+ * 
+ *         if do_dark or do_flat or do_polarization or do_solidAngle:
+ */
+    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_t_5 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__ascontiguousarray); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_5);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __pyx_t_2 = PyObject_GetAttr(__pyx_v_polarization, __pyx_n_s__ravel); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_4);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_2);
+    PyTuple_SET_ITEM(__pyx_t_2, 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 = 290; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(((PyObject *)__pyx_t_4));
+    __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_1);
+    __pyx_t_3 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__float32); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    if (PyDict_SetItem(__pyx_t_4, ((PyObject *)__pyx_n_s__dtype), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __pyx_t_3 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_2), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
+    __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
+    __pyx_t_13 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(__pyx_t_3);
+    if (unlikely(!__pyx_t_13.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __pyx_v_cpolarization = __pyx_t_13;
+    __pyx_t_13.memview = NULL;
+    __pyx_t_13.data = NULL;
+    goto __pyx_L8;
+  }
+  __pyx_L8:;
+
 291: 
+
 292:         if do_dark or do_flat or do_polarization or do_solidAngle:
+
+  /* "splitBBoxLUT.pyx":292
+ *             cpolarization = numpy.ascontiguousarray(polarization.ravel(), dtype=numpy.float32)
+ * 
+ *         if do_dark or do_flat or do_polarization or do_solidAngle:             # <<<<<<<<<<<<<<
+ *             tdata = numpy.ascontiguousarray(weights.ravel(), dtype=numpy.float32)
+ *             cdata = numpy.zeros(size,dtype=numpy.float32)
+ */
+  if (!__pyx_v_do_dark) {
+    if (!__pyx_v_do_flat) {
+      if (!__pyx_v_do_polarization) {
+        __pyx_t_11 = __pyx_v_do_solidAngle;
+      } else {
+        __pyx_t_11 = __pyx_v_do_polarization;
+      }
+      __pyx_t_14 = __pyx_t_11;
+    } else {
+      __pyx_t_14 = __pyx_v_do_flat;
+    }
+    __pyx_t_11 = __pyx_t_14;
+  } else {
+    __pyx_t_11 = __pyx_v_do_dark;
+  }
+  if (__pyx_t_11) {
+
 293:             tdata = numpy.ascontiguousarray(weights.ravel(), dtype=numpy.float32)
+
+    /* "splitBBoxLUT.pyx":293
+ * 
+ *         if do_dark or do_flat or do_polarization or do_solidAngle:
+ *             tdata = numpy.ascontiguousarray(weights.ravel(), dtype=numpy.float32)             # <<<<<<<<<<<<<<
+ *             cdata = numpy.zeros(size,dtype=numpy.float32)
+ *             for i in prange(size, nogil=True, schedule="static"):
+ */
+    __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_3);
+    __pyx_t_4 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__ascontiguousarray); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_4);
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __pyx_t_3 = PyObject_GetAttr(__pyx_v_weights, __pyx_n_s__ravel); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_3);
+    __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_2);
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_3);
+    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
+    __Pyx_GIVEREF(__pyx_t_2);
+    __pyx_t_2 = 0;
+    __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
+    __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_5);
+    __pyx_t_1 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__float32); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__dtype), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __pyx_t_1 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_3), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __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_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
+    __pyx_t_13 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(__pyx_t_1);
+    if (unlikely(!__pyx_t_13.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __pyx_v_tdata = __pyx_t_13;
+    __pyx_t_13.memview = NULL;
+    __pyx_t_13.data = NULL;
+
 294:             cdata = numpy.zeros(size,dtype=numpy.float32)
+
+    /* "splitBBoxLUT.pyx":294
+ *         if do_dark or do_flat or do_polarization or do_solidAngle:
+ *             tdata = numpy.ascontiguousarray(weights.ravel(), dtype=numpy.float32)
+ *             cdata = numpy.zeros(size,dtype=numpy.float32)             # <<<<<<<<<<<<<<
+ *             for i in prange(size, nogil=True, schedule="static"):
+ *                 data = tdata[i]
+ */
+    __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_1);
+    __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__zeros); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_2);
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __pyx_t_1 = PyInt_FromLong(__pyx_v_size); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __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 = 294; __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 = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(((PyObject *)__pyx_t_1));
+    __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_4);
+    __pyx_t_5 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__float32); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_5);
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__dtype), __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    __pyx_t_5 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_3), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_5);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
+    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
+    __pyx_t_13 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(__pyx_t_5);
+    if (unlikely(!__pyx_t_13.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    __pyx_v_cdata = __pyx_t_13;
+    __pyx_t_13.memview = NULL;
+    __pyx_t_13.data = NULL;
+
 295:             for i in prange(size, nogil=True, schedule="static"):
+
+    /* "splitBBoxLUT.pyx":295
+ *             tdata = numpy.ascontiguousarray(weights.ravel(), dtype=numpy.float32)
+ *             cdata = numpy.zeros(size,dtype=numpy.float32)
+ *             for i in prange(size, nogil=True, schedule="static"):             # <<<<<<<<<<<<<<
+ *                 data = tdata[i]
+ *                 #Nota: -= and /= operatore are seen as reduction in cython parallel.
+ */
+    {
+        #ifdef WITH_THREAD
+        PyThreadState *_save = NULL;
+        #endif
+        Py_UNBLOCK_THREADS
+        /*try:*/ {
+          __pyx_t_10 = __pyx_v_size;
+          if (1 == 0) abort();
+          {
+              #if ((defined(__APPLE__) || defined(__OSX__)) && (defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))))
+                  #undef likely
+                  #undef unlikely
+                  #define likely(x)   (x)
+                  #define unlikely(x) (x)
+              #endif
+              __pyx_t_16 = (__pyx_t_10 - 0) / 1;
+              if (__pyx_t_16 > 0)
+              {
+                  #ifdef _OPENMP
+                  #pragma omp parallel
+                  #endif /* _OPENMP */
+                  {
+                      #ifdef _OPENMP
+                      #pragma omp for lastprivate(__pyx_v_data) firstprivate(__pyx_v_i) lastprivate(__pyx_v_i) schedule(static)
+                      #endif /* _OPENMP */
+                      for (__pyx_t_15 = 0; __pyx_t_15 < __pyx_t_16; __pyx_t_15++){
+                          {
+                              __pyx_v_i = 0 + 1 * __pyx_t_15;
+                              /* Initialize private variables to invalid values */
+                              __pyx_v_data = ((float)__PYX_NAN);
+
+        /* "splitBBoxLUT.pyx":295
+ *             tdata = numpy.ascontiguousarray(weights.ravel(), dtype=numpy.float32)
+ *             cdata = numpy.zeros(size,dtype=numpy.float32)
+ *             for i in prange(size, nogil=True, schedule="static"):             # <<<<<<<<<<<<<<
+ *                 data = tdata[i]
+ *                 #Nota: -= and /= operatore are seen as reduction in cython parallel.
+ */
+        /*finally:*/ {
+          int __pyx_why;
+          __pyx_why = 0; goto __pyx_L12;
+          __pyx_L10: __pyx_why = 3; goto __pyx_L12;
+          __pyx_L11: __pyx_why = 4; goto __pyx_L12;
+          __pyx_L12:;
+          Py_BLOCK_THREADS
+          switch (__pyx_why) {
+            case 3: goto __pyx_L0;
+            case 4: goto __pyx_L1_error;
+          }
+        }
+    }
+    goto __pyx_L9;
+  }
+  /*else*/ {
+
 296:                 data = tdata[i]
+
+                              /* "splitBBoxLUT.pyx":296
+ *             cdata = numpy.zeros(size,dtype=numpy.float32)
+ *             for i in prange(size, nogil=True, schedule="static"):
+ *                 data = tdata[i]             # <<<<<<<<<<<<<<
+ *                 #Nota: -= and /= operatore are seen as reduction in cython parallel.
+ *                 if do_dark:
+ */
+                              __pyx_t_17 = __pyx_v_i;
+                              __pyx_v_data = (*((float *) ( /* dim=0 */ (__pyx_v_tdata.data + __pyx_t_17 * __pyx_v_tdata.strides[0]) )));
+
 297:                 #Nota: -= and /= operatore are seen as reduction in cython parallel.
+
 298:                 if do_dark:
+
+                              /* "splitBBoxLUT.pyx":298
+ *                 data = tdata[i]
+ *                 #Nota: -= and /= operatore are seen as reduction in cython parallel.
+ *                 if do_dark:             # <<<<<<<<<<<<<<
+ *                     data = data - cdark[i]
+ *                 if do_flat:
+ */
+                              if (__pyx_v_do_dark) {
+
 299:                     data = data - cdark[i]
+
+                                /* "splitBBoxLUT.pyx":299
+ *                 #Nota: -= and /= operatore are seen as reduction in cython parallel.
+ *                 if do_dark:
+ *                     data = data - cdark[i]             # <<<<<<<<<<<<<<
+ *                 if do_flat:
+ *                     data = data / cflat[i]
+ */
+                                if (unlikely(!__pyx_v_cdark.memview)) { __Pyx_RaiseUnboundMemoryviewSliceNogil("cdark"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 299; __pyx_clineno = __LINE__; goto __pyx_L15_error;} }
+                                __pyx_t_18 = __pyx_v_i;
+                                __pyx_v_data = (__pyx_v_data - (*((float *) ( /* dim=0 */ (__pyx_v_cdark.data + __pyx_t_18 * __pyx_v_cdark.strides[0]) ))));
+                                goto __pyx_L17;
+                              }
+                              __pyx_L17:;
+
 300:                 if do_flat:
+
+                              /* "splitBBoxLUT.pyx":300
+ *                 if do_dark:
+ *                     data = data - cdark[i]
+ *                 if do_flat:             # <<<<<<<<<<<<<<
+ *                     data = data / cflat[i]
+ *                 if do_polarization:
+ */
+                              if (__pyx_v_do_flat) {
+
 301:                     data = data / cflat[i]
+
+                                /* "splitBBoxLUT.pyx":301
+ *                     data = data - cdark[i]
+ *                 if do_flat:
+ *                     data = data / cflat[i]             # <<<<<<<<<<<<<<
+ *                 if do_polarization:
+ *                     data = data / cpolarization[i]
+ */
+                                if (unlikely(!__pyx_v_cflat.memview)) { __Pyx_RaiseUnboundMemoryviewSliceNogil("cflat"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L15_error;} }
+                                __pyx_t_19 = __pyx_v_i;
+                                __pyx_v_data = (__pyx_v_data / (*((float *) ( /* dim=0 */ (__pyx_v_cflat.data + __pyx_t_19 * __pyx_v_cflat.strides[0]) ))));
+                                goto __pyx_L18;
+                              }
+                              __pyx_L18:;
+
 302:                 if do_polarization:
+
+                              /* "splitBBoxLUT.pyx":302
+ *                 if do_flat:
+ *                     data = data / cflat[i]
+ *                 if do_polarization:             # <<<<<<<<<<<<<<
+ *                     data = data / cpolarization[i]
+ *                 if do_solidAngle:
+ */
+                              if (__pyx_v_do_polarization) {
+
 303:                     data = data / cpolarization[i]
+
+                                /* "splitBBoxLUT.pyx":303
+ *                     data = data / cflat[i]
+ *                 if do_polarization:
+ *                     data = data / cpolarization[i]             # <<<<<<<<<<<<<<
+ *                 if do_solidAngle:
+ *                     data = data / csolidAngle[i]
+ */
+                                if (unlikely(!__pyx_v_cpolarization.memview)) { __Pyx_RaiseUnboundMemoryviewSliceNogil("cpolarization"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 303; __pyx_clineno = __LINE__; goto __pyx_L15_error;} }
+                                __pyx_t_20 = __pyx_v_i;
+                                __pyx_v_data = (__pyx_v_data / (*((float *) ( /* dim=0 */ (__pyx_v_cpolarization.data + __pyx_t_20 * __pyx_v_cpolarization.strides[0]) ))));
+                                goto __pyx_L19;
+                              }
+                              __pyx_L19:;
+
 304:                 if do_solidAngle:
+
+                              /* "splitBBoxLUT.pyx":304
+ *                 if do_polarization:
+ *                     data = data / cpolarization[i]
+ *                 if do_solidAngle:             # <<<<<<<<<<<<<<
+ *                     data = data / csolidAngle[i]
+ *                 cdata[i]+=data
+ */
+                              if (__pyx_v_do_solidAngle) {
+
 305:                     data = data / csolidAngle[i]
+
+                                /* "splitBBoxLUT.pyx":305
+ *                     data = data / cpolarization[i]
+ *                 if do_solidAngle:
+ *                     data = data / csolidAngle[i]             # <<<<<<<<<<<<<<
+ *                 cdata[i]+=data
+ *         else:
+ */
+                                if (unlikely(!__pyx_v_csolidAngle.memview)) { __Pyx_RaiseUnboundMemoryviewSliceNogil("csolidAngle"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L15_error;} }
+                                __pyx_t_21 = __pyx_v_i;
+                                __pyx_v_data = (__pyx_v_data / (*((float *) ( /* dim=0 */ (__pyx_v_csolidAngle.data + __pyx_t_21 * __pyx_v_csolidAngle.strides[0]) ))));
+                                goto __pyx_L20;
+                              }
+                              __pyx_L20:;
+
 306:                 cdata[i]+=data
+
+                              /* "splitBBoxLUT.pyx":306
+ *                 if do_solidAngle:
+ *                     data = data / csolidAngle[i]
+ *                 cdata[i]+=data             # <<<<<<<<<<<<<<
+ *         else:
+ *             cdata = numpy.ascontiguousarray(weights.ravel(), dtype=numpy.float32)
+ */
+                              __pyx_t_22 = __pyx_v_i;
+                              *((float *) ( /* dim=0 */ (__pyx_v_cdata.data + __pyx_t_22 * __pyx_v_cdata.strides[0]) )) += __pyx_v_data;
+                              goto __pyx_L22;
+                              __pyx_L15_error:;
+                              {
+                                  #ifdef WITH_THREAD
+                                  PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
+                                  #endif
+                                  #ifdef _OPENMP
+                                  #pragma omp flush(__pyx_parallel_exc_type)
+                                  #endif /* _OPENMP */
+                                  if (!__pyx_parallel_exc_type) {
+                                    __Pyx_ErrFetch(&__pyx_parallel_exc_type, &__pyx_parallel_exc_value, &__pyx_parallel_exc_tb);
+                                    __pyx_parallel_filename = __pyx_filename; __pyx_parallel_lineno = __pyx_lineno; __pyx_parallel_clineno = __pyx_clineno;
+                                    __Pyx_GOTREF(__pyx_parallel_exc_type);
+                                  }
+                                  #ifdef WITH_THREAD
+                                  PyGILState_Release(__pyx_gilstate_save);
+                                  #endif
+                              }
+                              __pyx_parallel_why = 4;
+                              goto __pyx_L21;
+                              __pyx_L21:;
+                              #ifdef _OPENMP
+                              #pragma omp critical(__pyx_parallel_lastprivates0)
+                              #endif /* _OPENMP */
+                              {
+                                  __pyx_parallel_temp0 = __pyx_v_data;
+                                  __pyx_parallel_temp1 = __pyx_v_i;
+                              }
+                              __pyx_L22:;
+                              #ifdef _OPENMP
+                              #pragma omp flush(__pyx_parallel_why)
+                              #endif /* _OPENMP */
+                          }
+                      }
+                      #ifdef _OPENMP
+                      Py_END_ALLOW_THREADS
+                      #else
+{
+#ifdef WITH_THREAD
+                      PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
+                      #endif
+                      #endif /* _OPENMP */
+                      /* Clean up any temporaries */
+                      #ifdef WITH_THREAD
+                      PyGILState_Release(__pyx_gilstate_save);
+                      #endif
+                      #ifndef _OPENMP
+}
+#endif /* _OPENMP */
+                  }
+              }
+              if (__pyx_parallel_exc_type) {
+                /* This may have been overridden by a continue, break or return in another thread. Prefer the error. */
+                __pyx_parallel_why = 4;
+              }
+              if (__pyx_parallel_why) {
+                __pyx_v_data = __pyx_parallel_temp0;
+                __pyx_v_i = __pyx_parallel_temp1;
+                switch (__pyx_parallel_why) {
+                      case 3: goto __pyx_L10;
+                      case 4:
+                  {
+                      #ifdef WITH_THREAD
+                      PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
+                      #endif
+                      __Pyx_ErrRestore(__pyx_parallel_exc_type, __pyx_parallel_exc_value, __pyx_parallel_exc_tb);
+                      __pyx_filename = __pyx_parallel_filename; __pyx_lineno = __pyx_parallel_lineno; __pyx_clineno = __pyx_parallel_clineno;
+                      __Pyx_GIVEREF(__pyx_parallel_exc_type);
+                      #ifdef WITH_THREAD
+                      PyGILState_Release(__pyx_gilstate_save);
+                      #endif
+                  }
+                  goto __pyx_L11;
+                }
+              }
+          }
+          #if ((defined(__APPLE__) || defined(__OSX__)) && (defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))))
+              #undef likely
+              #undef unlikely
+              #define likely(x)   __builtin_expect(!!(x), 1)
+              #define unlikely(x) __builtin_expect(!!(x), 0)
+          #endif
+        }
+
 307:         else:
+
 308:             cdata = numpy.ascontiguousarray(weights.ravel(), dtype=numpy.float32)
+
+    /* "splitBBoxLUT.pyx":308
+ *                 cdata[i]+=data
+ *         else:
+ *             cdata = numpy.ascontiguousarray(weights.ravel(), dtype=numpy.float32)             # <<<<<<<<<<<<<<
+ * 
+ *         for i in prange(bins, nogil=True, schedule="guided"):
+ */
+    __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_5);
+    __pyx_t_1 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__ascontiguousarray); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    __pyx_t_5 = PyObject_GetAttr(__pyx_v_weights, __pyx_n_s__ravel); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_5);
+    __pyx_t_3 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_5);
+    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3);
+    __Pyx_GIVEREF(__pyx_t_3);
+    __pyx_t_3 = 0;
+    __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
+    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_t_4 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__float32); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_4);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__dtype), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_5), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __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_5)); __pyx_t_5 = 0;
+    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
+    __pyx_t_13 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(__pyx_t_4);
+    if (unlikely(!__pyx_t_13.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __pyx_v_cdata = __pyx_t_13;
+    __pyx_t_13.memview = NULL;
+    __pyx_t_13.data = NULL;
+  }
+  __pyx_L9:;
+
 309: 
+
 310:         for i in prange(bins, nogil=True, schedule="guided"):
+
+  /* "splitBBoxLUT.pyx":310
+ *             cdata = numpy.ascontiguousarray(weights.ravel(), dtype=numpy.float32)
+ * 
+ *         for i in prange(bins, nogil=True, schedule="guided"):             # <<<<<<<<<<<<<<
+ *             sum_data = 0.0
+ *             sum_count = 0.0
+ */
+  {
+      #ifdef WITH_THREAD
+      PyThreadState *_save = NULL;
+      #endif
+      Py_UNBLOCK_THREADS
+      /*try:*/ {
+        __pyx_t_16 = __pyx_v_bins;
+        if (1 == 0) abort();
+        {
+            #if ((defined(__APPLE__) || defined(__OSX__)) && (defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))))
+                #undef likely
+                #undef unlikely
+                #define likely(x)   (x)
+                #define unlikely(x) (x)
+            #endif
+            __pyx_t_10 = (__pyx_t_16 - 0) / 1;
+            if (__pyx_t_10 > 0)
+            {
+                #ifdef _OPENMP
+                #pragma omp parallel
+                #endif /* _OPENMP */
+                {
+                    #ifdef _OPENMP
+                    #pragma omp for lastprivate(__pyx_v_sum_count) lastprivate(__pyx_v_sum_data) lastprivate(__pyx_v_coef) lastprivate(__pyx_v_data) firstprivate(__pyx_v_i) lastprivate(__pyx_v_i) lastprivate(__pyx_v_idx) lastprivate(__pyx_v_j) schedule(guided)
+                    #endif /* _OPENMP */
+                    for (__pyx_t_15 = 0; __pyx_t_15 < __pyx_t_10; __pyx_t_15++){
+                        {
+                            __pyx_v_i = 0 + 1 * __pyx_t_15;
+                            /* Initialize private variables to invalid values */
+                            __pyx_v_sum_count = ((double)__PYX_NAN);
+                            __pyx_v_sum_data = ((double)__PYX_NAN);
+                            __pyx_v_coef = ((float)__PYX_NAN);
+                            __pyx_v_data = ((float)__PYX_NAN);
+                            __pyx_v_idx = ((int)0xbad0bad0);
+                            __pyx_v_j = ((int)0xbad0bad0);
+
+      /* "splitBBoxLUT.pyx":310
+ *             cdata = numpy.ascontiguousarray(weights.ravel(), dtype=numpy.float32)
+ * 
+ *         for i in prange(bins, nogil=True, schedule="guided"):             # <<<<<<<<<<<<<<
+ *             sum_data = 0.0
+ *             sum_count = 0.0
+ */
+      /*finally:*/ {
+        Py_BLOCK_THREADS
+      }
+  }
+
 311:             sum_data = 0.0
+
+                            /* "splitBBoxLUT.pyx":311
+ * 
+ *         for i in prange(bins, nogil=True, schedule="guided"):
+ *             sum_data = 0.0             # <<<<<<<<<<<<<<
+ *             sum_count = 0.0
+ *             for j in range(lut_size):
+ */
+                            __pyx_v_sum_data = 0.0;
+
 312:             sum_count = 0.0
+
+                            /* "splitBBoxLUT.pyx":312
+ *         for i in prange(bins, nogil=True, schedule="guided"):
+ *             sum_data = 0.0
+ *             sum_count = 0.0             # <<<<<<<<<<<<<<
+ *             for j in range(lut_size):
+ *                 idx = lut[i, j].idx
+ */
+                            __pyx_v_sum_count = 0.0;
+
 313:             for j in range(lut_size):
+
+                            /* "splitBBoxLUT.pyx":313
+ *             sum_data = 0.0
+ *             sum_count = 0.0
+ *             for j in range(lut_size):             # <<<<<<<<<<<<<<
+ *                 idx = lut[i, j].idx
+ *                 coef = lut[i, j].coef
+ */
+                            __pyx_t_23 = __pyx_v_lut_size;
+                            for (__pyx_t_24 = 0; __pyx_t_24 < __pyx_t_23; __pyx_t_24+=1) {
+                              __pyx_v_j = __pyx_t_24;
+
 314:                 idx = lut[i, j].idx
+
+                              /* "splitBBoxLUT.pyx":314
+ *             sum_count = 0.0
+ *             for j in range(lut_size):
+ *                 idx = lut[i, j].idx             # <<<<<<<<<<<<<<
+ *                 coef = lut[i, j].coef
+ *                 if idx <= 0 and coef <= 0.0:
+ */
+                              __pyx_t_25 = __pyx_v_i;
+                              __pyx_t_26 = __pyx_v_j;
+                              __pyx_v_idx = (*((struct __pyx_t_12splitBBoxLUT_lut_point *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_lut.data + __pyx_t_25 * __pyx_v_lut.strides[0]) ) + __pyx_t_26 * __pyx_v_lut.strides[1]) ))).idx;
+
 315:                 coef = lut[i, j].coef
+
+                              /* "splitBBoxLUT.pyx":315
+ *             for j in range(lut_size):
+ *                 idx = lut[i, j].idx
+ *                 coef = lut[i, j].coef             # <<<<<<<<<<<<<<
+ *                 if idx <= 0 and coef <= 0.0:
+ *                     break
+ */
+                              __pyx_t_27 = __pyx_v_i;
+                              __pyx_t_28 = __pyx_v_j;
+                              __pyx_v_coef = (*((struct __pyx_t_12splitBBoxLUT_lut_point *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_lut.data + __pyx_t_27 * __pyx_v_lut.strides[0]) ) + __pyx_t_28 * __pyx_v_lut.strides[1]) ))).coef;
+
 316:                 if idx <= 0 and coef <= 0.0:
+
+                              /* "splitBBoxLUT.pyx":316
+ *                 idx = lut[i, j].idx
+ *                 coef = lut[i, j].coef
+ *                 if idx <= 0 and coef <= 0.0:             # <<<<<<<<<<<<<<
+ *                     break
+ *                 data = cdata[idx]
+ */
+                              __pyx_t_11 = (__pyx_v_idx <= 0);
+                              if (__pyx_t_11) {
+                                __pyx_t_14 = (__pyx_v_coef <= 0.0);
+                                __pyx_t_29 = __pyx_t_14;
+                              } else {
+                                __pyx_t_29 = __pyx_t_11;
+                              }
+                              if (__pyx_t_29) {
+
 317:                     break
+
+                                /* "splitBBoxLUT.pyx":317
+ *                 coef = lut[i, j].coef
+ *                 if idx <= 0 and coef <= 0.0:
+ *                     break             # <<<<<<<<<<<<<<
+ *                 data = cdata[idx]
+ *                 if check_dummy:
+ */
+                                goto __pyx_L32_break;
+                                goto __pyx_L33;
+                              }
+                              __pyx_L33:;
+
 318:                 data = cdata[idx]
+
+                              /* "splitBBoxLUT.pyx":318
+ *                 if idx <= 0 and coef <= 0.0:
+ *                     break
+ *                 data = cdata[idx]             # <<<<<<<<<<<<<<
+ *                 if check_dummy:
+ *                     if cddummy:
+ */
+                              __pyx_t_30 = __pyx_v_idx;
+                              __pyx_v_data = (*((float *) ( /* dim=0 */ (__pyx_v_cdata.data + __pyx_t_30 * __pyx_v_cdata.strides[0]) )));
+
 319:                 if check_dummy:
+
+                              /* "splitBBoxLUT.pyx":319
+ *                     break
+ *                 data = cdata[idx]
+ *                 if check_dummy:             # <<<<<<<<<<<<<<
+ *                     if cddummy:
+ *                         if fabs(data-cdummy)<=cddummy:
+ */
+                              if (__pyx_v_check_dummy) {
+
 320:                     if cddummy:
+
+                                /* "splitBBoxLUT.pyx":320
+ *                 data = cdata[idx]
+ *                 if check_dummy:
+ *                     if cddummy:             # <<<<<<<<<<<<<<
+ *                         if fabs(data-cdummy)<=cddummy:
+ *                             continue
+ */
+                                __pyx_t_29 = (__pyx_v_cddummy != 0);
+                                if (__pyx_t_29) {
+
 321:                         if fabs(data-cdummy)<=cddummy:
+
+                                  /* "splitBBoxLUT.pyx":321
+ *                 if check_dummy:
+ *                     if cddummy:
+ *                         if fabs(data-cdummy)<=cddummy:             # <<<<<<<<<<<<<<
+ *                             continue
+ *                     else:
+ */
+                                  __pyx_t_29 = (fabs((__pyx_v_data - __pyx_v_cdummy)) <= __pyx_v_cddummy);
+                                  if (__pyx_t_29) {
+
 322:                             continue
+
+                                    /* "splitBBoxLUT.pyx":322
+ *                     if cddummy:
+ *                         if fabs(data-cdummy)<=cddummy:
+ *                             continue             # <<<<<<<<<<<<<<
+ *                     else:
+ *                         if data==cdummy:
+ */
+                                    goto __pyx_L31_continue;
+                                    goto __pyx_L36;
+                                  }
+                                  __pyx_L36:;
+                                  goto __pyx_L35;
+                                }
+                                /*else*/ {
+
 323:                     else:
+
 324:                         if data==cdummy:
+
+                                  /* "splitBBoxLUT.pyx":324
+ *                             continue
+ *                     else:
+ *                         if data==cdummy:             # <<<<<<<<<<<<<<
+ *                             continue
+ * 
+ */
+                                  __pyx_t_29 = (__pyx_v_data == __pyx_v_cdummy);
+                                  if (__pyx_t_29) {
+
 325:                             continue
+
+                                    /* "splitBBoxLUT.pyx":325
+ *                     else:
+ *                         if data==cdummy:
+ *                             continue             # <<<<<<<<<<<<<<
+ * 
+ *                 sum_data = sum_data + coef * data
+ */
+                                    goto __pyx_L31_continue;
+                                    goto __pyx_L37;
+                                  }
+                                  __pyx_L37:;
+                                }
+                                __pyx_L35:;
+                                goto __pyx_L34;
+                              }
+                              __pyx_L34:;
+
 326: 
+
 327:                 sum_data = sum_data + coef * data
+
+                              /* "splitBBoxLUT.pyx":327
+ *                             continue
+ * 
+ *                 sum_data = sum_data + coef * data             # <<<<<<<<<<<<<<
+ *                 sum_count = sum_count + coef
+ *             outData[i] += sum_data
+ */
+                              __pyx_v_sum_data = (__pyx_v_sum_data + (__pyx_v_coef * __pyx_v_data));
+
 328:                 sum_count = sum_count + coef
+
+                              /* "splitBBoxLUT.pyx":328
+ * 
+ *                 sum_data = sum_data + coef * data
+ *                 sum_count = sum_count + coef             # <<<<<<<<<<<<<<
+ *             outData[i] += sum_data
+ *             outCount[i] += sum_count
+ */
+                              __pyx_v_sum_count = (__pyx_v_sum_count + __pyx_v_coef);
+                              __pyx_L31_continue:;
+                            }
+                            __pyx_L32_break:;
+
 329:             outData[i] += sum_data
+
+                            /* "splitBBoxLUT.pyx":329
+ *                 sum_data = sum_data + coef * data
+ *                 sum_count = sum_count + coef
+ *             outData[i] += sum_data             # <<<<<<<<<<<<<<
+ *             outCount[i] += sum_count
+ *             if sum_count > epsilon:
+ */
+                            __pyx_t_23 = __pyx_v_i;
+                            *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_outData.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_outData.diminfo[0].strides) += __pyx_v_sum_data;
+
 330:             outCount[i] += sum_count
+
+                            /* "splitBBoxLUT.pyx":330
+ *                 sum_count = sum_count + coef
+ *             outData[i] += sum_data
+ *             outCount[i] += sum_count             # <<<<<<<<<<<<<<
+ *             if sum_count > epsilon:
+ *                 outMerge[i] += sum_data / sum_count
+ */
+                            __pyx_t_24 = __pyx_v_i;
+                            *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_outCount.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_outCount.diminfo[0].strides) += __pyx_v_sum_count;
+
 331:             if sum_count > epsilon:
+
+                            /* "splitBBoxLUT.pyx":331
+ *             outData[i] += sum_data
+ *             outCount[i] += sum_count
+ *             if sum_count > epsilon:             # <<<<<<<<<<<<<<
+ *                 outMerge[i] += sum_data / sum_count
+ *         return  self.outPos, outMerge, outData, outCount
+ */
+                            __pyx_t_29 = (__pyx_v_sum_count > __pyx_v_epsilon);
+                            if (__pyx_t_29) {
+
 332:                 outMerge[i] += sum_data / sum_count
+
+                              /* "splitBBoxLUT.pyx":332
+ *             outCount[i] += sum_count
+ *             if sum_count > epsilon:
+ *                 outMerge[i] += sum_data / sum_count             # <<<<<<<<<<<<<<
+ *         return  self.outPos, outMerge, outData, outCount
+ * 
+ */
+                              __pyx_t_31 = __pyx_v_i;
+                              *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_pybuffernd_outMerge.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_outMerge.diminfo[0].strides) += (__pyx_v_sum_data / __pyx_v_sum_count);
+                              goto __pyx_L38;
+                            }
+                            __pyx_L38:;
+                        }
+                    }
+                }
+            }
+        }
+        #if ((defined(__APPLE__) || defined(__OSX__)) && (defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))))
+            #undef likely
+            #undef unlikely
+            #define likely(x)   __builtin_expect(!!(x), 1)
+            #define unlikely(x) __builtin_expect(!!(x), 0)
+        #endif
+      }
+
 333:         return  self.outPos, outMerge, outData, outCount
+
+  /* "splitBBoxLUT.pyx":333
+ *             if sum_count > epsilon:
+ *                 outMerge[i] += sum_data / sum_count
+ *         return  self.outPos, outMerge, outData, outCount             # <<<<<<<<<<<<<<
+ * 
+ * 
+ */
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_4 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__outPos); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 333; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_4);
+  __pyx_t_3 = PyTuple_New(4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 333; __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_INCREF(((PyObject *)__pyx_v_outMerge));
+  PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_v_outMerge));
+  __Pyx_GIVEREF(((PyObject *)__pyx_v_outMerge));
+  __Pyx_INCREF(((PyObject *)__pyx_v_outData));
+  PyTuple_SET_ITEM(__pyx_t_3, 2, ((PyObject *)__pyx_v_outData));
+  __Pyx_GIVEREF(((PyObject *)__pyx_v_outData));
+  __Pyx_INCREF(((PyObject *)__pyx_v_outCount));
+  PyTuple_SET_ITEM(__pyx_t_3, 3, ((PyObject *)__pyx_v_outCount));
+  __Pyx_GIVEREF(((PyObject *)__pyx_v_outCount));
+  __pyx_t_4 = 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_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_5);
+  __PYX_XDEC_MEMVIEW(&__pyx_t_9, 1);
+  __PYX_XDEC_MEMVIEW(&__pyx_t_13, 1);
+  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
+    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
+    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_outCount.rcbuffer->pybuffer);
+    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_outData.rcbuffer->pybuffer);
+    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_outMerge.rcbuffer->pybuffer);
+  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
+  __Pyx_AddTraceback("splitBBoxLUT.HistoBBox1d.integrate", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  goto __pyx_L2;
+  __pyx_L0:;
+  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_outCount.rcbuffer->pybuffer);
+  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_outData.rcbuffer->pybuffer);
+  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_outMerge.rcbuffer->pybuffer);
+  __pyx_L2:;
+  __Pyx_XDECREF((PyObject *)__pyx_v_outData);
+  __Pyx_XDECREF((PyObject *)__pyx_v_outCount);
+  __Pyx_XDECREF((PyObject *)__pyx_v_outMerge);
+  __PYX_XDEC_MEMVIEW(&__pyx_v_lut, 1);
+  __PYX_XDEC_MEMVIEW(&__pyx_v_cdata, 1);
+  __PYX_XDEC_MEMVIEW(&__pyx_v_tdata, 1);
+  __PYX_XDEC_MEMVIEW(&__pyx_v_cflat, 1);
+  __PYX_XDEC_MEMVIEW(&__pyx_v_cdark, 1);
+  __PYX_XDEC_MEMVIEW(&__pyx_v_csolidAngle, 1);
+  __PYX_XDEC_MEMVIEW(&__pyx_v_cpolarization, 1);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_12splitBBoxLUT_1histoBBox1d(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_12splitBBoxLUT_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 & value of \"no good\" pixels\n    @param delta_dummy: precision of dummy value\n    @param mask: array (of int8) with masked pixels with 1 (0=not masked)\n    @param dark: array (of float32) with dark noise to be subtracted (or None)\n    @param flat: array (of float32) with flat image (including solid angle correctons or not...)\n    @return 2theta, I, weighted histogram, unweighted histogram\n    ";
+static PyMethodDef __pyx_mdef_12splitBBoxLUT_1histoBBox1d = {__Pyx_NAMESTR("histoBBox1d"), (PyCFunction)__pyx_pw_12splitBBoxLUT_1histoBBox1d, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_12splitBBoxLUT_histoBBox1d)};
+static PyObject *__pyx_pw_12splitBBoxLUT_1histoBBox1d(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_weights = 0;
+  PyObject *__pyx_v_pos0 = 0;
+  PyObject *__pyx_v_delta_pos0 = 0;
+  PyObject *__pyx_v_pos1 = 0;
+  PyObject *__pyx_v_delta_pos1 = 0;
+  PyObject *__pyx_v_bins = 0;
+  PyObject *__pyx_v_pos0Range = 0;
+  PyObject *__pyx_v_pos1Range = 0;
+  PyObject *__pyx_v_dummy = 0;
+  PyObject *__pyx_v_delta_dummy = 0;
+  PyObject *__pyx_v_mask = 0;
+  PyObject *__pyx_v_dark = 0;
+  PyObject *__pyx_v_flat = 0;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("histoBBox1d (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__weights,&__pyx_n_s__pos0,&__pyx_n_s__delta_pos0,&__pyx_n_s__pos1,&__pyx_n_s__delta_pos1,&__pyx_n_s__bins,&__pyx_n_s__pos0Range,&__pyx_n_s__pos1Range,&__pyx_n_s__dummy,&__pyx_n_s__delta_dummy,&__pyx_n_s__mask,&__pyx_n_s__dark,&__pyx_n_s__flat,0};
+    PyObject* values[13] = {0,0,0,0,0,0,0,0,0,0,0,0,0};
+
 334: 
+
 335: 
+
 336: def histoBBox1d(weights ,
+
+/* "splitBBoxLUT.pyx":336
+ * 
+ * 
+ * def histoBBox1d(weights ,             # <<<<<<<<<<<<<<
+ *                 pos0,
+ *                 delta_pos0,
+ */
+
+static PyObject *__pyx_pf_12splitBBoxLUT_histoBBox1d(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_weights, PyObject *__pyx_v_pos0, PyObject *__pyx_v_delta_pos0, PyObject *__pyx_v_pos1, PyObject *__pyx_v_delta_pos1, PyObject *__pyx_v_bins, PyObject *__pyx_v_pos0Range, PyObject *__pyx_v_pos1Range, PyObject *__pyx_v_dummy, PyObject *__pyx_v_delta_dummy, PyObject *__pyx_v_mask, PyObject *__pyx_v_dark, PyObject *__pyx_v_flat) {
+  PyObject *__pyx_v_size = NULL;
+  CYTHON_UNUSED long __pyx_v_bin;
+  double __pyx_v_epsilon;
+  double __pyx_v_cdummy;
+  double __pyx_v_ddummy;
+  long __pyx_v_check_pos1;
+  long __pyx_v_check_mask;
+  long __pyx_v_check_dummy;
+  long __pyx_v_do_dark;
+  long __pyx_v_do_flat;
+  PyObject *__pyx_v_cdata = NULL;
+  PyObject *__pyx_v_cpos0 = NULL;
+  PyObject *__pyx_v_dpos0 = NULL;
+  PyObject *__pyx_v_outData = NULL;
+  PyObject *__pyx_v_outCount = NULL;
+  PyObject *__pyx_v_outMax = NULL;
+  PyObject *__pyx_v_outMerge = NULL;
+  PyObject *__pyx_v_outPos = NULL;
+  PyObject *__pyx_v_cmask = NULL;
+  PyObject *__pyx_v_cdark = NULL;
+  PyObject *__pyx_v_cflat = NULL;
+  PyObject *__pyx_v_cpos0_lower = NULL;
+  PyObject *__pyx_v_cpos0_upper = NULL;
+  PyObject *__pyx_v_pos0_min = NULL;
+  PyObject *__pyx_v_pos0_max = NULL;
+  PyObject *__pyx_v_idx = NULL;
+  PyObject *__pyx_v_min0 = NULL;
+  PyObject *__pyx_v_max0 = NULL;
+  PyObject *__pyx_v_pos0_maxin = NULL;
+  PyObject *__pyx_v_cpos1 = NULL;
+  PyObject *__pyx_v_dpos1 = NULL;
+  PyObject *__pyx_v_pos1_min = NULL;
+  PyObject *__pyx_v_pos1_maxin = NULL;
+  PyObject *__pyx_v_pos1_max = NULL;
+  PyObject *__pyx_v_delta = NULL;
+  PyObject *__pyx_v_i = NULL;
+  PyObject *__pyx_v_data = NULL;
+  PyObject *__pyx_v_fbin0_min = NULL;
+  PyObject *__pyx_v_fbin0_max = NULL;
+  PyObject *__pyx_v_bin0_min = NULL;
+  PyObject *__pyx_v_bin0_max = NULL;
+  PyObject *__pyx_v_deltaA = NULL;
+  PyObject *__pyx_v_deltaL = NULL;
+  PyObject *__pyx_v_deltaR = NULL;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("histoBBox1d", 0);
+
+  /* "splitBBoxLUT.pyx":336
+ * 
+ * 
+ * def histoBBox1d(weights ,             # <<<<<<<<<<<<<<
+ *                 pos0,
+ *                 delta_pos0,
+ */
+  __pyx_k_tuple_54 = PyTuple_New(57); if (unlikely(!__pyx_k_tuple_54)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_k_tuple_54);
+  __Pyx_INCREF(((PyObject *)__pyx_n_s__weights));
+  PyTuple_SET_ITEM(__pyx_k_tuple_54, 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_54, 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_54, 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_54, 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_54, 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_54, 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_54, 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_54, 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_54, 8, ((PyObject *)__pyx_n_s__dummy));
+  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__dummy));
+  __Pyx_INCREF(((PyObject *)__pyx_n_s__delta_dummy));
+  PyTuple_SET_ITEM(__pyx_k_tuple_54, 9, ((PyObject *)__pyx_n_s__delta_dummy));
+  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__delta_dummy));
+  __Pyx_INCREF(((PyObject *)__pyx_n_s__mask));
+  PyTuple_SET_ITEM(__pyx_k_tuple_54, 10, ((PyObject *)__pyx_n_s__mask));
+  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__mask));
+  __Pyx_INCREF(((PyObject *)__pyx_n_s__dark));
+  PyTuple_SET_ITEM(__pyx_k_tuple_54, 11, ((PyObject *)__pyx_n_s__dark));
+  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__dark));
+  __Pyx_INCREF(((PyObject *)__pyx_n_s__flat));
+  PyTuple_SET_ITEM(__pyx_k_tuple_54, 12, ((PyObject *)__pyx_n_s__flat));
+  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__flat));
+  __Pyx_INCREF(((PyObject *)__pyx_n_s__size));
+  PyTuple_SET_ITEM(__pyx_k_tuple_54, 13, ((PyObject *)__pyx_n_s__size));
+  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__size));
+  __Pyx_INCREF(((PyObject *)__pyx_n_s__bin));
+  PyTuple_SET_ITEM(__pyx_k_tuple_54, 14, ((PyObject *)__pyx_n_s__bin));
+  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__bin));
+  __Pyx_INCREF(((PyObject *)__pyx_n_s__epsilon));
+  PyTuple_SET_ITEM(__pyx_k_tuple_54, 15, ((PyObject *)__pyx_n_s__epsilon));
+  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__epsilon));
+  __Pyx_INCREF(((PyObject *)__pyx_n_s__cdummy));
+  PyTuple_SET_ITEM(__pyx_k_tuple_54, 16, ((PyObject *)__pyx_n_s__cdummy));
+  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__cdummy));
+  __Pyx_INCREF(((PyObject *)__pyx_n_s__ddummy));
+  PyTuple_SET_ITEM(__pyx_k_tuple_54, 17, ((PyObject *)__pyx_n_s__ddummy));
+  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__ddummy));
+  __Pyx_INCREF(((PyObject *)__pyx_n_s__check_pos1));
+  PyTuple_SET_ITEM(__pyx_k_tuple_54, 18, ((PyObject *)__pyx_n_s__check_pos1));
+  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__check_pos1));
+  __Pyx_INCREF(((PyObject *)__pyx_n_s__check_mask));
+  PyTuple_SET_ITEM(__pyx_k_tuple_54, 19, ((PyObject *)__pyx_n_s__check_mask));
+  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__check_mask));
+  __Pyx_INCREF(((PyObject *)__pyx_n_s__check_dummy));
+  PyTuple_SET_ITEM(__pyx_k_tuple_54, 20, ((PyObject *)__pyx_n_s__check_dummy));
+  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__check_dummy));
+  __Pyx_INCREF(((PyObject *)__pyx_n_s__do_dark));
+  PyTuple_SET_ITEM(__pyx_k_tuple_54, 21, ((PyObject *)__pyx_n_s__do_dark));
+  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__do_dark));
+  __Pyx_INCREF(((PyObject *)__pyx_n_s__do_flat));
+  PyTuple_SET_ITEM(__pyx_k_tuple_54, 22, ((PyObject *)__pyx_n_s__do_flat));
+  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__do_flat));
+  __Pyx_INCREF(((PyObject *)__pyx_n_s__cdata));
+  PyTuple_SET_ITEM(__pyx_k_tuple_54, 23, ((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_54, 24, ((PyObject *)__pyx_n_s__cpos0));
+  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__cpos0));
+  __Pyx_INCREF(((PyObject *)__pyx_n_s__dpos0));
+  PyTuple_SET_ITEM(__pyx_k_tuple_54, 25, ((PyObject *)__pyx_n_s__dpos0));
+  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__dpos0));
+  __Pyx_INCREF(((PyObject *)__pyx_n_s__outData));
+  PyTuple_SET_ITEM(__pyx_k_tuple_54, 26, ((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_54, 27, ((PyObject *)__pyx_n_s__outCount));
+  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__outCount));
+  __Pyx_INCREF(((PyObject *)__pyx_n_s__outMax));
+  PyTuple_SET_ITEM(__pyx_k_tuple_54, 28, ((PyObject *)__pyx_n_s__outMax));
+  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__outMax));
+  __Pyx_INCREF(((PyObject *)__pyx_n_s__outMerge));
+  PyTuple_SET_ITEM(__pyx_k_tuple_54, 29, ((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_54, 30, ((PyObject *)__pyx_n_s__outPos));
+  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__outPos));
+  __Pyx_INCREF(((PyObject *)__pyx_n_s__cmask));
+  PyTuple_SET_ITEM(__pyx_k_tuple_54, 31, ((PyObject *)__pyx_n_s__cmask));
+  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__cmask));
+  __Pyx_INCREF(((PyObject *)__pyx_n_s__cdark));
+  PyTuple_SET_ITEM(__pyx_k_tuple_54, 32, ((PyObject *)__pyx_n_s__cdark));
+  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__cdark));
+  __Pyx_INCREF(((PyObject *)__pyx_n_s__cflat));
+  PyTuple_SET_ITEM(__pyx_k_tuple_54, 33, ((PyObject *)__pyx_n_s__cflat));
+  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__cflat));
+  __Pyx_INCREF(((PyObject *)__pyx_n_s__cpos0_lower));
+  PyTuple_SET_ITEM(__pyx_k_tuple_54, 34, ((PyObject *)__pyx_n_s__cpos0_lower));
+  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__cpos0_lower));
+  __Pyx_INCREF(((PyObject *)__pyx_n_s__cpos0_upper));
+  PyTuple_SET_ITEM(__pyx_k_tuple_54, 35, ((PyObject *)__pyx_n_s__cpos0_upper));
+  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__cpos0_upper));
+  __Pyx_INCREF(((PyObject *)__pyx_n_s__pos0_min));
+  PyTuple_SET_ITEM(__pyx_k_tuple_54, 36, ((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_54, 37, ((PyObject *)__pyx_n_s__pos0_max));
+  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__pos0_max));
+  __Pyx_INCREF(((PyObject *)__pyx_n_s__idx));
+  PyTuple_SET_ITEM(__pyx_k_tuple_54, 38, ((PyObject *)__pyx_n_s__idx));
+  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__idx));
+  __Pyx_INCREF(((PyObject *)__pyx_n_s__min0));
+  PyTuple_SET_ITEM(__pyx_k_tuple_54, 39, ((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_54, 40, ((PyObject *)__pyx_n_s__max0));
+  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__max0));
+  __Pyx_INCREF(((PyObject *)__pyx_n_s__pos0_maxin));
+  PyTuple_SET_ITEM(__pyx_k_tuple_54, 41, ((PyObject *)__pyx_n_s__pos0_maxin));
+  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__pos0_maxin));
+  __Pyx_INCREF(((PyObject *)__pyx_n_s__cpos1));
+  PyTuple_SET_ITEM(__pyx_k_tuple_54, 42, ((PyObject *)__pyx_n_s__cpos1));
+  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__cpos1));
+  __Pyx_INCREF(((PyObject *)__pyx_n_s__dpos1));
+  PyTuple_SET_ITEM(__pyx_k_tuple_54, 43, ((PyObject *)__pyx_n_s__dpos1));
+  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__dpos1));
+  __Pyx_INCREF(((PyObject *)__pyx_n_s__pos1_min));
+  PyTuple_SET_ITEM(__pyx_k_tuple_54, 44, ((PyObject *)__pyx_n_s__pos1_min));
+  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__pos1_min));
+  __Pyx_INCREF(((PyObject *)__pyx_n_s__pos1_maxin));
+  PyTuple_SET_ITEM(__pyx_k_tuple_54, 45, ((PyObject *)__pyx_n_s__pos1_maxin));
+  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__pos1_maxin));
+  __Pyx_INCREF(((PyObject *)__pyx_n_s__pos1_max));
+  PyTuple_SET_ITEM(__pyx_k_tuple_54, 46, ((PyObject *)__pyx_n_s__pos1_max));
+  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__pos1_max));
+  __Pyx_INCREF(((PyObject *)__pyx_n_s__delta));
+  PyTuple_SET_ITEM(__pyx_k_tuple_54, 47, ((PyObject *)__pyx_n_s__delta));
+  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__delta));
+  __Pyx_INCREF(((PyObject *)__pyx_n_s__i));
+  PyTuple_SET_ITEM(__pyx_k_tuple_54, 48, ((PyObject *)__pyx_n_s__i));
+  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__i));
+  __Pyx_INCREF(((PyObject *)__pyx_n_s__data));
+  PyTuple_SET_ITEM(__pyx_k_tuple_54, 49, ((PyObject *)__pyx_n_s__data));
+  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__data));
+  __Pyx_INCREF(((PyObject *)__pyx_n_s__fbin0_min));
+  PyTuple_SET_ITEM(__pyx_k_tuple_54, 50, ((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_54, 51, ((PyObject *)__pyx_n_s__fbin0_max));
+  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__fbin0_max));
+  __Pyx_INCREF(((PyObject *)__pyx_n_s__bin0_min));
+  PyTuple_SET_ITEM(__pyx_k_tuple_54, 52, ((PyObject *)__pyx_n_s__bin0_min));
+  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__bin0_min));
+  __Pyx_INCREF(((PyObject *)__pyx_n_s__bin0_max));
+  PyTuple_SET_ITEM(__pyx_k_tuple_54, 53, ((PyObject *)__pyx_n_s__bin0_max));
+  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__bin0_max));
+  __Pyx_INCREF(((PyObject *)__pyx_n_s__deltaA));
+  PyTuple_SET_ITEM(__pyx_k_tuple_54, 54, ((PyObject *)__pyx_n_s__deltaA));
+  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__deltaA));
+  __Pyx_INCREF(((PyObject *)__pyx_n_s__deltaL));
+  PyTuple_SET_ITEM(__pyx_k_tuple_54, 55, ((PyObject *)__pyx_n_s__deltaL));
+  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__deltaL));
+  __Pyx_INCREF(((PyObject *)__pyx_n_s__deltaR));
+  PyTuple_SET_ITEM(__pyx_k_tuple_54, 56, ((PyObject *)__pyx_n_s__deltaR));
+  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__deltaR));
+  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_54));
+
+  /* "splitBBoxLUT.pyx":336
+ * 
+ * 
+ * def histoBBox1d(weights ,             # <<<<<<<<<<<<<<
+ *                 pos0,
+ *                 delta_pos0,
+ */
+  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_12splitBBoxLUT_1histoBBox1d, NULL, __pyx_n_s__splitBBoxLUT); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 336; __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 = 336; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_k_codeobj_55 = (PyObject*)__Pyx_PyCode_New(13, 0, 57, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_54, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_48, __pyx_n_s__histoBBox1d, 336, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_55)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+
 337:                 pos0,
+
 338:                 delta_pos0,
+
 339:                 pos1=None,
+
+    /* "splitBBoxLUT.pyx":339
+ *                 pos0,
+ *                 delta_pos0,
+ *                 pos1=None,             # <<<<<<<<<<<<<<
+ *                 delta_pos1=None,
+ *                 bins=100,
+ */
+    values[3] = ((PyObject *)Py_None);
+
 340:                 delta_pos1=None,
+
+    /* "splitBBoxLUT.pyx":340
+ *                 delta_pos0,
+ *                 pos1=None,
+ *                 delta_pos1=None,             # <<<<<<<<<<<<<<
+ *                 bins=100,
+ *                 pos0Range=None,
+ */
+    values[4] = ((PyObject *)Py_None);
+    values[5] = ((PyObject *)__pyx_int_100);
+
 341:                 bins=100,
+
 342:                 pos0Range=None,
+
+    /* "splitBBoxLUT.pyx":342
+ *                 delta_pos1=None,
+ *                 bins=100,
+ *                 pos0Range=None,             # <<<<<<<<<<<<<<
+ *                 pos1Range=None,
+ *                 dummy=None,
+ */
+    values[6] = ((PyObject *)Py_None);
+
 343:                 pos1Range=None,
+
+    /* "splitBBoxLUT.pyx":343
+ *                 bins=100,
+ *                 pos0Range=None,
+ *                 pos1Range=None,             # <<<<<<<<<<<<<<
+ *                 dummy=None,
+ *                 delta_dummy=None,
+ */
+    values[7] = ((PyObject *)Py_None);
+
 344:                 dummy=None,
+
+    /* "splitBBoxLUT.pyx":344
+ *                 pos0Range=None,
+ *                 pos1Range=None,
+ *                 dummy=None,             # <<<<<<<<<<<<<<
+ *                 delta_dummy=None,
+ *                 mask=None,
+ */
+    values[8] = ((PyObject *)Py_None);
+
 345:                 delta_dummy=None,
+
+    /* "splitBBoxLUT.pyx":345
+ *                 pos1Range=None,
+ *                 dummy=None,
+ *                 delta_dummy=None,             # <<<<<<<<<<<<<<
+ *                 mask=None,
+ *                 dark=None,
+ */
+    values[9] = ((PyObject *)Py_None);
+
 346:                 mask=None,
+
+    /* "splitBBoxLUT.pyx":346
+ *                 dummy=None,
+ *                 delta_dummy=None,
+ *                 mask=None,             # <<<<<<<<<<<<<<
+ *                 dark=None,
+ *                 flat=None
+ */
+    values[10] = ((PyObject *)Py_None);
+
 347:                 dark=None,
+
+    /* "splitBBoxLUT.pyx":347
+ *                 delta_dummy=None,
+ *                 mask=None,
+ *                 dark=None,             # <<<<<<<<<<<<<<
+ *                 flat=None
+ *               ):
+ */
+    values[11] = ((PyObject *)Py_None);
+
 348:                 flat=None
+
+    /* "splitBBoxLUT.pyx":348
+ *                 mask=None,
+ *                 dark=None,
+ *                 flat=None             # <<<<<<<<<<<<<<
+ *               ):
+ *     """
+ */
+    values[12] = ((PyObject *)Py_None);
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
+        case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
+        case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
+        case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
+        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
+        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
+        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
+        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
+        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
+        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__weights)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+        case  1:
+        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__pos0)) != 0)) kw_args--;
+        else {
+          __Pyx_RaiseArgtupleInvalid("histoBBox1d", 0, 3, 13, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+        }
+        case  2:
+        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__delta_pos0)) != 0)) kw_args--;
+        else {
+          __Pyx_RaiseArgtupleInvalid("histoBBox1d", 0, 3, 13, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+        }
+        case  3:
+        if (kw_args > 0) {
+          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__pos1);
+          if (value) { values[3] = value; kw_args--; }
+        }
+        case  4:
+        if (kw_args > 0) {
+          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__delta_pos1);
+          if (value) { values[4] = value; kw_args--; }
+        }
+        case  5:
+        if (kw_args > 0) {
+          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__bins);
+          if (value) { values[5] = value; kw_args--; }
+        }
+        case  6:
+        if (kw_args > 0) {
+          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__pos0Range);
+          if (value) { values[6] = value; kw_args--; }
+        }
+        case  7:
+        if (kw_args > 0) {
+          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__pos1Range);
+          if (value) { values[7] = value; kw_args--; }
+        }
+        case  8:
+        if (kw_args > 0) {
+          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__dummy);
+          if (value) { values[8] = value; kw_args--; }
+        }
+        case  9:
+        if (kw_args > 0) {
+          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__delta_dummy);
+          if (value) { values[9] = value; kw_args--; }
+        }
+        case 10:
+        if (kw_args > 0) {
+          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__mask);
+          if (value) { values[10] = value; kw_args--; }
+        }
+        case 11:
+        if (kw_args > 0) {
+          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__dark);
+          if (value) { values[11] = value; kw_args--; }
+        }
+        case 12:
+        if (kw_args > 0) {
+          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__flat);
+          if (value) { values[12] = value; kw_args--; }
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "histoBBox1d") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+      }
+    } else {
+      switch (PyTuple_GET_SIZE(__pyx_args)) {
+        case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
+        case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
+        case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
+        case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
+        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
+        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
+        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
+        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
+        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
+        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+    }
+    __pyx_v_weights = values[0];
+    __pyx_v_pos0 = values[1];
+    __pyx_v_delta_pos0 = values[2];
+    __pyx_v_pos1 = values[3];
+    __pyx_v_delta_pos1 = values[4];
+    __pyx_v_bins = values[5];
+    __pyx_v_pos0Range = values[6];
+    __pyx_v_pos1Range = values[7];
+    __pyx_v_dummy = values[8];
+    __pyx_v_delta_dummy = values[9];
+    __pyx_v_mask = values[10];
+    __pyx_v_dark = values[11];
+    __pyx_v_flat = values[12];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("histoBBox1d", 0, 3, 13, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("splitBBoxLUT.histoBBox1d", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_12splitBBoxLUT_histoBBox1d(__pyx_self, __pyx_v_weights, __pyx_v_pos0, __pyx_v_delta_pos0, __pyx_v_pos1, __pyx_v_delta_pos1, __pyx_v_bins, __pyx_v_pos0Range, __pyx_v_pos1Range, __pyx_v_dummy, __pyx_v_delta_dummy, __pyx_v_mask, __pyx_v_dark, __pyx_v_flat);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
 349:               ):
+
 350:     """
+
 351:     Calculates histogram of pos0 (tth) weighted by weights
+
 352: 
+
 353:     Splitting is done on the pixel's bounding box like fit2D
+
 354: 
+
 355:     @param weights: array with intensities
+
 356:     @param pos0: 1D array with pos0: tth or q_vect
+
 357:     @param delta_pos0: 1D array with delta pos0: max center-corner distance
+
 358:     @param pos1: 1D array with pos1: chi
+
 359:     @param delta_pos1: 1D array with max pos1: max center-corner distance, unused !
+
 360:     @param bins: number of output bins
+
 361:     @param pos0Range: minimum and maximum  of the 2th range
+
 362:     @param pos1Range: minimum and maximum  of the chi range
+
 363:     @param dummy: value for bins without pixels & value of "no good" pixels
+
 364:     @param delta_dummy: precision of dummy value
+
 365:     @param mask: array (of int8) with masked pixels with 1 (0=not masked)
+
 366:     @param dark: array (of float32) with dark noise to be subtracted (or None)
+
 367:     @param flat: array (of float32) with flat image (including solid angle correctons or not...)
+
 368:     @return 2theta, I, weighted histogram, unweighted histogram
+
 369:     """
+
 370:     size = weights.size
+
+  /* "splitBBoxLUT.pyx":370
+ *     @return 2theta, I, weighted histogram, unweighted histogram
+ *     """
+ *     size = weights.size             # <<<<<<<<<<<<<<
+ *     assert pos0.size == size
+ *     assert delta_pos0.size == size
+ */
+  __pyx_t_1 = PyObject_GetAttr(__pyx_v_weights, __pyx_n_s__size); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_v_size = __pyx_t_1;
+  __pyx_t_1 = 0;
+
 371:     assert pos0.size == size
+
+  /* "splitBBoxLUT.pyx":371
+ *     """
+ *     size = weights.size
+ *     assert pos0.size == size             # <<<<<<<<<<<<<<
+ *     assert delta_pos0.size == size
+ *     assert  bins > 1
+ */
+  #ifndef CYTHON_WITHOUT_ASSERTIONS
+  __pyx_t_1 = PyObject_GetAttr(__pyx_v_pos0, __pyx_n_s__size); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 371; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_v_size, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 371; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 371; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  if (unlikely(!__pyx_t_3)) {
+    PyErr_SetNone(PyExc_AssertionError);
+    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 371; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  }
+  #endif
+
 372:     assert delta_pos0.size == size
+
+  /* "splitBBoxLUT.pyx":372
+ *     size = weights.size
+ *     assert pos0.size == size
+ *     assert delta_pos0.size == size             # <<<<<<<<<<<<<<
+ *     assert  bins > 1
+ *     bin = 0
+ */
+  #ifndef CYTHON_WITHOUT_ASSERTIONS
+  __pyx_t_2 = PyObject_GetAttr(__pyx_v_delta_pos0, __pyx_n_s__size); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 372; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_v_size, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 372; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 372; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  if (unlikely(!__pyx_t_3)) {
+    PyErr_SetNone(PyExc_AssertionError);
+    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 372; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  }
+  #endif
+
 373:     assert  bins > 1
+
+  /* "splitBBoxLUT.pyx":373
+ *     assert pos0.size == size
+ *     assert delta_pos0.size == size
+ *     assert  bins > 1             # <<<<<<<<<<<<<<
+ *     bin = 0
+ *     epsilon = 1e-10
+ */
+  #ifndef CYTHON_WITHOUT_ASSERTIONS
+  __pyx_t_1 = PyObject_RichCompare(__pyx_v_bins, __pyx_int_1, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  if (unlikely(!__pyx_t_3)) {
+    PyErr_SetNone(PyExc_AssertionError);
+    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  }
+  #endif
+
 374:     bin = 0
+
+  /* "splitBBoxLUT.pyx":374
+ *     assert delta_pos0.size == size
+ *     assert  bins > 1
+ *     bin = 0             # <<<<<<<<<<<<<<
+ *     epsilon = 1e-10
+ *     cdummy = 0
+ */
+  __pyx_v_bin = 0;
+
 375:     epsilon = 1e-10
+
+  /* "splitBBoxLUT.pyx":375
+ *     assert  bins > 1
+ *     bin = 0
+ *     epsilon = 1e-10             # <<<<<<<<<<<<<<
+ *     cdummy = 0
+ *     ddummy = 0
+ */
+  __pyx_v_epsilon = 1e-10;
+
 376:     cdummy = 0
+
+  /* "splitBBoxLUT.pyx":376
+ *     bin = 0
+ *     epsilon = 1e-10
+ *     cdummy = 0             # <<<<<<<<<<<<<<
+ *     ddummy = 0
+ * 
+ */
+  __pyx_v_cdummy = 0.0;
+
 377:     ddummy = 0
+
+  /* "splitBBoxLUT.pyx":377
+ *     epsilon = 1e-10
+ *     cdummy = 0
+ *     ddummy = 0             # <<<<<<<<<<<<<<
+ * 
+ *     check_pos1 = 0
+ */
+  __pyx_v_ddummy = 0.0;
+
 378: 
+
 379:     check_pos1 = 0
+
+  /* "splitBBoxLUT.pyx":379
+ *     ddummy = 0
+ * 
+ *     check_pos1 = 0             # <<<<<<<<<<<<<<
+ *     check_mask = 0
+ *     check_dummy = 0
+ */
+  __pyx_v_check_pos1 = 0;
+
 380:     check_mask = 0
+
+  /* "splitBBoxLUT.pyx":380
+ * 
+ *     check_pos1 = 0
+ *     check_mask = 0             # <<<<<<<<<<<<<<
+ *     check_dummy = 0
+ *     do_dark = 0
+ */
+  __pyx_v_check_mask = 0;
+
 381:     check_dummy = 0
+
+  /* "splitBBoxLUT.pyx":381
+ *     check_pos1 = 0
+ *     check_mask = 0
+ *     check_dummy = 0             # <<<<<<<<<<<<<<
+ *     do_dark = 0
+ *     do_flat = 0
+ */
+  __pyx_v_check_dummy = 0;
+
 382:     do_dark = 0
+
+  /* "splitBBoxLUT.pyx":382
+ *     check_mask = 0
+ *     check_dummy = 0
+ *     do_dark = 0             # <<<<<<<<<<<<<<
+ *     do_flat = 0
+ * 
+ */
+  __pyx_v_do_dark = 0;
+
 383:     do_flat = 0
+
+  /* "splitBBoxLUT.pyx":383
+ *     check_dummy = 0
+ *     do_dark = 0
+ *     do_flat = 0             # <<<<<<<<<<<<<<
+ * 
+ *     cdata = numpy.ascontiguousarray(weights.ravel(), dtype=numpy.float32)
+ */
+  __pyx_v_do_flat = 0;
+
 384: 
+
 385:     cdata = numpy.ascontiguousarray(weights.ravel(), dtype=numpy.float32)
+
+  /* "splitBBoxLUT.pyx":385
+ *     do_flat = 0
+ * 
+ *     cdata = numpy.ascontiguousarray(weights.ravel(), dtype=numpy.float32)             # <<<<<<<<<<<<<<
+ *     cpos0 = numpy.ascontiguousarray(pos0.ravel(), dtype=numpy.float32)
+ *     dpos0 = numpy.ascontiguousarray(delta_pos0.ravel(), dtype=numpy.float32)
+ */
+  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 385; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__ascontiguousarray); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 385; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_1 = PyObject_GetAttr(__pyx_v_weights, __pyx_n_s__ravel); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 385; __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 = 385; __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 = 385; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_1);
+  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4);
+  __Pyx_GIVEREF(__pyx_t_4);
+  __pyx_t_4 = 0;
+  __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 385; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
+  __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 385; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_5);
+  __pyx_t_6 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__float32); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 385; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_6);
+  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+  if (PyDict_SetItem(__pyx_t_4, ((PyObject *)__pyx_n_s__dtype), __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 385; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  __pyx_t_6 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 385; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_6);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
+  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
+  __pyx_v_cdata = __pyx_t_6;
+  __pyx_t_6 = 0;
+
 386:     cpos0 = numpy.ascontiguousarray(pos0.ravel(), dtype=numpy.float32)
+
+  /* "splitBBoxLUT.pyx":386
+ * 
+ *     cdata = numpy.ascontiguousarray(weights.ravel(), dtype=numpy.float32)
+ *     cpos0 = numpy.ascontiguousarray(pos0.ravel(), dtype=numpy.float32)             # <<<<<<<<<<<<<<
+ *     dpos0 = numpy.ascontiguousarray(delta_pos0.ravel(), dtype=numpy.float32)
+ * 
+ */
+  __pyx_t_6 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_6);
+  __pyx_t_4 = PyObject_GetAttr(__pyx_t_6, __pyx_n_s__ascontiguousarray); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_4);
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  __pyx_t_6 = PyObject_GetAttr(__pyx_v_pos0, __pyx_n_s__ravel); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_6);
+  __pyx_t_1 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_6);
+  PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1);
+  __Pyx_GIVEREF(__pyx_t_1);
+  __pyx_t_1 = 0;
+  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
+  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_5 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__float32); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_5);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__dtype), __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+  __pyx_t_5 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_6), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_5);
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
+  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
+  __pyx_v_cpos0 = __pyx_t_5;
+  __pyx_t_5 = 0;
+
 387:     dpos0 = numpy.ascontiguousarray(delta_pos0.ravel(), dtype=numpy.float32)
+
+  /* "splitBBoxLUT.pyx":387
+ *     cdata = numpy.ascontiguousarray(weights.ravel(), dtype=numpy.float32)
+ *     cpos0 = numpy.ascontiguousarray(pos0.ravel(), dtype=numpy.float32)
+ *     dpos0 = numpy.ascontiguousarray(delta_pos0.ravel(), dtype=numpy.float32)             # <<<<<<<<<<<<<<
+ * 
+ * 
+ */
+  __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_5);
+  __pyx_t_1 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__ascontiguousarray); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+  __pyx_t_5 = PyObject_GetAttr(__pyx_v_delta_pos0, __pyx_n_s__ravel); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_5);
+  __pyx_t_6 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_6);
+  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_5);
+  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6);
+  __Pyx_GIVEREF(__pyx_t_6);
+  __pyx_t_6 = 0;
+  __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(((PyObject *)__pyx_t_6));
+  __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_4);
+  __pyx_t_2 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__float32); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  if (PyDict_SetItem(__pyx_t_6, ((PyObject *)__pyx_n_s__dtype), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_5), ((PyObject *)__pyx_t_6)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
+  __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
+  __pyx_v_dpos0 = __pyx_t_2;
+  __pyx_t_2 = 0;
+
 388: 
+
 389: 
+
 390:     outData = numpy.zeros(bins, dtype=numpy.float64)
+
+  /* "splitBBoxLUT.pyx":390
+ * 
+ * 
+ *     outData = numpy.zeros(bins, dtype=numpy.float64)             # <<<<<<<<<<<<<<
+ *     outCount = numpy.zeros(bins, dtype=numpy.float64)
+ *     outMax = numpy.zeros(bins, dtype=numpy.int64)
+ */
+  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 390; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_6 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__zeros); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 390; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_6);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 390; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_INCREF(__pyx_v_bins);
+  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_bins);
+  __Pyx_GIVEREF(__pyx_v_bins);
+  __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 390; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(((PyObject *)__pyx_t_5));
+  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 390; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_4 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__float64); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 390; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_4);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  if (PyDict_SetItem(__pyx_t_5, ((PyObject *)__pyx_n_s__dtype), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 390; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  __pyx_t_4 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_t_2), ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 390; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_4);
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
+  __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
+  __pyx_v_outData = __pyx_t_4;
+  __pyx_t_4 = 0;
+
 391:     outCount = numpy.zeros(bins, dtype=numpy.float64)
+
+  /* "splitBBoxLUT.pyx":391
+ * 
+ *     outData = numpy.zeros(bins, dtype=numpy.float64)
+ *     outCount = numpy.zeros(bins, dtype=numpy.float64)             # <<<<<<<<<<<<<<
+ *     outMax = numpy.zeros(bins, dtype=numpy.int64)
+ *     outMerge = numpy.zeros(bins, dtype=numpy.float32)
+ */
+  __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_4);
+  __pyx_t_5 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__zeros); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_5);
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_4);
+  __Pyx_INCREF(__pyx_v_bins);
+  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_bins);
+  __Pyx_GIVEREF(__pyx_v_bins);
+  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
+  __pyx_t_6 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_6);
+  __pyx_t_1 = PyObject_GetAttr(__pyx_t_6, __pyx_n_s__float64); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__dtype), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_1 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
+  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
+  __pyx_v_outCount = __pyx_t_1;
+  __pyx_t_1 = 0;
+
 392:     outMax = numpy.zeros(bins, dtype=numpy.int64)
+
+  /* "splitBBoxLUT.pyx":392
+ *     outData = numpy.zeros(bins, dtype=numpy.float64)
+ *     outCount = numpy.zeros(bins, dtype=numpy.float64)
+ *     outMax = numpy.zeros(bins, dtype=numpy.int64)             # <<<<<<<<<<<<<<
+ *     outMerge = numpy.zeros(bins, dtype=numpy.float32)
+ *     outPos = numpy.zeros(bins, dtype=numpy.float32)
+ */
+  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 392; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__zeros); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 392; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 392; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_INCREF(__pyx_v_bins);
+  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_bins);
+  __Pyx_GIVEREF(__pyx_v_bins);
+  __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 392; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
+  __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 392; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_5);
+  __pyx_t_6 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__int64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 392; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_6);
+  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+  if (PyDict_SetItem(__pyx_t_4, ((PyObject *)__pyx_n_s__dtype), __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 392; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  __pyx_t_6 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 392; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_6);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
+  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
+  __pyx_v_outMax = __pyx_t_6;
+  __pyx_t_6 = 0;
+
 393:     outMerge = numpy.zeros(bins, dtype=numpy.float32)
+
+  /* "splitBBoxLUT.pyx":393
+ *     outCount = numpy.zeros(bins, dtype=numpy.float64)
+ *     outMax = numpy.zeros(bins, dtype=numpy.int64)
+ *     outMerge = numpy.zeros(bins, dtype=numpy.float32)             # <<<<<<<<<<<<<<
+ *     outPos = numpy.zeros(bins, dtype=numpy.float32)
+ * 
+ */
+  __pyx_t_6 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 393; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_6);
+  __pyx_t_4 = PyObject_GetAttr(__pyx_t_6, __pyx_n_s__zeros); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 393; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_4);
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 393; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_6);
+  __Pyx_INCREF(__pyx_v_bins);
+  PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_bins);
+  __Pyx_GIVEREF(__pyx_v_bins);
+  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 393; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
+  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 393; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_5 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__float32); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 393; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_5);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__dtype), __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 393; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+  __pyx_t_5 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_6), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 393; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_5);
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
+  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
+  __pyx_v_outMerge = __pyx_t_5;
+  __pyx_t_5 = 0;
+
 394:     outPos = numpy.zeros(bins, dtype=numpy.float32)
+
+  /* "splitBBoxLUT.pyx":394
+ *     outMax = numpy.zeros(bins, dtype=numpy.int64)
+ *     outMerge = numpy.zeros(bins, dtype=numpy.float32)
+ *     outPos = numpy.zeros(bins, dtype=numpy.float32)             # <<<<<<<<<<<<<<
+ * 
+ *     if  mask is not None:
+ */
+  __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 394; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_5);
+  __pyx_t_1 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__zeros); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 394; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 394; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_5);
+  __Pyx_INCREF(__pyx_v_bins);
+  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_bins);
+  __Pyx_GIVEREF(__pyx_v_bins);
+  __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 394; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(((PyObject *)__pyx_t_6));
+  __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 394; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_4);
+  __pyx_t_2 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__float32); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 394; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  if (PyDict_SetItem(__pyx_t_6, ((PyObject *)__pyx_n_s__dtype), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 394; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_5), ((PyObject *)__pyx_t_6)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 394; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
+  __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
+  __pyx_v_outPos = __pyx_t_2;
+  __pyx_t_2 = 0;
+
 395: 
+
 396:     if  mask is not None:
+
+  /* "splitBBoxLUT.pyx":396
+ *     outPos = numpy.zeros(bins, dtype=numpy.float32)
+ * 
+ *     if  mask is not None:             # <<<<<<<<<<<<<<
+ *         assert mask.size == size
+ *         check_mask = 1
+ */
+  __pyx_t_3 = (__pyx_v_mask != Py_None);
+  if (__pyx_t_3) {
+
 397:         assert mask.size == size
+
+    /* "splitBBoxLUT.pyx":397
+ * 
+ *     if  mask is not None:
+ *         assert mask.size == size             # <<<<<<<<<<<<<<
+ *         check_mask = 1
+ *         cmask = numpy.ascontiguousarray(mask.ravel(), dtype=numpy.int8)
+ */
+    #ifndef CYTHON_WITHOUT_ASSERTIONS
+    __pyx_t_2 = PyObject_GetAttr(__pyx_v_mask, __pyx_n_s__size); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_t_6 = PyObject_RichCompare(__pyx_t_2, __pyx_v_size, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+    if (unlikely(!__pyx_t_3)) {
+      PyErr_SetNone(PyExc_AssertionError);
+      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    }
+    #endif
+
 398:         check_mask = 1
+
+    /* "splitBBoxLUT.pyx":398
+ *     if  mask is not None:
+ *         assert mask.size == size
+ *         check_mask = 1             # <<<<<<<<<<<<<<
+ *         cmask = numpy.ascontiguousarray(mask.ravel(), dtype=numpy.int8)
+ * 
+ */
+    __pyx_v_check_mask = 1;
+
 399:         cmask = numpy.ascontiguousarray(mask.ravel(), dtype=numpy.int8)
+
+    /* "splitBBoxLUT.pyx":399
+ *         assert mask.size == size
+ *         check_mask = 1
+ *         cmask = numpy.ascontiguousarray(mask.ravel(), dtype=numpy.int8)             # <<<<<<<<<<<<<<
+ * 
+ *     if (dummy is not None) and delta_dummy is not None:
+ */
+    __pyx_t_6 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 399; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_6);
+    __pyx_t_2 = PyObject_GetAttr(__pyx_t_6, __pyx_n_s__ascontiguousarray); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 399; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_2);
+    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+    __pyx_t_6 = PyObject_GetAttr(__pyx_v_mask, __pyx_n_s__ravel); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 399; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_6);
+    __pyx_t_5 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 399; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_5);
+    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+    __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 399; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_6);
+    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5);
+    __Pyx_GIVEREF(__pyx_t_5);
+    __pyx_t_5 = 0;
+    __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 399; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(((PyObject *)__pyx_t_5));
+    __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 399; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_1);
+    __pyx_t_4 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__int8); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 399; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_4);
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    if (PyDict_SetItem(__pyx_t_5, ((PyObject *)__pyx_n_s__dtype), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 399; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_6), ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 399; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_4);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
+    __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
+    __pyx_v_cmask = __pyx_t_4;
+    __pyx_t_4 = 0;
+    goto __pyx_L3;
+  }
+  __pyx_L3:;
+
 400: 
+
 401:     if (dummy is not None) and delta_dummy is not None:
+
+  /* "splitBBoxLUT.pyx":401
+ *         cmask = numpy.ascontiguousarray(mask.ravel(), dtype=numpy.int8)
+ * 
+ *     if (dummy is not None) and delta_dummy is not None:             # <<<<<<<<<<<<<<
+ *         check_dummy = 1
+ *         cdummy = float(dummy)
+ */
+  __pyx_t_3 = (__pyx_v_dummy != Py_None);
+  if (__pyx_t_3) {
+    __pyx_t_7 = (__pyx_v_delta_dummy != Py_None);
+    __pyx_t_8 = __pyx_t_7;
+  } else {
+    __pyx_t_8 = __pyx_t_3;
+  }
+  if (__pyx_t_8) {
+
 402:         check_dummy = 1
+
+    /* "splitBBoxLUT.pyx":402
+ * 
+ *     if (dummy is not None) and delta_dummy is not None:
+ *         check_dummy = 1             # <<<<<<<<<<<<<<
+ *         cdummy = float(dummy)
+ *         ddummy = float(delta_dummy)
+ */
+    __pyx_v_check_dummy = 1;
+
 403:         cdummy = float(dummy)
+
+    /* "splitBBoxLUT.pyx":403
+ *     if (dummy is not None) and delta_dummy is not None:
+ *         check_dummy = 1
+ *         cdummy = float(dummy)             # <<<<<<<<<<<<<<
+ *         ddummy = float(delta_dummy)
+ *     elif (dummy is not None):
+ */
+    __pyx_t_9 = __Pyx_PyObject_AsDouble(__pyx_v_dummy); if (unlikely(__pyx_t_9 == ((double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 403; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_v_cdummy = __pyx_t_9;
+
 404:         ddummy = float(delta_dummy)
+
+    /* "splitBBoxLUT.pyx":404
+ *         check_dummy = 1
+ *         cdummy = float(dummy)
+ *         ddummy = float(delta_dummy)             # <<<<<<<<<<<<<<
+ *     elif (dummy is not None):
+ *         cdummy = float(dummy)
+ */
+    __pyx_t_9 = __Pyx_PyObject_AsDouble(__pyx_v_delta_dummy); if (unlikely(__pyx_t_9 == ((double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 404; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_v_ddummy = __pyx_t_9;
+    goto __pyx_L4;
+  }
+
 405:     elif (dummy is not None):
+
+  /* "splitBBoxLUT.pyx":405
+ *         cdummy = float(dummy)
+ *         ddummy = float(delta_dummy)
+ *     elif (dummy is not None):             # <<<<<<<<<<<<<<
+ *         cdummy = float(dummy)
+ *     else:
+ */
+  __pyx_t_8 = (__pyx_v_dummy != Py_None);
+  if (__pyx_t_8) {
+
 406:         cdummy = float(dummy)
+
+    /* "splitBBoxLUT.pyx":406
+ *         ddummy = float(delta_dummy)
+ *     elif (dummy is not None):
+ *         cdummy = float(dummy)             # <<<<<<<<<<<<<<
+ *     else:
+ *         cdummy = 0.0
+ */
+    __pyx_t_9 = __Pyx_PyObject_AsDouble(__pyx_v_dummy); if (unlikely(__pyx_t_9 == ((double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_v_cdummy = __pyx_t_9;
+    goto __pyx_L4;
+  }
+  /*else*/ {
+
 407:     else:
+
 408:         cdummy = 0.0
+
+    /* "splitBBoxLUT.pyx":408
+ *         cdummy = float(dummy)
+ *     else:
+ *         cdummy = 0.0             # <<<<<<<<<<<<<<
+ * 
+ *     if dark is not None:
+ */
+    __pyx_v_cdummy = 0.0;
+  }
+  __pyx_L4:;
+
 409: 
+
 410:     if dark is not None:
+
+  /* "splitBBoxLUT.pyx":410
+ *         cdummy = 0.0
+ * 
+ *     if dark is not None:             # <<<<<<<<<<<<<<
+ *         assert dark.size == size
+ *         do_dark = 1
+ */
+  __pyx_t_8 = (__pyx_v_dark != Py_None);
+  if (__pyx_t_8) {
+
 411:         assert dark.size == size
+
+    /* "splitBBoxLUT.pyx":411
+ * 
+ *     if dark is not None:
+ *         assert dark.size == size             # <<<<<<<<<<<<<<
+ *         do_dark = 1
+ *         cdark = numpy.ascontiguousarray(dark.ravel(), dtype=numpy.float32)
+ */
+    #ifndef CYTHON_WITHOUT_ASSERTIONS
+    __pyx_t_4 = PyObject_GetAttr(__pyx_v_dark, __pyx_n_s__size); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_4);
+    __pyx_t_5 = PyObject_RichCompare(__pyx_t_4, __pyx_v_size, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    if (unlikely(!__pyx_t_8)) {
+      PyErr_SetNone(PyExc_AssertionError);
+      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    }
+    #endif
+
 412:         do_dark = 1
+
+    /* "splitBBoxLUT.pyx":412
+ *     if dark is not None:
+ *         assert dark.size == size
+ *         do_dark = 1             # <<<<<<<<<<<<<<
+ *         cdark = numpy.ascontiguousarray(dark.ravel(), dtype=numpy.float32)
+ * 
+ */
+    __pyx_v_do_dark = 1;
+
 413:         cdark = numpy.ascontiguousarray(dark.ravel(), dtype=numpy.float32)
+
+    /* "splitBBoxLUT.pyx":413
+ *         assert dark.size == size
+ *         do_dark = 1
+ *         cdark = numpy.ascontiguousarray(dark.ravel(), dtype=numpy.float32)             # <<<<<<<<<<<<<<
+ * 
+ *     if flat is not None:
+ */
+    __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 413; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_5);
+    __pyx_t_4 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__ascontiguousarray); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 413; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_4);
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    __pyx_t_5 = PyObject_GetAttr(__pyx_v_dark, __pyx_n_s__ravel); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 413; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_5);
+    __pyx_t_6 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 413; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_6);
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 413; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_5);
+    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6);
+    __Pyx_GIVEREF(__pyx_t_6);
+    __pyx_t_6 = 0;
+    __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 413; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(((PyObject *)__pyx_t_6));
+    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 413; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__float32); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 413; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    if (PyDict_SetItem(__pyx_t_6, ((PyObject *)__pyx_n_s__dtype), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 413; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __pyx_t_1 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_5), ((PyObject *)__pyx_t_6)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 413; __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_5)); __pyx_t_5 = 0;
+    __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
+    __pyx_v_cdark = __pyx_t_1;
+    __pyx_t_1 = 0;
+    goto __pyx_L5;
+  }
+  __pyx_L5:;
+
 414: 
+
 415:     if flat is not None:
+
+  /* "splitBBoxLUT.pyx":415
+ *         cdark = numpy.ascontiguousarray(dark.ravel(), dtype=numpy.float32)
+ * 
+ *     if flat is not None:             # <<<<<<<<<<<<<<
+ *         assert flat.size == size
+ *         do_flat = 1
+ */
+  __pyx_t_8 = (__pyx_v_flat != Py_None);
+  if (__pyx_t_8) {
+
 416:         assert flat.size == size
+
+    /* "splitBBoxLUT.pyx":416
+ * 
+ *     if flat is not None:
+ *         assert flat.size == size             # <<<<<<<<<<<<<<
+ *         do_flat = 1
+ *         cflat = numpy.ascontiguousarray(flat.ravel(), dtype=numpy.float32)
+ */
+    #ifndef CYTHON_WITHOUT_ASSERTIONS
+    __pyx_t_1 = PyObject_GetAttr(__pyx_v_flat, __pyx_n_s__size); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_1);
+    __pyx_t_6 = PyObject_RichCompare(__pyx_t_1, __pyx_v_size, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+    if (unlikely(!__pyx_t_8)) {
+      PyErr_SetNone(PyExc_AssertionError);
+      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    }
+    #endif
+
 417:         do_flat = 1
+
+    /* "splitBBoxLUT.pyx":417
+ *     if flat is not None:
+ *         assert flat.size == size
+ *         do_flat = 1             # <<<<<<<<<<<<<<
+ *         cflat = numpy.ascontiguousarray(flat.ravel(), dtype=numpy.float32)
+ * 
+ */
+    __pyx_v_do_flat = 1;
+
 418:         cflat = numpy.ascontiguousarray(flat.ravel(), dtype=numpy.float32)
+
+    /* "splitBBoxLUT.pyx":418
+ *         assert flat.size == size
+ *         do_flat = 1
+ *         cflat = numpy.ascontiguousarray(flat.ravel(), dtype=numpy.float32)             # <<<<<<<<<<<<<<
+ * 
+ * 
+ */
+    __pyx_t_6 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_6);
+    __pyx_t_1 = PyObject_GetAttr(__pyx_t_6, __pyx_n_s__ascontiguousarray); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+    __pyx_t_6 = PyObject_GetAttr(__pyx_v_flat, __pyx_n_s__ravel); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_6);
+    __pyx_t_5 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_5);
+    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+    __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_6);
+    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5);
+    __Pyx_GIVEREF(__pyx_t_5);
+    __pyx_t_5 = 0;
+    __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(((PyObject *)__pyx_t_5));
+    __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_4);
+    __pyx_t_2 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__float32); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_2);
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    if (PyDict_SetItem(__pyx_t_5, ((PyObject *)__pyx_n_s__dtype), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_6), ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_2);
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
+    __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
+    __pyx_v_cflat = __pyx_t_2;
+    __pyx_t_2 = 0;
+    goto __pyx_L6;
+  }
+  __pyx_L6:;
+
 419: 
+
 420: 
+
 421:     cpos0_lower = numpy.zeros(size, dtype=numpy.float32)
+
+  /* "splitBBoxLUT.pyx":421
+ * 
+ * 
+ *     cpos0_lower = numpy.zeros(size, dtype=numpy.float32)             # <<<<<<<<<<<<<<
+ *     cpos0_upper = numpy.zeros(size, dtype=numpy.float32)
+ *     pos0_min = cpos0[0]
+ */
+  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 421; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_5 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__zeros); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 421; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_5);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 421; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_INCREF(__pyx_v_size);
+  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_size);
+  __Pyx_GIVEREF(__pyx_v_size);
+  __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 421; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(((PyObject *)__pyx_t_6));
+  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 421; __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 = 421; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_4);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  if (PyDict_SetItem(__pyx_t_6, ((PyObject *)__pyx_n_s__dtype), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 421; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  __pyx_t_4 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_2), ((PyObject *)__pyx_t_6)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 421; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_4);
+  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
+  __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
+  __pyx_v_cpos0_lower = __pyx_t_4;
+  __pyx_t_4 = 0;
+
 422:     cpos0_upper = numpy.zeros(size, dtype=numpy.float32)
+
+  /* "splitBBoxLUT.pyx":422
+ * 
+ *     cpos0_lower = numpy.zeros(size, dtype=numpy.float32)
+ *     cpos0_upper = numpy.zeros(size, dtype=numpy.float32)             # <<<<<<<<<<<<<<
+ *     pos0_min = cpos0[0]
+ *     pos0_max = cpos0[0]
+ */
+  __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 422; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_4);
+  __pyx_t_6 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__zeros); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 422; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_6);
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 422; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_4);
+  __Pyx_INCREF(__pyx_v_size);
+  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_size);
+  __Pyx_GIVEREF(__pyx_v_size);
+  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 422; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
+  __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 422; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_5);
+  __pyx_t_1 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__float32); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 422; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__dtype), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 422; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_1 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 422; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
+  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
+  __pyx_v_cpos0_upper = __pyx_t_1;
+  __pyx_t_1 = 0;
+
 423:     pos0_min = cpos0[0]
+
+  /* "splitBBoxLUT.pyx":423
+ *     cpos0_lower = numpy.zeros(size, dtype=numpy.float32)
+ *     cpos0_upper = numpy.zeros(size, dtype=numpy.float32)
+ *     pos0_min = cpos0[0]             # <<<<<<<<<<<<<<
+ *     pos0_max = cpos0[0]
+ *     for idx in range(size):
+ */
+  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_cpos0, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 423; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_v_pos0_min = __pyx_t_1;
+  __pyx_t_1 = 0;
+
 424:     pos0_max = cpos0[0]
+
+  /* "splitBBoxLUT.pyx":424
+ *     cpos0_upper = numpy.zeros(size, dtype=numpy.float32)
+ *     pos0_min = cpos0[0]
+ *     pos0_max = cpos0[0]             # <<<<<<<<<<<<<<
+ *     for idx in range(size):
+ *             min0 = cpos0[idx] - dpos0[idx]
+ */
+  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_cpos0, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 424; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_v_pos0_max = __pyx_t_1;
+  __pyx_t_1 = 0;
+
 425:     for idx in range(size):
+
+  /* "splitBBoxLUT.pyx":425
+ *     pos0_min = cpos0[0]
+ *     pos0_max = cpos0[0]
+ *     for idx in range(size):             # <<<<<<<<<<<<<<
+ *             min0 = cpos0[idx] - dpos0[idx]
+ *             max0 = cpos0[idx] + dpos0[idx]
+ */
+  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 425; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_INCREF(__pyx_v_size);
+  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_size);
+  __Pyx_GIVEREF(__pyx_v_size);
+  __pyx_t_2 = PyObject_Call(__pyx_builtin_range, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 425; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
+  if (PyList_CheckExact(__pyx_t_2) || PyTuple_CheckExact(__pyx_t_2)) {
+    __pyx_t_1 = __pyx_t_2; __Pyx_INCREF(__pyx_t_1); __pyx_t_10 = 0;
+    __pyx_t_11 = NULL;
+  } else {
+    __pyx_t_10 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 425; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_1);
+    __pyx_t_11 = Py_TYPE(__pyx_t_1)->tp_iternext;
+  }
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  for (;;) {
+    if (!__pyx_t_11 && PyList_CheckExact(__pyx_t_1)) {
+      if (__pyx_t_10 >= PyList_GET_SIZE(__pyx_t_1)) break;
+      #if CYTHON_COMPILING_IN_CPYTHON
+      __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_10); __Pyx_INCREF(__pyx_t_2); __pyx_t_10++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 425; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      #else
+      __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 425; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      #endif
+    } else if (!__pyx_t_11 && PyTuple_CheckExact(__pyx_t_1)) {
+      if (__pyx_t_10 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
+      #if CYTHON_COMPILING_IN_CPYTHON
+      __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_10); __Pyx_INCREF(__pyx_t_2); __pyx_t_10++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 425; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      #else
+      __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 425; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      #endif
+    } else {
+      __pyx_t_2 = __pyx_t_11(__pyx_t_1);
+      if (unlikely(!__pyx_t_2)) {
+        if (PyErr_Occurred()) {
+          if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
+          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 425; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        }
+        break;
+      }
+      __Pyx_GOTREF(__pyx_t_2);
+    }
+    __Pyx_XDECREF(__pyx_v_idx);
+    __pyx_v_idx = __pyx_t_2;
+    __pyx_t_2 = 0;
+
 426:             min0 = cpos0[idx] - dpos0[idx]
+
+    /* "splitBBoxLUT.pyx":426
+ *     pos0_max = cpos0[0]
+ *     for idx in range(size):
+ *             min0 = cpos0[idx] - dpos0[idx]             # <<<<<<<<<<<<<<
+ *             max0 = cpos0[idx] + dpos0[idx]
+ *             cpos0_upper[idx] = max0
+ */
+    __pyx_t_2 = PyObject_GetItem(__pyx_v_cpos0, __pyx_v_idx); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 426; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_t_4 = PyObject_GetItem(__pyx_v_dpos0, __pyx_v_idx); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 426; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_4);
+    __pyx_t_6 = PyNumber_Subtract(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 426; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_6);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __Pyx_XDECREF(__pyx_v_min0);
+    __pyx_v_min0 = __pyx_t_6;
+    __pyx_t_6 = 0;
+
 427:             max0 = cpos0[idx] + dpos0[idx]
+
+    /* "splitBBoxLUT.pyx":427
+ *     for idx in range(size):
+ *             min0 = cpos0[idx] - dpos0[idx]
+ *             max0 = cpos0[idx] + dpos0[idx]             # <<<<<<<<<<<<<<
+ *             cpos0_upper[idx] = max0
+ *             cpos0_lower[idx] = min0
+ */
+    __pyx_t_6 = PyObject_GetItem(__pyx_v_cpos0, __pyx_v_idx); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 427; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_6);
+    __pyx_t_4 = PyObject_GetItem(__pyx_v_dpos0, __pyx_v_idx); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 427; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_4);
+    __pyx_t_2 = PyNumber_Add(__pyx_t_6, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 427; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_2);
+    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __Pyx_XDECREF(__pyx_v_max0);
+    __pyx_v_max0 = __pyx_t_2;
+    __pyx_t_2 = 0;
+
 428:             cpos0_upper[idx] = max0
+
+    /* "splitBBoxLUT.pyx":428
+ *             min0 = cpos0[idx] - dpos0[idx]
+ *             max0 = cpos0[idx] + dpos0[idx]
+ *             cpos0_upper[idx] = max0             # <<<<<<<<<<<<<<
+ *             cpos0_lower[idx] = min0
+ *             if max0 > pos0_max:
+ */
+    if (PyObject_SetItem(__pyx_v_cpos0_upper, __pyx_v_idx, __pyx_v_max0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 428; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+
 429:             cpos0_lower[idx] = min0
+
+    /* "splitBBoxLUT.pyx":429
+ *             max0 = cpos0[idx] + dpos0[idx]
+ *             cpos0_upper[idx] = max0
+ *             cpos0_lower[idx] = min0             # <<<<<<<<<<<<<<
+ *             if max0 > pos0_max:
+ *                 pos0_max = max0
+ */
+    if (PyObject_SetItem(__pyx_v_cpos0_lower, __pyx_v_idx, __pyx_v_min0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 429; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+
 430:             if max0 > pos0_max:
+
+    /* "splitBBoxLUT.pyx":430
+ *             cpos0_upper[idx] = max0
+ *             cpos0_lower[idx] = min0
+ *             if max0 > pos0_max:             # <<<<<<<<<<<<<<
+ *                 pos0_max = max0
+ *             if min0 < pos0_min:
+ */
+    __pyx_t_2 = PyObject_RichCompare(__pyx_v_max0, __pyx_v_pos0_max, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 430; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 430; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    if (__pyx_t_8) {
+
 431:                 pos0_max = max0
+
+      /* "splitBBoxLUT.pyx":431
+ *             cpos0_lower[idx] = min0
+ *             if max0 > pos0_max:
+ *                 pos0_max = max0             # <<<<<<<<<<<<<<
+ *             if min0 < pos0_min:
+ *                 pos0_min = min0
+ */
+      __Pyx_INCREF(__pyx_v_max0);
+      __Pyx_DECREF(__pyx_v_pos0_max);
+      __pyx_v_pos0_max = __pyx_v_max0;
+      goto __pyx_L9;
+    }
+    __pyx_L9:;
+
 432:             if min0 < pos0_min:
+
+    /* "splitBBoxLUT.pyx":432
+ *             if max0 > pos0_max:
+ *                 pos0_max = max0
+ *             if min0 < pos0_min:             # <<<<<<<<<<<<<<
+ *                 pos0_min = min0
+ * 
+ */
+    __pyx_t_2 = PyObject_RichCompare(__pyx_v_min0, __pyx_v_pos0_min, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    if (__pyx_t_8) {
+
 433:                 pos0_min = min0
+
+      /* "splitBBoxLUT.pyx":433
+ *                 pos0_max = max0
+ *             if min0 < pos0_min:
+ *                 pos0_min = min0             # <<<<<<<<<<<<<<
+ * 
+ *     if pos0Range is not None and len(pos0Range) > 1:
+ */
+      __Pyx_INCREF(__pyx_v_min0);
+      __Pyx_DECREF(__pyx_v_pos0_min);
+      __pyx_v_pos0_min = __pyx_v_min0;
+      goto __pyx_L10;
+    }
+    __pyx_L10:;
+  }
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
 434: 
+
 435:     if pos0Range is not None and len(pos0Range) > 1:
+
+  /* "splitBBoxLUT.pyx":435
+ *                 pos0_min = min0
+ * 
+ *     if pos0Range is not None and len(pos0Range) > 1:             # <<<<<<<<<<<<<<
+ *         pos0_min = min(pos0Range)
+ *         pos0_maxin = max(pos0Range)
+ */
+  __pyx_t_8 = (__pyx_v_pos0Range != Py_None);
+  if (__pyx_t_8) {
+    __pyx_t_10 = PyObject_Length(__pyx_v_pos0Range); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 435; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_3 = (__pyx_t_10 > 1);
+    __pyx_t_7 = __pyx_t_3;
+  } else {
+    __pyx_t_7 = __pyx_t_8;
+  }
+  if (__pyx_t_7) {
+
 436:         pos0_min = min(pos0Range)
+
+    /* "splitBBoxLUT.pyx":436
+ * 
+ *     if pos0Range is not None and len(pos0Range) > 1:
+ *         pos0_min = min(pos0Range)             # <<<<<<<<<<<<<<
+ *         pos0_maxin = max(pos0Range)
+ *     else:
+ */
+    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 436; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_INCREF(__pyx_v_pos0Range);
+    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_pos0Range);
+    __Pyx_GIVEREF(__pyx_v_pos0Range);
+    __pyx_t_2 = PyObject_Call(__pyx_builtin_min, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 436; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_2);
+    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
+    __Pyx_DECREF(__pyx_v_pos0_min);
+    __pyx_v_pos0_min = __pyx_t_2;
+    __pyx_t_2 = 0;
+
 437:         pos0_maxin = max(pos0Range)
+
+    /* "splitBBoxLUT.pyx":437
+ *     if pos0Range is not None and len(pos0Range) > 1:
+ *         pos0_min = min(pos0Range)
+ *         pos0_maxin = max(pos0Range)             # <<<<<<<<<<<<<<
+ *     else:
+ *         pos0_maxin = pos0_max
+ */
+    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_2);
+    __Pyx_INCREF(__pyx_v_pos0Range);
+    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_pos0Range);
+    __Pyx_GIVEREF(__pyx_v_pos0Range);
+    __pyx_t_1 = PyObject_Call(__pyx_builtin_max, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
+    __pyx_v_pos0_maxin = __pyx_t_1;
+    __pyx_t_1 = 0;
+    goto __pyx_L11;
+  }
+  /*else*/ {
+
 438:     else:
+
 439:         pos0_maxin = pos0_max
+
+    /* "splitBBoxLUT.pyx":439
+ *         pos0_maxin = max(pos0Range)
+ *     else:
+ *         pos0_maxin = pos0_max             # <<<<<<<<<<<<<<
+ *     if pos0_min < 0: pos0_min = 0
+ *     pos0_max = pos0_maxin * (1.0 + numpy.finfo(numpy.float32).eps)
+ */
+    __Pyx_INCREF(__pyx_v_pos0_max);
+    __pyx_v_pos0_maxin = __pyx_v_pos0_max;
+  }
+  __pyx_L11:;
+
 440:     if pos0_min < 0: pos0_min = 0
+
+  /* "splitBBoxLUT.pyx":440
+ *     else:
+ *         pos0_maxin = pos0_max
+ *     if pos0_min < 0: pos0_min = 0             # <<<<<<<<<<<<<<
+ *     pos0_max = pos0_maxin * (1.0 + numpy.finfo(numpy.float32).eps)
+ * 
+ */
+  __pyx_t_1 = PyObject_RichCompare(__pyx_v_pos0_min, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 440; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 440; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  if (__pyx_t_7) {
+    __Pyx_INCREF(__pyx_int_0);
+    __Pyx_DECREF(__pyx_v_pos0_min);
+    __pyx_v_pos0_min = __pyx_int_0;
+    goto __pyx_L12;
+  }
+  __pyx_L12:;
+
 441:     pos0_max = pos0_maxin * (1.0 + numpy.finfo(numpy.float32).eps)
+
+  /* "splitBBoxLUT.pyx":441
+ *         pos0_maxin = pos0_max
+ *     if pos0_min < 0: pos0_min = 0
+ *     pos0_max = pos0_maxin * (1.0 + numpy.finfo(numpy.float32).eps)             # <<<<<<<<<<<<<<
+ * 
+ *     if pos1Range is not None and len(pos1Range) > 1:
+ */
+  __pyx_t_1 = PyFloat_FromDouble(1.0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_4 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__finfo); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_4);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_6 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__float32); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_6);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_2);
+  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_6);
+  __Pyx_GIVEREF(__pyx_t_6);
+  __pyx_t_6 = 0;
+  __pyx_t_6 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_6);
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
+  __pyx_t_2 = PyObject_GetAttr(__pyx_t_6, __pyx_n_s__eps); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  __pyx_t_6 = PyNumber_Add(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_6);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_2 = PyNumber_Multiply(__pyx_v_pos0_maxin, __pyx_t_6); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  __Pyx_DECREF(__pyx_v_pos0_max);
+  __pyx_v_pos0_max = __pyx_t_2;
+  __pyx_t_2 = 0;
+
 442: 
+
 443:     if pos1Range is not None and len(pos1Range) > 1:
+
+  /* "splitBBoxLUT.pyx":443
+ *     pos0_max = pos0_maxin * (1.0 + 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_7 = (__pyx_v_pos1Range != Py_None);
+  if (__pyx_t_7) {
+    __pyx_t_10 = PyObject_Length(__pyx_v_pos1Range); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_8 = (__pyx_t_10 > 1);
+    __pyx_t_3 = __pyx_t_8;
+  } else {
+    __pyx_t_3 = __pyx_t_7;
+  }
+  if (__pyx_t_3) {
+
 444:         assert pos1.size == size
+
+    /* "splitBBoxLUT.pyx":444
+ * 
+ *     if pos1Range is not None and len(pos1Range) > 1:
+ *         assert pos1.size == size             # <<<<<<<<<<<<<<
+ *         assert delta_pos1.size == size
+ *         check_pos1 = 1
+ */
+    #ifndef CYTHON_WITHOUT_ASSERTIONS
+    __pyx_t_2 = PyObject_GetAttr(__pyx_v_pos1, __pyx_n_s__size); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_t_6 = PyObject_RichCompare(__pyx_t_2, __pyx_v_size, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+    if (unlikely(!__pyx_t_3)) {
+      PyErr_SetNone(PyExc_AssertionError);
+      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    }
+    #endif
+
 445:         assert delta_pos1.size == size
+
+    /* "splitBBoxLUT.pyx":445
+ *     if pos1Range is not None and len(pos1Range) > 1:
+ *         assert pos1.size == size
+ *         assert delta_pos1.size == size             # <<<<<<<<<<<<<<
+ *         check_pos1 = 1
+ *         cpos1 = numpy.ascontiguousarray(pos1.ravel(), dtype=numpy.float32)
+ */
+    #ifndef CYTHON_WITHOUT_ASSERTIONS
+    __pyx_t_6 = PyObject_GetAttr(__pyx_v_delta_pos1, __pyx_n_s__size); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_6);
+    __pyx_t_2 = PyObject_RichCompare(__pyx_t_6, __pyx_v_size, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    if (unlikely(!__pyx_t_3)) {
+      PyErr_SetNone(PyExc_AssertionError);
+      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    }
+    #endif
+
 446:         check_pos1 = 1
+
+    /* "splitBBoxLUT.pyx":446
+ *         assert pos1.size == size
+ *         assert delta_pos1.size == size
+ *         check_pos1 = 1             # <<<<<<<<<<<<<<
+ *         cpos1 = numpy.ascontiguousarray(pos1.ravel(), dtype=numpy.float32)
+ *         dpos1 = numpy.ascontiguousarray(delta_pos1.ravel(), dtype=numpy.float32)
+ */
+    __pyx_v_check_pos1 = 1;
+
 447:         cpos1 = numpy.ascontiguousarray(pos1.ravel(), dtype=numpy.float32)
+
+    /* "splitBBoxLUT.pyx":447
+ *         assert delta_pos1.size == size
+ *         check_pos1 = 1
+ *         cpos1 = numpy.ascontiguousarray(pos1.ravel(), dtype=numpy.float32)             # <<<<<<<<<<<<<<
+ *         dpos1 = numpy.ascontiguousarray(delta_pos1.ravel(), dtype=numpy.float32)
+ *         pos1_min = min(pos1Range)
+ */
+    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 447; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_t_6 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__ascontiguousarray); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 447; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_6);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __pyx_t_2 = PyObject_GetAttr(__pyx_v_pos1, __pyx_n_s__ravel); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 447; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 447; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 447; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_2);
+    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
+    __Pyx_GIVEREF(__pyx_t_1);
+    __pyx_t_1 = 0;
+    __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 447; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(((PyObject *)__pyx_t_1));
+    __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 447; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_4);
+    __pyx_t_5 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__float32); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 447; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_5);
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__dtype), __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 447; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    __pyx_t_5 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_t_2), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 447; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_5);
+    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+    __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
+    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
+    __pyx_v_cpos1 = __pyx_t_5;
+    __pyx_t_5 = 0;
+
 448:         dpos1 = numpy.ascontiguousarray(delta_pos1.ravel(), dtype=numpy.float32)
+
+    /* "splitBBoxLUT.pyx":448
+ *         check_pos1 = 1
+ *         cpos1 = numpy.ascontiguousarray(pos1.ravel(), dtype=numpy.float32)
+ *         dpos1 = numpy.ascontiguousarray(delta_pos1.ravel(), dtype=numpy.float32)             # <<<<<<<<<<<<<<
+ *         pos1_min = min(pos1Range)
+ *         pos1_maxin = max(pos1Range)
+ */
+    __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 448; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_5);
+    __pyx_t_1 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__ascontiguousarray); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 448; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    __pyx_t_5 = PyObject_GetAttr(__pyx_v_delta_pos1, __pyx_n_s__ravel); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 448; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_5);
+    __pyx_t_2 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 448; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_2);
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 448; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_5);
+    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2);
+    __Pyx_GIVEREF(__pyx_t_2);
+    __pyx_t_2 = 0;
+    __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 448; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
+    __pyx_t_6 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 448; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_6);
+    __pyx_t_4 = PyObject_GetAttr(__pyx_t_6, __pyx_n_s__float32); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 448; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_4);
+    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+    if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__dtype), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 448; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_5), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 448; __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_5)); __pyx_t_5 = 0;
+    __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
+    __pyx_v_dpos1 = __pyx_t_4;
+    __pyx_t_4 = 0;
+
 449:         pos1_min = min(pos1Range)
+
+    /* "splitBBoxLUT.pyx":449
+ *         cpos1 = numpy.ascontiguousarray(pos1.ravel(), dtype=numpy.float32)
+ *         dpos1 = numpy.ascontiguousarray(delta_pos1.ravel(), dtype=numpy.float32)
+ *         pos1_min = min(pos1Range)             # <<<<<<<<<<<<<<
+ *         pos1_maxin = max(pos1Range)
+ *         pos1_max = pos1_maxin * (1 + numpy.finfo(numpy.float32).eps)
+ */
+    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_4);
+    __Pyx_INCREF(__pyx_v_pos1Range);
+    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_pos1Range);
+    __Pyx_GIVEREF(__pyx_v_pos1Range);
+    __pyx_t_2 = PyObject_Call(__pyx_builtin_min, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_2);
+    __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
+    __pyx_v_pos1_min = __pyx_t_2;
+    __pyx_t_2 = 0;
+
 450:         pos1_maxin = max(pos1Range)
+
+    /* "splitBBoxLUT.pyx":450
+ *         dpos1 = numpy.ascontiguousarray(delta_pos1.ravel(), dtype=numpy.float32)
+ *         pos1_min = min(pos1Range)
+ *         pos1_maxin = max(pos1Range)             # <<<<<<<<<<<<<<
+ *         pos1_max = pos1_maxin * (1 + numpy.finfo(numpy.float32).eps)
+ * 
+ */
+    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_2);
+    __Pyx_INCREF(__pyx_v_pos1Range);
+    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_pos1Range);
+    __Pyx_GIVEREF(__pyx_v_pos1Range);
+    __pyx_t_4 = PyObject_Call(__pyx_builtin_max, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_4);
+    __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
+    __pyx_v_pos1_maxin = __pyx_t_4;
+    __pyx_t_4 = 0;
+
 451:         pos1_max = pos1_maxin * (1 + numpy.finfo(numpy.float32).eps)
+
+    /* "splitBBoxLUT.pyx":451
+ *         pos1_min = min(pos1Range)
+ *         pos1_maxin = max(pos1Range)
+ *         pos1_max = pos1_maxin * (1 + numpy.finfo(numpy.float32).eps)             # <<<<<<<<<<<<<<
+ * 
+ *     delta = (pos0_max - pos0_min) / ((bins))
+ */
+    __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_4);
+    __pyx_t_2 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__finfo); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_2);
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_4);
+    __pyx_t_5 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__float32); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_5);
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_4);
+    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
+    __Pyx_GIVEREF(__pyx_t_5);
+    __pyx_t_5 = 0;
+    __pyx_t_5 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_5);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
+    __pyx_t_4 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__eps); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_4);
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    __pyx_t_5 = PyNumber_Add(__pyx_int_1, __pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_5);
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __pyx_t_4 = PyNumber_Multiply(__pyx_v_pos1_maxin, __pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_4);
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    __pyx_v_pos1_max = __pyx_t_4;
+    __pyx_t_4 = 0;
+    goto __pyx_L13;
+  }
+  __pyx_L13:;
+
 452: 
+
 453:     delta = (pos0_max - pos0_min) / ((bins))
+
+  /* "splitBBoxLUT.pyx":453
+ *         pos1_max = pos1_maxin * (1 + numpy.finfo(numpy.float32).eps)
+ * 
+ *     delta = (pos0_max - pos0_min) / ((bins))             # <<<<<<<<<<<<<<
+ * 
+ *     for i in range(bins):
+ */
+  __pyx_t_4 = PyNumber_Subtract(__pyx_v_pos0_max, __pyx_v_pos0_min); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_4);
+  __pyx_t_5 = __Pyx_PyNumber_Divide(__pyx_t_4, __pyx_v_bins); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_5);
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  __pyx_v_delta = __pyx_t_5;
+  __pyx_t_5 = 0;
+
 454: 
+
 455:     for i in range(bins):
+
+  /* "splitBBoxLUT.pyx":455
+ *     delta = (pos0_max - pos0_min) / ((bins))
+ * 
+ *     for i in range(bins):             # <<<<<<<<<<<<<<
+ *                 outPos[i] = pos0_min + (0.5 + i) * delta
+ * 
+ */
+  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 455; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_5);
+  __Pyx_INCREF(__pyx_v_bins);
+  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_bins);
+  __Pyx_GIVEREF(__pyx_v_bins);
+  __pyx_t_4 = PyObject_Call(__pyx_builtin_range, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 455; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_4);
+  __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
+  if (PyList_CheckExact(__pyx_t_4) || PyTuple_CheckExact(__pyx_t_4)) {
+    __pyx_t_5 = __pyx_t_4; __Pyx_INCREF(__pyx_t_5); __pyx_t_10 = 0;
+    __pyx_t_11 = NULL;
+  } else {
+    __pyx_t_10 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 455; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_5);
+    __pyx_t_11 = Py_TYPE(__pyx_t_5)->tp_iternext;
+  }
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  for (;;) {
+    if (!__pyx_t_11 && PyList_CheckExact(__pyx_t_5)) {
+      if (__pyx_t_10 >= PyList_GET_SIZE(__pyx_t_5)) break;
+      #if CYTHON_COMPILING_IN_CPYTHON
+      __pyx_t_4 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_10); __Pyx_INCREF(__pyx_t_4); __pyx_t_10++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 455; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      #else
+      __pyx_t_4 = PySequence_ITEM(__pyx_t_5, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 455; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      #endif
+    } else if (!__pyx_t_11 && PyTuple_CheckExact(__pyx_t_5)) {
+      if (__pyx_t_10 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
+      #if CYTHON_COMPILING_IN_CPYTHON
+      __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_10); __Pyx_INCREF(__pyx_t_4); __pyx_t_10++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 455; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      #else
+      __pyx_t_4 = PySequence_ITEM(__pyx_t_5, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 455; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      #endif
+    } else {
+      __pyx_t_4 = __pyx_t_11(__pyx_t_5);
+      if (unlikely(!__pyx_t_4)) {
+        if (PyErr_Occurred()) {
+          if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
+          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 455; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        }
+        break;
+      }
+      __Pyx_GOTREF(__pyx_t_4);
+    }
+    __Pyx_XDECREF(__pyx_v_i);
+    __pyx_v_i = __pyx_t_4;
+    __pyx_t_4 = 0;
+
 456:                 outPos[i] = pos0_min + (0.5 + i) * delta
+
+    /* "splitBBoxLUT.pyx":456
+ * 
+ *     for i in range(bins):
+ *                 outPos[i] = pos0_min + (0.5 + i) * delta             # <<<<<<<<<<<<<<
+ * 
+ *     for idx in range(size):
+ */
+    __pyx_t_4 = PyFloat_FromDouble(0.5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_4);
+    __pyx_t_2 = PyNumber_Add(__pyx_t_4, __pyx_v_i); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_2);
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __pyx_t_4 = PyNumber_Multiply(__pyx_t_2, __pyx_v_delta); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_4);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __pyx_t_2 = PyNumber_Add(__pyx_v_pos0_min, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_2);
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    if (PyObject_SetItem(__pyx_v_outPos, __pyx_v_i, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  }
+  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+
 457: 
+
 458:     for idx in range(size):
+
+  /* "splitBBoxLUT.pyx":458
+ *                 outPos[i] = pos0_min + (0.5 + i) * delta
+ * 
+ *     for idx in range(size):             # <<<<<<<<<<<<<<
+ *             if (check_mask) and (cmask[idx]):
+ *                 continue
+ */
+  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_5);
+  __Pyx_INCREF(__pyx_v_size);
+  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_size);
+  __Pyx_GIVEREF(__pyx_v_size);
+  __pyx_t_2 = PyObject_Call(__pyx_builtin_range, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
+  if (PyList_CheckExact(__pyx_t_2) || PyTuple_CheckExact(__pyx_t_2)) {
+    __pyx_t_5 = __pyx_t_2; __Pyx_INCREF(__pyx_t_5); __pyx_t_10 = 0;
+    __pyx_t_11 = NULL;
+  } else {
+    __pyx_t_10 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_5);
+    __pyx_t_11 = Py_TYPE(__pyx_t_5)->tp_iternext;
+  }
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  for (;;) {
+    if (!__pyx_t_11 && PyList_CheckExact(__pyx_t_5)) {
+      if (__pyx_t_10 >= PyList_GET_SIZE(__pyx_t_5)) break;
+      #if CYTHON_COMPILING_IN_CPYTHON
+      __pyx_t_2 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_10); __Pyx_INCREF(__pyx_t_2); __pyx_t_10++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      #else
+      __pyx_t_2 = PySequence_ITEM(__pyx_t_5, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      #endif
+    } else if (!__pyx_t_11 && PyTuple_CheckExact(__pyx_t_5)) {
+      if (__pyx_t_10 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
+      #if CYTHON_COMPILING_IN_CPYTHON
+      __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_10); __Pyx_INCREF(__pyx_t_2); __pyx_t_10++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      #else
+      __pyx_t_2 = PySequence_ITEM(__pyx_t_5, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      #endif
+    } else {
+      __pyx_t_2 = __pyx_t_11(__pyx_t_5);
+      if (unlikely(!__pyx_t_2)) {
+        if (PyErr_Occurred()) {
+          if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
+          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        }
+        break;
+      }
+      __Pyx_GOTREF(__pyx_t_2);
+    }
+    __Pyx_XDECREF(__pyx_v_idx);
+    __pyx_v_idx = __pyx_t_2;
+    __pyx_t_2 = 0;
+
 459:             if (check_mask) and (cmask[idx]):
+
+    /* "splitBBoxLUT.pyx":459
+ * 
+ *     for idx in range(size):
+ *             if (check_mask) and (cmask[idx]):             # <<<<<<<<<<<<<<
+ *                 continue
+ * 
+ */
+    if (__pyx_v_check_mask) {
+      if (unlikely(!__pyx_v_cmask)) { __Pyx_RaiseUnboundLocalError("cmask"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
+      __pyx_t_2 = PyObject_GetItem(__pyx_v_cmask, __pyx_v_idx); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_2);
+      __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+      __pyx_t_7 = __pyx_t_3;
+    } else {
+      __pyx_t_7 = __pyx_v_check_mask;
+    }
+    if (__pyx_t_7) {
+
 460:                 continue
+
+      /* "splitBBoxLUT.pyx":460
+ *     for idx in range(size):
+ *             if (check_mask) and (cmask[idx]):
+ *                 continue             # <<<<<<<<<<<<<<
+ * 
+ *             data = cdata[idx]
+ */
+      goto __pyx_L16_continue;
+      goto __pyx_L18;
+    }
+    __pyx_L18:;
+
 461: 
+
 462:             data = cdata[idx]
+
+    /* "splitBBoxLUT.pyx":462
+ *                 continue
+ * 
+ *             data = cdata[idx]             # <<<<<<<<<<<<<<
+ *             if check_dummy and (fabs(data - cdummy) <= ddummy):
+ *                 continue
+ */
+    __pyx_t_2 = PyObject_GetItem(__pyx_v_cdata, __pyx_v_idx); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_2);
+    __Pyx_XDECREF(__pyx_v_data);
+    __pyx_v_data = __pyx_t_2;
+    __pyx_t_2 = 0;
+
 463:             if check_dummy and (fabs(data - cdummy) <= ddummy):
+
+    /* "splitBBoxLUT.pyx":463
+ * 
+ *             data = cdata[idx]
+ *             if check_dummy and (fabs(data - cdummy) <= ddummy):             # <<<<<<<<<<<<<<
+ *                 continue
+ * 
+ */
+    if (__pyx_v_check_dummy) {
+      __pyx_t_2 = PyFloat_FromDouble(__pyx_v_cdummy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 463; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_2);
+      __pyx_t_4 = PyNumber_Subtract(__pyx_v_data, __pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 463; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_4);
+      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+      __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_9 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 463; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      __pyx_t_7 = (fabs(__pyx_t_9) <= __pyx_v_ddummy);
+      __pyx_t_3 = __pyx_t_7;
+    } else {
+      __pyx_t_3 = __pyx_v_check_dummy;
+    }
+    if (__pyx_t_3) {
+
 464:                 continue
+
+      /* "splitBBoxLUT.pyx":464
+ *             data = cdata[idx]
+ *             if check_dummy and (fabs(data - cdummy) <= ddummy):
+ *                 continue             # <<<<<<<<<<<<<<
+ * 
+ *             min0 = cpos0_lower[idx]
+ */
+      goto __pyx_L16_continue;
+      goto __pyx_L19;
+    }
+    __pyx_L19:;
+
 465: 
+
 466:             min0 = cpos0_lower[idx]
+
+    /* "splitBBoxLUT.pyx":466
+ *                 continue
+ * 
+ *             min0 = cpos0_lower[idx]             # <<<<<<<<<<<<<<
+ *             max0 = cpos0_upper[idx]
+ * 
+ */
+    __pyx_t_4 = PyObject_GetItem(__pyx_v_cpos0_lower, __pyx_v_idx); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_4);
+    __Pyx_XDECREF(__pyx_v_min0);
+    __pyx_v_min0 = __pyx_t_4;
+    __pyx_t_4 = 0;
+
 467:             max0 = cpos0_upper[idx]
+
+    /* "splitBBoxLUT.pyx":467
+ * 
+ *             min0 = cpos0_lower[idx]
+ *             max0 = cpos0_upper[idx]             # <<<<<<<<<<<<<<
+ * 
+ *             if check_pos1 and (((cpos1[idx] + dpos1[idx]) < pos1_min) or ((cpos1[idx] - dpos1[idx]) > pos1_max)):
+ */
+    __pyx_t_4 = PyObject_GetItem(__pyx_v_cpos0_upper, __pyx_v_idx); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 467; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_4);
+    __Pyx_XDECREF(__pyx_v_max0);
+    __pyx_v_max0 = __pyx_t_4;
+    __pyx_t_4 = 0;
+
 468: 
+
 469:             if check_pos1 and (((cpos1[idx] + dpos1[idx]) < pos1_min) or ((cpos1[idx] - dpos1[idx]) > pos1_max)):
+
+    /* "splitBBoxLUT.pyx":469
+ *             max0 = cpos0_upper[idx]
+ * 
+ *             if check_pos1 and (((cpos1[idx] + dpos1[idx]) < pos1_min) or ((cpos1[idx] - dpos1[idx]) > pos1_max)):             # <<<<<<<<<<<<<<
+ *                     continue
+ * 
+ */
+    if (__pyx_v_check_pos1) {
+      if (unlikely(!__pyx_v_cpos1)) { __Pyx_RaiseUnboundLocalError("cpos1"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
+      __pyx_t_4 = PyObject_GetItem(__pyx_v_cpos1, __pyx_v_idx); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_4);
+      if (unlikely(!__pyx_v_dpos1)) { __Pyx_RaiseUnboundLocalError("dpos1"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
+      __pyx_t_2 = PyObject_GetItem(__pyx_v_dpos1, __pyx_v_idx); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_2);
+      __pyx_t_1 = PyNumber_Add(__pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 469; __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_2); __pyx_t_2 = 0;
+      if (unlikely(!__pyx_v_pos1_min)) { __Pyx_RaiseUnboundLocalError("pos1_min"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
+      __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_v_pos1_min, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+      if (!__pyx_t_3) {
+        __pyx_t_2 = PyObject_GetItem(__pyx_v_cpos1, __pyx_v_idx); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __Pyx_GOTREF(__pyx_t_2);
+        __pyx_t_1 = PyObject_GetItem(__pyx_v_dpos1, __pyx_v_idx); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __Pyx_GOTREF(__pyx_t_1);
+        __pyx_t_4 = PyNumber_Subtract(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __Pyx_GOTREF(__pyx_t_4);
+        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+        if (unlikely(!__pyx_v_pos1_max)) { __Pyx_RaiseUnboundLocalError("pos1_max"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
+        __pyx_t_1 = PyObject_RichCompare(__pyx_t_4, __pyx_v_pos1_max, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+        __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+        __pyx_t_8 = __pyx_t_7;
+      } else {
+        __pyx_t_8 = __pyx_t_3;
+      }
+      __pyx_t_3 = __pyx_t_8;
+    } else {
+      __pyx_t_3 = __pyx_v_check_pos1;
+    }
+    if (__pyx_t_3) {
+
 470:                     continue
+
+      /* "splitBBoxLUT.pyx":470
+ * 
+ *             if check_pos1 and (((cpos1[idx] + dpos1[idx]) < pos1_min) or ((cpos1[idx] - dpos1[idx]) > pos1_max)):
+ *                     continue             # <<<<<<<<<<<<<<
+ * 
+ *             fbin0_min = getBinNr(min0, pos0_min, delta)
+ */
+      goto __pyx_L16_continue;
+      goto __pyx_L20;
+    }
+    __pyx_L20:;
+
 471: 
+
 472:             fbin0_min = getBinNr(min0, pos0_min, delta)
+
+    /* "splitBBoxLUT.pyx":472
+ *                     continue
+ * 
+ *             fbin0_min = getBinNr(min0, pos0_min, delta)             # <<<<<<<<<<<<<<
+ *             fbin0_max = getBinNr(max0, pos0_min, delta)
+ *             bin0_min = <int> (fbin0_min)
+ */
+    __pyx_t_12 = __pyx_PyFloat_AsFloat(__pyx_v_min0); if (unlikely((__pyx_t_12 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 472; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_13 = __pyx_PyFloat_AsFloat(__pyx_v_pos0_min); if (unlikely((__pyx_t_13 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 472; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_14 = __pyx_PyFloat_AsFloat(__pyx_v_delta); if (unlikely((__pyx_t_14 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 472; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_1 = PyFloat_FromDouble(__pyx_f_12splitBBoxLUT_getBinNr(__pyx_t_12, __pyx_t_13, __pyx_t_14)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 472; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_XDECREF(__pyx_v_fbin0_min);
+    __pyx_v_fbin0_min = __pyx_t_1;
+    __pyx_t_1 = 0;
+
 473:             fbin0_max = getBinNr(max0, pos0_min, delta)
+
+    /* "splitBBoxLUT.pyx":473
+ * 
+ *             fbin0_min = getBinNr(min0, pos0_min, delta)
+ *             fbin0_max = getBinNr(max0, pos0_min, delta)             # <<<<<<<<<<<<<<
+ *             bin0_min = <int> (fbin0_min)
+ *             bin0_max = <int> (fbin0_max)
+ */
+    __pyx_t_14 = __pyx_PyFloat_AsFloat(__pyx_v_max0); if (unlikely((__pyx_t_14 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 473; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_13 = __pyx_PyFloat_AsFloat(__pyx_v_pos0_min); if (unlikely((__pyx_t_13 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 473; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_12 = __pyx_PyFloat_AsFloat(__pyx_v_delta); if (unlikely((__pyx_t_12 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 473; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_1 = PyFloat_FromDouble(__pyx_f_12splitBBoxLUT_getBinNr(__pyx_t_14, __pyx_t_13, __pyx_t_12)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 473; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_XDECREF(__pyx_v_fbin0_max);
+    __pyx_v_fbin0_max = __pyx_t_1;
+    __pyx_t_1 = 0;
+
 474:             bin0_min = <int> (fbin0_min)
+
+    /* "splitBBoxLUT.pyx":474
+ *             fbin0_min = getBinNr(min0, pos0_min, delta)
+ *             fbin0_max = getBinNr(max0, pos0_min, delta)
+ *             bin0_min = <int> (fbin0_min)             # <<<<<<<<<<<<<<
+ *             bin0_max = <int> (fbin0_max)
+ * 
+ */
+    __pyx_t_15 = __Pyx_PyInt_AsInt(__pyx_v_fbin0_min); if (unlikely((__pyx_t_15 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_1 = PyInt_FromLong(((int)__pyx_t_15)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_XDECREF(__pyx_v_bin0_min);
+    __pyx_v_bin0_min = __pyx_t_1;
+    __pyx_t_1 = 0;
+
 475:             bin0_max = <int> (fbin0_max)
+
+    /* "splitBBoxLUT.pyx":475
+ *             fbin0_max = getBinNr(max0, pos0_min, delta)
+ *             bin0_min = <int> (fbin0_min)
+ *             bin0_max = <int> (fbin0_max)             # <<<<<<<<<<<<<<
+ * 
+ *             if (bin0_max < 0) or (bin0_min >= bins):
+ */
+    __pyx_t_15 = __Pyx_PyInt_AsInt(__pyx_v_fbin0_max); if (unlikely((__pyx_t_15 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_1 = PyInt_FromLong(((int)__pyx_t_15)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_XDECREF(__pyx_v_bin0_max);
+    __pyx_v_bin0_max = __pyx_t_1;
+    __pyx_t_1 = 0;
+
 476: 
+
 477:             if (bin0_max < 0) or (bin0_min >= bins):
+
+    /* "splitBBoxLUT.pyx":477
+ *             bin0_max = <int> (fbin0_max)
+ * 
+ *             if (bin0_max < 0) or (bin0_min >= bins):             # <<<<<<<<<<<<<<
+ *                 continue
+ *             if bin0_max >= bins:
+ */
+    __pyx_t_1 = PyObject_RichCompare(__pyx_v_bin0_max, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 477; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 477; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    if (!__pyx_t_3) {
+      __pyx_t_1 = PyObject_RichCompare(__pyx_v_bin0_min, __pyx_v_bins, Py_GE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 477; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 477; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      __pyx_t_7 = __pyx_t_8;
+    } else {
+      __pyx_t_7 = __pyx_t_3;
+    }
+    if (__pyx_t_7) {
+
 478:                 continue
+
+      /* "splitBBoxLUT.pyx":478
+ * 
+ *             if (bin0_max < 0) or (bin0_min >= bins):
+ *                 continue             # <<<<<<<<<<<<<<
+ *             if bin0_max >= bins:
+ *                 bin0_max = bins - 1
+ */
+      goto __pyx_L16_continue;
+      goto __pyx_L21;
+    }
+    __pyx_L21:;
+
 479:             if bin0_max >= bins:
+
+    /* "splitBBoxLUT.pyx":479
+ *             if (bin0_max < 0) or (bin0_min >= bins):
+ *                 continue
+ *             if bin0_max >= bins:             # <<<<<<<<<<<<<<
+ *                 bin0_max = bins - 1
+ *             if  bin0_min < 0:
+ */
+    __pyx_t_1 = PyObject_RichCompare(__pyx_v_bin0_max, __pyx_v_bins, Py_GE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 479; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 479; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    if (__pyx_t_7) {
+
 480:                 bin0_max = bins - 1
+
+      /* "splitBBoxLUT.pyx":480
+ *                 continue
+ *             if bin0_max >= bins:
+ *                 bin0_max = bins - 1             # <<<<<<<<<<<<<<
+ *             if  bin0_min < 0:
+ *                 bin0_min = 0
+ */
+      __pyx_t_1 = PyNumber_Subtract(__pyx_v_bins, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_1);
+      __Pyx_DECREF(__pyx_v_bin0_max);
+      __pyx_v_bin0_max = __pyx_t_1;
+      __pyx_t_1 = 0;
+      goto __pyx_L22;
+    }
+    __pyx_L22:;
+
 481:             if  bin0_min < 0:
+
+    /* "splitBBoxLUT.pyx":481
+ *             if bin0_max >= bins:
+ *                 bin0_max = bins - 1
+ *             if  bin0_min < 0:             # <<<<<<<<<<<<<<
+ *                 bin0_min = 0
+ * 
+ */
+    __pyx_t_1 = PyObject_RichCompare(__pyx_v_bin0_min, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 481; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 481; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    if (__pyx_t_7) {
+
 482:                 bin0_min = 0
+
+      /* "splitBBoxLUT.pyx":482
+ *                 bin0_max = bins - 1
+ *             if  bin0_min < 0:
+ *                 bin0_min = 0             # <<<<<<<<<<<<<<
+ * 
+ *             if do_dark:
+ */
+      __Pyx_INCREF(__pyx_int_0);
+      __Pyx_DECREF(__pyx_v_bin0_min);
+      __pyx_v_bin0_min = __pyx_int_0;
+      goto __pyx_L23;
+    }
+    __pyx_L23:;
+
 483: 
+
 484:             if do_dark:
+
+    /* "splitBBoxLUT.pyx":484
+ *                 bin0_min = 0
+ * 
+ *             if do_dark:             # <<<<<<<<<<<<<<
+ *                 data -= cdark[idx]
+ *             if do_flat:
+ */
+    if (__pyx_v_do_dark) {
+
 485:                 data -= cdark[idx]
+
+      /* "splitBBoxLUT.pyx":485
+ * 
+ *             if do_dark:
+ *                 data -= cdark[idx]             # <<<<<<<<<<<<<<
+ *             if do_flat:
+ *                 data /= cflat[idx]
+ */
+      if (unlikely(!__pyx_v_cdark)) { __Pyx_RaiseUnboundLocalError("cdark"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
+      __pyx_t_1 = PyObject_GetItem(__pyx_v_cdark, __pyx_v_idx); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_1);
+      __pyx_t_4 = PyNumber_InPlaceSubtract(__pyx_v_data, __pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_4);
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      __Pyx_DECREF(__pyx_v_data);
+      __pyx_v_data = __pyx_t_4;
+      __pyx_t_4 = 0;
+      goto __pyx_L24;
+    }
+    __pyx_L24:;
+
 486:             if do_flat:
+
+    /* "splitBBoxLUT.pyx":486
+ *             if do_dark:
+ *                 data -= cdark[idx]
+ *             if do_flat:             # <<<<<<<<<<<<<<
+ *                 data /= cflat[idx]
+ * 
+ */
+    if (__pyx_v_do_flat) {
+
 487:                 data /= cflat[idx]
+
+      /* "splitBBoxLUT.pyx":487
+ *                 data -= cdark[idx]
+ *             if do_flat:
+ *                 data /= cflat[idx]             # <<<<<<<<<<<<<<
+ * 
+ *             if bin0_min == bin0_max:
+ */
+      if (unlikely(!__pyx_v_cflat)) { __Pyx_RaiseUnboundLocalError("cflat"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 487; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
+      __pyx_t_4 = PyObject_GetItem(__pyx_v_cflat, __pyx_v_idx); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 487; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_4);
+      __pyx_t_1 = __Pyx_PyNumber_InPlaceDivide(__pyx_v_data, __pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 487; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_1);
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      __Pyx_DECREF(__pyx_v_data);
+      __pyx_v_data = __pyx_t_1;
+      __pyx_t_1 = 0;
+      goto __pyx_L25;
+    }
+    __pyx_L25:;
+
 488: 
+
 489:             if bin0_min == bin0_max:
+
+    /* "splitBBoxLUT.pyx":489
+ *                 data /= cflat[idx]
+ * 
+ *             if bin0_min == bin0_max:             # <<<<<<<<<<<<<<
+ *                 #All pixel is within a single bin
+ *                 outCount[bin0_min] += 1.0
+ */
+    __pyx_t_1 = PyObject_RichCompare(__pyx_v_bin0_min, __pyx_v_bin0_max, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 489; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 489; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    if (__pyx_t_7) {
+
 490:                 #All pixel is within a single bin
+
 491:                 outCount[bin0_min] += 1.0
+
+      /* "splitBBoxLUT.pyx":491
+ *             if bin0_min == bin0_max:
+ *                 #All pixel is within a single bin
+ *                 outCount[bin0_min] += 1.0             # <<<<<<<<<<<<<<
+ *                 outData[bin0_min] += data
+ *                 outMax[bin0_min] += 1
+ */
+      __Pyx_INCREF(__pyx_v_bin0_min);
+      __pyx_t_1 = __pyx_v_bin0_min;
+      __pyx_t_4 = PyObject_GetItem(__pyx_v_outCount, __pyx_t_1); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_4);
+      __pyx_t_2 = PyFloat_FromDouble(1.0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_2);
+      __pyx_t_6 = PyNumber_InPlaceAdd(__pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_6);
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+      if (PyObject_SetItem(__pyx_v_outCount, __pyx_t_1, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
 492:                 outData[bin0_min] += data
+
+      /* "splitBBoxLUT.pyx":492
+ *                 #All pixel is within a single bin
+ *                 outCount[bin0_min] += 1.0
+ *                 outData[bin0_min] += data             # <<<<<<<<<<<<<<
+ *                 outMax[bin0_min] += 1
+ * 
+ */
+      __Pyx_INCREF(__pyx_v_bin0_min);
+      __pyx_t_1 = __pyx_v_bin0_min;
+      __pyx_t_6 = PyObject_GetItem(__pyx_v_outData, __pyx_t_1); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_6);
+      __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_t_6, __pyx_v_data); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_2);
+      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+      if (PyObject_SetItem(__pyx_v_outData, __pyx_t_1, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
 493:                 outMax[bin0_min] += 1
+
+      /* "splitBBoxLUT.pyx":493
+ *                 outCount[bin0_min] += 1.0
+ *                 outData[bin0_min] += data
+ *                 outMax[bin0_min] += 1             # <<<<<<<<<<<<<<
+ * 
+ *             else: #we have pixel spliting.
+ */
+      __Pyx_INCREF(__pyx_v_bin0_min);
+      __pyx_t_1 = __pyx_v_bin0_min;
+      __pyx_t_2 = PyObject_GetItem(__pyx_v_outMax, __pyx_t_1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 493; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_2);
+      __pyx_t_6 = PyNumber_InPlaceAdd(__pyx_t_2, __pyx_int_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 493; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_6);
+      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+      if (PyObject_SetItem(__pyx_v_outMax, __pyx_t_1, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 493; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      goto __pyx_L26;
+    }
+    /*else*/ {
+
 494: 
+
 495:             else: #we have pixel spliting.
+
 496:                 deltaA = 1.0 / (fbin0_max - fbin0_min)
+
+      /* "splitBBoxLUT.pyx":496
+ * 
+ *             else: #we have pixel spliting.
+ *                 deltaA = 1.0 / (fbin0_max - fbin0_min)             # <<<<<<<<<<<<<<
+ * 
+ *                 deltaL = (bin0_min + 1) - fbin0_min
+ */
+      __pyx_t_1 = PyFloat_FromDouble(1.0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 496; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_1);
+      __pyx_t_6 = PyNumber_Subtract(__pyx_v_fbin0_max, __pyx_v_fbin0_min); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 496; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_6);
+      __pyx_t_2 = __Pyx_PyNumber_Divide(__pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 496; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_2);
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+      __Pyx_XDECREF(__pyx_v_deltaA);
+      __pyx_v_deltaA = __pyx_t_2;
+      __pyx_t_2 = 0;
+
 497: 
+
 498:                 deltaL = (bin0_min + 1) - fbin0_min
+
+      /* "splitBBoxLUT.pyx":498
+ *                 deltaA = 1.0 / (fbin0_max - fbin0_min)
+ * 
+ *                 deltaL = (bin0_min + 1) - fbin0_min             # <<<<<<<<<<<<<<
+ *                 deltaR = fbin0_max - (bin0_max)
+ * 
+ */
+      __pyx_t_2 = PyNumber_Add(__pyx_v_bin0_min, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 498; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_2);
+      __pyx_t_6 = PyNumber_Subtract(__pyx_t_2, __pyx_v_fbin0_min); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 498; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_6);
+      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+      __Pyx_XDECREF(__pyx_v_deltaL);
+      __pyx_v_deltaL = __pyx_t_6;
+      __pyx_t_6 = 0;
+
 499:                 deltaR = fbin0_max - (bin0_max)
+
+      /* "splitBBoxLUT.pyx":499
+ * 
+ *                 deltaL = (bin0_min + 1) - fbin0_min
+ *                 deltaR = fbin0_max - (bin0_max)             # <<<<<<<<<<<<<<
+ * 
+ *                 outCount[bin0_min] += (deltaA * deltaL)
+ */
+      __pyx_t_6 = PyNumber_Subtract(__pyx_v_fbin0_max, __pyx_v_bin0_max); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_6);
+      __Pyx_XDECREF(__pyx_v_deltaR);
+      __pyx_v_deltaR = __pyx_t_6;
+      __pyx_t_6 = 0;
+
 500: 
+
 501:                 outCount[bin0_min] += (deltaA * deltaL)
+
+      /* "splitBBoxLUT.pyx":501
+ *                 deltaR = fbin0_max - (bin0_max)
+ * 
+ *                 outCount[bin0_min] += (deltaA * deltaL)             # <<<<<<<<<<<<<<
+ *                 outData[bin0_min] += (data * deltaA * deltaL)
+ *                 outMax[bin0_min] += 1
+ */
+      __Pyx_INCREF(__pyx_v_bin0_min);
+      __pyx_t_6 = __pyx_v_bin0_min;
+      __pyx_t_2 = PyObject_GetItem(__pyx_v_outCount, __pyx_t_6); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 501; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_2);
+      __pyx_t_1 = PyNumber_Multiply(__pyx_v_deltaA, __pyx_v_deltaL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 501; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_1);
+      __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 501; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_4);
+      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      if (PyObject_SetItem(__pyx_v_outCount, __pyx_t_6, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 501; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+
 502:                 outData[bin0_min] += (data * deltaA * deltaL)
+
+      /* "splitBBoxLUT.pyx":502
+ * 
+ *                 outCount[bin0_min] += (deltaA * deltaL)
+ *                 outData[bin0_min] += (data * deltaA * deltaL)             # <<<<<<<<<<<<<<
+ *                 outMax[bin0_min] += 1
+ * 
+ */
+      __Pyx_INCREF(__pyx_v_bin0_min);
+      __pyx_t_6 = __pyx_v_bin0_min;
+      __pyx_t_4 = PyObject_GetItem(__pyx_v_outData, __pyx_t_6); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_4);
+      __pyx_t_1 = PyNumber_Multiply(__pyx_v_data, __pyx_v_deltaA); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_1);
+      __pyx_t_2 = PyNumber_Multiply(__pyx_t_1, __pyx_v_deltaL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_2);
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 502; __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_2); __pyx_t_2 = 0;
+      if (PyObject_SetItem(__pyx_v_outData, __pyx_t_6, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+
 503:                 outMax[bin0_min] += 1
+
+      /* "splitBBoxLUT.pyx":503
+ *                 outCount[bin0_min] += (deltaA * deltaL)
+ *                 outData[bin0_min] += (data * deltaA * deltaL)
+ *                 outMax[bin0_min] += 1             # <<<<<<<<<<<<<<
+ * 
+ *                 outCount[bin0_max] += (deltaA * deltaR)
+ */
+      __Pyx_INCREF(__pyx_v_bin0_min);
+      __pyx_t_6 = __pyx_v_bin0_min;
+      __pyx_t_1 = PyObject_GetItem(__pyx_v_outMax, __pyx_t_6); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_1);
+      __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_t_1, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_2);
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      if (PyObject_SetItem(__pyx_v_outMax, __pyx_t_6, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+
 504: 
+
 505:                 outCount[bin0_max] += (deltaA * deltaR)
+
+      /* "splitBBoxLUT.pyx":505
+ *                 outMax[bin0_min] += 1
+ * 
+ *                 outCount[bin0_max] += (deltaA * deltaR)             # <<<<<<<<<<<<<<
+ *                 outData[bin0_max] += (data * deltaA * deltaR)
+ *                 outMax[bin0_max] += 1
+ */
+      __Pyx_INCREF(__pyx_v_bin0_max);
+      __pyx_t_6 = __pyx_v_bin0_max;
+      __pyx_t_2 = PyObject_GetItem(__pyx_v_outCount, __pyx_t_6); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 505; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_2);
+      __pyx_t_1 = PyNumber_Multiply(__pyx_v_deltaA, __pyx_v_deltaR); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 505; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_1);
+      __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 505; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_4);
+      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      if (PyObject_SetItem(__pyx_v_outCount, __pyx_t_6, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 505; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+
 506:                 outData[bin0_max] += (data * deltaA * deltaR)
+
+      /* "splitBBoxLUT.pyx":506
+ * 
+ *                 outCount[bin0_max] += (deltaA * deltaR)
+ *                 outData[bin0_max] += (data * deltaA * deltaR)             # <<<<<<<<<<<<<<
+ *                 outMax[bin0_max] += 1
+ *                 if bin0_min + 1 < bin0_max:
+ */
+      __Pyx_INCREF(__pyx_v_bin0_max);
+      __pyx_t_6 = __pyx_v_bin0_max;
+      __pyx_t_4 = PyObject_GetItem(__pyx_v_outData, __pyx_t_6); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 506; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_4);
+      __pyx_t_1 = PyNumber_Multiply(__pyx_v_data, __pyx_v_deltaA); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 506; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_1);
+      __pyx_t_2 = PyNumber_Multiply(__pyx_t_1, __pyx_v_deltaR); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 506; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_2);
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 506; __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_2); __pyx_t_2 = 0;
+      if (PyObject_SetItem(__pyx_v_outData, __pyx_t_6, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 506; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+
 507:                 outMax[bin0_max] += 1
+
+      /* "splitBBoxLUT.pyx":507
+ *                 outCount[bin0_max] += (deltaA * deltaR)
+ *                 outData[bin0_max] += (data * deltaA * deltaR)
+ *                 outMax[bin0_max] += 1             # <<<<<<<<<<<<<<
+ *                 if bin0_min + 1 < bin0_max:
+ *                     for i in range(bin0_min + 1, bin0_max):
+ */
+      __Pyx_INCREF(__pyx_v_bin0_max);
+      __pyx_t_6 = __pyx_v_bin0_max;
+      __pyx_t_1 = PyObject_GetItem(__pyx_v_outMax, __pyx_t_6); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 507; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_1);
+      __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_t_1, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 507; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_2);
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      if (PyObject_SetItem(__pyx_v_outMax, __pyx_t_6, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 507; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+
 508:                 if bin0_min + 1 < bin0_max:
+
+      /* "splitBBoxLUT.pyx":508
+ *                 outData[bin0_max] += (data * deltaA * deltaR)
+ *                 outMax[bin0_max] += 1
+ *                 if bin0_min + 1 < bin0_max:             # <<<<<<<<<<<<<<
+ *                     for i in range(bin0_min + 1, bin0_max):
+ *                         outCount[i] += deltaA
+ */
+      __pyx_t_6 = PyNumber_Add(__pyx_v_bin0_min, __pyx_int_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 508; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_6);
+      __pyx_t_2 = PyObject_RichCompare(__pyx_t_6, __pyx_v_bin0_max, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 508; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 508; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+      if (__pyx_t_7) {
+
 509:                     for i in range(bin0_min + 1, bin0_max):
+
+        /* "splitBBoxLUT.pyx":509
+ *                 outMax[bin0_max] += 1
+ *                 if bin0_min + 1 < bin0_max:
+ *                     for i in range(bin0_min + 1, bin0_max):             # <<<<<<<<<<<<<<
+ *                         outCount[i] += deltaA
+ *                         outData[i] += (data * deltaA)
+ */
+        __pyx_t_2 = PyNumber_Add(__pyx_v_bin0_min, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 509; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __Pyx_GOTREF(__pyx_t_2);
+        __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 509; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __Pyx_GOTREF(__pyx_t_6);
+        PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2);
+        __Pyx_GIVEREF(__pyx_t_2);
+        __Pyx_INCREF(__pyx_v_bin0_max);
+        PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_bin0_max);
+        __Pyx_GIVEREF(__pyx_v_bin0_max);
+        __pyx_t_2 = 0;
+        __pyx_t_2 = PyObject_Call(__pyx_builtin_range, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 509; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __Pyx_GOTREF(__pyx_t_2);
+        __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
+        if (PyList_CheckExact(__pyx_t_2) || PyTuple_CheckExact(__pyx_t_2)) {
+          __pyx_t_6 = __pyx_t_2; __Pyx_INCREF(__pyx_t_6); __pyx_t_16 = 0;
+          __pyx_t_17 = NULL;
+        } else {
+          __pyx_t_16 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 509; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+          __Pyx_GOTREF(__pyx_t_6);
+          __pyx_t_17 = Py_TYPE(__pyx_t_6)->tp_iternext;
+        }
+        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+        for (;;) {
+          if (!__pyx_t_17 && PyList_CheckExact(__pyx_t_6)) {
+            if (__pyx_t_16 >= PyList_GET_SIZE(__pyx_t_6)) break;
+            #if CYTHON_COMPILING_IN_CPYTHON
+            __pyx_t_2 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_16); __Pyx_INCREF(__pyx_t_2); __pyx_t_16++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 509; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+            #else
+            __pyx_t_2 = PySequence_ITEM(__pyx_t_6, __pyx_t_16); __pyx_t_16++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 509; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+            #endif
+          } else if (!__pyx_t_17 && PyTuple_CheckExact(__pyx_t_6)) {
+            if (__pyx_t_16 >= PyTuple_GET_SIZE(__pyx_t_6)) break;
+            #if CYTHON_COMPILING_IN_CPYTHON
+            __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_16); __Pyx_INCREF(__pyx_t_2); __pyx_t_16++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 509; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+            #else
+            __pyx_t_2 = PySequence_ITEM(__pyx_t_6, __pyx_t_16); __pyx_t_16++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 509; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+            #endif
+          } else {
+            __pyx_t_2 = __pyx_t_17(__pyx_t_6);
+            if (unlikely(!__pyx_t_2)) {
+              if (PyErr_Occurred()) {
+                if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
+                else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 509; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+              }
+              break;
+            }
+            __Pyx_GOTREF(__pyx_t_2);
+          }
+          __Pyx_XDECREF(__pyx_v_i);
+          __pyx_v_i = __pyx_t_2;
+          __pyx_t_2 = 0;
+
 510:                         outCount[i] += deltaA
+
+          /* "splitBBoxLUT.pyx":510
+ *                 if bin0_min + 1 < bin0_max:
+ *                     for i in range(bin0_min + 1, bin0_max):
+ *                         outCount[i] += deltaA             # <<<<<<<<<<<<<<
+ *                         outData[i] += (data * deltaA)
+ *                         outMax[i] += 1
+ */
+          __Pyx_INCREF(__pyx_v_i);
+          __pyx_t_2 = __pyx_v_i;
+          __pyx_t_1 = PyObject_GetItem(__pyx_v_outCount, __pyx_t_2); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 510; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+          __Pyx_GOTREF(__pyx_t_1);
+          __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_t_1, __pyx_v_deltaA); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 510; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+          __Pyx_GOTREF(__pyx_t_4);
+          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+          if (PyObject_SetItem(__pyx_v_outCount, __pyx_t_2, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 510; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
 511:                         outData[i] += (data * deltaA)
+
+          /* "splitBBoxLUT.pyx":511
+ *                     for i in range(bin0_min + 1, bin0_max):
+ *                         outCount[i] += deltaA
+ *                         outData[i] += (data * deltaA)             # <<<<<<<<<<<<<<
+ *                         outMax[i] += 1
+ * 
+ */
+          __Pyx_INCREF(__pyx_v_i);
+          __pyx_t_2 = __pyx_v_i;
+          __pyx_t_4 = PyObject_GetItem(__pyx_v_outData, __pyx_t_2); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 511; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+          __Pyx_GOTREF(__pyx_t_4);
+          __pyx_t_1 = PyNumber_Multiply(__pyx_v_data, __pyx_v_deltaA); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 511; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+          __Pyx_GOTREF(__pyx_t_1);
+          __pyx_t_18 = PyNumber_InPlaceAdd(__pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 511; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+          __Pyx_GOTREF(__pyx_t_18);
+          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+          if (PyObject_SetItem(__pyx_v_outData, __pyx_t_2, __pyx_t_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 511; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+          __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
+          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
 512:                         outMax[i] += 1
+
+          /* "splitBBoxLUT.pyx":512
+ *                         outCount[i] += deltaA
+ *                         outData[i] += (data * deltaA)
+ *                         outMax[i] += 1             # <<<<<<<<<<<<<<
+ * 
+ *     for i in range(bins):
+ */
+          __Pyx_INCREF(__pyx_v_i);
+          __pyx_t_2 = __pyx_v_i;
+          __pyx_t_18 = PyObject_GetItem(__pyx_v_outMax, __pyx_t_2); if (!__pyx_t_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 512; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+          __Pyx_GOTREF(__pyx_t_18);
+          __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_t_18, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 512; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+          __Pyx_GOTREF(__pyx_t_1);
+          __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
+          if (PyObject_SetItem(__pyx_v_outMax, __pyx_t_2, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 512; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+        }
+        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+        goto __pyx_L27;
+      }
+      __pyx_L27:;
+    }
+    __pyx_L26:;
+    __pyx_L16_continue:;
+  }
+  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+
 513: 
+
 514:     for i in range(bins):
+
+  /* "splitBBoxLUT.pyx":514
+ *                         outMax[i] += 1
+ * 
+ *     for i in range(bins):             # <<<<<<<<<<<<<<
+ *                 if outCount[i] > epsilon:
+ *                     outMerge[i] = (outData[i] / outCount[i])
+ */
+  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 514; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_5);
+  __Pyx_INCREF(__pyx_v_bins);
+  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_bins);
+  __Pyx_GIVEREF(__pyx_v_bins);
+  __pyx_t_6 = PyObject_Call(__pyx_builtin_range, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 514; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_6);
+  __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
+  if (PyList_CheckExact(__pyx_t_6) || PyTuple_CheckExact(__pyx_t_6)) {
+    __pyx_t_5 = __pyx_t_6; __Pyx_INCREF(__pyx_t_5); __pyx_t_10 = 0;
+    __pyx_t_11 = NULL;
+  } else {
+    __pyx_t_10 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 514; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_5);
+    __pyx_t_11 = Py_TYPE(__pyx_t_5)->tp_iternext;
+  }
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  for (;;) {
+    if (!__pyx_t_11 && PyList_CheckExact(__pyx_t_5)) {
+      if (__pyx_t_10 >= PyList_GET_SIZE(__pyx_t_5)) break;
+      #if CYTHON_COMPILING_IN_CPYTHON
+      __pyx_t_6 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_10); __Pyx_INCREF(__pyx_t_6); __pyx_t_10++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 514; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      #else
+      __pyx_t_6 = PySequence_ITEM(__pyx_t_5, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 514; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      #endif
+    } else if (!__pyx_t_11 && PyTuple_CheckExact(__pyx_t_5)) {
+      if (__pyx_t_10 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
+      #if CYTHON_COMPILING_IN_CPYTHON
+      __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_10); __Pyx_INCREF(__pyx_t_6); __pyx_t_10++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 514; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      #else
+      __pyx_t_6 = PySequence_ITEM(__pyx_t_5, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 514; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      #endif
+    } else {
+      __pyx_t_6 = __pyx_t_11(__pyx_t_5);
+      if (unlikely(!__pyx_t_6)) {
+        if (PyErr_Occurred()) {
+          if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
+          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 514; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        }
+        break;
+      }
+      __Pyx_GOTREF(__pyx_t_6);
+    }
+    __Pyx_XDECREF(__pyx_v_i);
+    __pyx_v_i = __pyx_t_6;
+    __pyx_t_6 = 0;
+
 515:                 if outCount[i] > epsilon:
+
+    /* "splitBBoxLUT.pyx":515
+ * 
+ *     for i in range(bins):
+ *                 if outCount[i] > epsilon:             # <<<<<<<<<<<<<<
+ *                     outMerge[i] = (outData[i] / outCount[i])
+ *                 else:
+ */
+    __pyx_t_6 = PyObject_GetItem(__pyx_v_outCount, __pyx_v_i); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 515; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_6);
+    __pyx_t_2 = PyFloat_FromDouble(__pyx_v_epsilon); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 515; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_t_1 = PyObject_RichCompare(__pyx_t_6, __pyx_t_2, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 515; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 515; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    if (__pyx_t_7) {
+
 516:                     outMerge[i] = (outData[i] / outCount[i])
+
+      /* "splitBBoxLUT.pyx":516
+ *     for i in range(bins):
+ *                 if outCount[i] > epsilon:
+ *                     outMerge[i] = (outData[i] / outCount[i])             # <<<<<<<<<<<<<<
+ *                 else:
+ *                     outMerge[i] = cdummy
+ */
+      __pyx_t_1 = PyObject_GetItem(__pyx_v_outData, __pyx_v_i); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 516; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_1);
+      __pyx_t_2 = PyObject_GetItem(__pyx_v_outCount, __pyx_v_i); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 516; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_2);
+      __pyx_t_6 = __Pyx_PyNumber_Divide(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 516; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_6);
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+      if (PyObject_SetItem(__pyx_v_outMerge, __pyx_v_i, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 516; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+      goto __pyx_L32;
+    }
+    /*else*/ {
+
 517:                 else:
+
 518:                     outMerge[i] = cdummy
+
+      /* "splitBBoxLUT.pyx":518
+ *                     outMerge[i] = (outData[i] / outCount[i])
+ *                 else:
+ *                     outMerge[i] = cdummy             # <<<<<<<<<<<<<<
+ * 
+ *     return  outPos, outMerge, outData, outCount, outMax
+ */
+      __pyx_t_6 = PyFloat_FromDouble(__pyx_v_cdummy); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 518; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_6);
+      if (PyObject_SetItem(__pyx_v_outMerge, __pyx_v_i, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 518; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+    }
+    __pyx_L32:;
+  }
+  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+
 519: 
+
 520:     return  outPos, outMerge, outData, outCount, outMax
+
+  /* "splitBBoxLUT.pyx":520
+ *                     outMerge[i] = cdummy
+ * 
+ *     return  outPos, outMerge, outData, outCount, outMax             # <<<<<<<<<<<<<<
+ * 
+ * 
+ */
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_5 = PyTuple_New(5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 520; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_5);
+  __Pyx_INCREF(__pyx_v_outPos);
+  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_outPos);
+  __Pyx_GIVEREF(__pyx_v_outPos);
+  __Pyx_INCREF(__pyx_v_outMerge);
+  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_outMerge);
+  __Pyx_GIVEREF(__pyx_v_outMerge);
+  __Pyx_INCREF(__pyx_v_outData);
+  PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_outData);
+  __Pyx_GIVEREF(__pyx_v_outData);
+  __Pyx_INCREF(__pyx_v_outCount);
+  PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_v_outCount);
+  __Pyx_GIVEREF(__pyx_v_outCount);
+  __Pyx_INCREF(__pyx_v_outMax);
+  PyTuple_SET_ITEM(__pyx_t_5, 4, __pyx_v_outMax);
+  __Pyx_GIVEREF(__pyx_v_outMax);
+  __pyx_r = ((PyObject *)__pyx_t_5);
+  __pyx_t_5 = 0;
+  goto __pyx_L0;
+
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_XDECREF(__pyx_t_6);
+  __Pyx_XDECREF(__pyx_t_18);
+  __Pyx_AddTraceback("splitBBoxLUT.histoBBox1d", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_v_size);
+  __Pyx_XDECREF(__pyx_v_cdata);
+  __Pyx_XDECREF(__pyx_v_cpos0);
+  __Pyx_XDECREF(__pyx_v_dpos0);
+  __Pyx_XDECREF(__pyx_v_outData);
+  __Pyx_XDECREF(__pyx_v_outCount);
+  __Pyx_XDECREF(__pyx_v_outMax);
+  __Pyx_XDECREF(__pyx_v_outMerge);
+  __Pyx_XDECREF(__pyx_v_outPos);
+  __Pyx_XDECREF(__pyx_v_cmask);
+  __Pyx_XDECREF(__pyx_v_cdark);
+  __Pyx_XDECREF(__pyx_v_cflat);
+  __Pyx_XDECREF(__pyx_v_cpos0_lower);
+  __Pyx_XDECREF(__pyx_v_cpos0_upper);
+  __Pyx_XDECREF(__pyx_v_pos0_min);
+  __Pyx_XDECREF(__pyx_v_pos0_max);
+  __Pyx_XDECREF(__pyx_v_idx);
+  __Pyx_XDECREF(__pyx_v_min0);
+  __Pyx_XDECREF(__pyx_v_max0);
+  __Pyx_XDECREF(__pyx_v_pos0_maxin);
+  __Pyx_XDECREF(__pyx_v_cpos1);
+  __Pyx_XDECREF(__pyx_v_dpos1);
+  __Pyx_XDECREF(__pyx_v_pos1_min);
+  __Pyx_XDECREF(__pyx_v_pos1_maxin);
+  __Pyx_XDECREF(__pyx_v_pos1_max);
+  __Pyx_XDECREF(__pyx_v_delta);
+  __Pyx_XDECREF(__pyx_v_i);
+  __Pyx_XDECREF(__pyx_v_data);
+  __Pyx_XDECREF(__pyx_v_fbin0_min);
+  __Pyx_XDECREF(__pyx_v_fbin0_max);
+  __Pyx_XDECREF(__pyx_v_bin0_min);
+  __Pyx_XDECREF(__pyx_v_bin0_max);
+  __Pyx_XDECREF(__pyx_v_deltaA);
+  __Pyx_XDECREF(__pyx_v_deltaL);
+  __Pyx_XDECREF(__pyx_v_deltaR);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
+static int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_5numpy_7ndarray___getbuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags));
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
 521: 
+
 522: 
+
 523: 
+
 524: 
+

diff --git a/src/splitBBoxLUT.pyx b/src/splitBBoxLUT.pyx
index e17b9694..002999b0 100644
--- a/src/splitBBoxLUT.pyx
+++ b/src/splitBBoxLUT.pyx
@@ -108,7 +108,7 @@ class HistoBBox1d(object):
             self.mask_checksum=None
         delta = (self.pos0_max - pos0_min) / (bins)
         self.delta = delta
-        self.lut_max_idx, self.lut_idx, self.lut_coef = self.calc_lut()
+        self.lut_max_idx, lut_idx, lut_coef = self.calc_lut()
         ########################################################################
         # Linspace has been discareded becaus it does calculation in double precision and all others are done in single
         #self.outPos = numpy.linspace(self.pos0_min+0.5*delta,self.pos0_max-0.5*delta, self.bins)
@@ -116,9 +116,9 @@ class HistoBBox1d(object):
         for i in prange(bins,nogil=True, schedule="static"):
             outPos[i] = pos0_min + (0.5 +< float > i) * delta
         self.outPos = outPos
-        self.lut = numpy.recarray(shape=self.lut_coef.shape,dtype=[("idx",numpy.uint32),("coef",numpy.float32)])
-        self.lut.coef = self.lut_coef
-        self.lut.idx = self.lut_idx
+        self.lut = numpy.recarray(shape=lut_coef.shape,dtype=[("idx",numpy.uint32),("coef",numpy.float32)])
+        self.lut.coef = lut_coef
+        self.lut.idx = lut_idx
 
     @cython.cdivision(True)
     @cython.boundscheck(False)