How to use the georinex.load function in georinex

To help you get started, we’ve selected a few georinex examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github scivision / georinex / tests / test_sp3.py View on Github external
def test_sp3c():
    dat = gr.load(R / "igs19362.sp3")

    d0 = dat.sel(time="2017-02-14T00:15:00")

    assert len(d0.sv) == 32

    G20 = d0.sel(sv="G20")

    assert G20["position"].values == approx([-6468.900825, 14715.965428, 20990.8862])
    assert G20.clock.item() == approx(459.946483)
github scivision / georinex / tests / test_conv.py View on Github external
def test_netcdf_write(tmp_path):
    """
    NetCDF4 wants suffix .nc -- arbitrary tempfile.NamedTemporaryFile names do NOT work!
    """
    pytest.importorskip('netCDF4')

    fn = tmp_path / 'rw.nc'
    obs = gr.load(R/'demo.10o', out=fn)

    wobs = gr.load(fn)

    assert obs.equals(wobs)
github scivision / georinex / tests / test_sp3.py View on Github external
def test_minimal_sp3c():
    dat = gr.load(R / "minimal.sp3c")

    d0 = dat.sel(time="2017-02-14T00:00:00")

    assert len(d0.sv) == 32

    G20 = d0.sel(sv="G20")

    assert G20["position"].values == approx([-4091.382501, 15329.987734, 21147.362623])
    assert G20.clock.item() == approx(459.944522)
github scivision / georinex / tests / test_obs2.py View on Github external
def test_one_system(use):
    """./ReadRinex.py tests/demo.10o -u G -o r2G.nc
    """
    pytest.importorskip('netCDF4')

    truth = xarray.open_dataset(R / 'r2G.nc', group='OBS')

    obs = gr.load(R/'demo.10o', use=use)
    assert obs.equals(truth)
    assert obs.fast_processing
github scivision / georinex / tests / test_lzw.py View on Github external
def test_obs2_lzw():
    pytest.importorskip('unlzw3')

    fn = R / 'ac660270.18o.Z'

    obs = gr.load(fn)

    hdr = gr.rinexheader(fn)

    assert hdr['t0'] <= gr.to_datetime(obs.time[0])

    assert not obs.fast_processing
github scivision / georinex / tests / test_nav2.py View on Github external
def test_ionospheric_correction():
    nav = gr.load(R/"14601736.18n")
    assert nav.attrs['ionospheric_corr_GPS'] == approx(
                    [0.4657e-08,  0.1490e-07, -0.5960e-07, -0.1192e-06,
                     0.8192e+05,  0.9830e+05, -0.6554e+05, -0.5243e+06])
github scivision / georinex / tests / test_conv.py View on Github external
def test_nc_load(dtype):
    pytest.importorskip('netCDF4')

    truth = xarray.open_dataset(R/'r2all.nc', group=dtype)

    obs = gr.load(R/f'demo.10{dtype[0].lower()}')
    assert obs.equals(truth)
github scivision / georinex / tests / test_conv.py View on Github external
def test_bad_files(tmp_path):
    emptyfn = tmp_path/'nonexistingfilename'
    emptyfn.touch()
    emptyfnrinex = tmp_path/'nonexistingfilename.18o'
    emptyfnrinex.touch()
    emptyfnNC = tmp_path/'nonexistingfilename.nc'
    emptyfnNC.touch()

    nonexist = tmp_path/'nonexist'  # don't touch

    with pytest.raises(ValueError):
        gr.load(emptyfn)

    with pytest.raises(ValueError):
        gr.load(emptyfnrinex)

    with pytest.raises(FileNotFoundError):
        gr.load(nonexist)

    with pytest.raises(ValueError):
        gr.load(emptyfnNC)
github scivision / georinex / PlotRinex.py View on Github external
def main():
    p = ArgumentParser(description='Plot raw Rinex data')
    p.add_argument('rinexfn', help='RINEX file to analyze')
    p.add_argument('sv', help='SVs to analyze e.g. G14 C12', nargs='+')
    p.add_argument('-t', '--tlim', help='time limits (start stop) e.g. 2017-05-25T12:47 2017-05-25T13:05', nargs=2)
    p.add_argument('-w', '--what', help='what measurements to plot e.g. L1C',
                   nargs='+', default=['L1C', 'P1'])
    P = p.parse_args()

    rinexfn = Path(P.rinexfn).expanduser()

    obs = gr.load(rinexfn, use='G')

# %% optional time indexing demo
    # can use datetime or string

    # boolean indexing  -- set "i=slice(None)" to disable time indexing.
    if P.tlim is not None:
        i = (obs.time >= np.datetime64(P.tlim[0])) & (obs.time <= np.datetime64(P.tlim[1]))
    else:
        i = slice(None)
# %% plot
    SV = P.sv
    what = P.what
    # FIXME: make these title automatic based on requested measurement?
    # titles = ['Psedoranges of GPS and Glonass', 'Carrier Phase', 'Doppler', 'Signal Strength']
    # ylabels = ['Pseudoranges', 'Phase', 'Doppler', 'signal strength']