Bläddra i källkod

Flag, sat max elev

tags/v1.0
Nico Rey 6 år sedan
förälder
incheckning
8064e6770b
2 ändrade filer med 14 tillägg och 9 borttagningar
  1. +12
    -7
      receive.sh
  2. +2
    -2
      schedule_sat.sh

+ 12
- 7
receive.sh Visa fil

@@ -41,14 +41,19 @@ fi
# $4 = TLE File
# $5 = EPOC start time
# $6 = Time to capture
# $7 = Satellite max elevation

START_DATE=$(date '+%d-%m-%Y %H:%M')
timeout "${6}" /usr/local/bin/rtl_fm -f "${2}"M -s 60k -g 50 -p 55 -E wav -E deemp -F 9 - | sox -t raw -e signed -c 1 -b 16 -r 60000 - ${NOAA_OUTPUT}/audio/"${3}".wav rate 11025
FOLDER_DATE="$(date +%Y)/$(date +%m)/$(date +%d)"
timeout "${6}" /usr/local/bin/rtl_fm -f "${2}"M -s 60k -g 50 -p 55 -E wav -E deemp -F 9 - | /usr/bin/sox -t raw -e signed -c 1 -b 16 -r 60000 - ${NOAA_OUTPUT}/audio/"${3}".wav rate 11025

PASS_START=$(expr "$5" + 90)

SUN_ELEV=$(python2 sun.py $PASS_START)

if [ ! -d ${NOAA_OUTPUT}/image/${FOLDER_DATE} ]; then
mkdir -p ${NOAA_OUTPUT}/image/${FOLDER_DATE}
fi

if [ "${SUN_ELEV}" -gt "${SUN_MIN_ELEV}" ]; then
ENHANCEMENTS="ZA MCIR MCIR-precip MSA MSA-precip HVC-precip HVCT-precip HVC HVCT"
else
@@ -57,13 +62,13 @@ fi

/usr/local/bin/wxmap -T "${1}" -H "${4}" -p 0 -l 0 -o "${PASS_START}" ${NOAA_HOME}/map/"${3}"-map.png
for i in $ENHANCEMENTS; do
/usr/local/bin/wxtoimg -o -m ${NOAA_HOME}/map/"${3}"-map.png -e $i ${NOAA_OUTPUT}/audio/"${3}".wav ${NOAA_OUTPUT}/image/"${3}"-$i.jpg
/usr/bin/convert -quality 90 -format jpg ${NOAA_OUTPUT}/image/"${3}"-$i.jpg -undercolor black -fill yellow -pointsize 18 -annotate +20+20 "${1} $i ${START_DATE}" ${NOAA_OUTPUT}/image/"${3}"-$i.jpg
/usr/bin/gdrive upload --parent 1gehY-0iYkNSkBU9RCDsSTexRaQ_ukN0A ${NOAA_OUTPUT}/image/"${3}"-$i.jpg
/usr/local/bin/wxtoimg -o -m ${NOAA_HOME}/map/"${3}"-map.png -e $i ${NOAA_OUTPUT}/audio/"${3}".wav ${NOAA_OUTPUT}/image/${FOLDER_DATE}/"${3}"-$i.jpg
/usr/bin/convert -quality 90 -format jpg ${NOAA_OUTPUT}/image/${FOLDER_DATE}/"${3}"-$i.jpg -undercolor black -fill yellow -pointsize 18 -annotate +20+20 "${1} $i ${START_DATE}" ${NOAA_OUTPUT}/image/${FOLDER_DATE}/"${3}"-$i.jpg
/usr/bin/gdrive upload --parent 1gehY-0iYkNSkBU9RCDsSTexRaQ_ukN0A ${NOAA_OUTPUT}/image/${FOLDER_DATE}/"${3}"-$i.jpg
done

if [ "${SUN_ELEV}" -gt "${SUN_MIN_ELEV}" ]; then
python2 ${NOAA_HOME}/post.py "$1 ${START_DATE}" ${NOAA_OUTPUT}/image/$3-MCIR-precip.jpg ${NOAA_OUTPUT}/image/$3-MSA-precip.jpg ${NOAA_OUTPUT}/image/$3-HVC-precip.jpg ${NOAA_OUTPUT}/image/$3-HVCT.jpg
python2 ${NOAA_HOME}/post.py "$1 ${START_DATE}" "$7" ${NOAA_OUTPUT}/image/${FOLDER_DATE}/$3-MCIR-precip.jpg ${NOAA_OUTPUT}/image/${FOLDER_DATE}/$3-MSA-precip.jpg ${NOAA_OUTPUT}/image/${FOLDER_DATE}/$3-HVC-precip.jpg ${NOAA_OUTPUT}/image/${FOLDER_DATE}/$3-HVCT-precip.jpg
else
python2 ${NOAA_HOME}/post.py "$1 ${START_DATE}" ${NOAA_OUTPUT}/image/$3-MCIR-precip.jpg ${NOAA_OUTPUT}/image/$3-MCIR.jpg
python2 ${NOAA_HOME}/post.py "$1 ${START_DATE}" "$7" ${NOAA_OUTPUT}/image/${FOLDER_DATE}/$3-MCIR-precip.jpg ${NOAA_OUTPUT}/image/${FOLDER_DATE}/$3-MCIR.jpg
fi

+ 2
- 2
schedule_sat.sh Visa fil

@@ -1,7 +1,7 @@
#!/bin/sh

## debug
#set -x
# set -x

. ~/.noaa.conf

@@ -27,7 +27,7 @@ while [ "$(date --date="@${var2}" +%D)" = "$(date +%D)" ]; do
SATNAME=$(echo "$1" | sed "s/ //g")
echo ${SATNAME} "${OUTDATE}" "$MAXELEV"
echo "${NOAA_HOME}/receive.sh \"${1}\" $2 ${SATNAME}${OUTDATE} "${NOAA_HOME}"/predict/weather.tle \
${var1} ${TIMER}" | at "$(date --date="TZ=\"UTC\" ${START_TIME}" +"%H:%M %D")"
${var1} ${TIMER} ${MAXELEV}" | at "$(date --date="TZ=\"UTC\" ${START_TIME}" +"%H:%M %D")"
fi
NEXTPREDICT=$(expr "${var2}" + 60)
PREDICTION_START=$(/usr/bin/predict -t "${NOAA_HOME}"/predict/weather.tle -p "${1}" "${NEXTPREDICT}" | head -1)


Laddar…
Avbryt
Spara