gpsd-dev
[Top][All Lists]
Advanced

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

[gpsd-dev] [PATCH 1/2] Remove call to leastsquares in graph code. This i


From: Sanjeev Gupta
Subject: [gpsd-dev] [PATCH 1/2] Remove call to leastsquares in graph code. This is not used at all
Date: Sat, 9 May 2015 10:41:24 +0800

Since URC corrections are in infrequent discrete jumps of 1s,
it makes no sense to try and graph trends and error bars.  Residual
errors, if any, should be plotted with respect to DUT1.

This patch removes the call, next patch will remove dead code.
---
 leapsecond.py | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/leapsecond.py b/leapsecond.py
index b7de5a0..2de3a2e 100755
--- a/leapsecond.py
+++ b/leapsecond.py
@@ -292,14 +292,9 @@ def unix_to_iso(tv):
 def graph_history(filename):
     "Generate a GNUPLOT plot of the leap-second history."
     raw = fetch_leapsecs(filename)
-    (b, c, e) = leastsquares(zip(range(len(raw)), raw))
-    e /= (60 * 60 * 24 * 7)
     dates = map(lambda t: time.strftime("%Y-%m-%d", time.localtime(t)), raw)
     enddate = time.strftime("%Y-%m-%d", time.localtime(raw[-1]+16416000)) # 
Adding 190 days to scale
     fmt = ''
-    fmt += '# Least-squares approximation of Unix time from leapsecond is:\n'
-    fmt += 'lsq(x) = %s * x + %s\n' % (b, c)
-    fmt += '# Maximum residual error is %.2f weeks\n' % e
     fmt += 'set autoscale\n'
     fmt += 'set ylabel "GPS-UTC (s)"\n'
     fmt += 'set yrange [-1:%d]\n' % (len(dates))
-- 
2.1.4




reply via email to

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