diff options
author | Gary E. Miller <gem@rellim.com> | 2009-11-11 11:12:11 +0000 |
---|---|---|
committer | Gary E. Miller <gem@rellim.com> | 2009-11-11 11:12:11 +0000 |
commit | 0a4ab8e5e8bf3c1bc65467d1193556a5a1dd6ff2 (patch) | |
tree | b72526df74b0b647b93065a4997295b1397c6c5b /gpsprof | |
parent | 9e8952cceb1522fbc47cfafea1d172c89e276c34 (diff) | |
download | gpsd-0a4ab8e5e8bf3c1bc65467d1193556a5a1dd6ff2.tar.gz |
Add comment and remove redundant else.
Diffstat (limited to 'gpsprof')
-rwxr-xr-x | gpsprof | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -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 |