diff --git a/tracking/wakepotential.py b/tracking/wakepotential.py index 444309b119ab9d818fb0376a74161954f9cdca51..06bf7371322a4443cd205fde6640b7f49e045422 100644 --- a/tracking/wakepotential.py +++ b/tracking/wakepotential.py @@ -196,15 +196,10 @@ class WakePotential(Element): Wake function array in [V/C] or [V/C/m]. """ - - try: - tau0 = getattr(self, "tau0_" + wake_type) - dtau0 = getattr(self, "dtau0_" + wake_type) - W0 = getattr(self, "W0_" + wake_type) - except AttributeError: - tau0 = np.array(getattr(self.wakefield, wake_type).data.index) - dtau0 = tau0[1] - tau0[0] - W0 = np.array(getattr(self.wakefield, wake_type).data["real"]) + + tau0 = np.array(getattr(self.wakefield, wake_type).data.index) + dtau0 = tau0[1] - tau0[0] + W0 = np.array(getattr(self.wakefield, wake_type).data["real"]) # Keep only the wake function on the rho window ind = np.all([min(tau[0], 0) < tau0, max(tau[-1], 0) > tau0],