Browse Source

Labels added to the graphical output.

klaute 2 years ago
parent
commit
2ceacc0a90
2 changed files with 8 additions and 6 deletions
  1. 1
    1
      tools/2m_scan.bat
  2. 7
    5
      tools/meas.py

+ 1
- 1
tools/2m_scan.bat View File

@@ -1,5 +1,5 @@
1 1
 @echo off
2 2
 
3
-C:\Python27\python.exe meas.py -o 2m.csv -s 144000000 -e 146100000 -i 1 -p 5000 -d COM16 -m
3
+C:\Python27\python.exe meas.py -o 2m.csv -s 144000000 -e 146100000 -i 1 -p 5000 -d COM16 -m -g
4 4
 
5 5
 pause

+ 7
- 5
tools/meas.py View File

@@ -528,8 +528,8 @@ if __name__ == "__main__":
528 528
                 min_vswr[0] = vswr
529 529
                 min_vswr[1] = m[0] # the frequency
530 530
 
531
-              # R = meas_data[0] * 5V / 1023 * I
532
-              r = 50.0 * vswr # (m[1] * 5.0 / 1023.0) / i
531
+              # impedance
532
+              r = 50.0 * vswr
533 533
               meas_r.append(r)
534 534
 
535 535
               # P = meas_data[0] * 5V ^ 2 / r
@@ -549,9 +549,11 @@ if __name__ == "__main__":
549 549
             print "Output file " + args.output_file + " written."
550 550
 
551 551
           if args.show_graph == True:
552
-            plt.plot(meas_freq, meas_ratio)
553
-            plt.plot(meas_freq, meas_r)
554
-            plt.plot(meas_freq, meas_p)
552
+            lv, = plt.plot(meas_freq, meas_ratio, label='VSWR')
553
+            lr, = plt.plot(meas_freq, meas_r, label='Impedance')
554
+            lw, = plt.plot(meas_freq, meas_p, label='Watt')
555
+
556
+            plt.legend(handles=[lv, lr, lw])
555 557
 
556 558
             print "Please close the mathplot window to exit..."
557 559
             plt.show()