diff --git a/README.md b/README.md index 01eb168..32afc8f 100644 --- a/README.md +++ b/README.md @@ -30,6 +30,7 @@ The following scripts are in the repo: * `wut` --- Feed it an observation ID and it returns if it is a "good", "bad", or "failed" observation. * `wut-compare` --- Compare an observations' current presumably human vetting with a `wut` vetting. * `wut-compare-all` --- Compare all the observations in `download/` with `wut` vettings. +* `wut-compare-txmode` --- Compare all the observations in `download/` with `wut` vettings using selected encoding. * `wut-dl-sort` --- Populate `data/` dir with waterfalls from `download/`. * `wut-dl-sort-txmode` --- Populate `data/` dir with waterfalls from `download/` using selected encoding. * `wut-ml` --- Main machine learning Python script using Tensorflow and Keras. diff --git a/wut-compare-txmode b/wut-compare-txmode new file mode 100755 index 0000000..fe57bd9 --- /dev/null +++ b/wut-compare-txmode @@ -0,0 +1,45 @@ +#!/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 + diff --git a/wut-dl-sort-txmode b/wut-dl-sort-txmode index b7b8a14..a290a13 100755 --- a/wut-dl-sort-txmode +++ b/wut-dl-sort-txmode @@ -22,7 +22,7 @@ # * File is randomly copied to either data/train or data/val directory. # # Possible vetted_status: bad, failed, good, null, unknown. -set -x + OBSENC="$1" OBSIDMIN="$2" OBSIDMAX="$3"