Skip to content

Commit

Permalink
fix the test I just broke
Browse files Browse the repository at this point in the history
  • Loading branch information
JoschD committed Jan 21, 2025
1 parent 7642b4b commit 9fb8b31
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions omc3/correction/arc_by_arc.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,15 @@

def reduce_phase_measurements_to_arcs(
meas_dict: dict[str, pd.DataFrame],
nominal_model: tfs.TfsDataFrame,
model: tfs.TfsDataFrame,
include_ips: str | None = None
):
""" Reduce the phase-advance in the given measurement to the phase-advance
between two BPM-pairs at the extremities of each arc.
Args:
meas_dict (dict[str, pd.DataFrame]): Dictionary of measurements as used in Global Correction.
nominal_model (tfs.TfsDataFrame): Model of the machine, used only the get the tunes from the headers.
model (tfs.TfsDataFrame): Model of the machine, used only the get the tunes from the headers.
include_ips (str | None): Include the IPs of each arc. Can be either 'left', 'right', 'both' or None
Returns:
Expand All @@ -57,8 +57,8 @@ def reduce_phase_measurements_to_arcs(
for plane, tune in (("X", "Q1"), ("Y", "Q2")):
phase_df = meas_dict[f"{PHASE}{plane}"]

bpm_pairs = get_arc_by_arc_bpm_pairs(phase_df.index, include_ips, plane=plane)
new_phase_df = get_bpm_pair_phases(phase_df, bpm_pairs=bpm_pairs, tune=nominal_model.headers[tune], plane=plane)
bpm_pairs = get_arc_by_arc_bpm_pairs(phase_df.index, include_ips)
new_phase_df = get_bpm_pair_phases(phase_df, bpm_pairs=bpm_pairs, tune=model.headers[tune])

meas_dict[f"{PHASE}{plane}"] = new_phase_df
return meas_dict
Expand Down
2 changes: 1 addition & 1 deletion omc3/correction/handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def correct(accel_inst: Accelerator, opt: DotDict) -> None:
meas_dict = model_appenders.add_differences_to_model_to_measurements(nominal_model, meas_dict)

if opt.arc_by_arc_phase and isinstance(accel_inst, lhc.Lhc):
meas_dict = abba.reduce_phase_measurements_to_arcs(meas_dict, nominal_model, opt)
meas_dict = abba.reduce_phase_measurements_to_arcs(meas_dict, nominal_model, opt.include_ips_in_arc_by_arc)

resp_dict = filters.filter_response_index(resp_dict, meas_dict, optics_params)
resp_matrix = _join_responses(resp_dict, optics_params, vars_list)
Expand Down
2 changes: 1 addition & 1 deletion omc3/global_correction.py
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ def correction_params():
help="Set to perform arc-by-arc total phase correction.", )
params.add_parameter(name="include_ips_in_arc_by_arc",
type=str,
choices=("left", "right"),
choices=("left", "right", "both"),
default=CORRECTION_DEFAULTS["include_ips_in_arc_by_arc"],
help="If not specified only takes pure arcs. Otherwise it includes IPs left or right of arcs.", )
return params
Expand Down

0 comments on commit 9fb8b31

Please sign in to comment.