Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions src/georinex/obs3.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"])
Expand Down Expand Up @@ -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] = {}
Expand Down
8 changes: 8 additions & 0 deletions src/georinex/tests/test_obs3.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]