finesse.model.Model.sim_trace_config_manager

Model.sim_trace_config_manager(**kwargs)[source]

Change the Model.sim_trace_config within a context.

This provides a convenient pattern through which one can temporarily set the simulation beam tracing behaviour in a with block. The method Model.reset_sim_trace_config() is called on exit.

Parameters

kwargs : keyword arguments

Examples

Temporarily change the tracing order:

with model.sim_trace_config_manager(order=["cavC", "gauss1", "cavA"]):
    out = model.run()

or disable certain dependencies in a context:

with model.sim_trace_config_manager(disable="cavA"):
    out = model.run()