2023-01-18 16:06:08 -07:00
|
|
|
#!/bin/bash
|
|
|
|
#
|
|
|
|
# Script to control a rotator and perform an RFI acquisition.
|
|
|
|
#
|
|
|
|
# GPLv3+
|
|
|
|
# Copyright (C) 2023 Jeff Moe
|
|
|
|
#
|
2023-01-19 09:45:12 -07:00
|
|
|
# Dependencies:
|
2023-01-19 10:00:03 -07:00
|
|
|
# apt install ghostscript imagemagick
|
2023-01-19 09:45:12 -07:00
|
|
|
#
|
2023-01-18 16:06:08 -07:00
|
|
|
# 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
|
|
|
|
|
2023-01-19 10:55:50 -07:00
|
|
|
GAIN=`grep "self.RTL820T.set_gain(" top_block.py | cut -f 2 -d "(" | cut -f 1 -d ","`
|
|
|
|
|
2023-01-19 11:08:55 -07:00
|
|
|
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
|
|
|
|
|
2023-01-18 16:06:08 -07:00
|
|
|
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
|
2023-01-19 10:55:50 -07:00
|
|
|
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
|
2023-01-18 16:06:08 -07:00
|
|
|
|
|
|
|
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
|
2023-01-19 10:55:50 -07:00
|
|
|
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
|
2023-01-18 16:06:08 -07:00
|
|
|
|
|
|
|
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
|
2023-01-19 10:55:50 -07:00
|
|
|
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
|
2023-01-18 16:06:08 -07:00
|
|
|
|
|
|
|
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
|
2023-01-19 10:55:50 -07:00
|
|
|
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
|
2023-01-18 16:06:08 -07:00
|
|
|
|
2023-01-19 10:14:48 -07:00
|
|
|
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
|
2023-01-18 16:06:08 -07:00
|
|
|
|