def test_nav2(): """./ReadRinex.py tests/demo.10n -o tests/test2all.nc""" truth = xarray.open_dataset(rdir / 'test2all.nc', group='NAV') nav = rinexnav(rdir / 'demo.10n') assert nav.equals(truth)
def test_nav3galileo(): """ ./ReadRinex.py tests/galileo3.15n -o tests/test3galileo.nc """ truth = xarray.open_dataset(rdir / 'test3galileo.nc', group='NAV') nav = rinexnav(rdir / 'galileo3.15n') assert nav.equals(truth)
def test_nav(): truthnav = read_hdf(str(rdir / 'tests/demo.h5'), key='NAV') testnav = rinexnav(str(rdir / 'tests/demo.10n')) assert_allclose(testnav, truthnav)
p = ArgumentParser( description='example of reading a RINEX 2 Navigation file') p.add_argument('rinexfn', help='path to RINEX file') p.add_argument('-o', '--outfn', help='write data as HDF5 file') p.add_argument( '--maxtimes', help='Choose to read only the first N INTERVALs of OBS file', type=int) p.add_argument('--profile', help='profile code for debugging', action='store_true') p = p.parse_args() rinexfn = p.rinexfn if rinexfn.lower().endswith('n'): nav = rinexnav(rinexfn, p.outfn) print(nav.head()) elif rinexfn.lower().endswith('o'): if p.profile: import cProfile from pstats import Stats profFN = 'RinexObsReader.pstats' cProfile.run('rinexobs(rinexfn)', profFN) Stats(profFN).sort_stats('time', 'cumulative').print_stats(20) else: data, _ = rinexobs(rinexfn, p.outfn) ax = figure().gca() data.loc['P1', :, :, 'data'].plot(ax=ax) ax.set_xlabel('time [UTC]') ax.set_ylabel('P1')
def test_nav2(): truth = xarray.open_dataset(rdir / 'test2all.nc', group='NAV') nav = rinexnav(rdir / 'demo.10n') assert nav.equals(truth)
def test_nav3gps(): truth = xarray.open_dataarray(str(ofn3gps), group='NAV') testnav = rinexnav(rdir / 'tests/demo.17n') assert_allclose(testnav, truth)