Mercurial > ~darius > hgwebdir.cgi > pyinst
diff rs_fsp7_noisetest.py @ 77:23c96322cfb6
Spell Rohde Schwarz correctly.
author | Daniel O'Connor <doconnor@gsoft.com.au> |
---|---|
date | Fri, 27 Sep 2024 11:34:16 +0930 |
parents | 91b476ebc0f2 |
children | 4b4ae555067b |
line wrap: on
line diff
--- a/rs_fsp7_noisetest.py Fri Sep 27 10:05:55 2024 +0930 +++ b/rs_fsp7_noisetest.py Fri Sep 27 11:34:16 2024 +0930 @@ -48,7 +48,7 @@ rtndb = 10 * math.log10(rtn) return rtndb - + def setup(r, freq, span, sweeps, bw): # Reset to defaults r.write("*RST") @@ -80,7 +80,7 @@ # Set video bandwidth (10x res BW) r.write("SENS1:BAND:VID %f Hz" % (bw * 10)) - + def getnoise(r): # Trigger the sweep r.write("INIT;*WAI") @@ -90,7 +90,7 @@ opc = scpi.getdata(r.read(None), int) #print "OPC - %d" % (opc) assert(opc == 1) - + # Set data format r.write("FORM:DATA ASC") @@ -117,7 +117,7 @@ enr = 10 ** (enrdb / 10) nf = 10 * math.log10(enr / (y - 1)) return nf - + def donoisetest(r, enr): print("Acquiring with noise off..") setnoise(r, False) @@ -128,8 +128,8 @@ return off, on, calcnf(enr, off, on) if __name__ == '__main__': - parser = optparse.OptionParser(usage = '%prog [options] address frequency', - description = 'Configures a Rhode Schwartz FSP7 spectrum analyser to do a noise figure test', + parser = optparse.OptionParser(usage = '%prog [options] address frequency', + description = 'Configures a Rohde Schwarz FSP7 spectrum analyser to do a noise figure test', epilog = 'video bandwidth is set to 10 times the resolution bandwidth') parser.add_option('-s', '--span', dest = 'span', default = 1e6, help = 'Span frequency in Hz (default: %default)', type = float) parser.add_option('-i', '--input', dest = 'input', default = None, help = 'Frequency used to compute ENR (defaults to frequency)', type = float)