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
kwargskeyword arguments

See Model.sim_trace_config.

Examples

Temporarily change the tracing order:

with model.sim_trace_config_manager(order=["cavXARM", "gaussBS", "cavYARM"]):
    out = model.run("noxaxis()")

Disable certain dependencies in a context:

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

Switch off re-tracing and enable only two specific trace dependencies:

with model.sim_trace_config_manager(
    retrace=False, enable_only=["cavXARM", "cavYARM"]
):
    out = model.run("noxaxis()")

Use asymmetric tracing and mask all data points where any unstable cavity is encountered:

with model.sim_trace_config_manager(symmetric=False, unstable_handling="mask"):
    out = model.run("noxaxis()")