Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.
 
 
 
 
 
 

51 строка
1.9 KiB

  1. #!/bin/bash
  2. ## import common lib
  3. . ~/common.sh
  4. ## pass start timestamp and sun elevation
  5. PASS_START=$(expr "$5" + 90)
  6. SUN_ELEV=$(python3 sun.py "$PASS_START")
  7. if pgrep "rtl_fm" > /dev/null
  8. then
  9. log "There is an existing rtl_fm instance running, I quit" "ERROR"
  10. exit 1
  11. fi
  12. # $1 = Satellite Name
  13. # $2 = Frequency
  14. # $3 = FileName base
  15. # $4 = TLE File
  16. # $5 = EPOC start time
  17. # $6 = Time to capture
  18. # $7 = Satellite max elevation
  19. 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_AUDIO}/audio/${3}.wav" rate 11025
  20. if [ ! -d "{NOAA_OUTPUT}/image/${FOLDER_DATE}" ]; then
  21. mkdir -p "${NOAA_OUTPUT}/image/${FOLDER_DATE}"
  22. fi
  23. if [ "${SUN_ELEV}" -gt "${SUN_MIN_ELEV}" ]; then
  24. ENHANCEMENTS="ZA MCIR MCIR-precip MSA MSA-precip HVC-precip HVCT-precip HVC HVCT"
  25. else
  26. ENHANCEMENTS="ZA MCIR MCIR-precip"
  27. fi
  28. /usr/local/bin/wxmap -T "${1}" -H "${4}" -p 0 -l 0 -o "${PASS_START}" "${NOAA_HOME}/map/${3}-map.png"
  29. for i in $ENHANCEMENTS; do
  30. /usr/local/bin/wxtoimg -o -m "${NOAA_HOME}/map/${3}-map.png" -e "$i" "${NOAA_AUDIO}/audio/${3}.wav" "${NOAA_OUTPUT}/image/${FOLDER_DATE}/${3}-$i.jpg"
  31. /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"
  32. done
  33. if [ "${SUN_ELEV}" -gt "${SUN_MIN_ELEV}" ]; then
  34. python3 "${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"
  35. else
  36. python3 "${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"
  37. fi
  38. rm "${NOAA_AUDIO}/audio/${3}.wav"