system.Parameter
Define a measurement parameter.
Usage
system.Parameter(
name,
unit,
setter=None,
getter=None,
default=None,
dtypes=None,
chunks=None,
trigger=None,
setter_args=None,
setter_kwargs=None,
getter_args=None,
getter_kwargs=None,
trigger_args=None,
trigger_kwargs=None,
label=None
)This class describes one parameter in matrix. It can define a single or multiple columns of the measurement.
Parameters
name: str or list of str-
Name of the column(s) as string or list of strings. If this is a list, make sure unit, default and chunks have same length.
unit: str or list of str-
Unit of the column(s) as string or list of strings.
default: float or list of floats = None-
Default value for parameter. If not None this value is always used unless another value is specified in the measurement. If None (default), no default value is set/used.
dtypes: str or list of str = None-
Dtype specified for saving into hdf5 files, not used for ascii files. Default value is “f8” (8 byte float).
chunks: int or list of int = None-
Length of the readback value. If a list is returned for a single parameter, set to the length of that list. If None (default), a chunk of 1 is assumed (readback of parameter is single float).
setter: callable, str, or list = None-
Function which should be called to set the values. Must be one of:
- A callable function with the call signature
func(value, *args, **kwargs). For optional arguments and kwargs see setter_args/setter_kwargs. - A string with a system method/property name. If it corresponds to a method its call signature and arguments must be equal to the callable function above.
- A list of the following scheme [device_name : str, method_name : str, args : tuple, kwargs : dict]. The args and kwargs entries are deprecated and should be replaced by the setter_args, setter_kwargs parameters.
- A callable function with the call signature
getter: callable, str, or list = None-
Function which should be called to fetch the values. Must be one of:
- A callable function with the call signature
func(*args, **kwargs). The arguments and kwargs are optional and can be supplied via getter_args/getter_kwargs. - A string with a system method/property name. If it corresponds to a method its call signature and arguments must be equal to the callable function above.
- A list of the following scheme [device_name : str, method_name : str, args : tuple, kwargs : dict]. The args and kwargs entries are deprecated and should be replaced by the getter_args, getter_kwargs parameters.
- A callable function with the call signature
trigger: callable, str, or list = None-
Takes a trigger function. The options are equal to the getter options. For the optional arguments and kwargs use trigger_args/trigger_kwargs.
label: str = None- Parameters label if different from name. This might be in particular needed if an automatically generated label from a name-list is not describing the content very well.
Attributes
All parameters are set as attributes of same name.
Raises
ValueError-
If parameter types or lengths are inconsistent.
TypeError- If parameter types are incorrect.