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

Enable Rohde&Schwarz ZNLE VNA #6796

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 5 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
1 change: 1 addition & 0 deletions docs/changes/newsfragments/6672.improved_driver
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Enabled use of ZNLE R&S VNA by recognizing the model name in RohdeSchwarzZNBBase, and creating an ZNLE class as an alias
33 changes: 28 additions & 5 deletions src/qcodes/instrument_drivers/rohde_schwarz/ZNB.py
Original file line number Diff line number Diff line change
Expand Up @@ -442,11 +442,29 @@
"ZNB8": -80,
"ZNB20": -60,
"ZNB40": -60,
"ZNLE3": -10,
"ZNLE4": -10,
"ZNLE6": -10,
"ZNLE14": -10,
"ZNLE18": -10,
}
self._model_max_source_power = {

Check warning on line 451 in src/qcodes/instrument_drivers/rohde_schwarz/ZNB.py

View check run for this annotation

Codecov / codecov/patch

src/qcodes/instrument_drivers/rohde_schwarz/ZNB.py#L451

Added line #L451 was not covered by tests
"ZNB4": 25,
"ZNB8": 25,
"ZNB20": 25,
"ZNB40": 25,
"ZNLE3": 0,
"ZNLE4": 0,
"ZNLE6": 0,
"ZNLE14": 0,
"ZNLE18": 0,
}
if model not in self._model_min_source_power.keys():
raise RuntimeError(f"Unsupported ZNB model: {model}")
self._min_source_power: float
self._min_source_power = self._model_min_source_power[model]
self._max_source_power: float
self._max_source_power = self._model_max_source_power[model]

Check warning on line 467 in src/qcodes/instrument_drivers/rohde_schwarz/ZNB.py

View check run for this annotation

Codecov / codecov/patch

src/qcodes/instrument_drivers/rohde_schwarz/ZNB.py#L466-L467

Added lines #L466 - L467 were not covered by tests

self.vna_parameter: Parameter = self.add_parameter(
name="vna_parameter",
Expand All @@ -462,7 +480,7 @@
get_cmd=f"SOUR{n}:POW?",
set_cmd=f"SOUR{n}:POW {{:.4f}}",
get_parser=float,
vals=vals.Numbers(self._min_source_power, 25),
vals=vals.Numbers(self._min_source_power, self._max_source_power),
)
"""Parameter power"""
self.bandwidth: Parameter = self.add_parameter(
Expand Down Expand Up @@ -1009,10 +1027,10 @@

class RohdeSchwarzZNBBase(VisaInstrument):
"""
Base class for QCoDeS driver for the Rohde & Schwarz ZNB8 and ZNB20
virtual network analyser. It can probably be extended to ZNB4 and 40
without too much work. This class should not be instantiated directly
the RohdeSchwarzZNB8 and RohdeSchwarzZNB20 should be used instead.
Base class for QCoDeS driver for the Rohde & Schwarz
ZNB4, ZNB8, ZNB20, ZNB40, ZNLE3, ZNLE4, ZNLE6, ZNLE14 and ZNLE18.
This class should not be instantiated directly
the ZNB and ZNLE should be used instead.

Requires FrequencySweep parameter for taking a trace

Expand Down Expand Up @@ -1059,6 +1077,11 @@
"ZNB8": (9e3, 8.5e9),
"ZNB20": (100e3, 20e9),
"ZNB40": (10e6, 40e9),
"ZNLE3": (1e6, 3e9),
"ZNLE4": (1e6, 4e9),
"ZNLE6": (1e6, 6e9),
"ZNLE14": (1e6, 14e9),
"ZNLE18": (1e6, 18e9),
}
if model not in m_frequency.keys():
raise RuntimeError(f"Unsupported ZNB model {model}")
Expand Down
4 changes: 4 additions & 0 deletions src/qcodes/instrument_drivers/rohde_schwarz/ZNLE.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
from .ZNB import RohdeSchwarzZNBBase

class ZNLE(RohdeSchwarzZNBBase):
pass
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These short names are soft deprecated so let's not add them for new instruments.

Rather please create classes of the form RohdeSchwarzZNLE3 in a private file _rohde_schwarz_znle.py
and add the imports of these files to the __init__.py file in the folder.

Loading