accelmo.poco.calibrated

Closed-orbit fitter that also fits BPM gains and corrector kick calibrations (see accelmo.poco.calibration).

class accelmo.poco.calibrated.CalibratedClosedOrbitFitter(accelerator, sequence_config, series, observables=CLOSED_ORBIT_OBSERVABLES, lm_config=None, initial_knob_strengths=None, machine_state=None, true_strengths=None, use_errors=True, knob_sigmas=None, output_config=None, runtime=None, *, sigma_bpm=1e-2, sigma_corrector=1e-2, loss_only_trials=True, kick_prefix='k_', fit_corrector_gains=True, corrector_gain_pattern=None, zero_mean_gain_pattern=None, debug=False)[source]

Bases: ClosedOrbitFitter

ClosedOrbitFitter with (1 + b_bpm)(1 + g_corrector) calibration parameters.

Every <kick_prefix><corrector> kick a series’ own machine_state sets (its change from the fitter’s machine_state is worked out internally) gets a gain, named after the corrector; a series may set any number, none included. The BPM gains are eliminated by a Schur complement each iteration and recovered by back-substitution, so the Levenberg-Marquardt solve is over the magnet knobs and the corrector gains only. sigma_bpm / sigma_corrector are Gaussian priors that also fix the b/g scale degeneracy. knob_sigmas is the magnet-knob prior of LMFitter. After the fit, calibration_result holds every gain.

With fit_corrector_gains=False only the BPM gains are fitted: no kick is scaled and sigma_corrector is unused. This is the mode for absolute orbits, where every corrector’s standing kick is part of the orbit and only the correctors some series sets could be given a gain. corrector_gain_pattern (regex, full match on the upper-case corrector name) gives a gain only to the correctors it matches; the others’ kicks are taken as exact. zero_mean_gain_pattern holds the mean gain of the fitted correctors it matches at 0, removing the common scale those correctors share with the BPM gains (it goes to the BPMs).

Parameters:
  • accelerator (Accelerator)

  • sequence_config (SequenceConfig)

  • series (list[ClosedOrbitSeries] | tuple[ClosedOrbitSeries, ...])

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

  • lm_config (LevenbergMarquardtConfig | None)

  • initial_knob_strengths (dict[str, float] | None)

  • machine_state (Path | Mapping[str, float] | None)

  • true_strengths (Path | dict[str, float] | None)

  • use_errors (bool)

  • knob_sigmas (Mapping[str, float] | None)

  • output_config (OutputConfig | None)

  • runtime (WorkerRuntime | None)

  • sigma_bpm (float)

  • sigma_corrector (float)

  • loss_only_trials (bool)

  • kick_prefix (str)

  • fit_corrector_gains (bool)

  • corrector_gain_pattern (str | None)

  • zero_mean_gain_pattern (str | None)

  • debug (bool)

worker_class

alias of CalibratedClosedOrbitWorker