#!/bin/bash # # Script to control a rotator and perform an RFI acquisition. # # GPLv3+ # Copyright (C) 2023 Jeff Moe # # Dependencies: # apt install ghostscript imagemagick # # TODO: # Script should do a loop that queries the position until it is reached. # In lieu of actual programming, just sleep longer. # Make sure rotator has time to move to initial position # from furthest possible position. set -x cd ~/devel/spacecruft/CygnusRFI source env/bin/activate GAIN=`grep "self.RTL820T.set_gain(" top_block.py | cut -f 2 -d "(" | cut -f 1 -d ","` rm -f rfi_plot-01-1-45.png rfi_plot-02-90-45.png rfi_plot-03-180-45.png rfi_plot-04-270-45.png rfi_plots.png spacecruft-greenctld-cmd "P 1 45" sleep 84 PYTHONPATH=/usr/lib/python3/dist-packages:/usr/lib/python3/site-packages:$PYTHONPATH python CygnusRFI.py -b 2400000 -c 2048 -t 0.5 -d 5 -f 400000000 -F 430000000 convert -font Helvetica -pointsize 72 -annotate 0x0+100+100 "`hostname` ; 1 Azimuth, 45 Elevation ; Gain $GAIN ; `date -uR`" rfi_plot.png rfi_plot-01-1-45.png spacecruft-greenctld-cmd "P 90 45" sleep 30 PYTHONPATH=/usr/lib/python3/dist-packages:/usr/lib/python3/site-packages:$PYTHONPATH python CygnusRFI.py -b 2400000 -c 2048 -t 0.5 -d 5 -f 400000000 -F 430000000 convert -font Helvetica -pointsize 72 -annotate 0x0+100+100 "`hostname` ; 90 Azimuth, 45 Elevation ; Gain $GAIN ; `date -uR`" rfi_plot.png rfi_plot-02-90-45.png spacecruft-greenctld-cmd "P 180 45" sleep 30 PYTHONPATH=/usr/lib/python3/dist-packages:/usr/lib/python3/site-packages:$PYTHONPATH python CygnusRFI.py -b 2400000 -c 2048 -t 0.5 -d 5 -f 400000000 -F 430000000 convert -font Helvetica -pointsize 72 -annotate 0x0+100+100 "`hostname` ; 180 Azimuth, 45 Elevation ; Gain $GAIN ; `date -uR`" rfi_plot.png rfi_plot-03-180-45.png spacecruft-greenctld-cmd "P 270 45" sleep 30 PYTHONPATH=/usr/lib/python3/dist-packages:/usr/lib/python3/site-packages:$PYTHONPATH python CygnusRFI.py -b 2400000 -c 2048 -t 0.5 -d 5 -f 400000000 -F 430000000 convert -font Helvetica -pointsize 72 -annotate 0x0+100+100 "`hostname` ; 270 Azimuth, 45 Elevation ; Gain $GAIN ; `date -uR`" rfi_plot.png rfi_plot-04-270-45.png convert -append rfi_plot-01-1-45.png rfi_plot-02-90-45.png rfi_plot-03-180-45.png rfi_plot-04-270-45.png rfi_plots.png