at.matching.globalfit#
Collection of functions to fit various global parameters such as the tune and the chromaticity
Functions
|
Fits the tunes using 2 families |
|
Fit the chromaticities using 2 families |
- fit_chrom(ring, refpts1, refpts2, newval, tol=1e-12, dp=0, niter=3, regex=False, HStep=None, **kwargs)[source]#
Fit the chromaticities using 2 families
- Parameters:
ring (Lattice) – Lattice description
refpts1 (Type[Element] | Element | Callable[[Element], bool] | str | None | int | Sequence[int] | bool | Sequence[bool] | RefptsCode) – Selection of the 1st family
refpts2 (Type[Element] | Element | Callable[[Element], bool] | str | None | int | Sequence[int] | bool | Sequence[bool] | RefptsCode) – Selection of the 2nd family
newval – New tunes
- Keyword Arguments:
tol – Tolerance for the matching; Default: 1.0e-12
dp – Momentum deviation. Default: 0
niter – Maximum number of iterations. Default 3
regex – Using regular expressions for refpt string matching; Default: False
HStep – gradient variation applied to magnets. Default 1e-4
scaling – Scales the families instead of incrementing them. Default False
Typical usage: at.fit_chrom(ring, refpts1, refpts2, [10,5])
- fit_tune(ring, refpts1, refpts2, newval, tol=1e-12, dp=0, niter=3, regex=False, KStep=None, **kwargs)[source]#
Fits the tunes using 2 families
- Parameters:
ring (Lattice) – Lattice description
refpts1 (Type[Element] | Element | Callable[[Element], bool] | str | None | int | Sequence[int] | bool | Sequence[bool] | RefptsCode) – Selection of the 1st family
refpts2 (Type[Element] | Element | Callable[[Element], bool] | str | None | int | Sequence[int] | bool | Sequence[bool] | RefptsCode) – Selection of the 2nd family
newval – New tunes, in case an non-zero integer part is provided, fit_integer is set to True
- Keyword Arguments:
tol – Tolerance for the matching; Default: 1.0e-12
dp – Momentum deviation. Default: 0
niter – Maximum number of iterations. Default 3
fit_integer – bool (default=False), use integer tune
regex – Using regular expressions for refpt string matching; Default: False
KStep – gradient variation applied to magnets. Default 1e-5
scaling – Scales the families instead of incrementing. Default False
Typical usage: at.fit_tune(ring, refpts1, refpts2, [0.1,0.25])