Skip to content

Commit e9fcad7

Browse files
committed
update rinexconv
1 parent 61e1003 commit e9fcad7

10 files changed

Lines changed: 800 additions & 295 deletions

RELEASE_NOTES.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@
55
FIXES:
66

77
1. Restore (nested) pynmeagps dependency in pyproject.toml. Fixes #136
8+
1. Fix blank meteorology output file error. Fixes #138
9+
10+
CHANGES:
11+
12+
1. Updates to rinex conversion to support RINEX version 4.02 in addition to 3.05.
813

914
### RELEASE 1.2.0
1015

examples/process_rxmsfrbx_frames.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
raw NAV subframes from a UBX RXM-SFRBX data log using
66
the pygnssutils.RawNav utility class.
77
8-
This collates the following subframes for each SV4
8+
This collates the following subframes for each SV
99
into a single RawNav object.
1010
1111
- subframe 1: clock corrections, sv health, etc.
@@ -42,7 +42,7 @@
4242
SFR2 = 2
4343
SFR3 = 4
4444
SFR4 = 8
45-
TARGET_SFR = SFR1 | SFR2 | SFR3 # | SFR4
45+
TARGET_SFR = SFR1 | SFR2 | SFR3 # | SFR4
4646

4747

4848
def main(**kwargs):
@@ -67,9 +67,7 @@ def main(**kwargs):
6767
tot += 1
6868

6969
sfrdata = RawNav.process_rxm_sfrbx(parsed)
70-
if sfrdata.get("gnss", "") != GPS or sfrdata.get("sigid", "") not in (
71-
"1C",
72-
):
70+
if sfrdata.get("gnss", "") != GPS or sfrdata.get("sigid", "") not in ("1C","2L"):
7371
continue
7472

7573
gnss = sfrdata["gnss"]
@@ -98,8 +96,6 @@ def main(**kwargs):
9896
if nav.sfracq & 0b111 == TARGET_SFR:
9997
frame = navs.pop((gnss, svid))
10098
print(f"{str(frame)}\n")
101-
# if frame.svid == 19:
102-
# print(f"{frame.gnss}{frame.svid=:02d}, {frame.tow=}, {frame.iodc=}")
10399
lnavs[svid] = lnavs.get(svid, 0) + 1
104100
sfr += 1
105101
except RINEXProcessingError:

src/pygnssutils/rinex_conv.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
MET,
4444
NAV,
4545
OBS,
46+
RINEX4,
4647
RINEX_CANCELLED,
4748
RINEX_ERROR,
4849
RINEX_NORECS,
@@ -272,7 +273,7 @@ def process_input_data(
272273
for raw, parsed in gnr:
273274
if stopevent is not None:
274275
if stopevent.is_set():
275-
raise RINEXProcessingError("Cancelled")
276+
raise KeyboardInterrupt("Terminated by user")
276277
if raw is not None:
277278
self._tot += 1
278279
self._progress = int(round(100 * self._tot / self._msgcount, 0))
@@ -300,9 +301,6 @@ def process_input_data(
300301
self.process_output_data(rinextypes)
301302
res = RINEX_OK
302303

303-
# except (TypeError, ValueError, AttributeError) as err:
304-
# self.logger.error(err)
305-
# res = RINEX_ERROR
306304
except RINEXProcessingError as err:
307305
self.logger.error(f"Processing error {err}")
308306
res = RINEX_ERROR
@@ -346,7 +344,7 @@ def format_header_common(self, rinextype: Literal["O", "N", "M"]) -> str:
346344
+ format_runby()
347345
+ format_comments(self.user_comments)
348346
)
349-
if self._rinex_version >= "4.00":
347+
if self._rinex_version >= RINEX4:
350348
hdr += (
351349
format_doi(self._doi)
352350
+ format_licenseofuse(self._license)

src/pygnssutils/rinex_conv_cli.py

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
RINEX_OK,
3434
RINEXTYPE,
3535
RINEXVER_DEFAULT,
36+
RINEXVERSIONS,
3637
)
3738
from pygnssutils.rinex_helpers import listify
3839

@@ -64,8 +65,9 @@ def main():
6465
"-R",
6566
"--rinexver",
6667
required=False,
67-
help="RINEX Version e.g. '3.05'",
68+
help="RINEX Version",
6869
type=str,
70+
choices=RINEXVERSIONS,
6971
default=RINEXVER_DEFAULT,
7072
)
7173
ap.add_argument(
@@ -153,6 +155,27 @@ def main():
153155
type=str,
154156
default="",
155157
)
158+
ap.add_argument(
159+
"--doi",
160+
required=False,
161+
help="Digital Object Identifier (RINEX 4 only)",
162+
type=str,
163+
default="",
164+
)
165+
ap.add_argument(
166+
"--license",
167+
required=False,
168+
help="License of Use (RINEX 4 only)",
169+
type=str,
170+
default="",
171+
)
172+
ap.add_argument(
173+
"--station",
174+
required=False,
175+
help="Station Information (RINEX 4 only)",
176+
type=str,
177+
default="",
178+
)
156179
ap.add_argument(
157180
"--comments",
158181
required=False,
@@ -191,6 +214,9 @@ def main():
191214
protfilter=int(
192215
kwargs.pop("protfilter", NMEA_PROTOCOL | UBX_PROTOCOL | RTCM3_PROTOCOL)
193216
),
217+
doi=kwargs.pop("doi", ""),
218+
license=kwargs.pop("license", ""),
219+
station=kwargs.pop("station", ""),
194220
**kwargs,
195221
)
196222
res = rc.process_input(

0 commit comments

Comments
 (0)