summaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
authorChris Kuethe <chris.kuethe@gmail.com>2008-02-13 06:03:11 +0000
committerChris Kuethe <chris.kuethe@gmail.com>2008-02-13 06:03:11 +0000
commitc246a89ff97bde7933e84f2ef5387f5b39ff7db9 (patch)
treebbfa52a58d8a845f4f7300b4b909376131de868d /contrib
parent17ba3c01cc815d0e16bd54f68f554b6b9c5b40e2 (diff)
downloadgpsd-c246a89ff97bde7933e84f2ef5387f5b39ff7db9.tar.gz
Add a little maximum satellite visibility analyzer
Diffstat (limited to 'contrib')
-rw-r--r--contrib/README5
-rwxr-xr-xcontrib/maxsats.pl42
2 files changed, 47 insertions, 0 deletions
diff --git a/contrib/README b/contrib/README
index f59d4b01..20a0f0e8 100644
--- a/contrib/README
+++ b/contrib/README
@@ -34,3 +34,8 @@ have the PHP-GD installed to use this script.
ashctl is like nmeasend or sirfctl, but for Ashtech receivers.
ubxsend is like nmeasend or sirfctl, but for u-blox receivers.
+
+maxsats.pl analyzes a collection of "Y" messages and outputs records
+describing periods of excellent visibility (ie. 10 or more PRNs tracked).
+With over 30 SVs on orbit, there are periods where 14 PRNs are above the
+horizon, 13 are tracking, and at least 12 are actually used in a solution.
diff --git a/contrib/maxsats.pl b/contrib/maxsats.pl
new file mode 100755
index 00000000..69639e83
--- /dev/null
+++ b/contrib/maxsats.pl
@@ -0,0 +1,42 @@
+#!/usr/bin/perl
+# $Id$
+
+# Copyright (c) 2008 Chris Kuethe <chris.kuethe@gmail.com>
+#
+# Permission to use, copy, modify, and distribute this software for any
+# purpose with or without fee is hereby granted, provided that the above
+# copyright notice and this permission notice appear in all copies.
+#
+# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+
+use strict;
+use warnings;
+
+my ($tm, $nsr, $nt, $nu, @TL, @UL, $l);
+while (<>){
+ next unless (/,Y=\w+ (\d+\.\d+) (\d+):(.+:)/);
+ $tm = $1;
+ $nsr = $2;
+ $l = ":$3:";
+ $nt = $nu = 0;
+ @TL = @UL = ();
+ while ($l =~ /(\d+) \w+ \w+ (\d+) ([01]):/g){
+ if ($1 <= 32){ # $1 => prn
+ if ($2){ # $2 => snr
+ push(@TL, $1);
+ $nt++;
+ }
+ if ($3){ # $3 => used
+ push(@UL, $1);
+ $nu++;
+ }
+ }
+ }
+ print "$tm $nsr nu/nt = $nu/$nt T=\[@TL\] U=\[@UL\]\n" if (($nu >= 10));
+}