Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
 
 
 
 
 
 

60 lignes
2.1 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 [ "${SUN_ELEV}" -lt "${SUN_MIN_ELEV}" ]; then
  8. log "Sun elev is too low. Meteor IR radiometers are not working" "INFO"
  9. exit 0
  10. fi
  11. if pgrep "rtl_fm" > /dev/null
  12. then
  13. log "There is an already running rtl_fm instance but I dont care for now, I prefer this pass" "INFO"
  14. pkill -9 -f rtl_fm
  15. fi
  16. # $1 = Satellite Name
  17. # $2 = Frequency
  18. # $3 = FileName base
  19. # $4 = TLE File
  20. # $5 = EPOC start time
  21. # $6 = Time to capture
  22. # $7 = Satellite max elevation
  23. log "Starting rtl_fm record" "INFO"
  24. timeout "${6}" /usr/local/bin/rtl_fm -M raw -f "${2}"M -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
  25. log "Normalization in progress" "INFO"
  26. sox "${NOAA_AUDIO}/audio/${3}.wav" "${METEOR_OUTPUT}/${3}.wav" gain -n
  27. rm "${NOAA_AUDIO}/audio/${3}.wav"
  28. log "Demodulation in progress (QPSK)" "INFO"
  29. meteor_demod -B -o "${METEOR_OUTPUT}/${3}.qpsk" "${METEOR_OUTPUT}/${3}.wav"
  30. rm "${METEOR_OUTPUT}/${3}.wav"
  31. log "Decoding in progress (QPSK to BMP)" "INFO"
  32. medet_arm "${METEOR_OUTPUT}/${3}.qpsk" "${METEOR_OUTPUT}/${3}" -cd
  33. rm "${METEOR_OUTPUT}/${3}.qpsk"
  34. if [ -f "${METEOR_OUTPUT}/${3}.dec" ]; then
  35. log "I got a successful ${3}.dec file. Creating false color image" "INFO"
  36. medet_arm "${METEOR_OUTPUT}/${3}.dec" "${METEOR_OUTPUT}/${3}-122" -r 65 -g 65 -b 64 -d
  37. convert "${METEOR_OUTPUT}/${3}-122.bmp" "${NOAA_OUTPUT}/image/${FOLDER_DATE}/${3}-122.jpg"
  38. log "Rectifying image to adjust aspect ratio" "INFO"
  39. python3 "${NOAA_HOME}/rectify.py" "${NOAA_OUTPUT}/image/${FOLDER_DATE}/${3}-122.jpg"
  40. rm "${METEOR_OUTPUT}/${3}-122.bmp"
  41. rm "${METEOR_OUTPUT}/${3}.bmp"
  42. log "Posting to Twitter" "INFO"
  43. python3 "${NOAA_HOME}/post.py" "$1 EXPERIMENTAL ${START_DATE} Resolución completa: http://weather.reyni.co/image/${FOLDER_DATE}/${3}-122-rectified.jpg" "$7" "${NOAA_OUTPUT}/image/${FOLDER_DATE}/${3}-122-rectified.jpg"
  44. else
  45. log "Decoding failed, either a bad pass/low SNR or a software problem" "ERROR"
  46. fi