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_ned():
xyz = pm.aer2ecef(*aer0, *lla0)
enu = pm.aer2enu(*aer0)
ned = (enu[1], enu[0], -enu[2])
lla = pm.aer2geodetic(*aer0, *lla0)
assert pm.aer2ned(*aer0) == approx(ned0)
with pytest.raises(ValueError):
pm.aer2ned(aer0[0], aer0[1], -1)
assert pm.enu2aer(*enu) == approx(aer0)
assert pm.enu2aer(*enu, deg=False) == approx(raer0)
assert pm.ned2aer(*ned) == approx(aer0)
assert pm.ecef2ned(*xyz, *lla0) == approx(ned)
assert pm.ned2ecef(*ned, *lla0) == approx(xyz)
def test_aer_enu():
xyz = pm.aer2ecef(*aer0, *lla0)
enu = pm.aer2enu(*aer0)
assert enu == approx(enu0)
assert pm.aer2enu(*raer0, deg=False) == approx(enu0)
with pytest.raises(ValueError):
pm.aer2enu(aer0[0], aer0[1], -1)
assert pm.enu2ecef(*enu, *lla0) == approx(xyz)
assert pm.enu2ecef(*enu, *rlla0, deg=False) == approx(xyz)
assert pm.ecef2enu(*xyz, *lla0) == approx(enu)
assert pm.ecef2enu(*xyz, *rlla0, deg=False) == approx(enu)
def test_aer_enu():
xyz = pm.aer2ecef(*aer0, *lla0)
enu = pm.aer2enu(*aer0)
assert enu == approx(enu0)
assert pm.aer2enu(*raer0, deg=False) == approx(enu0)
with pytest.raises(ValueError):
pm.aer2enu(aer0[0], aer0[1], -1)
assert pm.enu2ecef(*enu, *lla0) == approx(xyz)
assert pm.enu2ecef(*enu, *rlla0, deg=False) == approx(xyz)
assert pm.ecef2enu(*xyz, *lla0) == approx(enu)
assert pm.ecef2enu(*xyz, *rlla0, deg=False) == approx(enu)
def test_aer_enu():
xyz = pm.aer2ecef(aer0[0], aer0[1], aer0[2], lla0[0], lla0[1], lla0[2])
enu = pm.aer2enu(aer0[0], aer0[1], aer0[2])
assert pm.enu2ecef(enu[0], enu[1], enu[2], lla0[0], lla0[1], lla0[2]) == approx(xyz)
def test_aer_enu():
xyz = pm.aer2ecef(*aer0, *lla0)
enu = pm.aer2enu(*aer0)
assert enu == approx(enu0)
assert pm.aer2enu(*raer0, deg=False) == approx(enu0)
with pytest.raises(ValueError):
pm.aer2enu(aer0[0], aer0[1], -1)
assert pm.enu2ecef(*enu, *lla0) == approx(xyz)
assert pm.enu2ecef(*enu, *rlla0, deg=False) == approx(xyz)
assert pm.ecef2enu(*xyz, *lla0) == approx(enu)
assert pm.ecef2enu(*xyz, *rlla0, deg=False) == approx(enu)