particle module

Define objects to store initial state/trajectory of a particle.

class ParticleInitialState(w_kin: float, phi_abs: float, z_in: float, synchronous: bool)

Bases: object

Hold the initial energy/phase of a particle, and if it is synchronous.

It is stored in Accelerator, and is parent of ParticleFullTrajectory.

w_kin: float
phi_abs: float
z_in: float
synchronous: bool
property tracewin_command: list[str]

Create the energy and phase arguments for TraceWin command.

__init__(w_kin: float, phi_abs: float, z_in: float, synchronous: bool) None
class ParticleFullTrajectory(w_kin: ndarray | list, phi_abs: ndarray | list, synchronous: bool)

Bases: object

Hold the full energy, phase, etc of a particle.

It is stored in a SimulationOutput. A single Accelerator can have several SimulationOutput, hence an Accelerator.ParticleInitialState can have several SimulationOutput.ParticleFullTrajectory.

Phase is defined as:

phi = omega_0_bunch * t

while in electric_field it is:

phi = omega_0_rf * t

w_kin: ndarray | list
phi_abs: ndarray | list
synchronous: bool
__post_init__()

Ensure that LightWin has everything it needs, with proper format.

__str__() str

Show amplitude of phase and energy.

property tracewin_command: list[str]

Raise an error, this method should be called from InitialPart.

compute_complementary_data()

Compute some data necessary to do the post-treatment.

has(key: str) bool

Tell if the required attribute is in this class.

get(*keys: tuple[str], to_deg: bool = False, **kwargs: dict) tuple[Any]

Shorthand to get attributes.

__init__(w_kin: ndarray | list, phi_abs: ndarray | list, synchronous: bool) None