You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

75 regels
1.8 KiB

  1. #!/bin/sh
  2. ## debug
  3. # set -x
  4. . ~/.noaa.conf
  5. ## sane checks
  6. if [ ! -d "${NOAA_HOME}" ]; then
  7. mkdir -p "${NOAA_HOME}"
  8. fi
  9. if [ ! -d "${NOAA_OUTPUT}" ]; then
  10. mkdir -p "${NOAA_OUTPUT}"
  11. fi
  12. if [ ! -d "${METEOR_OUTPUT}" ]; then
  13. mkdir -p "${METEOR_OUTPUT}"
  14. fi
  15. if [ ! -d "${NOAA_AUDIO}/audio/" ]; then
  16. mkdir -p "${NOAA_AUDIO}/audio/"
  17. fi
  18. if [ ! -d "${NOAA_OUTPUT}/image/" ]; then
  19. mkdir -p "${NOAA_OUTPUT}/image/"
  20. fi
  21. if [ ! -d "${NOAA_HOME}/map/" ]; then
  22. mkdir -p "${NOAA_HOME}/map/"
  23. fi
  24. if [ ! -d "${NOAA_HOME}/predict/" ]; then
  25. mkdir -p "${NOAA_HOME}/predict/"
  26. fi
  27. if pgrep "rtl_fm" > /dev/null
  28. then
  29. exit 1
  30. fi
  31. # $1 = Satellite Name
  32. # $2 = Frequency
  33. # $3 = FileName base
  34. # $4 = TLE File
  35. # $5 = EPOC start time
  36. # $6 = Time to capture
  37. # $7 = Satellite max elevation
  38. START_DATE=$(date '+%d-%m-%Y %H:%M')
  39. FOLDER_DATE="$(date +%Y)/$(date +%m)/$(date +%d)"
  40. if [ ! -d "${NOAA_OUTPUT}/image/${FOLDER_DATE}" ]; then
  41. mkdir -p "${NOAA_OUTPUT}/image/${FOLDER_DATE}"
  42. fi
  43. timeout 660 /usr/local/bin/rtl_fm -M raw -f 137.1M -s 288k -g 48 -p 1 | sox -t raw -r 288k -c 2 -b 16 -e s - -t wav "${NOAA_AUDIO}/audio/${3}.wav" rate 96k
  44. sox "${NOAA_AUDIO}/audio/${3}.wav" "${METEOR_OUTPUT}/${3}.wav" gain -n
  45. rm "${NOAA_AUDIO}/audio/${3}.wav"
  46. meteor_demod -B -o "${METEOR_OUTPUT}/${3}.qpsk" "${METEOR_OUTPUT}/${3}.wav"
  47. medet_arm "${METEOR_OUTPUT}/${3}.qpsk" "${METEOR_OUTPUT}/${3}" -cd
  48. if [ -f "${METEOR_OUTPUT}/${3}.dec" ]; then
  49. medet_arm "${METEOR_OUTPUT}/${3}.dec" "${METEOR_OUTPUT}/${3}-122" -r 65 -g 65 -b 64 -d
  50. convert "${METEOR_OUTPUT}/${3}-122.bmp" "${NOAA_OUTPUT}/image/${FOLDER_DATE}/${3}-122.jpg"
  51. python3 "${NOAA_HOME}/rectify.py" "${NOAA_OUTPUT}/image/${FOLDER_DATE}/${3}-122.jpg"
  52. rm "${METEOR_OUTPUT}/${3}-122.bmp"
  53. python3 "${NOAA_HOME}/post.py" "$1 EXPERIMENTAL ${START_DATE}" "$7" "${NOAA_OUTPUT}/image/${FOLDER_DATE}/${3}-122-rectified.jpg"
  54. fi