mirror of https://github.com/silx-kit/pyFAI.git
v0.7.7:
limit memory footprint (LUT is huge) reset integrator only if needed.
This commit is contained in:
parent
b8ef5715f2
commit
e7158d79a2
|
@ -1,4 +1,4 @@
|
|||
version = "0.7.6"
|
||||
version = "0.7.7"
|
||||
import sys, logging
|
||||
logging.basicConfig()
|
||||
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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 + (<float>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 + (<float>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 + (<float>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)
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -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 + (<float>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)
|
||||
|
|
Loading…
Reference in New Issue