Skip to content

Commit

Permalink
test pass
Browse files Browse the repository at this point in the history
  • Loading branch information
scivision committed Oct 31, 2018
1 parent 457dd39 commit 36b67ec
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions tests/test_kepler.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
"""
test keplerian ephemeride to ECEF conversion
"""
import pytest
import xarray
from pytest import approx
import georinex as gr
from datetime import datetime, timedelta
import numpy as np
Expand Down Expand Up @@ -38,9 +40,17 @@
dat = xarray.Dataset(sv, attrs={'svtype': 'G'},
coords={'time': [time]})

x, y, z = gr.keplerian2ecef(dat)

print(x, y, z)
def test_kepler():
x, y, z = gr.keplerian2ecef(dat)

magerr = np.sqrt((x-xref)**2 + (y-yref)**2 + (z-zref)**2)
print('error magnitude [meters]', magerr)
assert x == approx(xref,rel=1e-4)
assert y == approx(yref,rel=1e-4)
assert z == approx(zref,rel=1e-4)

magerr = np.sqrt((x-xref)**2 + (y-yref)**2 + (z-zref)**2)
print('error magnitude [meters]', magerr)


if __name__ == '__main__':
pytest.main(['-x',__file__])

0 comments on commit 36b67ec

Please sign in to comment.