finesse.components.dof module
- class finesse.components.dof.DOFWorkspace(owner, sim)[source]
Bases:
ConnectorWorkspace
- class finesse.components.dof.DegreeOfFreedom(*args, **kwargs)[source]
Bases:
ConnectorThe degree of freedom element represents degrees of freedom in your optical setup. It is used to control multiple parameters in your model in a coherent way.
Parameters
- namestr
Name of the degree of freedom.
- *node_amplitude_pairs: tuple[str, float | Symbol]
String referring to a parameter or a local degree of freedom, coupled with the amplitude with which this DOF will drive the parameter. The parameter value will be set to the product of this (symbolic) amplitude and the DOF.DC parameter. In case multiple DOFS drive the same parameter, their contributions will be summed.
- DCfloat, optional
DC value for the degree of freedom, by default 0
- lock_parametersbool, optional
Whether to ‘lock’ the parameters driven by this degree of freedom. This prevents accidental overriding of parameter values that are meant to be controlled by a dof, by default True.
Raises
- RuntimeError
When not supplying any node-amplitude pairs
- Exception
When nodes and amplitudes are not the same length
- IllegalSelfReferencing
When symbolic amplitudes are self-referencing (cyclical references)
- TypeError
When one of the input nodes is not a parameter or a local degree of freedom
- TypeError
When the ‘AC_IN_type’ of the local degree of freedom is not a mechanical or electrical node.
- TypeError
When the ‘AC_IN_type’ of the local degree of freedom is not a mechanical or electrical node.
- TypeError
When one of the amplitudes is not a real number or a symbolic expression.
- property DC
DC : float, optional DC value for the degree of freedom, by default 0
- property amplitudes: ndarray[source]
Amplitudes a node is driving.
- Getter:
Returns copy of the amplitudes a node is driving.
- property dc_enabled[source]
Whether all driving nodes have an associated DC parameter.
- Getter:
Returns True if all driving nodes have an associated DC parameter that can be varied.
- property driven_parameters: list[Parameter][source]
List of all the parameters driven by this degree of freedom
Returns
- list[Parameter]
List of the driven parameters
Raises
- NotImplementedError
For drives that are not a Parameter or a LocalDegreeOfFreedom
- property drives: tuple[LocalDegreeOfFreedom, ...][source]
Nodes this degree of freedom is driving.
- Getter:
Returns the nodes this degree of freedom drives.
- lock_driven_parameters(verbose: bool = False)[source]
Locks all the parameters used by this degree of freedom.
Parameters
- verbosebool, optional
Prints every parameter being locked, by default False
- property lock_parameters
lock_parameters : bool, optional Whether to ‘lock’ the parameters driven by this degree of freedom. This prevents accidental overriding of parameter values that are meant to be controlled by a dof, by default True.