experimental.new_evaluator.simulation_output.presets module

Create some generic evaluators for SimulationOutput.

class LongitudinalEmittance(max_percentage_rel_increase: float, reference: ~beam_calculation.simulation_output.simulation_output.SimulationOutput, plotter: ~experimental.plotter.pd_plotter.PandasPlotter = <experimental.plotter.pd_plotter.PandasPlotter object>)

Bases: ISimulationOutputEvaluator

Check that the longitudinal emittance is acceptable.

__init__(max_percentage_rel_increase: float, reference: ~beam_calculation.simulation_output.simulation_output.SimulationOutput, plotter: ~experimental.plotter.pd_plotter.PandasPlotter = <experimental.plotter.pd_plotter.PandasPlotter object>) None

Instantiate with a reference simulation output.

_abc_impl = <_abc._abc_data object>
_constant_limits: bool = True
_fignum: int = 110
property _markdown: str

Give the proper markdown.

_to_deg: bool = False
_y_quantity: str = 'eps_phiw'
evaluate(*simulation_outputs, elts: Sequence[ListOfElements] | None = None, plot_kwargs: dict[str, Any] | None = None, **kwargs) tuple[list[bool], ndarray[Any, dtype[float64]]]

Assert that longitudinal emittance does not grow too much.

post_treat(ydata: Iterable[float]) ndarray[Any, dtype[float64]]

Compute relative diff w.r.t. reference value @ z = 0.

class LongitudinalMismatchFactor(max_mismatch: float, reference: ~beam_calculation.simulation_output.simulation_output.SimulationOutput, plotter: ~experimental.plotter.pd_plotter.PandasPlotter = <experimental.plotter.pd_plotter.PandasPlotter object>)

Bases: ISimulationOutputEvaluator

Check that mismatch factor at end is not too high.

__init__(max_mismatch: float, reference: ~beam_calculation.simulation_output.simulation_output.SimulationOutput, plotter: ~experimental.plotter.pd_plotter.PandasPlotter = <experimental.plotter.pd_plotter.PandasPlotter object>) None

Instantiate with a reference simulation output.

_abc_impl = <_abc._abc_data object>
_constant_limits: bool = True
_fignum: int = 112
_getter(simulation_output: SimulationOutput, quantity: str) ndarray[Any, dtype[float64]]

Call the get method with proper kwarguments.

Also skip calculation with reference accelerator, as mismatch will not be defined.

_to_deg: bool = False
_y_quantity: str = 'mismatch_factor_zdelta'
evaluate(*simulation_outputs, elts: Sequence[ListOfElements] | None = None, plot_kwargs: dict[str, Any] | None = None, **kwargs) tuple[list[bool], ndarray[Any, dtype[float64]]]

Assert that longitudinal emittance does not grow too much.

post_treat(ydata: Iterable[float]) ndarray[Any, dtype[float64]]

Return the unaltered ydata.

class PowerLoss(max_percentage_increase: float, reference: ~beam_calculation.simulation_output.simulation_output.SimulationOutput, plotter: ~experimental.plotter.pd_plotter.PandasPlotter = <experimental.plotter.pd_plotter.PandasPlotter object>)

Bases: ISimulationOutputEvaluator

Check that the power loss is acceptable.

__init__(max_percentage_increase: float, reference: ~beam_calculation.simulation_output.simulation_output.SimulationOutput, plotter: ~experimental.plotter.pd_plotter.PandasPlotter = <experimental.plotter.pd_plotter.PandasPlotter object>) None

Instantiate with a reference simulation output.

_abc_impl = <_abc._abc_data object>
_constant_limits: bool = True
_fignum: int = 101
_y_quantity: str = 'pow_lost'
evaluate(*simulation_outputs, elts: Sequence[ListOfElements] | None = None, plot_kwargs: dict[str, Any] | None = None, **kwargs) tuple[list[bool], ndarray[Any, dtype[float64]]]

Assert that lost power is lower than maximum.

post_treat(ydata: Iterable[float]) ndarray[Any, dtype[float64]]

Set the first point to 0 (sometimes it is inf in TW).

class SynchronousPhases(min_phi_s_deg: float, max_phi_s_deg: float, reference: ~beam_calculation.simulation_output.simulation_output.SimulationOutput, plotter: ~experimental.plotter.pd_plotter.PandasPlotter = <experimental.plotter.pd_plotter.PandasPlotter object>)

Bases: ISimulationOutputEvaluator

Check that synchronous phases are within [-90deg, 0deg].

__init__(min_phi_s_deg: float, max_phi_s_deg: float, reference: ~beam_calculation.simulation_output.simulation_output.SimulationOutput, plotter: ~experimental.plotter.pd_plotter.PandasPlotter = <experimental.plotter.pd_plotter.PandasPlotter object>) None

Instantiate with a reference simulation output.

_abc_impl = <_abc._abc_data object>
_constant_limits: bool = True
_fignum: int = 120
_getter(simulation_output: SimulationOutput, quantity: str) ndarray[Any, dtype[float64]]

Call the get method with proper kwarguments.

_to_deg: bool = True
_x_quantity: str = 'elt_idx'
_y_quantity: str = 'phi_s'
evaluate(*simulation_outputs, elts: Sequence[ListOfElements] | None = None, plot_kwargs: dict[str, Any] | None = None, **kwargs) tuple[list[bool], ndarray[Any, dtype[float64]]]

Assert that longitudinal emittance does not grow too much.

post_treat(ydata: Iterable[float]) ndarray[Any, dtype[float64]]

Remove the None.

class TransverseMismatchFactor(max_mismatch: float, reference: ~beam_calculation.simulation_output.simulation_output.SimulationOutput, plotter: ~experimental.plotter.pd_plotter.PandasPlotter = <experimental.plotter.pd_plotter.PandasPlotter object>)

Bases: ISimulationOutputEvaluator

Check that mismatch factor at end is not too high.

__init__(max_mismatch: float, reference: ~beam_calculation.simulation_output.simulation_output.SimulationOutput, plotter: ~experimental.plotter.pd_plotter.PandasPlotter = <experimental.plotter.pd_plotter.PandasPlotter object>) None

Instantiate with a reference simulation output.

_abc_impl = <_abc._abc_data object>
_constant_limits: bool = True
_fignum: int = 111
_getter(simulation_output: SimulationOutput, quantity: str) ndarray[Any, dtype[float64]]

Call the get method with proper kwarguments.

Also skip calculation with reference accelerator, as mismatch will not be defined.

_to_deg: bool = False
_y_quantity: str = 'mismatch_factor_t'
evaluate(*simulation_outputs, elts: Sequence[ListOfElements] | None = None, plot_kwargs: dict[str, Any] | None = None, **kwargs) tuple[list[bool], ndarray[Any, dtype[float64]]]

Assert that longitudinal emittance does not grow too much.

post_treat(ydata: Iterable[float]) ndarray[Any, dtype[float64]]

Return the unaltered ydata.