示例#1
0
 def get_lorentz_polarisation_factor(self, range_theta, sigma_star):
     """
         Calculates Lorentz polarization factor for the given theta range
         and sigma-star value using the information about the goniometer's
         geometry.
     """
     return get_lorentz_polarisation_factor(range_theta, sigma_star,
                                            self.data_object)
示例#2
0
 def get_lorentz_polarisation_factor(self, range_theta, sigma_star):
     """
         Calculates Lorentz polarization factor for the given theta range
         and sigma-star value using the information about the goniometer's
         geometry.
     """
     return get_lorentz_polarisation_factor(
         range_theta, sigma_star, self.soller1, self.soller2, self.mcr_2theta
     )
示例#3
0
文件: phases.py 项目: openafox/PyXRD
def get_intensity(range_theta, range_stl, soller1, soller2, phase):
    """
        Gets intensity for a single phase taking the
        lorentz polarization factor into account.
    """

    intensity = get_diffracted_intensity(range_theta, range_stl, phase)
    if phase.apply_lpf:
        return intensity * get_lorentz_polarisation_factor(
            range_theta, phase.sigma_star, soller1, soller2)
    else:
        return intensity
示例#4
0
 def test_lorentz_polarisation_factor(self):
     result = get_lorentz_polarisation_factor(
         np.asanyarray([2.2551711385, 2.478038901, 2.7001518288, 2.9214422642, 3.1418428, 3.3612863, 3.5797059197, 3.7970351263]),
         12,
         self.goniometer_data.soller1, self.goniometer_data.soller2, self.goniometer_data.mcr_2theta
     )
     self.assertIsNotNone(result)
     self.assertEquals(np.allclose(
         result, 
         [3.00643375e-03, 4.83799816e-03, 1.33173586e-02, 6.56714627e-02, 5.11941694e+02, 6.59637604e-02, 1.35695934e-02, 4.97673826e-03]
         #[3.67253512e-01, 5.84371208e-01, 1.55735810e+00, 6.54044238e+00, 7.99531670e+03, 6.56417033e+00, 1.58546668e+00, 6.00742559e-01]
     ), True)
     pass
示例#5
0
 def test_lorentz_polarisation_factor(self):
     result = get_lorentz_polarisation_factor(
         np.asanyarray([
             2.2551711385, 2.478038901, 2.7001518288, 2.9214422642,
             3.1418428, 3.3612863, 3.5797059197, 3.7970351263
         ]), 12, self.goniometer_data.soller1, self.goniometer_data.soller2)
     self.assertIsNotNone(result)
     self.assertEquals(
         np.allclose(result, [
             3.00643375e-03, 4.83799816e-03, 1.33173586e-02, 6.56714627e-02,
             5.11941694e+02, 6.59637604e-02, 1.35695934e-02, 4.97673826e-03
         ]), True)
     pass
示例#6
0
def get_intensity(range_theta, range_stl, soller1, soller2, phase):
    """
        Gets intensity for a single taking the
        lorentz polarization factor into account.
    """

    intensity = get_diffracted_intensity(range_theta, range_stl, phase)
    if phase.apply_lpf:
        lpf = get_lorentz_polarisation_factor(
            range_theta,
            phase.sigma_star,
            soller1, soller2
        )
        return intensity * lpf
    else:
        return intensity
示例#7
0
 def test_lorentz_polarisation_factor(self):
     result = get_lorentz_polarisation_factor(
         np.asanyarray([
             2.2551711385, 2.478038901, 2.7001518288, 2.9214422642,
             3.1418428, 3.3612863, 3.5797059197, 3.7970351263
         ]), 12, self.goniometer_data.soller1, self.goniometer_data.soller2,
         self.goniometer_data.mcr_2theta)
     self.assertIsNotNone(result)
     self.assertEquals(
         np.allclose(
             result, [
                 3.00643375e-03, 4.83799816e-03, 1.33173586e-02,
                 6.56714627e-02, 5.11941694e+02, 6.59637604e-02,
                 1.35695934e-02, 4.97673826e-03
             ]
             #[3.67253512e-01, 5.84371208e-01, 1.55735810e+00, 6.54044238e+00, 7.99531670e+03, 6.56417033e+00, 1.58546668e+00, 6.00742559e-01]
         ),
         True)
     pass