Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Increase efficiency in ZNB driver #1564

Merged
merged 4 commits into from
May 15, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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