def test4(self): self.mode(2, alpha=5, gamma=10, betain=4) self.hkl([.7, .9, 1.3]) aneq_((5, 22.9649, 10., -11.8850, 4.7799, 80.4416), self.sixc(), 4, note="[alpha, delta, gamma, omega, chi, phi")
def test_hkl_to_angles(): dc.con('a_eq_b') dc.con('mu', 0) dc.con(NUNAME, 0) h, k, l = [1, 0, 0] angles_calc, param_calc = dc.hkl_to_angles(h, k, l) aneq_(angles_calc, angles) dneq_(param_calc, param)
def test_hkl_to_angles_bypassing_hardware_plugin(): dc.con('a_eq_b') dc.con('mu', 0) dc.con(NUNAME, 0) h, k, l = [1, 0, 0] angles_calc, param_calc = dc.hkl_to_angles(h, k, l, en) aneq_(angles_calc, angles) dneq_(param_calc, param)
def test2(self): self.mode(1, alpha=5, gamma=0) self.hkl([.7, .9, 1.3]) aneq_((5., 26.9296, 0., 8.4916, 27.2563, 59.5855), self.sixc(), 4)
def test_angles_to_hkl(): hkl_calc, param_calc = dc.angles_to_hkl(angles, en) aneq_(hkl_calc, [1, 0, 0]) assert_dict_almost_equal(param_calc, param)
def testHkl001(self): self.dc.hklmode(1) self.dc.sigtau(0, 0) self.hkl([0, 0, 1]) aneq_(self.fourc()[0:3], (60, 30, 90), 4) # (phi is undetermined here)
def test1(self): self.dc.hklmode(1) self.dc.setpar('alpha', 0) self.hkl([.7, .9, 1.3]) aneq_((0., 27.3557, 13.6779, 37.7746, 53.9654), self.fivec(), 4)
def test10(self): self.mode(20, sig=-1.35, tau=-106) # 6czBeq self.hkl([.7, .9, 1.3]) aneq_((8.1693, 22.0156, 8.1693, -40.2188, 1.35, 106.), self.sixc(), 4)
def test6(self): self.mode(2, alpha=5, gamma=10, sig=-1.3500, tau=-106, betain=6) self.hkl([.7, .9, 1.3]) aneq_((5., 22.9649, 10., 2.2388, 4.3898, 65.4395), self.sixc(), 4)
def test5(self): self.mode(1, alpha=5, gamma=10, sig=-1.3500, tau=-106) self.hkl([.7, .9, 1.3]) aneq_((5., 22.9649, 10., 30.6586, 4.5295, 35.4036), self.sixc(), 4)
def test3(self): self.mode(1, alpha=5, gamma=10) self.hkl([.7, .9, 1.3]) aneq_((5., 22.9649, 10., 42.2204, 4.9721, 23.0655), self.sixc(), 4)
def test1(self): self.mode(1) self.hkl([.7, .9, 1.3]) aneq_((0., 27.3557, 0., 13.6779, 37.7746, 53.9654), self.sixc(), 4) print self.hkl print self.hklverbose
def testGetPosition(self): aneq_(self.fourc.getPosition(), [1, 2, 93, 4])
def test8(self): #8 self.mode(10, gamma=10, sig=-1.35, tau=-106) # 5cgBeq self.hkl([.7, .9, 1.3]) aneq_((6.1937, 22.1343, 10., 46.9523, 1.5102, 18.8112), self.sixc(), 3)
def test7(self): self.mode(3, alpha=5, gamma=10, sig=-1.3500, tau=-106, betaout=7) self.hkl([.7, .9, 1.3]) aneq_((5., 22.9649, 10., 43.4628, 5.0387, 21.7292), self.sixc(), 4)
def test12(self): self.mode(22, betaout=1, sig=-1.35, tau=-106) # 6czBin self.hkl([.7, .9, 1.3]) aneq_((15.4706, 22.0994, 1., -45.5521, 1.3500, 106.), self.sixc(), 4)
def test1(self): self.dc.hklmode(1) self.hkl([.7, .9, 1.3]) aneq_((27.3557325339904, 13.67786626699521, 23.481729970652825, 47.81491152277463), self.fourc(), 4)
def test9(self): self.mode(13, alpha=5, gamma=10, sig=-1.35, tau=-106) # 5cgBeq self.hkl([.7, .9, 1.3]) aneq_((5., 22.2183, 11.1054, 65.8276, 2.5180, -0.0749), self.sixc(), 4)
def testHkl101(self): self.hkl([1, 0, 1]) aneq_(self.fourc(), [98.74666191021282, 117.347760720783, 90., -90.], note="[delta, omega, chi, phi]")
def _check(self, desired_xyz): called_with_xyz = self.xyz_eta.asynchronousMoveTo.call_args[0][0] aneq_(called_with_xyz, desired_xyz)
def test11(self): self.mode(21, betain=8, sig=-1.35, tau=-106) # 6czBin self.hkl([.7, .9, 1.3]) aneq_((8., 22.0156, 8.3386, -40.0939, 1.3500, 106.), self.sixc(), 4)
def checkHKL(self, hkl, adgocp=None, betaout=None, nu=None): self.hklverbose.asynchronousMoveTo(hkl) aneq_(self.sixc(), list(adgocp), 3) aneq_(self.hklverbose(), (hkl[0], hkl[1], hkl[2], betaout), 3)
def test2(self): self.dc.hklmode(1) self.dc.setpar('alpha', 5) self.hkl([.7, .9, 1.3]) aneq_((5., 26.9296, 8.4916, 27.2563, 59.5855), self.fivec(), 4)
def testHkl100(self): self.dc.hklmode(1) self.dc.sigtau(0, 0) self.hkl([1, 0, 0]) aneq_(self.fourc(), (60, -60, 0, 90), 4)
def testHkl001(self): self.hkl([0, 0, 1]) aneq_(self.fourc(), [33.07329403295449, 16.536647016477247, 90., -90.], note="[delta, omega, chi, phi]")
def test_angles_to_hkl_bypassing_hardware_plugin(): hkl_calc, param_calc = dc.angles_to_hkl(angles, en) aneq_(hkl_calc, [1, 0, 0]) dneq_(param_calc, param)
def test_angles_to_hkl_bypassing_hardware_plugin(): hkl_calc, param_calc = dc.angles_to_hkl(angles, en) aneq_(hkl_calc, [1, 0, 0]) assert_dict_almost_equal(param_calc, param)
def test_angles_to_hkl(): hkl_calc, param_calc = dc.angles_to_hkl(angles) aneq_(hkl_calc, [1, 0, 0]) dneq_(param_calc, param)
def test_hkl_to_angles(): dc.con('a_eq_b') h, k, l = [1, 0, 0] angles_calc, param_calc = dc.hkl_to_angles(h, k, l, en) aneq_(angles_calc, angles) assert_dict_almost_equal(param_calc, param)
def test_rotate_about_phi(self): aneq_(move_lab_origin_into_phi(0, 45, [0, 1, 4]), [sqrt(.5), -sqrt(.5), -4])