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

Update R and S drivers to conform to docs standard #4595

Merged
merged 4 commits into from
Sep 12, 2022
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ genapi:
../qcodes/instrument_drivers/QDev/* \
../qcodes/instrument_drivers/QuantumDesign/DynaCoolPPMS/private/* \
../qcodes/instrument_drivers/rigol/* \
../qcodes/instrument_drivers/rohde_schwarz/* \
../qcodes/instrument_drivers/stahl/*\
../qcodes/instrument_drivers/stanford_research/* \
../qcodes/instrument_drivers/signal_hound/* \
Expand Down
7 changes: 7 additions & 0 deletions docs/drivers_api/RohdeSchwarz.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.. _rohdeschwarz_api :

Rohde & Schwarz Drivers
=======================

.. automodule:: qcodes.instrument_drivers.rohde_schwarz
:autosummary:
1 change: 1 addition & 0 deletions docs/make.bat
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ sphinx-apidoc -o _auto -d 10 ..\qcodes ^
..\qcodes\instrument_drivers\QuantumDesign\DynaCoolPPMS\private\* ^
..\qcodes\instrument_drivers\QDev\* ^
..\qcodes\instrument_drivers\rigol\* ^
..\qcodes\instrument_drivers\rohde_schwarz\* ^
..\qcodes\instrument_drivers\stahl\* ^
..\qcodes\instrument_drivers\stanford_research\* ^
..\qcodes\instrument_drivers\signal_hound\* ^
Expand Down
34 changes: 25 additions & 9 deletions qcodes/instrument_drivers/rohde_schwarz/RTO1000.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ def get_raw(self) -> np.ndarray:
return output


class ScopeMeasurement(InstrumentChannel):
class RohdeSchwarzRTO1000ScopeMeasurement(InstrumentChannel):
"""
Class to hold a measurement of the scope.
"""
Expand Down Expand Up @@ -290,7 +290,10 @@ def __init__(self, parent: Instrument, name: str, meas_nr: int) -> None:
' results.')


class ScopeChannel(InstrumentChannel):
ScopeMeasurement = RohdeSchwarzRTO1000ScopeMeasurement


class RohdeSchwarzRTO1000ScopeChannel(InstrumentChannel):
"""
Class to hold an input channel of the scope.

Expand Down Expand Up @@ -432,7 +435,10 @@ def _set_scale(self, value: float) -> None:
self._parent.write(f'CHANnel{self.channum}:SCALe {value}')


class RTO1000(VisaInstrument):
ScopeChannel = RohdeSchwarzRTO1000ScopeChannel


class RohdeSchwarzRTO1000(VisaInstrument):
"""
QCoDeS Instrument driver for the
Rohde-Schwarz RTO1000 series oscilloscopes.
Expand Down Expand Up @@ -684,13 +690,15 @@ def __init__(self, name: str, address: str,
get_parser=str)

# Add the channels to the instrument
for ch in range(1, self.num_chans+1):
chan = ScopeChannel(self, f'channel{ch}', ch)
self.add_submodule(f'ch{ch}', chan)
for ch in range(1, self.num_chans + 1):
chan = RohdeSchwarzRTO1000ScopeChannel(self, f"channel{ch}", ch)
self.add_submodule(f"ch{ch}", chan)

for measId in range(1, self.num_meas+1):
measCh = ScopeMeasurement(self, f'measurement{measId}', measId)
self.add_submodule(f'meas{measId}', measCh)
for measId in range(1, self.num_meas + 1):
measCh = RohdeSchwarzRTO1000ScopeMeasurement(
self, f"measurement{measId}", measId
)
self.add_submodule(f"meas{measId}", measCh)

self.add_function('stop', call_cmd='STOP')
self.add_function('reset', call_cmd='*RST')
Expand Down Expand Up @@ -805,3 +813,11 @@ def _get_trigger_level(self) -> float:
val = self.ask(f'TRIGger1:LEVel{source}?')

return float(val.strip())


class RTO1000(RohdeSchwarzRTO1000):
"""
Backwards compatibility alias for RohdeSchwarzRTO1000
"""

pass
10 changes: 10 additions & 0 deletions qcodes/instrument_drivers/rohde_schwarz/Rohde_Schwarz_ZNB20.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
from .ZNB import ZNB


class RohdeSchwarzZNB20(ZNB):
"""
QCoDeS driver for Rohde & Schwarz ZNB20

"""

pass
12 changes: 12 additions & 0 deletions qcodes/instrument_drivers/rohde_schwarz/Rohde_Schwarz_ZNB8.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Ensuring backwards compatibility

from .ZNB import ZNB


class RohdeSchwarzZNB8(ZNB):
"""
QCoDeS driver for Rohde & Schwarz ZNB8

"""

pass
6 changes: 5 additions & 1 deletion qcodes/instrument_drivers/rohde_schwarz/SGS100A.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from qcodes.parameters import create_on_off_val_mapping


class RohdeSchwarz_SGS100A(VisaInstrument):
class RohdeSchwarzSGS100A(VisaInstrument):
"""
This is the QCoDeS driver for the Rohde & Schwarz SGS100A signal generator.

Expand Down Expand Up @@ -150,3 +150,7 @@ def on(self) -> None:

def off(self) -> None:
self.status('off')


class RohdeSchwarz_SGS100A(RohdeSchwarzSGS100A):
pass
27 changes: 15 additions & 12 deletions qcodes/instrument_drivers/rohde_schwarz/ZNB.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class FixedFrequencyTraceIQ(MultiParameter):
"""

def __init__(
self, name: str, instrument: "ZNBChannel", npts: int, bandwidth: int
self, name: str, instrument: "RohdeSchwarzZNBChannel", npts: int, bandwidth: int
) -> None:
super().__init__(
name,
Expand Down Expand Up @@ -74,7 +74,7 @@ def get_raw(self) -> Tuple[np.ndarray, np.ndarray]:
`cw_check_sweep_first` is set to `True` then at the cost of a few ms
overhead checks if the vna is setup correctly.
"""
assert isinstance(self.instrument, ZNBChannel)
assert isinstance(self.instrument, RohdeSchwarzZNBChannel)
i, q = self.instrument._get_cw_data()
return i, q

Expand All @@ -95,7 +95,7 @@ class FixedFrequencyPointIQ(MultiParameter):
instrument: instrument the parameter belongs to
"""

def __init__(self, name: str, instrument: "ZNBChannel") -> None:
def __init__(self, name: str, instrument: "RohdeSchwarzZNBChannel") -> None:
super().__init__(
name,
instrument=instrument,
Expand All @@ -112,7 +112,7 @@ def get_raw(self) -> Tuple[float, float]:
parameter `cw_check_sweep_first` is set to `True` then at the cost of a
few ms overhead checks if the vna is setup correctly.
"""
assert isinstance(self.instrument, ZNBChannel)
assert isinstance(self.instrument, RohdeSchwarzZNBChannel)
i, q = self.instrument._get_cw_data()
return float(np.mean(i)), float(np.mean(q))

Expand All @@ -131,7 +131,7 @@ class FixedFrequencyPointMagPhase(MultiParameter):
instrument: instrument the parameter belongs to
"""

def __init__(self, name: str, instrument: "ZNBChannel") -> None:
def __init__(self, name: str, instrument: "RohdeSchwarzZNBChannel") -> None:
super().__init__(
name,
instrument=instrument,
Expand All @@ -152,7 +152,7 @@ def get_raw(self) -> Tuple[float, ...]:
`True` for the instrument then at the cost of a few ms overhead
checks if the vna is setup correctly.
"""
assert isinstance(self.instrument, ZNBChannel)
assert isinstance(self.instrument, RohdeSchwarzZNBChannel)
i, q = self.instrument._get_cw_data()
s = np.mean(i) + 1j * np.mean(q)
return np.abs(s), np.angle(s)
Expand All @@ -166,7 +166,7 @@ class FrequencySweepMagPhase(MultiParameter):
def __init__(
self,
name: str,
instrument: "ZNBChannel",
instrument: "RohdeSchwarzZNBChannel",
start: float,
stop: float,
npts: int,
Expand Down Expand Up @@ -203,7 +203,7 @@ def set_sweep(self, start: float, stop: float, npts: int) -> None:
self.shapes = ((npts,), (npts,))

def get_raw(self) -> Tuple[ParamRawDataType, ...]:
assert isinstance(self.instrument, ZNBChannel)
assert isinstance(self.instrument, RohdeSchwarzZNBChannel)
with self.instrument.format.set_to("Complex"):
data = self.instrument._get_sweep_data(force_polar=True)
return abs(data), np.angle(data)
Expand All @@ -218,7 +218,7 @@ class FrequencySweepDBPhase(MultiParameter):
def __init__(
self,
name: str,
instrument: "ZNBChannel",
instrument: "RohdeSchwarzZNBChannel",
start: float,
stop: float,
npts: int,
Expand Down Expand Up @@ -255,7 +255,7 @@ def set_sweep(self, start: float, stop: float, npts: int) -> None:
self.shapes = ((npts,), (npts,))

def get_raw(self) -> Tuple[ParamRawDataType, ...]:
assert isinstance(self.instrument, ZNBChannel)
assert isinstance(self.instrument, RohdeSchwarzZNBChannel)
with self.instrument.format.set_to("Complex"):
data = self.instrument._get_sweep_data(force_polar=True)
return 20*np.log10(np.abs(data)), np.angle(data)
Expand Down Expand Up @@ -320,11 +320,11 @@ def set_sweep(self, start: float, stop: float, npts: int) -> None:
self.shape = (npts,)

def get_raw(self) -> ParamRawDataType:
assert isinstance(self.instrument, ZNBChannel)
assert isinstance(self.instrument, RohdeSchwarzZNBChannel)
return self.instrument._get_sweep_data()


class ZNBChannel(InstrumentChannel):
class RohdeSchwarzZNBChannel(InstrumentChannel):
def __init__(
self,
parent: "ZNB",
Expand Down Expand Up @@ -922,6 +922,9 @@ def _get_cw_data(self) -> Tuple[np.ndarray, np.ndarray]:
return i, q


ZNBChannel = RohdeSchwarzZNBChannel


class ZNB(VisaInstrument):
"""
QCoDeS driver for the Rohde & Schwarz ZNB8 and ZNB20
Expand Down
4 changes: 3 additions & 1 deletion qcodes/instrument_drivers/rohde_schwarz/ZNB20.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Ensuring backwards compatibility

from .ZNB import ZNB as ZNB20
from .ZNB import ZNB

ZNB20 = ZNB
19 changes: 19 additions & 0 deletions qcodes/instrument_drivers/rohde_schwarz/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
from .Rohde_Schwarz_ZNB8 import RohdeSchwarzZNB8
from .Rohde_Schwarz_ZNB20 import RohdeSchwarzZNB20
from .RTO1000 import (
RohdeSchwarzRTO1000,
RohdeSchwarzRTO1000ScopeChannel,
RohdeSchwarzRTO1000ScopeMeasurement,
)
from .SGS100A import RohdeSchwarzSGS100A
from .ZNB import RohdeSchwarzZNBChannel

__all__ = [
"RohdeSchwarzRTO1000",
"RohdeSchwarzRTO1000ScopeChannel",
"RohdeSchwarzRTO1000ScopeMeasurement",
"RohdeSchwarzSGS100A",
"RohdeSchwarzZNB20",
"RohdeSchwarzZNB8",
"RohdeSchwarzZNBChannel",
]
95 changes: 0 additions & 95 deletions qcodes/instrument_drivers/rohde_schwarz/private/HMC804x.py

This file was deleted.

Empty file.
Loading