Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_ecef_ned():
enu = pm.aer2enu(*aer0)
ned = (enu[1], enu[0], -enu[2])
xyz = pm.aer2ecef(*aer0, *lla0)
n, e, d = pm.ecef2ned(*xyz, *lla0)
assert n == approx(ned[0])
assert e == approx(ned[1])
assert d == approx(ned[2])
assert pm.ned2ecef(*ned, *lla0) == approx(xyz)
def test_aer2ecef(aer, lla, xyz):
x, y, z = pm.aer2ecef(*aer, *lla)
assert x == approx(xyz[0])
assert y == approx(xyz[1])
assert z == approx(xyz[2])
raer = (radians(aer[0]), radians(aer[1]), aer[2])
rlla = (radians(lla[0]), radians(lla[1]), lla[2])
assert pm.aer2ecef(*raer, *rlla, deg=False) == approx(xyz)
with pytest.raises(ValueError):
pm.aer2ecef(aer[0], aer[1], -1, *lla)
def test_aer2ecef(aer, lla, xyz):
x, y, z = pm.aer2ecef(*aer, *lla)
assert x == approx(xyz[0])
assert y == approx(xyz[1])
assert z == approx(xyz[2])
raer = (radians(aer[0]), radians(aer[1]), aer[2])
rlla = (radians(lla[0]), radians(lla[1]), lla[2])
assert pm.aer2ecef(*raer, *rlla, deg=False) == approx(xyz)
with pytest.raises(ValueError):
pm.aer2ecef(aer[0], aer[1], -1, *lla)
def test_aer2ecef(aer, lla, xyz):
x, y, z = pm.aer2ecef(*aer, *lla)
assert x == approx(xyz[0])
assert y == approx(xyz[1])
assert z == approx(xyz[2])
raer = (radians(aer[0]), radians(aer[1]), aer[2])
rlla = (radians(lla[0]), radians(lla[1]), lla[2])
assert pm.aer2ecef(*raer, *rlla, deg=False) == approx(xyz)
with pytest.raises(ValueError):
pm.aer2ecef(aer[0], aer[1], -1, *lla)