Mercurial > ~darius > hgwebdir.cgi > pyinst
annotate specan.py @ 84:4b4ae555067b
Use RMS detector and fix the sweep time for more accuracy.
Add links to app notes discussing theory.
Run forever without pause and print a summary on ctrl-c
author | Daniel O'Connor <doconnor@gsoft.com.au> |
---|---|
date | Thu, 03 Oct 2024 08:57:10 +0930 |
parents | 23c96322cfb6 |
children |
rev | line source |
---|---|
31
c6c86dcb54ba
Add code to automate a sitesurvey (to some degree).
Daniel O'Connor <darius@dons.net.au>
parents:
diff
changeset
|
1 import exceptions |
c6c86dcb54ba
Add code to automate a sitesurvey (to some degree).
Daniel O'Connor <darius@dons.net.au>
parents:
diff
changeset
|
2 import numpy |
c6c86dcb54ba
Add code to automate a sitesurvey (to some degree).
Daniel O'Connor <darius@dons.net.au>
parents:
diff
changeset
|
3 import scpi |
c6c86dcb54ba
Add code to automate a sitesurvey (to some degree).
Daniel O'Connor <darius@dons.net.au>
parents:
diff
changeset
|
4 |
c6c86dcb54ba
Add code to automate a sitesurvey (to some degree).
Daniel O'Connor <darius@dons.net.au>
parents:
diff
changeset
|
5 class Traceinst(object): |
c6c86dcb54ba
Add code to automate a sitesurvey (to some degree).
Daniel O'Connor <darius@dons.net.au>
parents:
diff
changeset
|
6 '''Generic class for a trace based instrument''' |
c6c86dcb54ba
Add code to automate a sitesurvey (to some degree).
Daniel O'Connor <darius@dons.net.au>
parents:
diff
changeset
|
7 attrs = {} |
c6c86dcb54ba
Add code to automate a sitesurvey (to some degree).
Daniel O'Connor <darius@dons.net.au>
parents:
diff
changeset
|
8 tracetypename = None |
c6c86dcb54ba
Add code to automate a sitesurvey (to some degree).
Daniel O'Connor <darius@dons.net.au>
parents:
diff
changeset
|
9 tracedtype = None |
c6c86dcb54ba
Add code to automate a sitesurvey (to some degree).
Daniel O'Connor <darius@dons.net.au>
parents:
diff
changeset
|
10 tracequery = None |
c6c86dcb54ba
Add code to automate a sitesurvey (to some degree).
Daniel O'Connor <darius@dons.net.au>
parents:
diff
changeset
|
11 |
c6c86dcb54ba
Add code to automate a sitesurvey (to some degree).
Daniel O'Connor <darius@dons.net.au>
parents:
diff
changeset
|
12 def __init__(self, con): |
c6c86dcb54ba
Add code to automate a sitesurvey (to some degree).
Daniel O'Connor <darius@dons.net.au>
parents:
diff
changeset
|
13 self.con = con |
c6c86dcb54ba
Add code to automate a sitesurvey (to some degree).
Daniel O'Connor <darius@dons.net.au>
parents:
diff
changeset
|
14 # Set trace format |
c6c86dcb54ba
Add code to automate a sitesurvey (to some degree).
Daniel O'Connor <darius@dons.net.au>
parents:
diff
changeset
|
15 self.con.write("FORM " + self.tracetypename) |
c6c86dcb54ba
Add code to automate a sitesurvey (to some degree).
Daniel O'Connor <darius@dons.net.au>
parents:
diff
changeset
|
16 |
c6c86dcb54ba
Add code to automate a sitesurvey (to some degree).
Daniel O'Connor <darius@dons.net.au>
parents:
diff
changeset
|
17 def setconf(self, name, value): |
c6c86dcb54ba
Add code to automate a sitesurvey (to some degree).
Daniel O'Connor <darius@dons.net.au>
parents:
diff
changeset
|
18 if name not in self.attrs: |
c6c86dcb54ba
Add code to automate a sitesurvey (to some degree).
Daniel O'Connor <darius@dons.net.au>
parents:
diff
changeset
|
19 raise exceptions.KeyError(name + " not supported") |
c6c86dcb54ba
Add code to automate a sitesurvey (to some degree).
Daniel O'Connor <darius@dons.net.au>
parents:
diff
changeset
|
20 # Check value is correct type |
c6c86dcb54ba
Add code to automate a sitesurvey (to some degree).
Daniel O'Connor <darius@dons.net.au>
parents:
diff
changeset
|
21 tmp = self.attrs[name][1](value) |
c6c86dcb54ba
Add code to automate a sitesurvey (to some degree).
Daniel O'Connor <darius@dons.net.au>
parents:
diff
changeset
|
22 # Run validation function (if necessary) |
c6c86dcb54ba
Add code to automate a sitesurvey (to some degree).
Daniel O'Connor <darius@dons.net.au>
parents:
diff
changeset
|
23 if self.attrs[name][2] != None: |
c6c86dcb54ba
Add code to automate a sitesurvey (to some degree).
Daniel O'Connor <darius@dons.net.au>
parents:
diff
changeset
|
24 self.attrs[name][2](value) |
c6c86dcb54ba
Add code to automate a sitesurvey (to some degree).
Daniel O'Connor <darius@dons.net.au>
parents:
diff
changeset
|
25 #print "Setting %s to %s" % (self.attrs[name][0], str(value)) |
c6c86dcb54ba
Add code to automate a sitesurvey (to some degree).
Daniel O'Connor <darius@dons.net.au>
parents:
diff
changeset
|
26 self.con.write("%s %s" % (self.attrs[name][0], str(value))) |
c6c86dcb54ba
Add code to automate a sitesurvey (to some degree).
Daniel O'Connor <darius@dons.net.au>
parents:
diff
changeset
|
27 |
c6c86dcb54ba
Add code to automate a sitesurvey (to some degree).
Daniel O'Connor <darius@dons.net.au>
parents:
diff
changeset
|
28 def getconf(self, name): |
c6c86dcb54ba
Add code to automate a sitesurvey (to some degree).
Daniel O'Connor <darius@dons.net.au>
parents:
diff
changeset
|
29 if name not in self.attrs: |
c6c86dcb54ba
Add code to automate a sitesurvey (to some degree).
Daniel O'Connor <darius@dons.net.au>
parents:
diff
changeset
|
30 raise exceptions.KeyError(name + " not supported") |
c6c86dcb54ba
Add code to automate a sitesurvey (to some degree).
Daniel O'Connor <darius@dons.net.au>
parents:
diff
changeset
|
31 self.con.write("%s?" % (self.attrs[name][0])) |
c6c86dcb54ba
Add code to automate a sitesurvey (to some degree).
Daniel O'Connor <darius@dons.net.au>
parents:
diff
changeset
|
32 r = self.con.read() |
c6c86dcb54ba
Add code to automate a sitesurvey (to some degree).
Daniel O'Connor <darius@dons.net.au>
parents:
diff
changeset
|
33 return self.attrs[name][1](r) |
c6c86dcb54ba
Add code to automate a sitesurvey (to some degree).
Daniel O'Connor <darius@dons.net.au>
parents:
diff
changeset
|
34 |
c6c86dcb54ba
Add code to automate a sitesurvey (to some degree).
Daniel O'Connor <darius@dons.net.au>
parents:
diff
changeset
|
35 def write(self, *args): |
c6c86dcb54ba
Add code to automate a sitesurvey (to some degree).
Daniel O'Connor <darius@dons.net.au>
parents:
diff
changeset
|
36 return self.con.write(*args) |
c6c86dcb54ba
Add code to automate a sitesurvey (to some degree).
Daniel O'Connor <darius@dons.net.au>
parents:
diff
changeset
|
37 |
c6c86dcb54ba
Add code to automate a sitesurvey (to some degree).
Daniel O'Connor <darius@dons.net.au>
parents:
diff
changeset
|
38 def read(self, *args): |
c6c86dcb54ba
Add code to automate a sitesurvey (to some degree).
Daniel O'Connor <darius@dons.net.au>
parents:
diff
changeset
|
39 return self.con.read(*args) |
c6c86dcb54ba
Add code to automate a sitesurvey (to some degree).
Daniel O'Connor <darius@dons.net.au>
parents:
diff
changeset
|
40 |
c6c86dcb54ba
Add code to automate a sitesurvey (to some degree).
Daniel O'Connor <darius@dons.net.au>
parents:
diff
changeset
|
41 def gettrace(self, timeout = 10): |
c6c86dcb54ba
Add code to automate a sitesurvey (to some degree).
Daniel O'Connor <darius@dons.net.au>
parents:
diff
changeset
|
42 # Trigger the sweep |
c6c86dcb54ba
Add code to automate a sitesurvey (to some degree).
Daniel O'Connor <darius@dons.net.au>
parents:
diff
changeset
|
43 self.con.write("INIT;*WAI") |
c6c86dcb54ba
Add code to automate a sitesurvey (to some degree).
Daniel O'Connor <darius@dons.net.au>
parents:
diff
changeset
|
44 |
c6c86dcb54ba
Add code to automate a sitesurvey (to some degree).
Daniel O'Connor <darius@dons.net.au>
parents:
diff
changeset
|
45 # Wait for it to be done |
44
c93d6d4cb04b
Use *OPC where supported, otherwise poll.
Daniel O'Connor <darius@dons.net.au>
parents:
34
diff
changeset
|
46 self.wait(timeout) |
c93d6d4cb04b
Use *OPC where supported, otherwise poll.
Daniel O'Connor <darius@dons.net.au>
parents:
34
diff
changeset
|
47 |
c93d6d4cb04b
Use *OPC where supported, otherwise poll.
Daniel O'Connor <darius@dons.net.au>
parents:
34
diff
changeset
|
48 # Grab trace data |
c93d6d4cb04b
Use *OPC where supported, otherwise poll.
Daniel O'Connor <darius@dons.net.au>
parents:
34
diff
changeset
|
49 self.con.write(self.tracequery) |
c93d6d4cb04b
Use *OPC where supported, otherwise poll.
Daniel O'Connor <darius@dons.net.au>
parents:
34
diff
changeset
|
50 dat = self.con.read(10) |
c93d6d4cb04b
Use *OPC where supported, otherwise poll.
Daniel O'Connor <darius@dons.net.au>
parents:
34
diff
changeset
|
51 |
c93d6d4cb04b
Use *OPC where supported, otherwise poll.
Daniel O'Connor <darius@dons.net.au>
parents:
34
diff
changeset
|
52 # Parse into array |
c93d6d4cb04b
Use *OPC where supported, otherwise poll.
Daniel O'Connor <darius@dons.net.au>
parents:
34
diff
changeset
|
53 ary = scpi.bindecode(dat, dtype = self.tracedtype) |
c93d6d4cb04b
Use *OPC where supported, otherwise poll.
Daniel O'Connor <darius@dons.net.au>
parents:
34
diff
changeset
|
54 return ary |
c93d6d4cb04b
Use *OPC where supported, otherwise poll.
Daniel O'Connor <darius@dons.net.au>
parents:
34
diff
changeset
|
55 |
c93d6d4cb04b
Use *OPC where supported, otherwise poll.
Daniel O'Connor <darius@dons.net.au>
parents:
34
diff
changeset
|
56 def wait(self, timeout): |
c93d6d4cb04b
Use *OPC where supported, otherwise poll.
Daniel O'Connor <darius@dons.net.au>
parents:
34
diff
changeset
|
57 if self.hasopc: |
31
c6c86dcb54ba
Add code to automate a sitesurvey (to some degree).
Daniel O'Connor <darius@dons.net.au>
parents:
diff
changeset
|
58 self.con.write("*OPC?") |
c6c86dcb54ba
Add code to automate a sitesurvey (to some degree).
Daniel O'Connor <darius@dons.net.au>
parents:
diff
changeset
|
59 opc = scpi.getdata(self.con.read(timeout), int) |
c6c86dcb54ba
Add code to automate a sitesurvey (to some degree).
Daniel O'Connor <darius@dons.net.au>
parents:
diff
changeset
|
60 if opc != 1: |
c6c86dcb54ba
Add code to automate a sitesurvey (to some degree).
Daniel O'Connor <darius@dons.net.au>
parents:
diff
changeset
|
61 return None |
c6c86dcb54ba
Add code to automate a sitesurvey (to some degree).
Daniel O'Connor <darius@dons.net.au>
parents:
diff
changeset
|
62 else: |
c6c86dcb54ba
Add code to automate a sitesurvey (to some degree).
Daniel O'Connor <darius@dons.net.au>
parents:
diff
changeset
|
63 while True: |
c6c86dcb54ba
Add code to automate a sitesurvey (to some degree).
Daniel O'Connor <darius@dons.net.au>
parents:
diff
changeset
|
64 self.con.write(':STATus:OPERation?') |
c6c86dcb54ba
Add code to automate a sitesurvey (to some degree).
Daniel O'Connor <darius@dons.net.au>
parents:
diff
changeset
|
65 i = scpi.getdata(self.con.read(timeout), int) |
c6c86dcb54ba
Add code to automate a sitesurvey (to some degree).
Daniel O'Connor <darius@dons.net.au>
parents:
diff
changeset
|
66 if i & 256: |
c6c86dcb54ba
Add code to automate a sitesurvey (to some degree).
Daniel O'Connor <darius@dons.net.au>
parents:
diff
changeset
|
67 break |
c6c86dcb54ba
Add code to automate a sitesurvey (to some degree).
Daniel O'Connor <darius@dons.net.au>
parents:
diff
changeset
|
68 |
44
c93d6d4cb04b
Use *OPC where supported, otherwise poll.
Daniel O'Connor <darius@dons.net.au>
parents:
34
diff
changeset
|
69 |
31
c6c86dcb54ba
Add code to automate a sitesurvey (to some degree).
Daniel O'Connor <darius@dons.net.au>
parents:
diff
changeset
|
70 def dumpconf(self): |
c6c86dcb54ba
Add code to automate a sitesurvey (to some degree).
Daniel O'Connor <darius@dons.net.au>
parents:
diff
changeset
|
71 rtn = {} |
c6c86dcb54ba
Add code to automate a sitesurvey (to some degree).
Daniel O'Connor <darius@dons.net.au>
parents:
diff
changeset
|
72 for k in self.attrs: |
c6c86dcb54ba
Add code to automate a sitesurvey (to some degree).
Daniel O'Connor <darius@dons.net.au>
parents:
diff
changeset
|
73 self.con.write(self.attrs[k][0] + '?') |
c6c86dcb54ba
Add code to automate a sitesurvey (to some degree).
Daniel O'Connor <darius@dons.net.au>
parents:
diff
changeset
|
74 res = self.con.read() |
c6c86dcb54ba
Add code to automate a sitesurvey (to some degree).
Daniel O'Connor <darius@dons.net.au>
parents:
diff
changeset
|
75 #print "Getting " + k + " / " + self.attrs[k][0] + " = " + res |
c6c86dcb54ba
Add code to automate a sitesurvey (to some degree).
Daniel O'Connor <darius@dons.net.au>
parents:
diff
changeset
|
76 rtn[k] = self.attrs[k][1](res) |
c6c86dcb54ba
Add code to automate a sitesurvey (to some degree).
Daniel O'Connor <darius@dons.net.au>
parents:
diff
changeset
|
77 return rtn |
c6c86dcb54ba
Add code to automate a sitesurvey (to some degree).
Daniel O'Connor <darius@dons.net.au>
parents:
diff
changeset
|
78 |
c6c86dcb54ba
Add code to automate a sitesurvey (to some degree).
Daniel O'Connor <darius@dons.net.au>
parents:
diff
changeset
|
79 class RSSPA(Traceinst): |
77
23c96322cfb6
Spell Rohde Schwarz correctly.
Daniel O'Connor <doconnor@gsoft.com.au>
parents:
44
diff
changeset
|
80 '''Rohde & Schwarz Spectrum Analyzer''' |
31
c6c86dcb54ba
Add code to automate a sitesurvey (to some degree).
Daniel O'Connor <darius@dons.net.au>
parents:
diff
changeset
|
81 |
c6c86dcb54ba
Add code to automate a sitesurvey (to some degree).
Daniel O'Connor <darius@dons.net.au>
parents:
diff
changeset
|
82 attrs = { 'fstart' : ['FREQ:START', float, None], # Page 561 |
c6c86dcb54ba
Add code to automate a sitesurvey (to some degree).
Daniel O'Connor <darius@dons.net.au>
parents:
diff
changeset
|
83 'fstop' : ['FREQ:STOP', float, None], |
c6c86dcb54ba
Add code to automate a sitesurvey (to some degree).
Daniel O'Connor <darius@dons.net.au>
parents:
diff
changeset
|
84 'atten' : ['INP:ATT', float, None], # Page 518 |
c6c86dcb54ba
Add code to automate a sitesurvey (to some degree).
Daniel O'Connor <darius@dons.net.au>
parents:
diff
changeset
|
85 'resbw' : ['SENSE:BANDWIDTH:RESOLUTION', float, None], # Page 539 |
c6c86dcb54ba
Add code to automate a sitesurvey (to some degree).
Daniel O'Connor <darius@dons.net.au>
parents:
diff
changeset
|
86 'vidbw' : ['SENSE:BANDWIDTH:VIDEO', float, None], # Page 541 |
c6c86dcb54ba
Add code to automate a sitesurvey (to some degree).
Daniel O'Connor <darius@dons.net.au>
parents:
diff
changeset
|
87 'sweept' : ['SENSE:SWEEP:TIME', float, None], # Page 599 |
c6c86dcb54ba
Add code to automate a sitesurvey (to some degree).
Daniel O'Connor <darius@dons.net.au>
parents:
diff
changeset
|
88 #'sweeppts' : ['SWEEP:POINTS', int, RSSPA.sweepptscheck], |
c6c86dcb54ba
Add code to automate a sitesurvey (to some degree).
Daniel O'Connor <darius@dons.net.au>
parents:
diff
changeset
|
89 'sweeppts' : ['SWEEP:POINTS', int, None], # Page 599 |
c6c86dcb54ba
Add code to automate a sitesurvey (to some degree).
Daniel O'Connor <darius@dons.net.au>
parents:
diff
changeset
|
90 'sweepcnt' : ['SENSE1:AVERAGE:COUNT', int, None], # Page 595 |
c6c86dcb54ba
Add code to automate a sitesurvey (to some degree).
Daniel O'Connor <darius@dons.net.au>
parents:
diff
changeset
|
91 'reflev' : ['DISPLAY:WINDOW1:TRACE1:Y:SCALE:RLEVEL', float, None], # Page 506 |
c6c86dcb54ba
Add code to automate a sitesurvey (to some degree).
Daniel O'Connor <darius@dons.net.au>
parents:
diff
changeset
|
92 'detector' : ['SENSE1:DETECTOR1:FUNCTION', str, None] , # Page 552 |
c6c86dcb54ba
Add code to automate a sitesurvey (to some degree).
Daniel O'Connor <darius@dons.net.au>
parents:
diff
changeset
|
93 } |
c6c86dcb54ba
Add code to automate a sitesurvey (to some degree).
Daniel O'Connor <darius@dons.net.au>
parents:
diff
changeset
|
94 |
44
c93d6d4cb04b
Use *OPC where supported, otherwise poll.
Daniel O'Connor <darius@dons.net.au>
parents:
34
diff
changeset
|
95 hasopc = True |
31
c6c86dcb54ba
Add code to automate a sitesurvey (to some degree).
Daniel O'Connor <darius@dons.net.au>
parents:
diff
changeset
|
96 tracetypename = 'REAL,32' |
c6c86dcb54ba
Add code to automate a sitesurvey (to some degree).
Daniel O'Connor <darius@dons.net.au>
parents:
diff
changeset
|
97 tracedtype = numpy.float32 |
c6c86dcb54ba
Add code to automate a sitesurvey (to some degree).
Daniel O'Connor <darius@dons.net.au>
parents:
diff
changeset
|
98 tracequery = 'TRAC1? TRACE1' |
c6c86dcb54ba
Add code to automate a sitesurvey (to some degree).
Daniel O'Connor <darius@dons.net.au>
parents:
diff
changeset
|
99 swptslist = [125, 251, 501, 1001, 2001, 4001, 8001] |
44
c93d6d4cb04b
Use *OPC where supported, otherwise poll.
Daniel O'Connor <darius@dons.net.au>
parents:
34
diff
changeset
|
100 |
31
c6c86dcb54ba
Add code to automate a sitesurvey (to some degree).
Daniel O'Connor <darius@dons.net.au>
parents:
diff
changeset
|
101 # def sweepptscheck(npts): |
c6c86dcb54ba
Add code to automate a sitesurvey (to some degree).
Daniel O'Connor <darius@dons.net.au>
parents:
diff
changeset
|
102 # if x not in RSSPA.swptslist: |
c6c86dcb54ba
Add code to automate a sitesurvey (to some degree).
Daniel O'Connor <darius@dons.net.au>
parents:
diff
changeset
|
103 # raise exceptions.ValueError("Sweep value not supported, must be one of " + str(RSSPA.swptslist)) |
44
c93d6d4cb04b
Use *OPC where supported, otherwise poll.
Daniel O'Connor <darius@dons.net.au>
parents:
34
diff
changeset
|
104 |
31
c6c86dcb54ba
Add code to automate a sitesurvey (to some degree).
Daniel O'Connor <darius@dons.net.au>
parents:
diff
changeset
|
105 |
c6c86dcb54ba
Add code to automate a sitesurvey (to some degree).
Daniel O'Connor <darius@dons.net.au>
parents:
diff
changeset
|
106 class AnSPA(Traceinst): |
c6c86dcb54ba
Add code to automate a sitesurvey (to some degree).
Daniel O'Connor <darius@dons.net.au>
parents:
diff
changeset
|
107 '''Anritsu Spectrum Analyzer''' |
34
182c42e7bf03
Add page references for each command to teh Anritsu.
Daniel O'Connor <darius@dons.net.au>
parents:
31
diff
changeset
|
108 attrs = { 'fstart' : ['FREQ:START', float, None], # Page 26 |
182c42e7bf03
Add page references for each command to teh Anritsu.
Daniel O'Connor <darius@dons.net.au>
parents:
31
diff
changeset
|
109 'fstop' : ['FREQ:STOP', float, None], # Page 26 |
182c42e7bf03
Add page references for each command to teh Anritsu.
Daniel O'Connor <darius@dons.net.au>
parents:
31
diff
changeset
|
110 'atten' : ['SENSE:POWER:ATTENUATION', float, None], # Page 27 |
182c42e7bf03
Add page references for each command to teh Anritsu.
Daniel O'Connor <darius@dons.net.au>
parents:
31
diff
changeset
|
111 'sweept' : ['SENSE:SWEEP:TIME', float, None], # Page 28 |
182c42e7bf03
Add page references for each command to teh Anritsu.
Daniel O'Connor <darius@dons.net.au>
parents:
31
diff
changeset
|
112 'sweepcnt' : [':SENSe:AVERage:COUNt', int, None], # Page 21 |
182c42e7bf03
Add page references for each command to teh Anritsu.
Daniel O'Connor <darius@dons.net.au>
parents:
31
diff
changeset
|
113 'tracemode' : [':SENSe:AVERage:TYPE', str, None], # Page 21 |
182c42e7bf03
Add page references for each command to teh Anritsu.
Daniel O'Connor <darius@dons.net.au>
parents:
31
diff
changeset
|
114 'resbw' : ['SENSE:BANDWIDTH:RESOLUTION', float, None], # Page 22 |
182c42e7bf03
Add page references for each command to teh Anritsu.
Daniel O'Connor <darius@dons.net.au>
parents:
31
diff
changeset
|
115 'vidbw' : ['SENSE:BANDWIDTH:VIDEO', float, None], # Page 23 |
182c42e7bf03
Add page references for each command to teh Anritsu.
Daniel O'Connor <darius@dons.net.au>
parents:
31
diff
changeset
|
116 'reflev' : [':DISPLAY:WIND:TRACE:Y:SCALE:RLEVEL', float, None], # Page 15 |
182c42e7bf03
Add page references for each command to teh Anritsu.
Daniel O'Connor <darius@dons.net.au>
parents:
31
diff
changeset
|
117 'detector' : [':SENSe:DETector:FUNCtion', str, None], # Page 24 |
31
c6c86dcb54ba
Add code to automate a sitesurvey (to some degree).
Daniel O'Connor <darius@dons.net.au>
parents:
diff
changeset
|
118 } |
c6c86dcb54ba
Add code to automate a sitesurvey (to some degree).
Daniel O'Connor <darius@dons.net.au>
parents:
diff
changeset
|
119 |
44
c93d6d4cb04b
Use *OPC where supported, otherwise poll.
Daniel O'Connor <darius@dons.net.au>
parents:
34
diff
changeset
|
120 hasopc = False |
31
c6c86dcb54ba
Add code to automate a sitesurvey (to some degree).
Daniel O'Connor <darius@dons.net.au>
parents:
diff
changeset
|
121 tracetypename = 'REAL,32' |
c6c86dcb54ba
Add code to automate a sitesurvey (to some degree).
Daniel O'Connor <darius@dons.net.au>
parents:
diff
changeset
|
122 tracedtype = numpy.float32 |
c6c86dcb54ba
Add code to automate a sitesurvey (to some degree).
Daniel O'Connor <darius@dons.net.au>
parents:
diff
changeset
|
123 tracequery = 'TRACE:DATA?' |
c6c86dcb54ba
Add code to automate a sitesurvey (to some degree).
Daniel O'Connor <darius@dons.net.au>
parents:
diff
changeset
|
124 |
c6c86dcb54ba
Add code to automate a sitesurvey (to some degree).
Daniel O'Connor <darius@dons.net.au>
parents:
diff
changeset
|
125 def getInst(inst): |
c6c86dcb54ba
Add code to automate a sitesurvey (to some degree).
Daniel O'Connor <darius@dons.net.au>
parents:
diff
changeset
|
126 if inst == "RSSPA": |
c6c86dcb54ba
Add code to automate a sitesurvey (to some degree).
Daniel O'Connor <darius@dons.net.au>
parents:
diff
changeset
|
127 return RSSPA |
c6c86dcb54ba
Add code to automate a sitesurvey (to some degree).
Daniel O'Connor <darius@dons.net.au>
parents:
diff
changeset
|
128 elif inst == "AnSPA": |
c6c86dcb54ba
Add code to automate a sitesurvey (to some degree).
Daniel O'Connor <darius@dons.net.au>
parents:
diff
changeset
|
129 return AnSPA |
c6c86dcb54ba
Add code to automate a sitesurvey (to some degree).
Daniel O'Connor <darius@dons.net.au>
parents:
diff
changeset
|
130 else: |
c6c86dcb54ba
Add code to automate a sitesurvey (to some degree).
Daniel O'Connor <darius@dons.net.au>
parents:
diff
changeset
|
131 raise exceptions.NotImplementedError("unknown instrument type " + inst) |