Mercurial > ~darius > hgwebdir.cgi > pyinst
comparison 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 |
comparison
equal
deleted
inserted
replaced
52:c1891d9074c1 | 53:d90acb55ce31 |
---|---|
162 # Setup parameters | 162 # Setup parameters |
163 setup(r, freq, options.span, options.sweeps, options.bw) | 163 setup(r, freq, options.span, options.sweeps, options.bw) |
164 | 164 |
165 r.write("INIT:CONT OFF") | 165 r.write("INIT:CONT OFF") |
166 | 166 |
167 nfs = [] | |
167 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) | 168 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) |
168 while options.repeat == None or options.repeat > 0: | 169 while options.repeat == None or options.repeat > 0: |
169 off, on, nf = donoisetest(r, enr) | 170 off, on, nf = donoisetest(r, enr) |
170 print "Off %.3f dBm/Hz, on %.3f dBm/Hz, NF %.2f dB" % (off, on, nf) | 171 print "Off %.3f dBm/Hz, on %.3f dBm/Hz, NF %.2f dB" % (off, on, nf) |
172 nfs.append(nf) | |
171 if options.repeat == None: | 173 if options.repeat == None: |
172 print "Press enter to perform a new measurement" | 174 print "Press enter to perform a new measurement" |
173 sys.stdin.readline() | 175 sys.stdin.readline() |
174 else: | 176 else: |
175 options.repeat -= 1 | 177 options.repeat -= 1 |
178 | |
179 if len(nfs) > 1: | |
180 nfs = numpy.array(nfs) | |
181 print "NF min: %.1f dBm/Hz, max: %.1f dBm/Hz, avg: %.1f dBm/hz, stddev: %.1f" % ( | |
182 nfs.min(), nfs.max(), nfs.sum() / len(nfs), numpy.std(nfs)) |