本文整理汇总了Python中pyFAI.azimuthalIntegrator.AzimuthalIntegrator.xrpd方法的典型用法代码示例。如果您正苦于以下问题:Python AzimuthalIntegrator.xrpd方法的具体用法?Python AzimuthalIntegrator.xrpd怎么用?Python AzimuthalIntegrator.xrpd使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pyFAI.azimuthalIntegrator.AzimuthalIntegrator
的用法示例。
在下文中一共展示了AzimuthalIntegrator.xrpd方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Refinment2D
# 需要导入模块: from pyFAI.azimuthalIntegrator import AzimuthalIntegrator [as 别名]
# 或者: from pyFAI.azimuthalIntegrator.AzimuthalIntegrator import xrpd [as 别名]
class Refinment2D(object):
"""
refine the parameters from image itself ...
(Jerome est-ce que tu peux elaborer un petit peu plus ???)
"""
def __init__(self, img, ai=None):
"""
@param img: raw image we are working on
@type img: ndarray
@param ai: azimuhal integrator we are working on
@type ai: pyFAI.azimuthalIntegrator.AzimutalIntegrator
"""
self.img = img
if ai is None:
self.ai = AzimuthalIntegrator()
else:
self.ai = ai
def get_shape(self):
return self.img.shape
shape = property(get_shape)
def reconstruct(self, tth, I):
"""
Reconstruct a perfect image according to 2th / I given in
input
@param tth: 2 theta array
@type tth: ndarray
@param I: intensity array
@type I: ndarray
@return: a reconstructed image
@rtype: ndarray
"""
return numpy.interp(self.ai.twoThetaArray(self.shape), tth, I)
def diff_tth_X(self, dx=0.1):
"""
Jerome peux-tu décrire de quoi il retourne ???
@param dx: ???
@type: float ???
@return: ???
@rtype: ???
"""
f = self.ai.getFit2D()
fp = f.copy()
fm = f.copy()
fm["centerX"] -= dx / 2.0
fp["centerX"] += dx / 2.0
ap = AzimuthalIntegrator()
am = AzimuthalIntegrator()
ap.setFit2D(**fp)
am.setFit2D(**fm)
dtthX = (ap.twoThetaArray(self.shape) - am.twoThetaArray(self.shape)) / dx
tth, I = self.ai.xrpd(self.img, max(self.shape))
dI = SGModule.getSavitzkyGolay(I, npoints=5, degree=2, order=1) / (tth[1] - tth[0])
dImg = self.reconstruct(tth, dI)
return (dtthX * dImg).sum()
def diff_tth_tilt(self, dx=0.1):
"""
idem ici ???
@param dx: ???
@type dx: float ???
@return: ???
@rtype: ???
"""
f = self.ai.getFit2D()
fp = f.copy()
fm = f.copy()
fm["tilt"] -= dx / 2.0
fp["tilt"] += dx / 2.0
ap = AzimuthalIntegrator()
am = AzimuthalIntegrator()
ap.setFit2D(**fp)
am.setFit2D(**fm)
dtthX = (ap.twoThetaArray(self.shape) - am.twoThetaArray(self.shape)) / dx
tth, I = self.ai.xrpd(self.img, max(self.shape))
dI = SGModule.getSavitzkyGolay(I, npoints=5, degree=2, order=1) / (tth[1] - tth[0])
dImg = self.reconstruct(tth, dI)
return (dtthX * dImg).sum()
def diff_Fit2D(self, axis="all", dx=0.1):
"""
???
@param axis: ???
@type axis: ???
@param dx: ???
@type dx: ???
@return: ???
@rtype: ???
#.........这里部分代码省略.........