WIP RBN, add skimmer analysis program
authorDirk Koopman <djk@tobit.co.uk>
Wed, 22 Jul 2020 22:28:02 +0000 (23:28 +0100)
committerDirk Koopman <djk@tobit.co.uk>
Wed, 22 Jul 2020 22:28:02 +0000 (23:28 +0100)
perl/RBN.pm
perl/skimmeranaylsis.pl [new file with mode: 0755]

index cfc082de685a99b676ca98d679d8544688c161ec..03efc0d380734b575eac63007196e40c7af0305b 100644 (file)
@@ -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 (executable)
index 0000000..b070476
--- /dev/null
@@ -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";