def _param_complex(): p = Parameter('simple_complex_parameter', set_cmd=None, get_cmd=lambda: 1 + 1j, vals=validators.ComplexNumbers()) return p
def __init__(self, name, **kw): super().__init__(name, **kw) # Instrument parameters for parname in ["x", "y", "z", "x0", "y0", "z0"]: self.add_parameter( parname, unit="m", parameter_class=ManualParameter, vals=vals.Numbers(), initial_value=0., ) # Instrument integer parameters for parname in [ "x_int", "y_int", "z_int", "x0_int", "y0_int", "z0_int" ]: self.add_parameter( parname, unit="m", parameter_class=ManualParameter, vals=vals.Ints(), initial_value=0, ) self.add_parameter( "noise", unit="V", label="white noise amplitude", parameter_class=ManualParameter, vals=vals.Numbers(), initial_value=0, ) self.add_parameter( "delay", unit="s", label="Sampling delay", parameter_class=ManualParameter, vals=vals.Numbers(), initial_value=0, ) self.add_parameter("parabola", unit="V", get_cmd=self._measure_parabola) self.add_parameter("parabola_int", unit="V", get_cmd=self._measure_parabola_int) self.add_parameter("parabola_float_int", unit="V", get_cmd=self._measure_parabola_float_int) self.add_parameter("parabola_list", unit="V", get_cmd=self._measure_parabola_list) self.add_parameter("skewed_parabola", unit="V", get_cmd=self._measure_skewed_parabola) self.add_parameter("cos_mod_parabola", unit="V", get_cmd=self._measure_cos_mod_parabola) self.add_parameter("lorentz_dip", unit="V", get_cmd=self._measure_lorentz_dip) self.add_parameter("lorentz_dip_cos_mod", unit="V", get_cmd=self._measure_lorentz_dip_cos_mod) self.add_parameter( "array_like", unit="a.u.", parameter_class=ManualParameter, vals=vals.Arrays(), ) self.add_parameter("nested_lists_like", unit="a.u.", parameter_class=ManualParameter, vals=vals.Lists(elt_validator=vals.Lists())) self.add_parameter("dict_like", unit="a.u.", parameter_class=ManualParameter, vals=vals.Dict()) self.add_parameter("complex_like", unit="a.u.", parameter_class=ManualParameter, vals=vals.ComplexNumbers()) self.add_parameter("status", vals=vals.Anything(), parameter_class=ManualParameter)