pyaml.tuning_tools.orbit_response_matrix#

Orbit response-matrix measurement tools.

This module measures BPM orbit changes caused by horizontal and vertical corrector perturbations and stores the fitted response in a structured data model.

Classes

OrbitResponseMatrix(name, bpm_array_name, ...)

Measure an orbit response matrix using BPMs and orbit correctors.

class pyaml.tuning_tools.orbit_response_matrix.OrbitResponseMatrix(name, bpm_array_name, hcorr_array_name, vcorr_array_name, corrector_delta, n_step=1, sleep_between_step=0, n_avg_meas=1, sleep_between_meas=0)#

Bases: MeasurementTool, DynamicValidation

Measure an orbit response matrix using BPMs and orbit correctors.

The orbit response matrix describes the change in measured beam position produced by a change in corrector strength. This measurement tool uses horizontal and vertical corrector arrays together with a BPM array to perform the measurement through the pySC interface.

After a successful measurement, the result is converted to OrbitResponseMatrixData and stored in latest_measurement. The stored data includes the response matrix, corrector and BPM names, and the plane associated with each variable and observable.

Parameters:
  • name (str) – Name of the measurement tool.

  • bpm_array_name (str) – Name of the BPM array used to measure the orbit.

  • hcorr_array_name (str) – Name of the horizontal corrector array.

  • vcorr_array_name (str) – Name of the vertical corrector array.

  • corrector_delta (float) – Change in corrector kick angle applied during the measurement, in radians.

  • n_step (int, optional) – Number of strength steps used for each corrector. The default is 1.

  • sleep_between_step (float, optional) – Time in seconds to wait after changing a corrector strength. The default is 0.

  • n_avg_meas (int, optional) – Number of orbit measurements averaged at each corrector setting. The default is 1.

  • sleep_between_meas (float, optional) – Time in seconds to wait between orbit measurements used for averaging. The default is 0.

Attributes

bpm_array_name

Name of the configured BPM array.

hcorr_array_name

Name of the configured horizontal corrector array.

vcorr_array_name

Name of the configured vertical corrector array.

corrector_delta

Corrector kick-angle change used for the measurement, in radians.

n_step

Configured number of corrector-strength steps.

sleep_between_step

Configured delay between corrector-strength changes.

n_avg_meas

Configured number of orbit measurements to average.

sleep_between_meas

Configured delay between averaged orbit measurements.

bpms

BPM array used for orbit readback.

hcorrectors

Horizontal corrector array used for the measurement.

vcorrectors

Vertical corrector array used for the measurement.

Methods

measure()

Measure orbit response matrix.

Configuration

- type: pyaml.tuning_tools.orbit_response_matrix
  name: ORBIT_RESPONSE_MATRIX
  bpm_array_name: BPM
  hcorr_array_name: HORIZONTAL_CORRECTORS
  vcorr_array_name: VERTICAL_CORRECTORS
  corrector_delta: 1e-6
measure(corrector_names=None, sleep_between_step=None, n_avg_meas=None, sleep_between_meas=None, callback=None)#

Measure orbit response matrix.

Example

sr = Accelerator.load("MyAccelerator.yaml")
acc = sr.design

if acc.orm.measure():
    acc.orm.save("ideal_orm.json")
    acc.orm.save("ideal_orm.yaml", with_type="yaml")
    acc.orm.save("ideal_orm.npz", with_type="npz")
Parameters:
  • corrector_names (list[str], optional) – Correctors to excite. Defaults to every corrector of the horizontal and vertical arrays.

  • sleep_between_step (float) – Delay in seconds after a corrector excitation. Default: from config.

  • n_avg_meas (int, optional) – Default number of orbit measurement per step used for averaging Default from config

  • sleep_between_meas (float) – Delay in seconds between two orbit measurements. Default: from config.

  • callback (Callable, optional) – example: callback(action:int, callback_data: ‘Complicated struct’) callback is executed after each strength setting and after each orbit reading. If the callback returns false, then the process is aborted.

property bpms: BPMArray#

Return the BPM array used for orbit readback.

property hcorrectors: MagnetArray#

Return the horizontal corrector array used for the measurement.

property vcorrectors: MagnetArray#

Return the vertical corrector array used for the measurement.