Skip to content

Commit b207708

Browse files
authored
Bug/bbs converter coupling fix (#410)
* added missing columns in coupling-conversion (BBS2OMC3)
1 parent 96f004c commit b207708

File tree

4 files changed

+15
-6
lines changed

4 files changed

+15
-6
lines changed

CHANGELOG.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
# OMC3 Changelog
22

3-
#### 2022-01-20 - v0.7.1 - _jdilly_
3+
#### 2023-03-16 - v0.7.2 - _jdilly_
4+
5+
- Fix:
6+
- Added missing columns to coupling in BBS-OMC3 converter
7+
8+
#### 2023-01-20 - v0.7.1 - _jdilly_
49

510
- Added:
611
- Amplitude Detuning plots: Switch to plot only with/without BBQ correction

omc3/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
__title__ = "omc3"
1212
__description__ = "An accelerator physics tools package for the OMC team at CERN."
1313
__url__ = "https://github.com/pylhc/omc3"
14-
__version__ = "0.7.1"
14+
__version__ = "0.7.2"
1515
__author__ = "pylhc"
1616
__author_email__ = "[email protected]"
1717
__license__ = "MIT"

omc3/scripts/betabeatsrc_output_converter.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -427,9 +427,9 @@ def convert_old_coupling(
427427

428428
dframe = tfs.read(old_file_path)
429429
rdt_dfs = {
430-
"1001": dframe.loc[: , ["S", "COUNT", "F1001W", "FWSTD1", "F1001R", "F1001I",
430+
"1001": dframe.loc[: , ["NAME", "S", "COUNT", "F1001W", "FWSTD1", "F1001R", "F1001I",
431431
"Q1001", "Q1001STD", "MDLF1001R", "MDLF1001I"]],
432-
"1010": dframe.loc[: , ["S", "COUNT", "F1010W", "FWSTD2", "F1010R", "F1010I",
432+
"1010": dframe.loc[: , ["NAME", "S", "COUNT", "F1010W", "FWSTD2", "F1010R", "F1010I",
433433
"Q1010", "Q1010STD", "MDLF1010R", "MDLF1010I"]],
434434
}
435435

@@ -447,6 +447,8 @@ def convert_old_coupling(
447447
f"MDLF{rdt}I": f"{IMAG}{MDL}",
448448
}
449449
)
450+
rdt_dfs[rdt][f"{ERR}{REAL}"] = rdt_dfs[rdt][f"{ERR}{AMPLITUDE}"]
451+
rdt_dfs[rdt][f"{ERR}{IMAG}"] = rdt_dfs[rdt][f"{ERR}{AMPLITUDE}"]
450452
tfs.write(Path(outputdir) / f"{new_file_name}{rdt}{EXT}", rdt_dfs[rdt])
451453

452454

tests/unit/test_betabeatsrc_output_converter.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55

66
from omc3.definitions.constants import PLANES
77
from omc3.optics_measurements.constants import (
8+
NAME,
9+
S,
810
AMPLITUDE,
911
AMP_BETA_NAME,
1012
BETA_NAME,
@@ -196,8 +198,8 @@ def _assert_correct_normalized_dispersion_columns(outputdir: Path, plane: str) -
196198
def _assert_correct_coupling_columns(outputdir: Path, rdt: str) -> None:
197199
"""Checks the expected columns are present in the normalized dispersion file in outputdir"""
198200
dframe = tfs.read(outputdir / f"f{rdt}.tfs")
199-
expected_converted_columns = [AMPLITUDE, f"{ERR}AMP", PHASE, f"{ERR}{PHASE}", f"{REAL}",
200-
f"{IMAG}", f"{REAL}{MDL}", f"{IMAG}{MDL}"] # replace renamed
201+
expected_converted_columns = [NAME, S, AMPLITUDE, f"{ERR}{AMPLITUDE}", PHASE, f"{ERR}{PHASE}", f"{REAL}",
202+
f"{ERR}{REAL}", f"{IMAG}", f"{ERR}{IMAG}", f"{REAL}{MDL}", f"{IMAG}{MDL}"]
201203
expected_renamed_columns = [f"F{rdt}W", f"Q{rdt}", f"Q{rdt}STD", f"F{rdt}R", f"F{rdt}I"] # disappeared
202204

203205
for col in expected_converted_columns:

0 commit comments

Comments
 (0)