本文整理汇总了Python中pyFAI.azimuthalIntegrator.AzimuthalIntegrator.makeHeaders方法的典型用法代码示例。如果您正苦于以下问题:Python AzimuthalIntegrator.makeHeaders方法的具体用法?Python AzimuthalIntegrator.makeHeaders怎么用?Python AzimuthalIntegrator.makeHeaders使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pyFAI.azimuthalIntegrator.AzimuthalIntegrator
的用法示例。
在下文中一共展示了AzimuthalIntegrator.makeHeaders方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: CalibrationModel
# 需要导入模块: from pyFAI.azimuthalIntegrator import AzimuthalIntegrator [as 别名]
# 或者: from pyFAI.azimuthalIntegrator.AzimuthalIntegrator import makeHeaders [as 别名]
#.........这里部分代码省略.........
if center_y < height and center_y > 0:
side2 = np.max([abs(height - center_y), center_y])
else:
side2 = height
max_dist = np.sqrt(side1 ** 2 + side2 ** 2)
return int(max_dist * max_dist_factor)
def load(self, filename):
"""
Loads a calibration file and and sets all the calibration parameter.
:param filename: filename for a *.poni calibration file
"""
self.spectrum_geometry = AzimuthalIntegrator()
self.spectrum_geometry.load(filename)
self.orig_pixel1 = self.spectrum_geometry.pixel1
self.orig_pixel2 = self.spectrum_geometry.pixel2
self.calibration_name = get_base_name(filename)
self.filename = filename
self.is_calibrated = True
self.create_cake_geometry()
self.set_supersampling()
def save(self, filename):
"""
Saves the current calibration parameters into a a text file. Default extension is
*.poni
"""
self.cake_geometry.save(filename)
self.calibration_name = get_base_name(filename)
self.filename = filename
def create_file_header(self):
return self.cake_geometry.makeHeaders(polarization_factor=self.polarization_factor)
def set_fit2d(self, fit2d_parameter):
"""
Reads in a dictionary with fit2d parameters where the fields of the dictionary are:
'directDist', 'centerX', 'centerY', 'tilt', 'tiltPlanRotation', 'pixelX', pixelY',
'polarization_factor', 'wavelength'
"""
self.spectrum_geometry.setFit2D(directDist=fit2d_parameter['directDist'],
centerX=fit2d_parameter['centerX'],
centerY=fit2d_parameter['centerY'],
tilt=fit2d_parameter['tilt'],
tiltPlanRotation=fit2d_parameter['tiltPlanRotation'],
pixelX=fit2d_parameter['pixelX'],
pixelY=fit2d_parameter['pixelY'])
self.spectrum_geometry.wavelength = fit2d_parameter['wavelength']
self.create_cake_geometry()
self.polarization_factor = fit2d_parameter['polarization_factor']
self.orig_pixel1 = fit2d_parameter['pixelX'] * 1e-6
self.orig_pixel2 = fit2d_parameter['pixelY'] * 1e-6
self.is_calibrated = True
self.set_supersampling()
def set_pyFAI(self, pyFAI_parameter):
"""
Reads in a dictionary with pyFAI parameters where the fields of dictionary are:
'dist', 'poni1', 'poni2', 'rot1', 'rot2', 'rot3', 'pixel1', 'pixel2', 'wavelength',
'polarization_factor'
"""
self.spectrum_geometry.setPyFAI(dist=pyFAI_parameter['dist'],
poni1=pyFAI_parameter['poni1'],
poni2=pyFAI_parameter['poni2'],
rot1=pyFAI_parameter['rot1'],
示例2: CalibrationData
# 需要导入模块: from pyFAI.azimuthalIntegrator import AzimuthalIntegrator [as 别名]
# 或者: from pyFAI.azimuthalIntegrator.AzimuthalIntegrator import makeHeaders [as 别名]
#.........这里部分代码省略.........
center_x = fit2d_parameter['centerX']
center_y = fit2d_parameter['centerY']
width, height = self.img_data.img_data.shape
if center_x < width and center_x > 0:
side1 = np.max([abs(width - center_x), center_x])
else:
side1 = width
if center_y < height and center_y > 0:
side2 = np.max([abs(height - center_y), center_y])
else:
side2 = height
max_dist = np.sqrt(side1 ** 2 + side2 ** 2)
return int(max_dist * max_dist_factor)
def load(self, filename):
self.spectrum_geometry = AzimuthalIntegrator()
self.spectrum_geometry.load(filename)
self.orig_pixel1 = self.spectrum_geometry.pixel1
self.orig_pixel2 = self.spectrum_geometry.pixel2
self.calibration_name = get_base_name(filename)
self.filename = filename
self.is_calibrated = True
self.create_cake_geometry()
self.set_supersampling()
def save(self, filename):
self.cake_geometry.save(filename)
self.calibration_name = get_base_name(filename)
self.filename = filename
def create_file_header(self):
return self.cake_geometry.makeHeaders(polarization_factor=self.polarization_factor)
def set_fit2d(self, fit2d_parameter):
print fit2d_parameter
self.spectrum_geometry.setFit2D(directDist=fit2d_parameter['directDist'],
centerX=fit2d_parameter['centerX'],
centerY=fit2d_parameter['centerY'],
tilt=fit2d_parameter['tilt'],
tiltPlanRotation=fit2d_parameter['tiltPlanRotation'],
pixelX=fit2d_parameter['pixelX'],
pixelY=fit2d_parameter['pixelY'])
self.spectrum_geometry.wavelength = fit2d_parameter['wavelength']
self.create_cake_geometry()
self.polarization_factor = fit2d_parameter['polarization_factor']
self.orig_pixel1 = fit2d_parameter['pixelX'] * 1e-6
self.orig_pixel2 = fit2d_parameter['pixelY'] * 1e-6
self.is_calibrated = True
self.set_supersampling()
def set_pyFAI(self, pyFAI_parameter):
self.spectrum_geometry.setPyFAI(dist=pyFAI_parameter['dist'],
poni1=pyFAI_parameter['poni1'],
poni2=pyFAI_parameter['poni2'],
rot1=pyFAI_parameter['rot1'],
rot2=pyFAI_parameter['rot2'],
rot3=pyFAI_parameter['rot3'],
pixel1=pyFAI_parameter['pixel1'],
pixel2=pyFAI_parameter['pixel2'])
self.spectrum_geometry.wavelength = pyFAI_parameter['wavelength']
self.create_cake_geometry()
self.polarization_factor = pyFAI_parameter['polarization_factor']
self.orig_pixel1 = pyFAI_parameter['pixel1']
self.orig_pixel2 = pyFAI_parameter['pixel2']