pass_beauty module
Define utility functions to perform a “pass beauty”.
After a LightWin optimisation, perform a second optimisation with TraceWin. As for now, the implementation is kept very simple:
The phase of compensating cavities can be retuned at +/-
tol_phi_degaround their compensated value.The amplitude of compensating cavities can be retuned at +/-
tol_k_earound their compensated value.We try to keep the phase dispersion between start of compensation zone, and
number_of_dsizelattices after.
Warning
Performing a pass beauty will break the colors of the cavities in the output plots. They will all appear in green, as if they were nominal.
Todo
fix colors in plots after pass beauty
- _cavity_settings_to_adjust(cavity_settings, dat_idx, number, tol_phi_deg=5, tol_k_e=0.05, link_index=0, phase_nature='')[source]
Create a ADJUST command with small bounds around current value.
- set_of_cavity_settings_to_adjust(set_of_cavity_settings, number, tol_phi_deg=5, link_k_g=False, tol_k_e=0.05, phase_nature='phi_0_rel')[source]
Create adjust commands for every compensating cavity.
- elements_to_diagnostics(fix_elts, compensating, number, number_of_dsize)[source]
Create the DSize3 commands that will be needed.
- Parameters:
fix_elts (
ListOfElements)compensating (
Collection[Element])number (
int)number_of_dsize (
int)
- Return type:
- _pass_beauty_instructions(fault_scenario, number_of_dsize, number=666333, link_k_g=True)[source]
Perform a beauty pass.
- Parameters:
fault_scenario (
FaultScenario)number_of_dsize (
int)number (
int, default:666333)link_k_g (
bool, default:True)
- Return type:
- insert_pass_beauty_instructions(fault_scenario, beam_calculator, number_of_dsize=10, number=666333, link_k_g=True)[source]
Overwrite
ListOfElementsto include pass beauty instructions.The
fault_scenario.fix_acc.elts(aListOfElements) will be overwritten.- Parameters:
fault_scenario (
FaultScenario|Collection[FaultScenario])beam_calculator (
BeamCalculator)number_of_dsize (
int, default:10)number (
int, default:666333)link_k_g (
bool, default:True)
- Return type:
- _is_adapted_to_pass_beauty(beam_calculator)[source]
Check if the provided beam calculator can perform beauty pass.
- Parameters:
beam_calculator (
BeamCalculator)- Return type: