summaryrefslogtreecommitdiff
path: root/gpsprof
diff options
context:
space:
mode:
authorGary E. Miller <gem@rellim.com>2018-07-14 14:26:29 -0700
committerGary E. Miller <gem@rellim.com>2018-07-14 14:26:29 -0700
commit29ae0aee57b71053f000f8b8cbc0386a6b1a1e4a (patch)
treef82b78130c1829f9b886c51323455a0c9ba256ce /gpsprof
parentec423cffe3105a6f88edc8435d5a9ab131b5b158 (diff)
downloadgpsd-29ae0aee57b71053f000f8b8cbc0386a6b1a1e4a.tar.gz
gpsprof: add mean SNR to polar plots.
Diffstat (limited to 'gpsprof')
-rwxr-xr-xgpsprof17
1 files changed, 8 insertions, 9 deletions
diff --git a/gpsprof b/gpsprof
index a97df99e..46bfd2d2 100755
--- a/gpsprof
+++ b/gpsprof
@@ -744,14 +744,13 @@ class polarplot(plotter):
return res
def plot(self):
- ss_min = 99 # min satellite signal strength
- ss_max = 0 # max satellite signal strength
+ ss = []
for fix in self.fixes:
- # collect min and max
- if ss_max < fix[1]:
- ss_max = fix[1]
- if 0 < fix[1] and ss_min > fix[1]:
- ss_min = fix[1]
+ ss.append(fix[1])
+
+ # calc sats used data: mean, min, max, sigma
+ stat_ss = stats()
+ stat_ss.min_max_mean(ss, 0)
fmt = '''\
unset border
@@ -815,8 +814,8 @@ set palette defined (100 "blue", 200 "green", 300 "red")
count = len(self.fixes)
fmt += '''\
set label 11 at screen 0.01, screen 0.15 "%s\\nmin SS = %d\\nmax SS = %d\\n\
-Samples %d"
-''' % (self.name, ss_min, ss_max, count)
+mean SS = %d\\nSamples %d"
+''' % (self.name, stat_ss.min, stat_ss.max, stat_ss.mean, count)
fmt += '''\
# and finally the plot