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

Fix errors in RINEX reading function #22

Merged
merged 3 commits into from
May 16, 2024

Conversation

jashlearn
Copy link
Collaborator

The existing rinex reading functions unfortunately atrophied over time and there was an failure in the line that extracted the expected column count from the signal header information (maybe due to changes in pandas versions) and then also failed using datetime2j2000 due to the runtime type checking in that function.
I reworked the column detection and then removed the type checking in the datetime2j2000 function (that function still might need love and updated type hints but I started by just deleting the branching because it seemed to have the same code on both branches).
This go the function working on the data I originally cared about but testing on further random data revealed it failed for /LGOW00AUS_S_20212590000_01D_30S_MO.rnx obtained from GA's gnss-data and more generally wouldn't work for any RINEX file with more than two lines of signals in the header.
I entirely reworked the way the header reading code works and I think simplified it overall. I also did a little tidy-up in the code generally and it seems to work for a large random sampling of rinex (3) files pulled from gnss-data.
This code still doesn't handle rinex 2, it is a bit brittle in places, and a little funky and maybe slow in implementation (it does a lot of weird fiddling with strings to do the parsing process and I think it can probably all be replaced with block-by-block read_fwf with some post-processing) but it's better than it started.

@jashlearn jashlearn requested a review from ronaldmaj May 15, 2024 23:33
Copy link
Collaborator

@ronaldmaj ronaldmaj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. I've tested this locally and after the new commits you've put through, works well in reading in RINEX files and outputting them as a dataframe.
Thanks for picking up on this and updating it for changes that have occurred in the dependent modules

@ronaldmaj ronaldmaj merged commit 02861d7 into GeoscienceAustralia:main May 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants