particle module
Define objects to store initial state/trajectory of a particle.
ParticleInitialStateis just here to save the position and energy of a particle at the entrance of the linac. Saved as anListOfElementsattribute.ParticleFullTrajectorysaves the energy, phase, position of a particle along the linac. As a singleParticleInitialStatecan lead to severalParticleFullTrajectory(according to size of the mesh, the solver, etc),ParticleFullTrajectoryare stored inSimulationOutput.
- class ParticleInitialState(w_kin, phi_abs, z_in, synchronous)[source]
Bases:
objectHold the initial energy/phase of a particle, and if it is synchronous.
It is used for
ListOfElementsattribute.
- class ParticleFullTrajectory(w_kin, phi_abs, synchronous, beam)[source]
Bases:
objectHold the full energy, phase, etc of a particle.
It is stored in a
SimulationOutput.Phase is defined as:
\[\phi = \omega_{0,\,\mathrm{bunch}} t\]while in
Fieldit is:\[\phi = \omega_{0,\,\mathrm{rf}} t\]- Parameters:
- beam: BeamKwargs
- property tracewin_command: list[str]
Raise an error, this method should be called from InitialPart.
- get(*keys, to_numpy=True, none_to_nan=False, to_deg=False, **kwargs)[source]
Get attributes from this class or its nested attributes.
- Parameters:
*keys (
Literal['beta','gamma','phi_abs','synchronous','w_kin','z_in'] |Literal['e_mev','e_rest_mev','f_bunch_mhz','i_milli_a','q_adim','sigma','inv_e_rest_mev','gamma_init','omega_0_bunch','lambda_bunch','q_over_m','m_over_q']) – Names of the desired attributes.to_numpy (
bool, default:True) – Convert list outputs to NumPy arrays.none_to_nan (
bool, default:False) – ConvertNonevalues tonp.nan.to_deg (
bool, default:False) – Convert phase attributes (containing “phi”) to degrees.**kwargs (
Any) – Passed to recursive_getter.
- Returns:
A single value if one key is given, or a tuple of values.
- Return type: