summaryrefslogtreecommitdiff
path: root/gpsprof
diff options
context:
space:
mode:
authorGary E. Miller <gem@rellim.com>2009-11-11 11:12:11 +0000
committerGary E. Miller <gem@rellim.com>2009-11-11 11:12:11 +0000
commit0a4ab8e5e8bf3c1bc65467d1193556a5a1dd6ff2 (patch)
treeb72526df74b0b647b93065a4997295b1397c6c5b /gpsprof
parent9e8952cceb1522fbc47cfafea1d172c89e276c34 (diff)
downloadgpsd-0a4ab8e5e8bf3c1bc65467d1193556a5a1dd6ff2.tar.gz
Add comment and remove redundant else.
Diffstat (limited to 'gpsprof')
-rwxr-xr-xgpsprof12
1 files changed, 6 insertions, 6 deletions
diff --git a/gpsprof b/gpsprof
index dbf42fa8..f12ff75c 100755
--- a/gpsprof
+++ b/gpsprof
@@ -65,12 +65,12 @@ class spaceplot:
if len(self.fixes) == 0:
sys.stderr.write("No fixes collected, can't estimate accuracy.")
sys.exit(1)
- else:
- self.centroid = (sum(map(lambda x:x[0], self.fixes))/len(self.fixes), sum(map(lambda x:x[1], self.fixes))/len(self.fixes))
- # Sort fixes by distance from centroid
- self.fixes.sort(lambda x, y: cmp(self.d(self.centroid, x), self.d(self.centroid, y)))
- # Convert fixes to offsets from centroid in meters
- self.recentered = map(lambda fix: gps.MeterOffset(self.centroid, fix[:2]), self.fixes)
+ # centroid is just arithemtic avg of lat,lon
+ self.centroid = (sum(map(lambda x:x[0], self.fixes))/len(self.fixes), sum(map(lambda x:x[1], self.fixes))/len(self.fixes))
+ # Sort fixes by distance from centroid
+ self.fixes.sort(lambda x, y: cmp(self.d(self.centroid, x), self.d(self.centroid, y)))
+ # Convert fixes to offsets from centroid in meters
+ self.recentered = map(lambda fix: gps.MeterOffset(self.centroid, fix[:2]), self.fixes)
# Compute CEP(50%)
cep_meters = gps.EarthDistance(self.centroid[:2], self.fixes[len(self.fixes)/2][:2])
alt_sum = 0