def test_dcm_loop(self): latitude = np.linspace(-np.pi/2, np.pi/2, 10) longitude = np.linspace(-np.pi, np.pi, 10) for lat, lon in zip(latitude, longitude): dcm_expected = rot2(np.pi/2 - lat, 'r').dot(rot3(lon, 'r')) dcm = transform.dcm_ecef2sez(lat, lon) np.testing.assert_allclose(dcm, dcm_expected)
def test_so3(self): latgd = np.random.uniform(-np.pi/2, np.pi/2) lon = np.random.uniform(-np.pi, np.pi) alt = 0 dcm = transform.dcm_ecef2sez(latgd, lon, alt) np.testing.assert_allclose(np.linalg.det(dcm), 1) np.testing.assert_array_almost_equal(dcm.T.dot(dcm), np.eye(3,3))
def test_inverse_identity(self): latgd = np.random.uniform(-np.pi/2, np.pi/2) lon = np.random.uniform(-np.pi, np.pi) alt = 0 dcm = transform.dcm_ecef2sez(latgd, lon, alt) dcm_opp = transform.dcm_sez2ecef(latgd, lon, alt) np.testing.assert_allclose(dcm.T, dcm_opp)
def test_dcm_loop(self): latitude = np.linspace(-np.pi / 2, np.pi / 2, 10) longitude = np.linspace(-np.pi, np.pi, 10) for lat, lon in zip(latitude, longitude): dcm_expected = rot2(np.pi / 2 - lat, 'r').dot(rot3(lon, 'r')) dcm = transform.dcm_ecef2sez(lat, lon) np.testing.assert_allclose(dcm, dcm_expected)
def test_inverse_identity(self): latgd = np.random.uniform(-np.pi / 2, np.pi / 2) lon = np.random.uniform(-np.pi, np.pi) alt = 0 dcm = transform.dcm_ecef2sez(latgd, lon, alt) dcm_opp = transform.dcm_sez2ecef(latgd, lon, alt) np.testing.assert_allclose(dcm.T, dcm_opp)
def test_so3(self): latgd = np.random.uniform(-np.pi / 2, np.pi / 2) lon = np.random.uniform(-np.pi, np.pi) alt = 0 dcm = transform.dcm_ecef2sez(latgd, lon, alt) np.testing.assert_allclose(np.linalg.det(dcm), 1) np.testing.assert_array_almost_equal(dcm.T.dot(dcm), np.eye(3, 3))
def test_equator_prime_meridian(self): latgd = 0 lon = 0 alt = 0 dcm_expected = np.array([[0, 0, -1], [0, 1, 0], [1, 0, 0]]) dcm = transform.dcm_ecef2sez(latgd, lon, alt) np.testing.assert_array_almost_equal(dcm, dcm_expected)