本文整理汇总了Python中pyFAI.azimuthalIntegrator.AzimuthalIntegrator.xrpd_splitPixel方法的典型用法代码示例。如果您正苦于以下问题:Python AzimuthalIntegrator.xrpd_splitPixel方法的具体用法?Python AzimuthalIntegrator.xrpd_splitPixel怎么用?Python AzimuthalIntegrator.xrpd_splitPixel使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pyFAI.azimuthalIntegrator.AzimuthalIntegrator
的用法示例。
在下文中一共展示了AzimuthalIntegrator.xrpd_splitPixel方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_azim_halfFrelon
# 需要导入模块: from pyFAI.azimuthalIntegrator import AzimuthalIntegrator [as 别名]
# 或者: from pyFAI.azimuthalIntegrator.AzimuthalIntegrator import xrpd_splitPixel [as 别名]
#.........这里部分代码省略.........
logger.info("Rwp numpy/fit2d = %.3f" % rwp)
if logger.getEffectiveLevel() == logging.DEBUG:
logger.info("Plotting results")
fig = pylab.figure()
fig.suptitle('Numpy Histogram vs Fit2D: Rwp=%.3f' % rwp)
sp = fig.add_subplot(111)
sp.plot(self.fit2d.T[0], self.fit2d.T[1], "-b", label='fit2d')
sp.plot(tth, I, "-r", label="numpy histogram")
handles, labels = sp.get_legend_handles_labels()
fig.legend(handles, labels)
fig.show()
raw_input("Press enter to quit")
assert rwp < 11
def test_cython_vs_fit2d(self):
"""
Compare cython histogram with results of fit2d
"""
# logger.info(self.ai.__repr__())
tth, I = self.ai.xrpd_cython(self.data,
len(self.fit2d), "tmp/cython.dat", correctSolidAngle=False, pixelSize=None)
# logger.info(tth)
# logger.info(I)
rwp = Rwp((tth, I), self.fit2d.T)
logger.info("Rwp cython/fit2d = %.3f" % rwp)
if logger.getEffectiveLevel() == logging.DEBUG:
logger.info("Plotting results")
fig = pylab.figure()
fig.suptitle('Cython Histogram vs Fit2D: Rwp=%.3f' % rwp)
sp = fig.add_subplot(111)
sp.plot(self.fit2d.T[0], self.fit2d.T[1], "-b", label='fit2d')
sp.plot(tth, I, "-r", label="cython")
handles, labels = sp.get_legend_handles_labels()
fig.legend(handles, labels)
fig.show()
raw_input("Press enter to quit")
assert rwp < 11
def test_cythonSP_vs_fit2d(self):
"""
Compare cython splitPixel with results of fit2d
"""
logger.info(self.ai.__repr__())
pos = self.ai.cornerArray(self.data.shape)
t0 = time.time()
logger.info("in test_cythonSP_vs_fit2d Before SP")
tth, I = self.ai.xrpd_splitPixel(self.data,
len(self.fit2d), self.tmpfiles["cythonSP"], correctSolidAngle=False)
logger.info("in test_cythonSP_vs_fit2d Before")
t1 = time.time() - t0
# logger.info(tth)
# logger.info(I)
rwp = Rwp((tth, I), self.fit2d.T)
logger.info("Rwp cythonSP(t=%.3fs)/fit2d = %.3f" % (t1, rwp))
if logger.getEffectiveLevel() == logging.DEBUG:
logger.info("Plotting results")
fig = pylab.figure()
fig.suptitle('CythonSP Histogram vs Fit2D: Rwp=%.3f' % rwp)
sp = fig.add_subplot(111)
sp.plot(self.fit2d.T[0], self.fit2d.T[1], "-b", label='fit2d')
sp.plot(tth, I, "-r", label="cython")
handles, labels = sp.get_legend_handles_labels()
fig.legend(handles, labels)
fig.show()
raw_input("Press enter to quit")
assert rwp < 11
def test_cython_vs_numpy(self):
"""
Compare cython histogram with numpy histogram
"""
# logger.info(self.ai.__repr__())
data = self.data
tth_np, I_np = self.ai.xrpd_numpy(data,
len(self.fit2d), correctSolidAngle=False)
tth_cy, I_cy = self.ai.xrpd_cython(data,
len(self.fit2d), correctSolidAngle=False)
logger.info("before xrpd_splitPixel")
tth_sp, I_sp = self.ai.xrpd_splitPixel(data,
len(self.fit2d), correctSolidAngle=False)
logger.info("After xrpd_splitPixel")
rwp = Rwp((tth_cy, I_cy), (tth_np, I_np))
logger.info("Rwp = %.3f" % rwp)
if logger.getEffectiveLevel() == logging.DEBUG:
logging.info("Plotting results")
fig = pylab.figure()
fig.suptitle('Numpy Histogram vs Cython: Rwp=%.3f' % rwp)
sp = fig.add_subplot(111)
sp.plot(self.fit2d.T[0], self.fit2d.T[1], "-y", label='fit2d')
sp.plot(tth_np, I_np, "-b", label='numpy')
sp.plot(tth_cy, I_cy , "-r", label="cython")
sp.plot(tth_sp, I_sp , "-g", label="SplitPixel")
handles, labels = sp.get_legend_handles_labels()
fig.legend(handles, labels)
fig.show()
raw_input("Press enter to quit")
assert rwp < 3