Skip to content

Commit

Permalink
Merge pull request #1564 from GateBuilder/znb_driver
Browse files Browse the repository at this point in the history
Increase efficiency in ZNB driver
  • Loading branch information
jenshnielsen authored May 15, 2019
2 parents cc4ca84 + 59cea9f commit c2fbc5d
Showing 1 changed file with 12 additions and 17 deletions.
29 changes: 12 additions & 17 deletions qcodes/instrument_drivers/rohde_schwarz/ZNB.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,13 +144,12 @@ def __init__(self, parent: 'ZNB', name: str, channel: int, vna_parameter: str=No
if full_modelname is not None:
model = full_modelname.split('-')[0]
else:
model = None
if model == 'ZNB4':
self._min_source_power = -80
elif model == 'ZNB8':
self._min_source_power = -80
elif model == 'ZNB20':
self._min_source_power = -60
raise RuntimeError("Could not determine ZNB model")
mSourcePower = {'ZNB4':-80, 'ZNB8':-80, 'ZNB20':-60}
if model not in mSourcePower.keys():
raise RuntimeError("Unsupported ZNB model: {}".format(model))
self._min_source_power: float
self._min_source_power = mSourcePower[model]

self.add_parameter(name='vna_parameter',
label='VNA parameter',
Expand Down Expand Up @@ -425,17 +424,13 @@ def __init__(self, name: str, address: str, init_s_params: bool = True,
else:
raise RuntimeError("Could not determine ZNB model")
# format seems to be ZNB8-4Port
if model == 'ZNB4':
self._max_freq = 4.5e9
self._min_freq = 9e3
elif model == 'ZNB8':
self._max_freq = 8.5e9
self._min_freq = 9e3
elif model == 'ZNB20':
self._max_freq = 20e9
self._min_freq = 100e3
else:
mFrequency = {'ZNB4':(9e3, 4.5e9), 'ZNB8':(9e3, 8.5e9), 'ZNB20':(100e3, 20e9)}
if model not in mFrequency.keys():
raise RuntimeError("Unsupported ZNB model {}".format(model))
self._min_freq: float
self._max_freq: float
self._min_freq, self._max_freq = mFrequency[model]

self.add_parameter(name='num_ports',
get_cmd='INST:PORT:COUN?',
get_parser=int)
Expand Down

0 comments on commit c2fbc5d

Please sign in to comment.