factory module
This module holds a factory to create the BeamCalculator.
- BEAM_CALCULATORS = ('Envelope1D', 'TraceWin', 'Envelope3D')
- _get_beam_calculator(tool, flag_cython=False, **kwargs)[source]
Get the proper
BeamCalculatorconstructor.
- class BeamCalculatorsFactory(beam_calculator, files, beam, beam_calculator_post=None, **other_kw)[source]
Bases:
objectA class to create
BeamCalculatorobjects.- Parameters:
- __init__(beam_calculator, files, beam, beam_calculator_post=None, **other_kw)[source]
Set up factory with arguments common to all
BeamCalculator.- Parameters:
beam_calculator (
dict[str,Any]) – Configuration entries for the firstBeamCalculator, used for optimisation.files (
dict[str,Any]) – Configuration entries for the input/output paths.beam (
BeamKwargs) – Configuration dictionary holding the initial beam parameters.beam_calculator_post (
dict[str,Any] |None, default:None) – Configuration entries for the second optionalBeamCalculator, used for a more thorough calculation of the beam propagation once the compensation settings are found.other_kw (
dict) – Other keyword arguments, not used for the moment.
- _patch_to_remove_misunderstood_key()[source]
Patch to remove a key not understood by TraceWin. Declare id list. :rtype:
NoneTodo
fixme
- run(tool, **beam_calculator_kw)[source]
Create a single
BeamCalculator.- Parameters:
tool (
Literal['Envelope1D','TraceWin','Envelope3D']) – The name of the beam calculator to construct.- Return type:
- Returns:
An instance of the proper beam calculator.