Skip to content

Instantly share code, notes, and snippets.

@jh4xsy
Last active March 8, 2024 00:16
Show Gist options
  • Save jh4xsy/ce9d023b94e0a4136d4bcc059b0e0b77 to your computer and use it in GitHub Desktop.
Save jh4xsy/ce9d023b94e0a4136d4bcc059b0e0b77 to your computer and use it in GitHub Desktop.
satnogs-clientでMETEOR M2-3を処理するpost-observation script
#!/bin/sh
# POST OBSERVATION SCRIPT for METEOR
ID="$1"
TLE="$3"
DATE="$4"
# check METEOR M2-3&4
NORAD=$(echo "$TLE" | jq .tle2 | awk '{print $2}')
if [ ${NORAD} -ne "57166" ] && [ ${NORAD} -ne "59051" ]
then
exit
fi
# decode LRPT
demod=/usr/local/bin/meteor_demod
decode=/usr/local/bin/meteor_decode
convert=/usr/bin/convert
cp /tmp/.satnogs/iq.dat /tmp/${ID}.dat
if [ $(date '+%H') -gt 17 ]; then
# IR-image
echo "RUNNING IR-image SCRIPT for " $NORAD
${demod} --batch --quiet -O 8 -f 128 -r 72000 -s 160000 -m oqpsk --bps 16 /tmp/${ID}.dat --stdout - | \
${decode} --diff -a 67,67,67 -o /tmp/foo.png -
# invert colors and improve contrast
if [ -e /tmp/foo.png ]; then
${convert} -negate -normalize /tmp/foo.png /tmp/.satnogs/data/data_${ID}_${DATE}.png
rm -f /tmp/foo.png
fi
else
# Visible-image
echo "RUNNING Visible-image SCRIPT for " $NORAD
${demod} --batch --quiet -O 8 -f 128 -r 72000 -s 160000 -m oqpsk --bps 16 /tmp/${ID}.dat --stdout - | \
${decode} --diff -a 65,65,64 -o /tmp/.satnogs/data/data_${ID}_${DATE}.png -
fi
rm -f /tmp/${ID}.dat
echo "POST OBSERVATION SCRIPT FINISHED"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment