-
Notifications
You must be signed in to change notification settings - Fork 0
/
noiseplot.sh
executable file
·106 lines (101 loc) · 2.24 KB
/
noiseplot.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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
#!/bin/sh
# noiseplot - makes a 3D gnuplot of noise from a MMM format
# Digisonde datafile
#
# useage: noiseplot {datafile}
#
# Requires gnuplot 3.8j or higher with pm3d and PNG support
#
# 17Jul04 TWB Adjust for Gnuplot 3.8j+ and 4.x+
# 09Apr05 TWB Most DGS256 have broken MPA in prelude.
#
MMMFILE=$1
BFN=${MMMFILE##*/}
NOIFILE=${BFN%.*}.dat
GNUFILE=script.gnu
TITLE=${BFN%.*}
FRQRNG='[0:12]'
#
# Convert the MMM file into a noise file
rm -f $NOIFILE
dgsmmm -n $MMMFILE > $NOIFILE
rm -f $GNUFILE
#
# Plot the MPA that is recomputed.
cat <<EOF > $GNUFILE
set pm3d map corners2color c1
set title "MPA (Noise) Plot for $TITLE"
set xdata time
set timefmt "%Y %j %H:%M:%S"
set format x "%H"
set xlabel "UT"
set yrange $FRQRNG
set ylabel "Frequency [MHz]"
set zrange [0:120]
set cbrange [20:120]
set cblabel "[dB]"
set terminal png crop size 800,600
splot "$NOIFILE" using 1:4:6 title ''
EOF
#
IMGFILE=${BFN%.*}_MPA.png
gnuplot $GNUFILE > $IMGFILE
#
# Plot the Max Signal
cat <<EOF > $GNUFILE
set pm3d map corners2color c1
set title "Max Signal Plot for $TITLE"
set xdata time
set timefmt "%Y %j %H:%M:%S"
set format x "%H"
set xlabel "UT"
set yrange $FRQRNG
set ylabel "Frequency [MHz]"
set zrange [0:120]
set cbrange [20:120]
set cblabel "[dB]"
set terminal png crop size 800,600
splot "$NOIFILE" using 1:4:8 title ''
EOF
#
IMGFILE=${BFN%.*}_MAX.png
gnuplot $GNUFILE > $IMGFILE
#
# Plot the Minimim Signal
cat <<EOF > $GNUFILE
set pm3d map corners2color c1
set title "Minimum Amplitude Plot for $TITLE"
set xdata time
set timefmt "%Y %j %H:%M:%S"
set format x "%H"
set xlabel "UT"
set yrange $FRQRNG
set ylabel "Frequency [MHz]"
set zrange [0:120]
set cbrange [0:100]
set cblabel "[dB]"
set terminal png crop size 800,600
splot "$NOIFILE" using 1:4:7 title ''
EOF
#
IMGFILE=${BFN%.*}_MIN.png
gnuplot $GNUFILE > $IMGFILE
# Plot the Signal to Noise(MPA)
cat <<EOF > $GNUFILE
set pm3d map corners2color c1
set title "SNR Plot for $TITLE"
set xdata time
set timefmt "%Y %j %H:%M:%S"
set format x "%H"
set xlabel "UT"
set yrange $FRQRNG
set ylabel "Frequency [MHz]"
set zrange [-10:60]
set cbrange [0:60]
set cblabel "[dB]"
set terminal png crop size 800,600
splot "$NOIFILE" using 1:4:(\$8-\$6) title ''
EOF
IMGFILE=${BFN%.*}_SNR.png
gnuplot $GNUFILE > $IMGFILE
exit 0