diff rs_fsp7_noisetest.py @ 53:d90acb55ce31

Log some stats after multiple runs.
author Daniel O'Connor <doconnor@gsoft.com.au>
date Thu, 21 Mar 2013 12:08:15 +1030
parents c1891d9074c1
children 42621291eb9b
line wrap: on
line diff
--- a/rs_fsp7_noisetest.py	Thu Mar 21 11:48:42 2013 +1030
+++ b/rs_fsp7_noisetest.py	Thu Mar 21 12:08:15 2013 +1030
@@ -164,12 +164,19 @@
 
     r.write("INIT:CONT OFF")
 
+    nfs = []
     print "Centre: %.1f Mhz, Span %.1f Mhz, Input %.1f MHz, BW %.1f kHz, %d sweeps, ENR %.2f dB" % (freq / 1e6, options.span / 1e6, options.input / 1e6, options.bw / 1e3, options.sweeps, enr)
     while options.repeat == None or options.repeat > 0:
         off, on, nf = donoisetest(r, enr)
         print "Off %.3f dBm/Hz, on %.3f dBm/Hz, NF %.2f dB" % (off, on, nf)
+        nfs.append(nf)
         if options.repeat == None:
             print "Press enter to perform a new measurement"
             sys.stdin.readline()
         else:
             options.repeat -= 1
+
+    if len(nfs) > 1:
+        nfs = numpy.array(nfs)
+        print "NF min: %.1f dBm/Hz, max: %.1f dBm/Hz, avg: %.1f dBm/hz, stddev: %.1f" % (
+            nfs.min(), nfs.max(), nfs.sum() / len(nfs), numpy.std(nfs))