def test_rotate_rt_12(): r = np.array([1.0, 0.0]) t = np.array([0.0, 1.0]) azi1 = 30 azi2 = 120 baz = 240 d1, d2 = rotate.rotate_rt_12(r, t, baz, azi1, azi2) n, e = rotate.rotate_12_ne(r, t, baz - 180, baz - 90) d1_true, d2_true = rotate.rotate_ne_12(n, e, azi1, azi2)
def test_rotate_ne_and_12(): # tests if rotate_NE_12 and rotate_12_NE are reversable n = np.array([1.0, 0.0]) e = np.array([0.0, 1.0]) d1, d2 = rotate.rotate_ne_12(n, e, 30, 120) n_new, e_new = rotate.rotate_12_ne(d1, d2, 30, 120) npt.assert_allclose(n, n_new) npt.assert_allclose(e, e_new)
def test_rotate_ne_12(): n = np.array([1.0, 0.0]) e = np.array([0.0, 1.0]) dnew1, dnew2 = rotate.rotate_ne_12(n, e, 30, 120) assert rotate.check_orthogonality(30, 120) == "left-hand" dnew1_true = np.array([np.sqrt(3) / 2.0, 0.5]) dnew2_true = np.array([-0.5, np.sqrt(3) / 2.0]) npt.assert_allclose(dnew1, dnew1_true) npt.assert_allclose(dnew2, dnew2_true)
def test_rotate_12_rt(): d1 = np.array([1.0, 0.0]) d2 = np.array([0.0, 1.0]) azi1 = 30 azi2 = 120 baz = 240 r, t = rotate.rotate_12_rt(d1, d2, baz, azi1, azi2) n, e = rotate.rotate_12_ne(d1, d2, azi1, azi2) r_true, t_true = rotate.rotate_ne_12(n, e, baz - 180, baz - 90) npt.assert_allclose(r, r_true) npt.assert_allclose(t, t_true)