Beispiel #1
0
 def testHkl_2_m5_12_calculated_from_DDIF(self):
     self.places = 3
     self._check((2, -5, 12),
                 Pos(delta=5.224, gamma=10.415, omegah=2, phi=-1.972),
                 {'betain': 2})
Beispiel #2
0
 def testHkl_2_19_32_calculated_from_DDIF(self):
     self.places = 3
     self._check((2, 19, 32),
                 Pos(delta=21.974, gamma=4.419, omegah=2, phi=-33.803),
                 {'betain': 2})
Beispiel #3
0
 def testHkl_0_7_22_calculated_from_DDIF(self):
     self.places = 3
     self._check((0, 7, 22),
                 Pos(delta=11.242, gamma=3.038, omegah=2, phi=123.064),
                 {'betain': 2})
Beispiel #4
0
        self._configure_ub()
        hkl, virtual = self.calc.anglesToHkl(pos, wavelength)
        assert_array_almost_equal(hkl, hkl_expected, self.places)
        assert_second_dict_almost_in_first(virtual, virtual_expected)

    @raises(DiffcalcException)
    def _check_hkl_to_angles_fails(self, *args):
        self._check_hkl_to_angles(*args)


# Primary and secondary reflections found with the help of DDIF on Diamond's
# i07 on Jan 27 2010

Si_5_5_12_WAVELENGTH = 0.6358
Si_5_5_12_HKL0 = 2, 19, 32
Si_5_5_12_REF0 = Pos(delta=21.975, gamma=4.419, omegah=2, phi=326.2)
Si_5_5_12_HKL1 = 0, 7, 22
Si_5_5_12_REF1 = Pos(delta=11.292, gamma=2.844, omegah=2, phi=124.1)

# This is U matrix displayed by DDIF
U_FROM_DDIF = matrix([[0.233140, 0.510833, 0.827463],
                      [-0.65596, -0.545557, 0.521617],
                      [0.717888, -0.664392, 0.207894]])

# This is the version that Diffcalc comes up with ( see following test)
Si_5_5_12_U_DIFFCALC = matrix([[-0.7178876, 0.6643924, -0.2078944],
                               [-0.6559596, -0.5455572, 0.5216170],
                               [0.2331402, 0.5108327, 0.8274634]])


class TestUBCalculationWithWillmotStrategy_Si_5_5_12():