Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PRX crashes if provided nav file's name does not follow rinex 3 convention #161

Open
jtec opened this issue Mar 21, 2025 · 6 comments · May be fixed by #162
Open

PRX crashes if provided nav file's name does not follow rinex 3 convention #161

jtec opened this issue Mar 21, 2025 · 6 comments · May be fixed by #162
Labels
bug Something isn't working

Comments

@jtec
Copy link
Owner

jtec commented Mar 21, 2025

To reproduce (to be confirmed), place a .nav file into the same folder as obs file and name it sept0794.25_.nav - it looks like prx crashes when extracting the time range from the file name or something.

@jtec jtec added the bug Something isn't working label Mar 21, 2025
@Ncoroiu
Copy link

Ncoroiu commented Mar 21, 2025

Error message :
2025-03-21:14:30:44,078 INFO [main.py:521] Starting processing sept0793_concat.obs (full path ../sept0793_concat.obs) 2025-03-21:14:30:44,218 WARNING [helpers.py:178] File ../sept0793_concat.obs already contains 'gfzrnx', skipping repair. 2025-03-21:14:30:44,218 INFO [helpers.py:37] Function repair_with_gfzrnx took 0 days 00:00:00.139529 to run. 2025-03-21:14:30:44,218 INFO [nav_file_discovery.py:178] Finding auxiliary files for ../sept0793_concat.obs ... 2025-03-21:14:30:44,219 INFO [rio.py:43] opening 195.484882 MByte sept0793_concat.obs 2025-03-21:14:31:54,555 INFO [rio.py:43] opening 195.484882 MByte sept0793_concat.obs 2025-03-21:14:31:54,689 DEBUG [cmd.py:1253] Popen(['git', 'cat-file', '--batch-check'], cwd=/Users/nicoletacoroiu/prx, stdin=<valid stream>, shell=False, universal_newlines=False) 2025-03-21:14:31:54,840 WARNING [helpers.py:178] File ../sept0793_concat.obs already contains 'gfzrnx', skipping repair. 2025-03-21:14:31:54,840 INFO [helpers.py:37] Function repair_with_gfzrnx took 0 days 00:00:00.104577 to run. 2025-03-21:14:31:55,453 INFO [helpers.py:37] Function parse_rinex_obs_file took 0 days 00:00:00.612725 to run. 2025-03-21:14:31:55,636 INFO [helpers.py:37] Function parse_rinex_nav_file took 0 days 00:00:00.182532 to run. 2025-03-21:14:31:55,838 INFO [helpers.py:37] Function parse_rinex_nav_file took 0 days 00:00:00.202010 to run. 2025-03-21:14:31:55,977 INFO [helpers.py:37] Function parse_rinex_nav_file took 0 days 00:00:00.138010 to run. 2025-03-21:14:31:56,135 INFO [helpers.py:37] Function parse_rinex_nav_file took 0 days 00:00:00.158386 to run. 2025-03-21:14:31:56,364 INFO [helpers.py:37] Function parse_rinex_nav_file took 0 days 00:00:00.228294 to run. 2025-03-21:14:31:56,555 INFO [helpers.py:37] Function parse_rinex_nav_file took 0 days 00:00:00.191040 to run. 2025-03-21:14:31:56,739 INFO [helpers.py:37] Function parse_rinex_nav_file took 0 days 00:00:00.183111 to run. 2025-03-21:14:31:56,964 INFO [helpers.py:37] Function parse_rinex_nav_file took 0 days 00:00:00.225376 to run. 2025-03-21:14:31:57,151 INFO [helpers.py:37] Function parse_rinex_nav_file took 0 days 00:00:00.185353 to run. 2025-03-21:14:31:57,152 INFO [helpers.py:445] Parsing ../.cache/uv/git-v0/checkouts/b4a85c53122a4ad9/95ef1d8/src/georinex/tests/data/spare_filled_nav3.rnx (hash e1293e71890010c0e2ab937ae494d3cb) ... 2025-03-21:14:31:57,152 WARNING [helpers.py:178] File ../.cache/uv/git-v0/checkouts/b4a85c53122a4ad9/95ef1d8/src/georinex/tests/data/spare_filled_nav3.rnx already contains 'gfzrnx', skipping repair. 2025-03-21:14:31:57,152 INFO [helpers.py:37] Function repair_with_gfzrnx took 0 days 00:00:00.000068 to run. 2025-03-21:14:31:57,181 INFO [helpers.py:37] Function parse_rinex_nav_file took 0 days 00:00:00.029309 to run. 2025-03-21:14:31:57,183 INFO [helpers.py:37] Function parse_rinex_nav_file took 0 days 00:00:00.001742 to run. 2025-03-21:14:31:57,183 INFO [helpers.py:445] Parsing ../.cache/uv/git-v0/checkouts/b4a85c53122a4ad9/95ef1d8/src/georinex/tests/data/BRDM00DLR_R_20130010000_01D_MN.rnx (hash f233d7e10d3b620eb7ce3e01f54b33d6) ... 2025-03-21:14:31:57,183 WARNING [helpers.py:178] File ../.cache/uv/git-v0/checkouts/b4a85c53122a4ad9/95ef1d8/src/georinex/tests/data/BRDM00DLR_R_20130010000_01D_MN.rnx already contains 'gfzrnx', skipping repair. 2025-03-21:14:31:57,183 INFO [helpers.py:37] Function repair_with_gfzrnx took 0 days 00:00:00.000049 to run. 2025-03-21:14:31:57,205 INFO [helpers.py:37] Function parse_rinex_nav_file took 0 days 00:00:00.022290 to run. 2025-03-21:14:31:57,418 INFO [rio.py:43] opening 195.484882 MByte sept0793_concat.obs 2025-03-21:14:31:57,922 INFO [helpers.py:37] Function parse_rinex_obs_file took 0 days 00:00:00.503344 to run. 2025-03-21:14:31:59,033 INFO [main.py:254] Computing times of emission in satellite time 2025-03-21:14:32:06,227 INFO [main.py:332] Computing satellite states for 2025-079 2025-03-21:14:32:06,238 INFO [helpers.py:37] Function parse_rinex_nav_file took 0 days 00:00:00.011613 to run. /Users/nicoletacoroiu/prx/.venv/lib/python3.12/site-packages/numpy/_core/fromnumeric.py:57: FutureWarning: 'DataFrame.swapaxes' is deprecated and will be removed in a future version. Please use 'DataFrame.transpose' instead. return bound(*args, **kwds) 2025-03-21:14:32:07,259 INFO [helpers.py:37] Function parse_rinex_nav_file took 0 days 00:00:00.010081 to run. 2025-03-21:14:32:07,259 INFO [helpers.py:37] Function parse_rinex_nav_file took 0 days 00:00:00.010105 to run. 2025-03-21:14:32:07,259 INFO [helpers.py:37] Function parse_rinex_nav_file took 0 days 00:00:00.010110 to run. 2025-03-21:14:32:07,259 INFO [helpers.py:37] Function parse_rinex_nav_file took 0 days 00:00:00.010110 to run. 2025-03-21:14:32:14,633 INFO [helpers.py:37] Function select_ephemerides took 0 days 00:00:07.373565 to run. 2025-03-21:14:32:14,647 INFO [helpers.py:37] Function select_ephemerides took 0 days 00:00:07.388068 to run. 2025-03-21:14:32:14,671 INFO [helpers.py:37] Function select_ephemerides took 0 days 00:00:07.411782 to run. 2025-03-21:14:32:14,675 INFO [helpers.py:37] Function select_ephemerides took 0 days 00:00:07.415973 to run. Traceback (most recent call last): File "/Users/nicoletacoroiu/prx/src/prx/main.py", line 572, in <module> process(Path(args.observation_file_path), args.output_format) File "/Users/nicoletacoroiu/prx/src/prx/helpers.py", line 34, in timeit_wrapper result = func(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^ File "/Users/nicoletacoroiu/prx/src/prx/main.py", line 535, in process records = build_records( ^^^^^^^^^^^^^^ File "/Users/nicoletacoroiu/prx/src/prx/helpers.py", line 34, in timeit_wrapper result = func(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^ File "/Users/nicoletacoroiu/prx/src/prx/main.py", line 318, in build_records year = int(file.name[12:16]) ^^^^^^^^^^^^^^^^^^^^^ ValueError: invalid literal for int() with base 10: '_nav'

@plutonheaven
Copy link
Collaborator

@Ncoroiu : could you remove the NAV file from the folder containing the OBS file, and launch uv run python --observation_file_path src/prx/main.py sept0793_concat.obs? I'd expect that prx would download a RINEX NAV file.

@plutonheaven
Copy link
Collaborator

@jtec, I see several problems occurring with this case:

  • The user has put a RINEX NAV file in the same folder than the RINEX OBS file to be processed by prx.
  • The RINEX NAV file is not following the RINEX 3 naming convention
  • The RINEX NAV file has been already been processed by gfzrnx by the user, but kept a non-conventional name.

What is occurring in prx:

  • nav_file_discovery.py does not verify RINEX 3 naming convention, and considers the RINEX NAV file provided by user
  • this file is not processed by gfzrnx because it has already been
  • main.py:318 want to get the year, assuming that the NAV filename follows the RINEX 3 naming convention

What we could change:

  • add a compliance check to the RINEX 3 naming convention in nav_file_discovery.py
  • get the year inside the file rather than in the file's name

@plutonheaven plutonheaven linked a pull request Mar 22, 2025 that will close this issue
@plutonheaven
Copy link
Collaborator

In PR #162, I implemented the first suggested change: add a compliance check to the RINEX 3 naming convention in nav_file_discovery.py

Looking through nav_file_discovery.py, I think we value having a local database of downloaded BRDC NAV files, over using user-defined NAV files. It is still possible to use a local NAV file if it is compliant with RNX naming convention.

See section 4 or appendix A.1 of the RINEX 3.04 format description

@Ncoroiu: you're welcome to test this PR ;-)

@Ncoroiu
Copy link

Ncoroiu commented Mar 24, 2025

Actually it seems it found a navigation file that was not the good one in the repository. I put the obs file in a specific folder (empty) and then the conversion was successfully.

@plutonheaven
Copy link
Collaborator

plutonheaven commented Mar 24, 2025

@Ncoroiu Glad to read that.
Still, I think this issue could be quite common, so thanks for raising it !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants