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

Add curve header parameters to Lakeshore model 336, make group parameter take callable get_cmd #6520

Merged
74 changes: 73 additions & 1 deletion src/qcodes/instrument_drivers/Lakeshore/Lakeshore_model_336.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from typing import TYPE_CHECKING, ClassVar

import qcodes.validators as vals
from qcodes.parameters import Group, GroupParameter
from qcodes.parameters import Group, GroupParameter, Parameter

from .lakeshore_base import (
LakeshoreBase,
Expand Down Expand Up @@ -203,6 +203,78 @@ def __init__(
get_cmd=f"INTYPE? {self._channel}",
)

# Parameters related to temperature calibration curve (CRVHDR)
self.curve_number: Parameter = self.add_parameter(
"curve_number",
get_cmd=f"INCRV? {self._channel}",
set_cmd=False,
get_parser=int,
label="Temperature calibration curve number",
)
"""
Temperature calibration curve number that is selected now
"""
self.curve_name: GroupParameter = self.add_parameter(
"curve_name",
label="Temperature calibration curve name",
parameter_class=GroupParameter,
)
"""
Temperature calibration curve name
for the current curve as selected by ``curve_number``
"""
self.curve_sn: GroupParameter = self.add_parameter(
"curve_sn",
label="Temperature calibration curve SN",
parameter_class=GroupParameter,
)
"""
Temperature calibration curve SN
for the current curve as selected by ``curve_number``
"""
self.curve_format: GroupParameter = self.add_parameter(
"curve_format",
label="Temperature calibration curve format",
get_parser=int,
val_mapping={"mV/K": 1, "V/K": 2, "Ohms/K": 3, "log Ohms/K": 4},
parameter_class=GroupParameter,
)
"""
Temperature calibration curve format
for the current curve as selected by ``curve_number``
"""
self.curve_limit: GroupParameter = self.add_parameter(
"curve_limit",
get_parser=float,
label="Temperature calibration curve limit value",
parameter_class=GroupParameter,
)
"""
Temperature calibration curve limit value
for the current curve as selected by ``curve_number``
"""
self.curve_coefficient: GroupParameter = self.add_parameter(
"curve_coefficient",
get_parser=int,
label="Temperature calibration curve coefficient",
val_mapping={"negative": 1, "positive": 2},
parameter_class=GroupParameter,
)
"""
Temperature calibration curve coefficient
for the current curve as selected by ``curve_number``
"""
self.curve_parameters_group = Group(
[
self.curve_name,
self.curve_sn,
self.curve_format,
self.curve_limit,
self.curve_coefficient,
],
get_cmd=f"CRVHDR? {self.curve_number()}",
)


class LakeshoreModel336(LakeshoreBase):
"""
Expand Down
Loading