From: Dirk Koopman Date: Wed, 22 Jul 2020 22:28:02 +0000 (+0100) Subject: WIP RBN, add skimmer analysis program X-Git-Url: http://gb7djk.dxcluster.net/gitweb/gitweb.cgi?a=commitdiff_plain;h=4eb47d73bc2221bde7a1dd761cef99e84b0bb388;p=spider.git WIP RBN, add skimmer analysis program --- diff --git a/perl/RBN.pm b/perl/RBN.pm index cfc082de..03efc0d3 100644 --- a/perl/RBN.pm +++ b/perl/RBN.pm @@ -301,7 +301,7 @@ sub normal # process to just the standard "message passing" which has been shown to be able to sustain over 5000 # per second (limited by the test program's output and network speed, rather than DXSpider's handling). - my $nqrg = nearest(1, $qrg); # normalised to nearest Khz + my $nqrg = nearest(5, $qrg*10); # normalised to nearest .5 Khz (but multipled by 10 to get an integer) # my $nqrg = nearest_even($qrg); # normalised to nearest Khz my $sp = "$call|$nqrg"; # hopefully the skimmers will be calibrated at least this well! my $spp = sprintf("$call|%d", $nqrg+1); # but, clearly, my hopes are rudely dashed @@ -513,7 +513,7 @@ sub dx_spot dbg("RBN: STRENGTH spot: $s->[SCall] qrg: $s->[SQrg] origin: $s->[SOrigin] dB: $r->[RStrength] < $strength") if isdbg 'rbnll'; } - if ($rf) { + if ($rf && !$want) { my ($want, undef) = $rf->it($s); dbg("RBN: FILTERING for $call spot: $s->[SCall] qrg: $s->[SQrg] origin: $s->[SOrigin] dB: $r->[RStrength] com: '$s->[SComment]' want: " . ($want ? 'YES':'NO')) if isdbg 'rbnll'; next unless $want; diff --git a/perl/skimmeranaylsis.pl b/perl/skimmeranaylsis.pl new file mode 100755 index 00000000..b0704765 --- /dev/null +++ b/perl/skimmeranaylsis.pl @@ -0,0 +1,38 @@ +#!/usr/bin/perl +# +# +use lib qw(.); +use Math::Round qw(:all); +use JSON; +use Text::Morse; + +$morse = new Text::Morse; + +while (<>) { + next unless /SK0MMR/; + ($gts,$sk,$f,$c,$md,$str,$zt)=m|^(\d+)\^.*DX de ([-\w\d/]+)-\#:\s+([\.\d]+)\s+([-\w\d/]+)\s+(\w{1,3})\s+(-?\d+).*(\d{4})Z|; + next unless $sk && $c; + $e = sprintf "%010d", nearest(5, $f*10); + $m = ''; #$morse->Encode($c); + $t10 = nearest(60, $gts); + $key = "$zt|$e"; + + $r = $spot{$key} ||= {}; + $s = $r->{"$c|$m"} ||= {}; + my ($sec,$min,$hour) = gmtime $gts; + $s->{$sk} = sprintf "%-.3s %4d %.1f %02d:%02d:%02d", $md, $str, $f, $hour, $min, $sec; + + ++$skim{$sk}; + ++$call{$c}; +} + +$json = JSON->new->canonical(1)->indent(1); +print $json->encode(\%spot), "\n"; +print $json->encode(\%skim), "\n"; +print $json->encode(\%call), "\n"; + +$spotk = keys %spot; +$skimk = keys %skim; +$callk = keys %call; + +print "spots: $spotk skimmers: $skimk spotted calls: $callk\n";