finesse.tracing.forest.TraceForest
¶
Overview
- class finesse.tracing.forest.TraceForest(model, bool symmetric, list trees=None)¶
Bases:
object
A container structure which stores multiple
TraceTree
instances.The
Model
stores a TraceForest object which then represents the current tracing state of the configuration. Each time aModel.beam_trace()
is called, either directly or indirectly, the TraceForest of the Model will be used to perform the tracing via propagation of the beam parameters through each tree. This is also detailed in Tracing the beam.Determination of the ordering and overall structure of the TraceForest happens through the “planting” of the forest. By calling
TraceForest.plant()
, the forest is cleared and re-planted according to the ordered list of trace dependencies passed to this method. This is a step which is performed automatically inModel.beam_trace()
, where this re-planting process only occurs under the following condition:a connector has been added or removed since the last call,
the type of beam tracing has been switched from symmetric to asymmetric or vice-verase,
or the tracing priority (i.e. ordered list of trace dependencies) has changed in any way.
In the initialisation process of building a simulation, a specialised version of a TraceForest is constructed from the model TraceForest using the
TraceForest.make_changing_forest
method. This inspects the model forest and selects only those trees, and branches of trees, which will have changing beam parameters during the simulation; i.e. due to someGeometricParameter
being scanned. This new, “changing TraceForest” is then the optimised structure via which simulation-time beam traces (on changing beam parameter paths) are performed. More details on this, including additional powerful features that this changing forest provides, can be found in Tracing the beam.Special method support
This class implements the following special methods:
__getitem__
,__len__
,__iter__
,__next__
and__contains__
, providing the following behaviour (assuming forest is an instance of this class):tree = forest[x]
- either get theTraceTree
at indexx
(i.e. the x-th tree to be traced when performing a beam trace on the forest), OR ifx
is aTraceDependency
get a list of all the trees in the forest which are associated with that dependency.N_trees = len(forest)
- the number of trees in the forest, equivalent toTraceForest.size()
.for tree in forest:
- iteration support over the forest, in order of tracing priority.flag = x in forest
- check whether some objectx
is in the forest. This can be aTraceTree
, anOpticalNode
, aSpace
or aConnector
. Equivalent toTraceForest.contains()
.
Properties
Methods
|
|
|
Clears the trace forest, removing all trace trees. |
|
Whether the forest contains the specified object, determined recursively for each tree within the forest. |
|
Draws the forest, by trace priority, as a string representation. |
Draws the forest as a string representation. |
|
|
Whether the forest is empty (no trees) or not. |
|
Finds the dependency object associated with the optical node. |
Finds the node couplings at which trees with differing trace dependencies intersect. |
|
Retrieves the node couplings which are potentially mode mismatched. |
|
|
Given an optical node, this finds the |
Finds all the optical nodes in the model which are not covered by the trace forest. |
|
Get the node couplings in the forest which correspond to self-reflections from mirror-like components. |
|
For a given TraceForest this method will determine which optical nodes in a model will have a changing complex beam parameter. |
|
Constructs a new TraceForest from this forest, consisting of only the trees which will have changing beam parameters. |
|
|
Constructs and stores all the trace trees according to the order of dependencies in trace_order. |
|
The number of trees in the forest. |
|
Performs a "model-time" beam trace on all trace trees. |
|
Get a list of all the |