satnogs-wut/src/wut-compare-tx

44 lines
1.1 KiB
Plaintext
Raw Normal View History

2020-01-03 15:23:12 -07:00
#!/bin/bash
# wut-compare-tx
#
# Check the results of a prediction against vetted results
# using a selected transmitter UUID.
# Uses all files in download/ directory.
#
# Usage:
# wut-compare-tx [Transmitter UUID]
# Example:
2020-01-03 18:13:37 -07:00
# wut-compare-tx KgazZMKEa74VnquqXLwAvD
2020-01-03 15:23:12 -07:00
MAIN_DIR=`pwd`
OBSTX="$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'`
TX=`cat download/$OBSID/$OBSID.json | jq --compact-output '.[0] | {transmitter_uuid}' | cut -f 2 -d ":" | sed -e 's/}//g' -e 's/"//g'`
if [ "$OBSTX" = "$TX" ] ; then
echo -n "$OBSID "
echo -n "Vet: $VET "
# Get Machine Learning Result
2022-08-16 18:23:36 -06:00
WUT_VETS=`wut $OBSID`
2020-01-04 01:06:03 -07:00
WUT_VET=`echo $WUT_VETS | cut -f 2 -d " "`
WUT_RATE=`echo $WUT_VETS | cut -f 1 -d " "`
echo -n "$WUT_VET, "
echo -n "$WUT_RATE, "
if [ "$VET" = "$WUT_VET" ] ; then
2020-01-03 15:23:12 -07:00
let CORRECT=$CORRECT+1
else
let INCORRECT=$INCORRECT+1
fi
echo "Correct: $CORRECT Incorrect: $INCORRECT"
fi
done