gpsd-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gpsd-dev] [PATCH 1/2] Excludes unknown-position sats from skyview displ


From: Fred Wright
Subject: [gpsd-dev] [PATCH 1/2] Excludes unknown-position sats from skyview displays.
Date: Thu, 22 Sep 2016 16:28:35 -0700

In some cases, the elevation and azimuth information are missing
(i.e., reported as 0) for some satellites.  E.g., the Navika-100
receiver fails to report positions for SBAS satellites.  This change
avoids showing such satellites at the "north point" of the display.
They are *not* excluded from the textual list.

TESTED:
Ran xgps, xgpsspeed, and webgps.py against data from a Navika-100
receiver, and verified that the SBAS satellites are no longer
inappropriately shown at the top.
---
 contrib/webgps.py | 5 ++++-
 xgps              | 2 ++
 xgpsspeed         | 9 ++++++---
 3 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/contrib/webgps.py b/contrib/webgps.py
index 0a801b5..2e9a818 100755
--- a/contrib/webgps.py
+++ b/contrib/webgps.py
@@ -244,7 +244,10 @@ function draw_satview() {
 
         # Draw the satellites
         for s in self.satellites:
-            x, y = polartocart(s.elevation, s.azimuth)
+            el, az = s.elevation, s.azimuth
+            if el == 0 and az == 0:
+                continue  # Skip satellites with unknown position
+            x, y = polartocart(el, az)
             fill = not s.used and 'lightgrey' or \
                 s.ss < 30 and 'red' or \
                 s.ss < 35 and 'yellow' or \
diff --git a/xgps b/xgps
index 4a0abbe..066401f 100755
--- a/xgps
+++ b/xgps
@@ -235,6 +235,8 @@ class SkyView(Gtk.DrawingArea):
         # The satellites
         self.cr.set_line_width(2)
         for sat in self.satellites:
+            if sat.az == 0 and sat.el == 0:
+                continue  # Skip satellites with unknown position
             (x, y) = self.pol2cart(sat.az, sat.el)
             if sat.ss < 10:
                 self.set_color("Gray")
diff --git a/xgpsspeed b/xgpsspeed
index 30954b2..277b575 100755
--- a/xgpsspeed
+++ b/xgpsspeed
@@ -449,15 +449,18 @@ class NauticalSpeedometer(Speedometer):
         self.cr.set_source_rgb(r, g, b)
 
     def draw_sat(self, satsoup, radius, x, y):
-        """given a sat's elevation, azimath, SNR, draw it on the skyview
+        """Given a sat's elevation, azimuth, SNR, draw it on the skyview
         Arg:
         satsoup: a dictionary {'el': xx, 'az': xx, 'ss': xx}
         """
-        h = pi / 2 - radians(satsoup['az'])  # to xy
+        el, az = satsoup['el'], satsoup['az']
+        if el == 0 and az == 0:
+            return  # Skip satellites with unknown position
+        h = pi / 2 - radians(az)  # to xy
         self.cr.set_line_width(2)
         self.cr.set_source_rgb(0, 0, 0)
 
-        x0, y0 = NauticalSpeedometer.polar2xy(radius * (90 - satsoup['el']) // 
90, h, x, y)
+        x0, y0 = NauticalSpeedometer.polar2xy(radius * (90 - el) // 90, h, x, 
y)
 
         self.cr.new_sub_path()
         if gps.is_sbas(satsoup['PRN']):
-- 
2.9.3




reply via email to

[Prev in Thread] Current Thread [Next in Thread]