finesse.tracing.tree.TraceTree

Overview

class finesse.tracing.tree.TraceTree(node, dependency)

Bases: object

A binary tree data structure representing all the beam tracing paths from some root optical node of a model.

Each instance of this class has a left and right sub-tree (of the class type) and a parent tree. These linked tree attributes can be None. If the tree has a left / right sub-tree then the memoryviews left_abcd_x, left_abcd_y etc. will be initialised from the numerical ABCD matrix from the tree’s optical node to the next tree’s optical node.

Every sub-tree has a dependency attribute which is the object that the trace tree depends on - either a Cavity or a Gauss instance.

Methods

TraceTree.__init__(*args, **kwargs)

TraceTree.add_left(self, TraceTree sub_tree)

Add a left sub-tree to the tree.

TraceTree.add_right(self, TraceTree sub_tree)

Add a right sub-tree to the tree.

TraceTree.compute_rt_abcd(self, double[, , ...)

TraceTree.contains(self, o)

Whether the tree contains the specified object, determined recursively.

TraceTree.draw(self, unicode left_pad=u)

TraceTree.find_tree_at_node(self, node, ...)

Recursively search for the TraceTree corresponding to the optical node.

TraceTree.from_cavity(type cls, cavity)

Construct a TraceTree from a cavity instance.

TraceTree.from_node(type cls, node, ...[, ...])

Construct a TraceTree from an optical node root.

TraceTree.from_path(list path)

Construct a TraceTree from a list of optical nodes.

TraceTree.get_all_nodes(self)

Retrieve a set consisting of all the OpticalNode objects covered by this tree.

TraceTree.get_broadest_changing_subtrees(self)

Retrieve a list of each TraceTree, from here, which is changing.

TraceTree.get_last_input_nodes(self)

Retrieves a list of the final input optical nodes within the tree.

TraceTree.get_last_left_branch(self)

Finds the final left sub-tree from this tree node.

TraceTree.get_mirror_reflection_couplings(self)

Obtain a list of all the node couplings corresponding to self-reflections.

TraceTree.is_changing(self, bool recursive=True)

TraceTree.propagate(self, dict trace, ...)

TraceTree.remove_left(self)

Removes the left sub-tree and returns it.

TraceTree.remove_right(self)

Removes the right sub-tree and returns it.

TraceTree.trace_beam(self, double lambda0, ...)

Trace the beam through the source tree.

TraceTree.trim_at_nodes(self, nodes, ...)

Trims branches from the tree starting at any optical node in nodes.