diff --git a/src/georinex/obs3.py b/src/georinex/obs3.py index 7b371dc..5889ad8 100644 --- a/src/georinex/obs3.py +++ b/src/georinex/obs3.py @@ -155,6 +155,9 @@ def rinexobs3( if time_offset: data.attrs["time_offset"] = time_offset + if "antenna" in hdr.keys(): + data.attrs["antenna"] = hdr["antenna"] + if "RCV CLOCK OFFS APPL" in hdr.keys(): try: data.attrs["receiver_clock_offset_applied"] = int(hdr["RCV CLOCK OFFS APPL"]) @@ -363,6 +366,12 @@ def obsheader3( fields = {k: fields[k] for k in use if k in fields} + # %% Antenna phase center (optional) + try: + hdr["antenna"] = [float(j) for j in hdr["ANTENNA: DELTA H/E/N"].split()] + except (KeyError, ValueError): + pass + # perhaps this could be done more efficiently, but it's probably low impact on overall program. # simple set and frozenset operations do NOT preserve order, which would completely mess up reading! sysind: dict[str, T.Any] = {} diff --git a/src/georinex/tests/test_obs3.py b/src/georinex/tests/test_obs3.py index 4f969cc..bdc8a97 100755 --- a/src/georinex/tests/test_obs3.py +++ b/src/georinex/tests/test_obs3.py @@ -208,3 +208,11 @@ def tests_all_indicators(): def test_time_system(fn, tname): obs = gr.load(ir.files(f"{__package__}.data") / fn) assert obs.attrs["time_system"] == tname + + +@pytest.mark.parametrize("fname", ["CEBR00ESP_R_20182000000_01D_30S_MO.crx.gz"]) +def test_antenna_offset(fname): + fn = ir.files(f"{__package__}.data") / fname + obs = gr.load(fn, use=["G"], tlim=['2018-07-19T01:00', '2018-07-19T01:05'] ) + + assert obs.antenna == [0.178, 0.0, 0.0]