本文整理汇总了Python中pyFAI.azimuthalIntegrator.AzimuthalIntegrator.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python AzimuthalIntegrator.__init__方法的具体用法?Python AzimuthalIntegrator.__init__怎么用?Python AzimuthalIntegrator.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pyFAI.azimuthalIntegrator.AzimuthalIntegrator
的用法示例。
在下文中一共展示了AzimuthalIntegrator.__init__方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from pyFAI.azimuthalIntegrator import AzimuthalIntegrator [as 别名]
# 或者: from pyFAI.azimuthalIntegrator.AzimuthalIntegrator import __init__ [as 别名]
def __init__(self, data, dist=1, poni1=None, poni2=None,
rot1=0, rot2=0, rot3=0,
pixel1=None, pixel2=None, splineFile=None, detector=None,
wavelength=None, dSpacing=None):
"""
@param data: ndarray float64 shape = n, 3
col0: pos in dim0 (in pixels)
col1: pos in dim1 (in pixels)
col2: ring index in dSpacing file
@param dist: guessed sample-detector distance (optional, in m)
@param poni1: guessed PONI coordinate along the Y axis (optional, in m)
@param poni2: guessed PONI coordinate along the X axis (optional, in m)
@param rot1: guessed tilt of the detector around the Y axis (optional, in rad)
@param rot2: guessed tilt of the detector around the X axis (optional, in rad)
@param rot3: guessed tilt of the detector around the incoming beam axis (optional, in rad)
@param pixel1: Pixel size along the vertical direction of the detector (in m), almost mandatory
@param pixel2: Pixel size along the horizontal direction of the detector (in m), almost mandatory
@param splineFile: file describing the detector as 2 cubic splines. Replaces pixel1 & pixel2
@param detector: name of the detector or Detector instance. Replaces splineFile, pixel1 & pixel2
@param wavelength: wavelength in m (1.54e-10)
@param dSpacing: filename or list or array or vector containing the d-spacing (in Angstrom)
"""
self.data = numpy.array(data, dtype="float64")
assert self.data.ndim == 2
assert self.data.shape[1] == 3
assert self.data.shape[0]>0
if (pixel1 is None) and (pixel2 is None) and (splineFile is None) and (detector is None):
raise RuntimeError("Setting up the geometry refinement without knowing the detector makes little sense")
AzimuthalIntegrator.__init__(self, dist, 0, 0,
rot1, rot2, rot3,
pixel1, pixel2, splineFile, detector, wavelength=wavelength)
if (poni1 is None) or (poni2 is None):
self.guess_poni()
else:
self.poni1 = float(poni1)
self.poni2 = float(poni2)
self._dist_min = 0
self._dist_max = 10
self._poni1_min = -10000 * self.pixel1
self._poni1_max = 15000 * self.pixel1
self._poni2_min = -10000 * self.pixel2
self._poni2_max = 15000 * self.pixel2
self._rot1_min = -pi
self._rot1_max = pi
self._rot2_min = -pi
self._rot2_max = pi
self._rot3_min = -pi
self._rot3_max = pi
self._wavelength_min = 1e-15
self._wavelength_max = 100.e-10
if dSpacing is not None:
if type(dSpacing) in types.StringTypes:
self.dSpacing = numpy.loadtxt(dSpacing)
else:
self.dSpacing = numpy.array(dSpacing, dtype=numpy.float64)
else:
self.dSpacing = numpy.array([])
示例2: __init__
# 需要导入模块: from pyFAI.azimuthalIntegrator import AzimuthalIntegrator [as 别名]
# 或者: from pyFAI.azimuthalIntegrator.AzimuthalIntegrator import __init__ [as 别名]
def __init__(self, data, dist=1, poni1=None, poni2=None,
rot1=0, rot2=0, rot3=0,
pixel1=None, pixel2=None, splineFile=None, detector=None,
wavelength=None, dSpacing=None):
"""
@param data: ndarray float64 shape = n, 3
col0: pos in dim0 (in pixels)
col1: pos in dim1 (in pixels)
col2: associated tth value (in rad)
@param detector: name of the detector or Detector instance.
"""
self.data = numpy.array(data, dtype="float64")
AzimuthalIntegrator.__init__(self, dist, 0, 0,
rot1, rot2, rot3,
pixel1, pixel2, splineFile, detector, wavelength=wavelength)
if (poni1 is None) or (poni2 is None):
self.guess_poni()
else:
self.poni1 = float(poni1)
self.poni2 = float(poni2)
self._dist_min = 0
self._dist_max = 10
self._poni1_min = -10000 * self.pixel1
self._poni1_max = 15000 * self.pixel1
self._poni2_min = -10000 * self.pixel2
self._poni2_max = 15000 * self.pixel2
self._rot1_min = -pi
self._rot1_max = pi
self._rot2_min = -pi
self._rot2_max = pi
self._rot3_min = -pi
self._rot3_max = pi
self._wavelength_min = 1e-15
self._wavelength_max = 100.e-10
if dSpacing is not None:
if type(dSpacing) in types.StringTypes:
self.dSpacing = numpy.loadtxt(dSpacing)
else:
self.dSpacing = numpy.array(dSpacing, dtype=numpy.float64)
else:
self.dSpacing = numpy.array([])