46 lines
1.2 KiB
Plaintext
46 lines
1.2 KiB
Plaintext
|
#!/bin/bash
|
||
|
# wut-compare-txmode
|
||
|
#
|
||
|
# Check the results of a prediction against vetted results
|
||
|
# using a selected encoding.
|
||
|
# Uses all files in download/ directory.
|
||
|
# Available encodings:
|
||
|
# AFSK AFSK1k2 AHRPT APT BPSK BPSK1k2 BPSK9k6 BPSK12k5 BPSK400 CERTO CW DUV
|
||
|
# FFSK1k2 FM FSK1k2 FSK4k8 FSK9k6 FSK19k2 GFSK1k2 GFSK2k4 GFSK4k8 GFSK9k6
|
||
|
# GFSK19k2 GFSK Rktr GMSK GMSK1k2 GMSK2k4 GMSK4k8 GMSK9k6 GMSK19k2 HRPT LRPT
|
||
|
# MSK1k2 MSK2k4 MSK4k8 PSK PSK31 SSTV USB WSJT
|
||
|
#
|
||
|
# Usage:
|
||
|
# wut-compare-txmode [Encoding]
|
||
|
# Example:
|
||
|
# wut-compare-txmode DUV
|
||
|
|
||
|
MAIN_DIR=`pwd`
|
||
|
OBSENC="$1"
|
||
|
|
||
|
cd download/ || exit
|
||
|
|
||
|
CORRECT=0
|
||
|
INCORRECT=0
|
||
|
for OBSID in *
|
||
|
do
|
||
|
cd $MAIN_DIR
|
||
|
# Get previous rating
|
||
|
VET=`cat download/$OBSID/$OBSID.json | jq --compact-output '.[0] | {vetted_status}' | cut -f 2 -d ":" | sed -e 's/}//g' -e 's/"//g'`
|
||
|
ENC=`cat download/$OBSID/$OBSID.json | jq --compact-output '.[0] | {transmitter_mode}' | cut -f 2 -d ":" | sed -e 's/}//g' -e 's/"//g'`
|
||
|
if [ $OBSENC = $ENC ] ; then
|
||
|
echo -n "$OBSID "
|
||
|
echo -n "Vet: $VET "
|
||
|
# Get Machine Learning Result
|
||
|
WUT_VET=`./wut $OBSID | cut -f 2 -d " "`
|
||
|
echo -n "Wut: $WUT_VET "
|
||
|
if [ $VET = $WUT_VET ] ; then
|
||
|
let CORRECT=$CORRECT+1
|
||
|
else
|
||
|
let INCORRECT=$INCORRECT+1
|
||
|
fi
|
||
|
echo "Correct: $CORRECT Incorrect: $INCORRECT"
|
||
|
fi
|
||
|
done
|
||
|
|