The Satellite (Sky) view oscillates between two different states when both GPGSV and PUBX03 (UBX03) are enabled:
This seems bad:
... while this looks OK:
The parsed data seems to be valid, so the problem is probably in the _process_UBX03() funcion (nmea_handler.py).
The function makes a dictionary of tuples:
gsvdict[key] = (
gnss,
svid,
getattr(data, f"azi{i+1:02}"),
getattr(data, f"ele{i+1:02}"),
str(getattr(data, f"cno{i+1:02}")),
now,
)
Later it moves the tuples around:
for key in gsv_dict:
self.gsv_log[key] = gsv_dict[key]
... and unpacks the tuples back into variables:
for key in self.gsv_log:
gnssId, svid, elev, azim, snr, lastupdate = self.gsv_log[key]
The 3rd and 4th fields are swapped, i.e. the elevation and azimuth have switched places!
It might be useful to have an assert statement to check that a satellite's elevation never exceeds 90 degrees.
probably also need to tweak SVID numbering for the PUBX03 message, which is not consistent with other NMEA or UBX SV messages for all constellations (e.g. Galileo).
PyGPSClient Bug Report Template
NB: Please raise any general queries in the pygpsclient Discussions Channels in the first instance.
Describe the bug
(Reported via email by Matti Öhman)
The Satellite (Sky) view oscillates between two different states when both GPGSV and PUBX03 (UBX03) are enabled:
This seems bad:![image1](https://github.com/semuconsulting/PyGPSClient/assets/28569967/4aab70e7-4e3a-42ba-9def-636f0cb9f2d1)
... while this looks OK:![image2](https://github.com/semuconsulting/PyGPSClient/assets/28569967/f4daaa11-0516-4213-9304-52bfac11c7f5)
The parsed data seems to be valid, so the problem is probably in the _process_UBX03() funcion (nmea_handler.py).
The function makes a dictionary of tuples: gsvdict[key] = ( gnss, svid, getattr(data, f"azi{i+1:02}"), getattr(data, f"ele{i+1:02}"), str(getattr(data, f"cno{i+1:02}")), now, )
Later it moves the tuples around: for key in gsv_dict: self.gsv_log[key] = gsv_dict[key]
... and unpacks the tuples back into variables: for key in self.gsv_log: gnssId, svid, elev, azim, snr, lastupdate = self.gsv_log[key]
The 3rd and 4th fields are swapped, i.e. the elevation and azimuth have switched places!
It might be useful to have an assert statement to check that a satellite's elevation never exceeds 90 degrees.