accelmo.machine.accelerators.magnet_grouping

Pure utilities for grouping accelerator magnets and their knob values.

accelmo.machine.accelerators.magnet_grouping.expand_psb_grouped_quadrupole_knobs(values, *, differential_tilt=False)[source]

Expand shared PSB QFO-cell values to physical per-element knob names.

differential_tilt: BR.QCELL<c>.tilt rolls both QFO<c> by +v and QDE<c> by -v.

Return type:

dict[str, float]

Parameters:
  • values (dict[str, float])

  • differential_tilt (bool)

accelmo.machine.accelerators.magnet_grouping.collapse_psb_grouped_quadrupole_knobs(values, *, differential_tilt=False)[source]

Collapse equal physical QFO pairs into PSB cell-grouped knobs.

differential_tilt: QFO<c>1/2 and QDE<c> tilts (QDE = -QFO) collapse to BR.QCELL<c>.tilt.

Return type:

dict[str, float]

Parameters:
  • values (dict[str, float])

  • differential_tilt (bool)

accelmo.machine.accelerators.magnet_grouping.normalise_lhcbend_magnets(true_strengths_dict, magnet_lengths)[source]

Normalise LHC bend names and length-weight-average grouped strengths.

S-bends are grouped regardless of sign. R-bends are grouped separately for positive and negative strengths.

Return type:

dict[str, float]

Parameters:
  • true_strengths_dict (dict[str, float])

  • magnet_lengths (dict[str, float])