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

Remove energy_change from Bunch

Not needed any more due the SynchrotronRadiation change.
parent 66874533
No related branches found
No related tags found
No related merge requests found
......@@ -86,11 +86,6 @@ class Bunch:
coordinates.
emit : array of shape (3,)
Bunch emittance for each plane [1]. !!! -> Correct for long ?
energy_change : series of shape (alive,)
Store the particle relative energy change in the last turn. Only the
values for alive particles are returned. Used by the
SynchrotronRadiation class to compute radiation damping. To be changed
by Element objects which change the energy, for example RF cavities.
Methods
-------
......@@ -128,8 +123,6 @@ class Bunch:
self.current = current
if not alive:
self.alive = np.zeros((self.mp_number,),dtype=bool)
self._energy_change = np.zeros((self.mp_number,),dtype=float)
def __len__(self):
"""Return the number of alive particles"""
......@@ -243,24 +236,6 @@ class Bunch:
(self.ring.optics.local_beta * np.mean(self['yp']**2))
return np.array((Jx,Jy))
@property
def energy_change(self):
"""Store the particle relative energy change in the last turn. Used by
the SynchrotronRadiation class to compute radiation damping. To be
changed by Element objects which change the energy, for example RF
cavities."""
if self.track_alive is True:
return self._energy_change[self.alive]
else:
return self._energy_change
@energy_change.setter
def energy_change(self, value):
if self.track_alive is True:
self._energy_change[self.alive] = value
else:
self._energy_change = value
def init_gaussian(self, cov=None, mean=None, **kwargs):
"""
Initialize bunch particles with 6D gaussian phase space.
......
......@@ -44,12 +44,8 @@ class RFCavity(Element):
----------
bunch : Bunch or Beam object
"""
energy_change = self.Vc / self.ring.E0 * np.cos(
bunch["delta"] += self.Vc / self.ring.E0 * np.cos(
self.m * self.ring.omega1 * bunch["tau"] + self.theta )
bunch["delta"] += energy_change
# energy_change is used by SynchrotronRadiation to compute radiation
# damping
bunch.energy_change += energy_change
def value(self, val):
return self.Vc / self.ring.E0 * np.cos(
......
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