Skip to content
Snippets Groups Projects
Commit afa2e9fc authored by Gamelin Alexis's avatar Gamelin Alexis
Browse files

Bugfix : transverse wake potential

Fix dipole_moment due to switch to numpy arrays for Bunch.binning
parent ac15e7e6
No related branches found
No related tags found
No related merge requests found
......@@ -141,9 +141,9 @@ class WakePotential(Element):
Dipole moment of the bunch.
"""
dipole = np.zeros((self.n_bin,))
for i in range(self.n_bin):
dipole[i] = bunch[plane][self.sorted_index == self.bins[i]].sum()
dipole = np.zeros((self.n_bin - 1,))
for i in range(self.n_bin - 1):
dipole[i] = bunch[plane][self.sorted_index == i].sum()
dipole = dipole/self.profile
dipole[np.isnan(dipole)] = 0
......
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