示例#1
0
 def testHkl_show_all_solutionsall0_3(self):
     self.mock_hardware.set_upper_limit('delta', 91)
     self.constraints._constrained = {'chi': 0, 'phi': 0, 'eta': 0 * TORAD}
     self._check((.1, 0, .01),
                 P(mu=30.3314, delta=5.7392, nu=0.4970, eta=0, chi=0,
                   phi=0))
     print self.calc.hkl_to_all_angles(.1, 0, .01, 1)
示例#2
0
 def testHkl_3(self):
     self.mock_hardware.set_upper_limit('delta', 91)
     self.wavelength = .1
     self.constraints._constrained = {'chi': 0, 'phi': 0 * TORAD, 'eta': 0}
     self._check((1, 0, .1),
                 P(mu=30.3314, delta=5.7392, nu=0.4970, eta=0, chi=0,
                   phi=0))
示例#3
0
 def testHkl789(self):
     self._check(
         (.7, .8, .9),  # betaout=26.7437
         P(mu=26.74368,
           delta=58.6754,
           nu=86.6919,
           eta=85.3391,
           chi=0,
           phi=0))
示例#4
0
 def testHklDeltaGreaterThan90(self):
     wavelength = 1
     hkl = (0.1, 0, 1.5)
     pos = P(mu=0,
             delta=97.46959231642,
             nu=0,
             eta=97.46959231642 / 2,
             chi=86.18592516571,
             phi=0)
     self._check_hkl_to_angles('', 0, 0, hkl, pos, wavelength)
示例#5
0
 def test_hkl_alpha_17_9776_failing_after_bigger_small(self):
     # This is failing here but on the live one. Suggesting some extreme sensitivity?
     self.constraints._constrained = {
         'delta': 0,
         'alpha': 17.8776 * TORAD,
         'eta': 0
     }
     self._check(
         [-1.1812112493619709, -0.71251524866987204, 5.1997083010199221],
         P(mu=25.85, delta=0, nu=52, eta=0, chi=45.2453, phi=-173.518),
         fails=False)
示例#6
0
 def test_hkl_psi90_works_okay_on_i16(self):
     # This is failing here but on the live one. Suggesting some extreme sensitivity?
     self.constraints._constrained = {
         'delta': 0,
         'psi': 90 * TORAD,
         'eta': 0
     }
     self._check(
         [-1.1812112493619709, -0.71251524866987204, 5.1997083010199221],
         P(mu=26, delta=0, nu=52, eta=0, chi=45.2453, phi=186.6933 - 360),
         fails=False)
示例#7
0
 def test_hkl_alpha_17_9776_used_to_fail(self):
     # This is failing here but on the live one. Suggesting some extreme sensitivity?
     self.constraints._constrained = {
         'delta': 0,
         'alpha': 17.9776 * TORAD,
         'eta': 0
     }
     self._check(
         [-1.1812112493619709, -0.71251524866987204, 5.1997083010199221],
         P(mu=26, delta=0, nu=52, eta=0, chi=45.2453, phi=186.6933 - 360),
         fails=False)
示例#8
0
 def testHkl_all0_2(self):
     self.mock_hardware.set_upper_limit('delta', 91)
     self.constraints._constrained = {'chi': 0, 'phi': 0, 'eta': 0 * TORAD}
     self._check((0, 0, .1),
                 P(mu=2.8660, delta=0, nu=5.7320, eta=0, chi=0, phi=0))
示例#9
0
 def testHkl_all0_1(self):
     self.mock_hardware.set_upper_limit('delta', 91)
     self.constraints._constrained = {'chi': 0, 'phi': 0, 'eta': 0 * TORAD}
     self._check((.01, .01, .1),
                 P(mu=8.6194, delta=0.5730, nu=5.7607, eta=0, chi=0, phi=0))
示例#10
0
 def testHkl_eta90_110(self):
     self.constraints._constrained = {'chi': 0, 'phi': 0, 'eta': 90 * TORAD}
     self._check((1, 1, 0), P(mu=0, delta=90, nu=0, eta=90, chi=0, phi=0))
示例#11
0
 def testHkl110(self):
     self._check(
         (1, 1, 0),  # betaout=0
         P(mu=0, delta=90, nu=0, eta=90, chi=0, phi=0))
示例#12
0
 def test_hkl_bisecting_works_okay_on_i16(self):
     self.constraints._constrained = {'delta': 0, 'a_eq_b': None, 'eta': 0}
     self._check(
         [-1.1812112493619709, -0.71251524866987204, 5.1997083010199221],
         P(mu=26, delta=0, nu=52, eta=0, chi=45.2453, phi=186.6933 - 360),
         fails=False)
示例#13
0
 def testHkl_2(self):
     self.wavelength = .1
     self.constraints._constrained = {'chi': 0, 'phi': 0 * TORAD, 'eta': 0}
     self._check((0, 0, 1),
                 P(mu=2.8660, delta=0, nu=5.7320, eta=0, chi=0, phi=0))
示例#14
0
 def testHkl100(self):
     self._check(
         (1, 0, 0),  # betaout=0
         P(mu=0, delta=60, nu=0, eta=30, chi=0, phi=0))
示例#15
0
 def testHkl788(self):
     self._check(
         (.7, .8, .8),  # betaout=23.5782
         P(mu=23.5782, delta=59.9980, nu=76.7037, eta=84.2591, chi=0,
           phi=0))
示例#16
0
 def testHklunder100(self):
     self._check(
         (.9, 0, 0),  # betaout=0
         P(mu=0, delta=53.4874, nu=0, eta=26.7437, chi=0, phi=0))
示例#17
0
 def testHklover100(self):
     self._check(
         (1.1, 0, 0),  # betaout=0
         P(mu=0, delta=66.7340, nu=0, eta=33.3670, chi=0, phi=0))
示例#18
0
 def testHkl111(self):
     self._check(
         (1, 1, 1),  # betaout=30
         P(mu=30, delta=54.7356, nu=150, eta=99.7356, chi=0, phi=0))
示例#19
0
 def testHkl11nearly0(self):
     self.places = 3
     self._check(
         (1, 1, .0001),  # betaout=0
         P(mu=0.0029, delta=89.9971, nu=90.0058, eta=90, chi=0, phi=0))
示例#20
0
 def testHkl011(self):
     self._check(
         (0, 1, 1),  # betaout=30
         P(mu=30, delta=54.7356, nu=90, eta=125.2644, chi=0, phi=0))
示例#21
0
 def testHkl_all0_010to001(self):
     self.constraints._constrained = {'chi': 0, 'phi': 0, 'eta': 0}
     self._check((0, cos(4 * TORAD), sin(4 * TORAD)),
                 P(mu=120 - 4, delta=0, nu=60, eta=0, chi=0, phi=0))
示例#22
0
 def testHkl7810(self):
     self._check(
         (.7, .8, 1),  # betaout=30
         P(mu=30, delta=57.0626, nu=96.86590, eta=86.6739, chi=0, phi=0))
示例#23
0
 def testHkl010(self):
     self._check(
         (0, 1, 0),  # betaout=0
         P(mu=120, delta=0, nu=60, eta=0, chi=90, phi=0))
示例#24
0
 def testHkl001(self):
     self._check(
         (0, 0, 1),  # betaout=30
         P(mu=30, delta=0, nu=60, eta=90, chi=0, phi=0),
         fails=True)
示例#25
0
 def testHkl_all0_011(self):
     self.constraints._constrained = {'chi': 0, 'phi': 0, 'eta': 0}
     self._check((0, 1, 1), P(mu=90, delta=0, nu=90, eta=0, chi=0, phi=0))
示例#26
0
 def testHkl_eta30_100(self):
     self.constraints._constrained = {'chi': 0, 'phi': 0, 'eta': 30 * TORAD}
     self._check((1, 0, 0), P(mu=0, delta=60, nu=0, eta=30, chi=0, phi=0))
示例#27
0
 def testHkl_1_1_15(self):
     self._check(
         (1, 1, 1.5),  # betaout=0
         P(mu=0, delta=60, nu=0, eta=30, chi=0, phi=0))
示例#28
0
 def testHkl101(self):
     self._check(
         (1, 0, 1),  # betaout=30
         P(mu=30, delta=54.7356, nu=90, eta=35.2644, chi=0, phi=0))