Exemplo n.º 1
0
def test_obs2():
    fn = R / 'york0440.15d'

    info = gr.rinexinfo(fn)
    assert int(info['version']) == 1

    obs = gr.load(fn, tlim=('2015-02-13T23:00', '2015-02-13T23:01'))

    assert obs.time.size == 3
    assert obs.sv.size == 9
    assert obs['S1'].values[0, :3] == pytest.approx([44., 41., 51.])
Exemplo n.º 2
0
def test_obs2():

    fn = R / "york0440.15d"

    info = gr.rinexinfo(fn)
    assert int(info["version"]) == 1

    obs = gr.load(fn, tlim=("2015-02-13T23:00", "2015-02-13T23:01"))

    assert obs.time.size == 3
    assert obs.sv.size == 9
    assert obs["S1"].values[0, :3] == pytest.approx([44.0, 41.0, 51.0])
Exemplo n.º 3
0
def test_obs3_gz():

    fn = R / "CEBR00ESP_R_20182000000_01D_30S_MO.crx.gz"

    info = gr.rinexinfo(fn)
    assert int(info["version"]) == 3

    # %% full file
    obs = gr.load(fn, tlim=("2018-07-19T01", "2018-07-19T01:10"))

    assert (obs.sv.values == [
        "C05",
        "C10",
        "C14",
        "C22",
        "C31",
        "E01",
        "E04",
        "E09",
        "E11",
        "E19",
        "E21",
        "E31",
        "G02",
        "G05",
        "G07",
        "G13",
        "G15",
        "G21",
        "G24",
        "G28",
        "G30",
        "R03",
        "R04",
        "R05",
        "R13",
        "R14",
        "R15",
        "R16",
        "R21",
        "S20",
        "S23",
        "S25",
        "S47",
        "S48",
    ]).all()

    times = gr.to_datetime(obs.time)

    assert times[0] == datetime(2018, 7, 19, 1)
    assert times[-1] == datetime(2018, 7, 19, 1, 10)
Exemplo n.º 4
0
def test_obs2():
    fn = R / 'york0440.15d'

    info = gr.rinexinfo(fn)
    assert int(info['version']) == 1

    if not gr.crxexe():
        pytest.skip(f'crx2rnx not found')

    obs = gr.load(fn, tlim=('2015-02-13T23:00', '2015-02-13T23:01'))

    assert obs.time.size == 3
    assert obs.sv.size == 9
    assert obs['S1'].values[0, :3] == pytest.approx([44., 41., 51.])
Exemplo n.º 5
0
def test_obs(rinex_version):
    fn = R / f'minimal{rinex_version}.10o'
    txt = fn.read_text()

    with io.StringIO(txt) as f:
        info = gr.rinexinfo(f)
        assert info['rinextype'] == 'obs'

        times = gr.gettime(f)
        obs = gr.load(f)

    assert times == datetime(2010, 3, 5, 0, 0, 30)

    assert obs.equals(gr.load(fn)), 'StringIO not matching direct file read'
Exemplo n.º 6
0
def test_nav3(rinex_version, t):
    fn = R / f'minimal{rinex_version}.10n'
    txt = fn.read_text()

    with io.StringIO(txt) as f:
        info = gr.rinexinfo(f)
        assert info['rinextype'] == 'nav'

        times = gr.gettime(f)
        nav = gr.load(f)

    assert times == t

    assert nav.equals(gr.load(fn)), 'StringIO not matching direct file read'
Exemplo n.º 7
0
def test_obs(rinex_version):
    fn = R / f"minimal{rinex_version}.10o"
    txt = fn.read_text()

    with io.StringIO(txt) as f:
        info = gr.rinexinfo(f)
        assert info["rinextype"] == "obs"

        times = gr.gettime(f)
        obs = gr.load(f)

    assert times == datetime(2010, 3, 5, 0, 0, 30)

    assert obs.equals(gr.load(fn)), "StringIO not matching direct file read"
Exemplo n.º 8
0
def test_nav3(rinex_version, t):
    fn = R / f"minimal{rinex_version}.10n"
    txt = fn.read_text()

    with io.StringIO(txt) as f:
        info = gr.rinexinfo(f)
        assert info["rinextype"] == "nav"

        times = gr.gettime(f)
        nav = gr.load(f)

    assert times == t

    assert nav.equals(gr.load(fn)), "StringIO not matching direct file read"
Exemplo n.º 9
0
def test_obs3(suffix):
    fn = R / ("P43300USA_R_20190012056_17M_15S_MO" + suffix)

    info = gr.rinexinfo(fn)

    assert int(info["version"]) == 3
    # %% full file
    obs = gr.load(fn, tlim=("2019-01-01", "2019-01-01T20:57"))

    assert (obs.sv.values == [
        "C08",
        "C19",
        "C20",
        "C22",
        "C32",
        "C36",
        "C37",
        "E02",
        "E03",
        "E05",
        "E08",
        "E24",
        "E25",
        "G01",
        "G03",
        "G06",
        "G09",
        "G14",
        "G16",
        "G22",
        "G23",
        "G26",
        "G31",
        "R01",
        "R02",
        "R08",
        "R10",
        "R11",
        "R12",
        "R17",
        "S31",
        "S33",
        "S35",
        "S38",
    ]).all()

    times = gr.to_datetime(obs.time)

    assert times[0] == datetime(2019, 1, 1, 20, 56, 45)
    assert times[-1] == datetime(2019, 1, 1, 20, 57)
Exemplo n.º 10
0
def test_obs3():
    fn = R / 'P43300USA_R_20190012056_17M_15S_MO.crx'

    info = gr.rinexinfo(fn)

    assert int(info['version']) == 3
    # %% full file
    obs = gr.load(fn, tlim=('2019-01-01', '2019-01-01T20:57'))

    assert (obs.sv.values == [
        'C08', 'C19', 'C20', 'C22', 'C32', 'C36', 'C37', 'E02', 'E03', 'E05',
        'E08', 'E24', 'E25', 'G01', 'G03', 'G06', 'G09', 'G14', 'G16', 'G22',
        'G23', 'G26', 'G31', 'R01', 'R02', 'R08', 'R10', 'R11', 'R12', 'R17',
        'S31', 'S33', 'S35', 'S38'
    ]).all()

    times = gr.to_datetime(obs.time)

    assert times[0] == datetime(2019, 1, 1, 20, 56, 45)
    assert times[-1] == datetime(2019, 1, 1, 20, 57)
Exemplo n.º 11
0
def test_obs3():
    if not gr.crxexe():
        pytest.skip(f'crx2rnx not found')

    fn = R / 'P43300USA_R_20190012056_17M_15S_MO.crx'

    info = gr.rinexinfo(fn)

    assert int(info['version']) == 3
# %% full file
    obs = gr.load(fn, tlim=('2019-01-01', '2019-01-01T20:57'))

    assert (obs.sv.values == ['C08', 'C19', 'C20', 'C22', 'C32', 'C36', 'C37', 'E02', 'E03',
                              'E05', 'E08', 'E24', 'E25', 'G01', 'G03', 'G06', 'G09', 'G14',
                              'G16', 'G22', 'G23', 'G26', 'G31', 'R01', 'R02', 'R08', 'R10',
                              'R11', 'R12', 'R17', 'S31', 'S33', 'S35', 'S38']).all()

    times = gr.to_datetime(obs.time)

    assert times[0] == datetime(2019, 1, 1, 20, 56, 45)
    assert times[-1] == datetime(2019, 1, 1, 20, 57)
Exemplo n.º 12
0
def test_obs3_gz():

    fn = R / 'CEBR00ESP_R_20182000000_01D_30S_MO.crx.gz'

    info = gr.rinexinfo(fn)
    assert int(info['version']) == 3

    if not gr.crxexe():
        pytest.skip(f'crx2rnx not found')
# %% full file
    obs = gr.load(fn, tlim=('2018-07-19T01', '2018-07-19T01:10'))

    assert (obs.sv.values == ['C05', 'C10', 'C14', 'C22', 'C31', 'E01', 'E04', 'E09', 'E11',
                              'E19', 'E21', 'E31', 'G02', 'G05', 'G07', 'G13', 'G15', 'G21',
                              'G24', 'G28', 'G30', 'R03', 'R04', 'R05', 'R13', 'R14', 'R15',
                              'R16', 'R21', 'S20', 'S23', 'S25', 'S47', 'S48']).all()

    times = gr.to_datetime(obs.time)

    assert times[0] == datetime(2018, 7, 19, 1)
    assert times[-1] == datetime(2018, 7, 19, 1, 10)
Exemplo n.º 13
0
def test_obs3():
    fn = R / 'CEBR00ESP_R_20182000000_01D_30S_MO.crx.gz'

    info = gr.rinexinfo(fn)

    assert info['hatanaka']
    assert int(info['version']) == 3
    # %% full file
    obs = gr.load(fn, tlim=('2018-07-19T01', '2018-07-19T01:10'))

    assert (obs.sv.values == [
        'C05', 'C10', 'C14', 'C22', 'C31', 'E01', 'E04', 'E09', 'E11', 'E19',
        'E21', 'E31', 'G02', 'G05', 'G07', 'G13', 'G15', 'G21', 'G24', 'G28',
        'G30', 'R03', 'R04', 'R05', 'R13', 'R14', 'R15', 'R16', 'R21', 'S20',
        'S23', 'S25', 'S47', 'S48'
    ]).all()

    times = obs.time.values.astype('datetime64[us]').astype(datetime)

    assert times[0] == datetime(2018, 7, 19, 1)
    assert times[-1] == datetime(2018, 7, 19, 1, 10)