Skip to content
Snippets Groups Projects
Commit e0afa488 authored by Alexis GAMELIN's avatar Alexis GAMELIN
Browse files

[Fix] read_ABCI

Fix transverse wake sign and add Wydip component which was missing.
parent eedde804
No related branches found
No related tags found
No related merge requests found
...@@ -161,9 +161,9 @@ def read_ABCI(file, azimuthal=False): ...@@ -161,9 +161,9 @@ def read_ABCI(file, azimuthal=False):
Path to ABCI .pot file. Path to ABCI .pot file.
azimuthal : bool, optional azimuthal : bool, optional
If True, the transverse wake potential and impedance is loaded from the If True, the transverse wake potential and impedance is loaded from the
"AZIMUTHAL" data. In that case, a -1 factor is applied on the wake to "AZIMUTHAL" data.
agree with mbtrack2 sign convention. If False, it is loaded from the "TRANSVERSE" data. In that case, a -1
If False, it is loaded from the "TRANSVERSE" data. factor is applied on the wake to agree with mbtrack2 sign convention.
The default is False. The default is False.
Returns Returns
...@@ -202,6 +202,8 @@ def read_ABCI(file, azimuthal=False): ...@@ -202,6 +202,8 @@ def read_ABCI(file, azimuthal=False):
names=["Time","Wake"]) names=["Time","Wake"])
df["Time"] = df["Time"] / c df["Time"] = df["Time"] / c
df["Wake"] = df["Wake"] * 1e-12 df["Wake"] = df["Wake"] * 1e-12
if (not azimuthal) and (file_type[-3:] == "dip"):
df["Wake"] = df["Wake"] * -1
df.set_index("Time", inplace = True) df.set_index("Time", inplace = True)
result = WakeFunction(variable = df.index, result = WakeFunction(variable = df.index,
function = df["Wake"], function = df["Wake"],
...@@ -250,9 +252,15 @@ def read_ABCI(file, azimuthal=False): ...@@ -250,9 +252,15 @@ def read_ABCI(file, azimuthal=False):
tmp.writelines(body) tmp.writelines(body)
tmp.flush() tmp.flush()
tmp.close() tmp.close()
comp = _read_temp(tmp.name, abci_dict[header[0]]) if abci_dict[header[0]][1:] == "long":
comp = _read_temp(tmp.name, abci_dict[header[0]])
wake_list.append(comp)
else:
comp_x = _read_temp(tmp.name, "Wxdip")
comp_y = _read_temp(tmp.name, "Wydip")
wake_list.append(comp_x)
wake_list.append(comp_y)
os.unlink(tmp.name) os.unlink(tmp.name)
wake_list.append(comp)
elif (abci_dict[header[0]][0] == "Z") and (abci_dict[header[0]][-2:] == "re"): elif (abci_dict[header[0]][0] == "Z") and (abci_dict[header[0]][-2:] == "re"):
tmp1 = NamedTemporaryFile(delete=False, mode = "w+") tmp1 = NamedTemporaryFile(delete=False, mode = "w+")
tmp1.writelines(body) tmp1.writelines(body)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment