Updates to OTF, and added RP100 strain cell power supply, as well as a couple network analysers. Results from the mRS network analyser are questionable at best, and nonsense at worst. Beware.
This commit is contained in:
59
frappy_psi/network_analysers/ZVL/ZVLNode.py
Normal file
59
frappy_psi/network_analysers/ZVL/ZVLNode.py
Normal file
@@ -0,0 +1,59 @@
|
||||
|
||||
import frappy.core as fc
|
||||
import frappy
|
||||
|
||||
from frappy_psi.network_analysers.ZVL.ZVLDriver import ZVLNetAnalyzer
|
||||
|
||||
class ZVLNode(fc.Readable):
|
||||
"""A ZVL Network Analyser.
|
||||
|
||||
Use
|
||||
---
|
||||
Set the center (target) and the analyser will be in a BUSY (3XX) state until the output is up to date (at that frequency).
|
||||
|
||||
Attributes
|
||||
----------
|
||||
value: the magnitude (in dB) of the signal at the set frequency.
|
||||
status: status tuple (see frappy docs)
|
||||
pollinterval: see frappy docs
|
||||
central_freq: the center frequency (in Hz) to be probing
|
||||
freq_span: the frequency span (in Hz) to be probing
|
||||
analyser_ip: the IP address of the network analyser. Best to set in the config!
|
||||
"""
|
||||
|
||||
value = fc.Parameter('value', fc.ArrayOf(fc.FloatRange(unit='dB'), minlen=1000, maxlen=1000), readonly=True)
|
||||
status = fc.Parameter(datatype=frappy.datatypes.StatusType(fc.Readable, "DISABLED", 'PREPARED', 'BUSY'), default=('IDLE', 'idle'))
|
||||
pollinterval = fc.Parameter(default=1)
|
||||
central_freq = fc.Parameter('central_freq', fc.FloatRange(min=9_000, max=13_600_000_000, unit='Hz'), default=10_000_000, readonly=False)
|
||||
freq_span = fc.Parameter('freq_span', fc.FloatRange(unit='Hz'), default=1_000_000, readonly=False)
|
||||
|
||||
analyser_ip = fc.Parameter('analyser_ip', fc.StringType())
|
||||
|
||||
def initialReads(self):
|
||||
self.connect()
|
||||
|
||||
def connect(self):
|
||||
self.NA = ZVLNetAnalyzer(self.analyser_ip)
|
||||
self.NA.reset()
|
||||
self.acq()
|
||||
|
||||
def acq(self):
|
||||
self.status = ('BUSY', 'acquiring')
|
||||
self.NA.set_freq_span(self.central_freq, self.freq_span)
|
||||
self.value = self.NA.get_data()[1]
|
||||
self.status = ('IDLE', 'idle')
|
||||
|
||||
def write_central_freq(self, f):
|
||||
self.central_freq = (f)
|
||||
self.acq()
|
||||
return self.read_central_freq()
|
||||
|
||||
def write_freq_span(self, f):
|
||||
self.freq_span = f
|
||||
self.acq()
|
||||
return self.read_freq_span()
|
||||
|
||||
def write_analyser_ip(self, ip):
|
||||
self.analyser_ip = ip
|
||||
self.connect()
|
||||
return self.read_analyser_ip()
|
||||
Reference in New Issue
Block a user