pylhc / Beta-Beat.src

Many scripts and files for beam optics simulations & measurements in the LHC
https://pylhc.github.io/Beta-Beat.src/
7 stars 10 forks source link

Beta from amplitude gives negative values and NaN #219

Closed tpersson closed 2 years ago

tpersson commented 3 years ago

Beta from amplitude gives very strange values including negatives. This does not prevent the normalized dispersion after the fix in 6cf7c60 but it needs to be fixed properly.

Mael-Le-Garrec commented 2 years ago

The problem, for the beta from amplitude, is located here: https://github.com/pylhc/Beta-Beat.src/blob/master/GetLLM/algorithms/get_action.py#L137

It comes from some beta from phase values being negative, which throws an error when computing a square root.

Why is there a beta_phase_filter variable that is not used? Removing the negative values make the beta from aplitude working, and seems to yield correct β values. Should this fix be implemented?