geospace-code / georinex

Python RINEX 2 / 3 NAV / OBS / sp3 reader & batch convert to HDF5 with C-like speed
MIT License
216 stars 89 forks source link

Navigation file parser: strip whitespace off string before casting to float to handle blank fields #101

Closed jtec closed 5 months ago

jtec commented 6 months ago

This PR strips leading and trailing whitespace off RINEX navigation message fields before converting to float. This avoids hitting https://github.com/geospace-code/georinex/blob/da3eb3e5af30d38e1c865854682447800503bfc8/src/georinex/nav3.py#L111, which each time discards a whole ephemeris (or more?) when there are blank fields.

Contributions by @betaBison:

Also fixes the situation where missing fields are at the end of the entry for QZSS. This was throwing an error since the .rstrip() happening to count the number of fields was removing the final spaces which was resulting in NaN values for the final "FitIntvl" field which should instead be treated as 0.0.

Adds two tests for missing fields.