pyepr.Parameter¶
- class pyepr.Parameter(name, value, unit='', description='', virtual=False, **kwargs)[source]¶
Represents a sequence or pulse parameter.
A general parameter.
- Parameters:
- namestr
The parameter name
- valuefloat or int
The parameter value, eithe initial or static
- unitstr, optional
The unit of parameter, by default None. Leave as None if unitless.
- descriptionstr, optional
A brief description of the parameter, by default None
- axisnp.ndarray, optional
The difference from the intial value for each position in a dynamic axis. Can be n-dimensional, by default None.
- ax_idlist, optional
- virtual: bool, optional
A virtual paramter is only used to vary other parameters, it is not varied itself and will not be directly passed to a spectrometer. This parameter is never inherited. By default, False
- Attributes:
- progressivebool
Is the parameter used in any progression or is it constant
- progdict
A dict containing progressive programs for this parameter. This list has two elements. 1) The axis_id”s and 2) the “axis” of values.
Examples
Creating a static parameter
Par1 = Parameter( name="Par1", value=10, unit="us", description="The first parameter")
Creating a dynamic parameter
Par1 = Parameter( name="Par1", value=10, unit="us", description="The first parameter", axis=np.arange(0,10,1), axis_id=0)
Adding a parameter and a number:
Par1 = Parameter( name="Par1", value=10, unit="us", description="The first parameter") Par2 = Par1 + 2
Attributes
- name¶
- unit = ''¶
- description = ''¶
- virtual = False¶
- axis = []¶
- ax_id = []¶
- property dim¶
Methods
- adjust_step(waveform_precision, keep_dim=True)[source]¶
Adjust the step size of the axis to be an integer multiple of the waveform precision. Additionally, the value is adjusted to the nearest step. This is only applied if the units are in [ns,us,ms]
Only has an affect on parmater with units of [ns,us,ms]
- Parameters:
- waveform_precisionfloat
The precision of the waveform in ns
- keep_dimbool, optional
If True, the dimension of the axis is kept the same. If False, the maximum value is perserved and the dim is extended, by default True