Open kstamatiou opened 8 months ago
This is representative of a larger issue.
elif sys == "I":
if N < 28 and len(cf) >= 28:
N = 28
cf = cf[:28]
elif N == 28:
cf = cf[:28]
Also, the cropped BRDC00IGS_R_20240840000_01D_MN.rnx
file you posted in this issue should work with or without this fix since the issue is with IRNSS (system I) and not GPS (system G). I downloaded the full rinex file from IGS and have attached here a cropped version of the rinex that includes an "I02" entry.
BRDC00IGS_R_20240840000_01D_MN.zip
N
being smaller than the standard value for its constellation since missing values that are treated as zero may be present at the end of the entry. In a previous commit, I made a patch to fix the same issue with QZSS, but in this issue the IRNSS entries have a similar problem.@scivision, I'm happy to create a pull request to fix this specific IRNSS issue, but I don't know if you'd rather have me reevaluate the _sparefields function or even the _num_fields function to fix the overall problem and not just patch by constellation. Let me know what you'd think is best.
Thanks a lot for the reply @betaBison.
Indeed, the problem is due to IRNSS, so the interim solution that I came up with is to simply truncate the file in order to exclude these entries; then load()
works just fine.
ValueError Traceback (most recent call last) Cell In[2], line 2 1 filepath = "/home/kostas/Downloads/BRDC00IGS_R_20240840000_01D_MN.rnx" ----> 2 dataset = gr.load(filepath)
File ~/zephr-xyz/zephyrus/.venv/lib/python3.10/site-packages/georinex/base.py:65, in load(rinexfn, out, use, tlim, useindicators, meas, verbose, overwrite, fast, interval) 62 info = rinexinfo(rinexfn) 64 if info["rinextype"] == "nav": ---> 65 return rinexnav(rinexfn, outfn, use=use, tlim=tlim, overwrite=overwrite) 66 elif info["rinextype"] == "obs": 67 return rinexobs( 68 rinexfn, 69 outfn, (...) 77 interval=interval, 78 )
File ~/zephr-xyz/zephyrus/.venv/lib/python3.10/site-packages/georinex/base.py:166, in rinexnav(fn, outfn, use, group, tlim, overwrite) 164 nav = rinexnav2(fn, tlim=tlim) 165 elif int(info["version"]) == 3: --> 166 nav = rinexnav3(fn, use=use, tlim=tlim) 167 else: 168 raise LookupError(f"unknown RINEX {info} {fn}")
File ~/zephr-xyz/zephyrus/.venv/lib/python3.10/site-packages/georinex/nav3.py:98, in rinexnav3(fn, use, tlim) 95 duplicate = tu.size != t[svi][check].size 97 full_fields = fields[sv[0]] ---> 98 compact_fields = _sparefields(full_fields, sys=sv[0], N=_num_fields(raws[svi[0]])) 99 compact_index = [i for i, c in enumerate(full_fields) if c in compact_fields] 101 darr = np.empty((svi.size, len(full_fields)))
File ~/zephr-xyz/zephyrus/.venv/lib/python3.10/site-packages/georinex/nav3.py:234, in _sparefields(cf, sys, N) 231 cf = cf[:28] 233 if N != len(cf): --> 234 raise ValueError(f"System {sys} NAV data is not the same length as the number of fields.") 236 return cf
ValueError: System I NAV data is not the same length as the number of fields.