finesse.solutions.beamtrace.BeamTraceSolution

Overview

class finesse.solutions.beamtrace.BeamTraceSolution(name, data, forest=None)[source]

Bases: BaseSolution

Trace solution corresponding to calls to Model.beam_trace().

Note that BeamTraceSolution objects are returned via Model.beam_trace() calls, they should never need to be created manually.

This class provides a dict-like interface to beam trace solution data. If trace is an instance of this class then one can access the beam parameters at both planes of a node via:

# Using the look-up key notation
qx, qy = trace[node]

# Or the get method
qx, qy = trace.get(node)

One can also access individual plane beam parameters with:

# Tangential plane
qx = trace[node].qx

# Sagittal plane
qy = trace[node].qy

A copy of the Python dictionary which stores all the underlying node : (qx, qy) mappings can be obtained with the BeamTraceSolution.data property.

To draw a forest representation of the trace solution data, one can simply do:

# Prints the forest of beam parameters
print(trace)

# Stores the forest as a string
trace_str = str(trace)

This forest will be ordered by the trace order used for the associated Model.beam_trace() call which constructed this solution.

Properties

BeamTraceSolution.data

A copy of the underlying dictionary of beam trace solution data.

BeamTraceSolution.data_qx

A copy of the underlying data dictionary but with only the tangential plane beam parameters selected.

BeamTraceSolution.data_qy

A copy of the underlying data dictionary but with only the sagittal plane beam parameters selected.

Methods

BeamTraceSolution.__init__(name, data[, forest])

BeamTraceSolution.get(node[, default])

Gets the beam parameter(s) at the specified node / port.

BeamTraceSolution.items()

A view on the underlying dict items.

BeamTraceSolution.keys()

A view on the underlying dict keys.

BeamTraceSolution.print()

Draws the trace solution as a forest of beam parameters.

BeamTraceSolution.q(node)

A convenience method for getting the non-astigmatic beam parameter at a node.

BeamTraceSolution.values()

A view on the underlying dict values.