From f4ab952bde2d4e38b7bfa833e808cce8cdaa0910 Mon Sep 17 00:00:00 2001 From: Jerome Kieffer Date: Fri, 15 Jun 2012 17:21:00 +0200 Subject: [PATCH] fix numpy based histogram ... for now --- pyFAI-src/azimuthalIntegrator.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/pyFAI-src/azimuthalIntegrator.py b/pyFAI-src/azimuthalIntegrator.py index 50f0aa5b..8fdcb9ef 100755 --- a/pyFAI-src/azimuthalIntegrator.py +++ b/pyFAI-src/azimuthalIntegrator.py @@ -217,7 +217,7 @@ class AzimuthalIntegrator(Geometry): open(filename, "w").writelines(["%s\t%s%s" % (t, i, os.linesep) for t, i in zip(tthAxis, I)]) return tthAxis, I - @timeit +# @timeit def xrpd_splitBBox(self, data, nbPt, filename=None, correctSolidAngle=True, tthRange=None, chiRange=None, mask=None, dummy=None, delta_dummy=None): """ @@ -336,7 +336,7 @@ class AzimuthalIntegrator(Geometry): #Default implementation: xrpd = xrpd_splitBBox - @timeit +# @timeit def xrpd_OpenCL(self, data, nbPt, filename=None, correctSolidAngle=True, tthRange=None, mask=None, dummy=None, delta_dummy=None, devicetype="all", useFp64=True, platformid=None, deviceid=None, safe=True): @@ -474,9 +474,9 @@ class AzimuthalIntegrator(Geometry): ref, binsChi, bins2Th = numpy.histogram2d(chi, tth, bins=list(bins)) self._nbPixCache[bins] = numpy.maximum(1.0, ref) if correctSolidAngle: - data = (data / self.solidAngleArray(data.shape))[mask] + data = (data / self.solidAngleArray(data.shape))[mask].astype("float64") else: - data = data[mask] + data = data[mask].astype("float64") if tthRange is not None: tthRange = [numpy.deg2rad(i) for i in tthRange] else: @@ -488,8 +488,9 @@ class AzimuthalIntegrator(Geometry): val, binsChi, bins2Th = numpy.histogram2d(chi, tth, bins=list(bins), - weights=data, - range=[chiRange, tthRange]) + weights=data) +# , +# range=[chiRange, tthRange]) I = val / self._nbPixCache[bins] return I, bins2Th, binsChi