pyaml.tuning_tools.chromaticity#
Chromaticity correction and response-matrix tools.
The Chromaticity tool reads measured chromaticity, computes sextupole
strength corrections from a response matrix, and applies those corrections to
an accelerator model or control-system interface.
Classes
|
Adjust horizontal and vertical chromaticity with sextupole strengths. |
- class pyaml.tuning_tools.chromaticity.Chromaticity(name, sextu_array_name, chromaticity_monitor_name, response_matrix)#
Bases:
TuningTool,DynamicValidationAdjust horizontal and vertical chromaticity with sextupole strengths.
A response matrix maps sextupole-strength changes to chromaticity changes. Its pseudoinverse is used to calculate the strength correction required for a requested chromaticity change.
- Parameters:
name (str) – Name of the tuning tool.
sextu_array_name (str) – Name of the sextupole array used to adjust the chromaticity.
chromaticity_monitor_name (str) – Name of the chromaticity monitor used for readback.
response_matrix (str | ResponseMatrixData) – Chromaticity response matrix or path to a saved response matrix file.
Attributes
Return the loaded chromaticity response matrix, if available.
Return the chromaticity monitor used for readback.
Return the sextupole array used for correction.
Methods
Load a chromaticity response matrix and prepare its pseudoinverse.
Return the requested horizontal and vertical chromaticity.
Measure and return the current horizontal and vertical chromaticity.
Iteratively correct chromaticity to a requested setpoint.
Calculate sextupole-strength changes for a chromaticity change.
Apply a chromaticity correction relative to the current setpoint.
Configuration
- type: pyaml.tuning_tools.chromaticity name: CHROMATICITY_CORRECTION sextu_array_name: SEXTUPOLES chromaticity_monitor_name: CHROMATICITY_MONITOR response_matrix: path/to/chromaticity_response.json
- add(dchroma, wait_time=0.0)#
Apply a chromaticity correction relative to the current setpoint.
- Parameters:
dchroma (numpy.ndarray) – Horizontal and vertical chromaticity change to apply (dimensionless).
wait_time (float) – Delay in seconds after changing sextupole strengths.
- correct(dchroma)#
Calculate sextupole-strength changes for a chromaticity change.
- Parameters:
dchroma (numpy.ndarray) – Desired horizontal and vertical chromaticity change (dimensionless).
- Returns:
numpy.ndarray – Sextupole-strength changes obtained from the response-matrix pseudoinverse, in the configured sextupole strength units (typically
m^-2).- Raises:
PyAMLException – If no response matrix has been loaded or measured.
- Return type:
array
- get()#
Return the requested dimensionless horizontal and vertical chromaticity.
- load(load_path)#
Load a chromaticity response matrix and prepare its pseudoinverse.
- Parameters:
load_path (Path) – Path to the serialized
ResponseMatrixDatafile.
- readback()#
Measure and return the current dimensionless horizontal and vertical chromaticity.
- set(chroma, iter=1, wait_time=0.0)#
Iteratively correct chromaticity to a requested setpoint.
- Parameters:
chroma (numpy.ndarray) – Target horizontal and vertical chromaticity values (dimensionless).
iter (int) – Number of correction iterations.
wait_time (float) – Delay in seconds between correction iterations.
- property chromaticity_monitor: ChromaticityMonitor#
Return the chromaticity monitor used for readback.
- property response_matrix: ResponseMatrixData | None#
Return the loaded chromaticity response matrix, if available.
- property sextupoles: MagnetArray#
Return the sextupole array used for correction.