core.particle module
Here we define objects to store initial state/trajectory of a particle.
ParticleInitialState
is just here to save the position and energy of a particle at the entrance of the linac. Saved as anAccelerator
attribute.
ParticleFullTrajectory
saves the energy, phase, position of a particle along the linac. As a singleParticleInitialState
can lead to severalParticleFullTrajectory
(according to size of the mesh, the solver, etc),ParticleFullTrajectory
are stored inSimulationOutput
.
- 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
- __init__(w_kin: ndarray | list, phi_abs: ndarray | list, synchronous: bool) None
- __post_init__()
Ensure that LightWin has everything it needs, with proper format.
- compute_complementary_data()
Compute some data necessary to do the post-treatment.
- get(*keys: tuple[str], to_deg: bool = False, **kwargs: dict) tuple[Any]
Shorthand to get attributes.
- has(key: str) bool
Tell if the required attribute is in this class.
- phi_abs: ndarray | list
- synchronous: bool
- property tracewin_command: list[str]
Raise an error, this method should be called from InitialPart.
- w_kin: ndarray | list
- 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.
- __init__(w_kin: float, phi_abs: float, z_in: float, synchronous: bool) None
- phi_abs: float
- synchronous: bool
- property tracewin_command: list[str]
Create the energy and phase arguments for TraceWin command.
- w_kin: float
- z_in: float