-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathaltitudes.sh
50 lines (34 loc) · 1.09 KB
/
altitudes.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#!/bin/bash
#set range of plot
range=230
echo "Plotting altidude heatmap for datafile $1"
nice -n 19 gnuplot -c /dev/stdin $1 $range <<"EOF"
data=ARG1
range=ARG2
set terminal pngcairo enhanced size 2000,2000
set datafile separator comma
set object 1 rectangle from screen 0,0 to screen 1,1 fillcolor rgb "black" behind
set output 'altmap.png'
set border lc rgb "white"
set cbrange [0:45000]
set cblabel "Altitude" tc rgb "white"
set palette negative rgb 33,13,10
set polar
set angles degrees
set theta clockwise top
set grid polar 45 linecolor rgb "white"
set colorbox user vertical origin 0.9, 0.80 size 0.02, 0.15
show angles
set size square
set title "Altitude Heatmap" tc rgb "white"
set xrange [-range:range]
set yrange [-range:range]
set rtics 50
set xtics 50
set ytics 50
print "Generating altitudes heatmap..."
plot '< sort -t"," -k4 -r '.data u ($6):($5/1852):($4) with dots lc palette
EOF
IP=$(ifconfig | sed -En 's/127.0.0.1//;s/.*inet (addr:)?(([0-9]*\.){3}[0-9]*).*/\2/p')
sudo cp altmap.png /run/dump1090-fa/altmap.png
echo "Plot available at http://$IP/dump1090-fa/data/altmap.png"