当前位置: 首页>>代码示例>>Python>>正文


Python AzimuthalIntegrator.chiArray方法代码示例

本文整理汇总了Python中pyFAI.azimuthalIntegrator.AzimuthalIntegrator.chiArray方法的典型用法代码示例。如果您正苦于以下问题:Python AzimuthalIntegrator.chiArray方法的具体用法?Python AzimuthalIntegrator.chiArray怎么用?Python AzimuthalIntegrator.chiArray使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在pyFAI.azimuthalIntegrator.AzimuthalIntegrator的用法示例。


在下文中一共展示了AzimuthalIntegrator.chiArray方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: image_test_rings

# 需要导入模块: from pyFAI.azimuthalIntegrator import AzimuthalIntegrator [as 别名]
# 或者: from pyFAI.azimuthalIntegrator.AzimuthalIntegrator import chiArray [as 别名]
def image_test_rings():
    rings = 10
    mod = 50
    detector = detector_factory("Titan")
    sigma = detector.pixel1 * 4
    shape = detector.max_shape
    ai = AzimuthalIntegrator(detector=detector)
    ai.setFit2D(1000, 1000, 1000)
    r = ai.rArray(shape)
    r_max = r.max()
    chi = ai.chiArray(shape)
    img = numpy.zeros(shape)
    modulation = (1 + numpy.sin(5 * r + chi * mod))
    for radius in numpy.linspace(0, r_max, rings):
        img += numpy.exp(-(r - radius) ** 2 / (2 * (sigma * sigma)))
    return img * modulation
开发者ID:SulzmannFr,项目名称:pyFAI,代码行数:18,代码来源:test_blob_detection.py

示例2: ObliqueAngleDetectorAbsorptionCorrectionTest

# 需要导入模块: from pyFAI.azimuthalIntegrator import AzimuthalIntegrator [as 别名]
# 或者: from pyFAI.azimuthalIntegrator.AzimuthalIntegrator import chiArray [as 别名]
class ObliqueAngleDetectorAbsorptionCorrectionTest(unittest.TestCase):
    def setUp(self):
        # defining geometry
        image_shape = [2048, 2048]  # pixel
        detector_distance = 200  # mm
        wavelength = 0.31  # angstrom
        center_x = 1024  # pixel
        center_y = 1024  # pixel
        self.tilt = 0  # degree
        self.rotation = 0  # degree
        pixel_size = 79  # um
        dummy_tth = np.linspace(0, 35, 2000)
        dummy_int = np.ones(dummy_tth.shape)
        self.geometry = AzimuthalIntegrator()
        self.geometry.setFit2D(directDist=detector_distance,
                               centerX=center_x,
                               centerY=center_y,
                               tilt=self.tilt,
                               tiltPlanRotation=self.rotation,
                               pixelX=pixel_size,
                               pixelY=pixel_size)
        self.geometry.wavelength = wavelength / 1e10
        self.dummy_img = self.geometry.calcfrom1d(dummy_tth, dummy_int, shape=image_shape, correctSolidAngle=True)

        self.tth_array = self.geometry.twoThetaArray(image_shape)
        self.azi_array = self.geometry.chiArray(image_shape)

    def tearDown(self):
        del self.azi_array
        del self.tth_array
        del self.dummy_img
        del self.geometry
        gc.collect()

    def test_that_it_is_correctly_calculating(self):
        oblique_correction = ObliqueAngleDetectorAbsorptionCorrection(
                tth_array=self.tth_array,
                azi_array=self.azi_array,
                detector_thickness=40,
                absorption_length=465.5,
                tilt=self.tilt,
                rotation=self.rotation
        )
        oblique_correction_data = oblique_correction.get_data()
        self.assertGreater(np.sum(oblique_correction_data), 0)
        self.assertEqual(oblique_correction_data.shape, self.dummy_img.shape)
        del oblique_correction
开发者ID:erangre,项目名称:Dioptas,代码行数:49,代码来源:test_ImgCorrections.py

示例3: CbnCorrectionTest

# 需要导入模块: from pyFAI.azimuthalIntegrator import AzimuthalIntegrator [as 别名]
# 或者: from pyFAI.azimuthalIntegrator.AzimuthalIntegrator import chiArray [as 别名]
class CbnCorrectionTest(unittest.TestCase):
    def setUp(self):
        # defining geometry
        image_shape = [2048, 2048]  # pixel
        detector_distance = 200  # mm
        wavelength = 0.31  # angstrom
        center_x = 1024  # pixel
        center_y = 1024  # pixel
        tilt = 0  # degree
        rotation = 0  # degree
        pixel_size = 79  # um
        dummy_tth = np.linspace(0, 35, 2000)
        dummy_int = np.ones(dummy_tth.shape)
        self.geometry = AzimuthalIntegrator()
        self.geometry.setFit2D(directDist=detector_distance,
                               centerX=center_x,
                               centerY=center_y,
                               tilt=tilt,
                               tiltPlanRotation=rotation,
                               pixelX=pixel_size,
                               pixelY=pixel_size)
        self.geometry.wavelength = wavelength / 1e10
        self.dummy_img = self.geometry.calcfrom1d(dummy_tth, dummy_int, shape=image_shape, correctSolidAngle=True)

        self.tth_array = self.geometry.twoThetaArray(image_shape)
        self.azi_array = self.geometry.chiArray(image_shape)

    def tearDown(self):
        del self.tth_array
        del self.azi_array
        del self.dummy_img
        del self.geometry
        gc.collect()

    def test_that_it_is_calculating_correctly(self):
        cbn_correction = CbnCorrection(self.tth_array, self.azi_array,
                                       diamond_thickness=2.2,
                                       seat_thickness=5.3,
                                       small_cbn_seat_radius=0.4,
                                       large_cbn_seat_radius=1.95,
                                       tilt=0,
                                       tilt_rotation=0)
        cbn_correction.update()
        cbn_correction_data = cbn_correction.get_data()
        self.assertGreater(np.sum(cbn_correction_data), 0)
        self.assertEqual(cbn_correction_data.shape, self.dummy_img.shape)
开发者ID:erangre,项目名称:Dioptas,代码行数:48,代码来源:test_ImgCorrections.py

示例4: image_test_rings

# 需要导入模块: from pyFAI.azimuthalIntegrator import AzimuthalIntegrator [as 别名]
# 或者: from pyFAI.azimuthalIntegrator.AzimuthalIntegrator import chiArray [as 别名]
def image_test_rings():
    "Creating a test image containing gaussian spots on several rings"
    rings = 10
    mod = 50
    detector = detector_factory("Titan")
    sigma = detector.pixel1 * 4
    shape = detector.max_shape
    ai = AzimuthalIntegrator(detector=detector)
    ai.setFit2D(1000, 1000, 1000)
    r = ai.rArray(shape)
    r_max = r.max()
    chi = ai.chiArray(shape)
    img = numpy.zeros(shape)
    modulation = (1 + numpy.sin(5 * r + chi * mod))
    for radius in numpy.linspace(0, r_max, rings):
        img += numpy.exp(-(r - radius) ** 2 / (2 * (sigma * sigma)))

    img *= modulation
    img = add_noise(img, 0.0)
    return img
开发者ID:jonwright,项目名称:pyFAI,代码行数:22,代码来源:blob.py

示例5: AzimuthalIntegrator

# 需要导入模块: from pyFAI.azimuthalIntegrator import AzimuthalIntegrator [as 别名]
# 或者: from pyFAI.azimuthalIntegrator.AzimuthalIntegrator import chiArray [as 别名]
dummy_tth = np.linspace(0, 35, 2000)
dummy_int = np.ones(dummy_tth.shape)
geometry = AzimuthalIntegrator()
geometry.setFit2D(directDist=detector_distance,
                  centerX=center_x,
                  centerY=center_y,
                  tilt=tilt,
                  tiltPlanRotation=rotation,
                  pixelX=pixel_size,
                  pixelY=pixel_size)
geometry.wavelength = wavelength/1e10
dummy_img = geometry.calcfrom1d(dummy_tth, dummy_int, shape=image_shape, correctSolidAngle=True)


tth_array = geometry.twoThetaArray(image_shape)
azi_array = geometry.chiArray(image_shape)


cbn_correction = CbnCorrection(tth_array, azi_array,
                               diamond_thickness=2.2,
                               seat_thickness=5.3,
                               small_cbn_seat_radius=0.4,
                               large_cbn_seat_radius=1.95,
                               tilt=0,
                               tilt_rotation=0)

t1= time.time()
cbn_correction.get_data()
print("It took {}s".format(time.time()-t1))

开发者ID:ggarba,项目名称:Dioptas,代码行数:31,代码来源:profiling_cbn_correction.py


注:本文中的pyFAI.azimuthalIntegrator.AzimuthalIntegrator.chiArray方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。