maxsats.pl 653 B

123456789101112131415161718192021222324252627282930313233
  1. #!/usr/bin/perl
  2. # Copyright (c) 2008 Chris Kuethe <chris.kuethe@gmail.com>
  3. #
  4. # This file is Copyright (c) 2008-2019 by the GPSD project
  5. # SPDX-License-Identifier: BSD-2-clause
  6. use strict;
  7. use warnings;
  8. my ($tm, $nsr, $nt, $nu, @TL, @UL, $l);
  9. while (<>){
  10. next unless (/,Y=\w+ (\d+\.\d+) (\d+):(.+:)/);
  11. $tm = $1;
  12. $nsr = $2;
  13. $l = ":$3:";
  14. $nt = $nu = 0;
  15. @TL = @UL = ();
  16. while ($l =~ /(\d+) \w+ \w+ (\d+) ([01]):/g){
  17. if ($1 <= 32){ # $1 => prn
  18. if ($2){ # $2 => snr
  19. push(@TL, $1);
  20. $nt++;
  21. }
  22. if ($3){ # $3 => used
  23. push(@UL, $1);
  24. $nu++;
  25. }
  26. }
  27. }
  28. print "$tm $nsr nu/nt = $nu/$nt T=\[@TL\] U=\[@UL\]\n" if (($nu >= 10));
  29. }