accelmo.fitting.bpm_gains

BPM gains, shared by the closed-orbit (poco) and tracking fits.

A gain g scales what a BPM reports: reading = (1 + g) * position. Only positions are read by a BPM; momenta are never scaled. Gains travel in the knob dict next to the magnet knobs as bpmgain.<x|y>.<BPM>.

accelmo.fitting.bpm_gains.bpm_gain_name(plane, bpm)[source]

Fit-parameter name of the gain of bpm in plane.

Return type:

str

Parameters:
  • plane (str)

  • bpm (str)

accelmo.fitting.bpm_gains.bpm_gain_names(bpms)[source]

Every x gain, then every y gain, in bpms order.

Return type:

list[str]

Parameters:

bpms (list[str] | tuple[str, ...])

accelmo.fitting.bpm_gains.is_bpm_gain(name)[source]

True if name is a BPM gain parameter.

Return type:

bool

Parameters:

name (str)

accelmo.fitting.bpm_gains.without_bpm_gains(knobs)[source]

knobs without the BPM gains.

Return type:

dict[str, float]

Parameters:

knobs (dict[str, float])

accelmo.fitting.bpm_gains.only_bpm_gains(knobs)[source]

Only the BPM gains of knobs.

Return type:

dict[str, float]

Parameters:

knobs (dict[str, float])

accelmo.fitting.bpm_gains.bpm_gains(knobs, plane, bpms)[source]

The plane gain of each of bpms from knobs; 0 where a gain is absent.

Return type:

ndarray

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

  • plane (str)

  • bpms (list[str] | tuple[str, ...])

accelmo.fitting.bpm_gains.bpm_reading(position, gains)[source]

What a BPM with gains reports for position (gains broadcast on the last axis).

Return type:

ndarray

Parameters:
  • position (np.ndarray | float)

  • gains (np.ndarray)

accelmo.fitting.bpm_gains.point_gain_index(point_names, gain_bpms)[source]

Index of each observation point’s BPM in gain_bpms; -1 for points with no gain.

Return type:

ndarray

Parameters:
  • point_names (list[str])

  • gain_bpms (tuple[str, ...])