initial_beam_parameters module
Gather beam parameters at the entrance of a ListOfElements.
For a list of the units associated with every parameter, see Units and conventions.
- class InitialBeamParameters(z_abs: float, gamma_kin: float, beta_kin: float)
Bases:
objectHold all emittances, envelopes, etc in various planes at a single position.
- Parameters:
z_abs (float) – Absolute position in the linac in \(\mathrm{m}\).
gamma_kin (float) – Lorentz gamma factor.
beta_kin (float) – Lorentz beta factor.
zdelta (InitialPhaseSpaceBeamParameters) – Beam parameters respectively in the \([z-z\delta]\), \([z-z']\), \([\phi-W]\), \([x-x']\), \([y-y']\) and \([t-t']\) planes.
z (InitialPhaseSpaceBeamParameters) – Beam parameters respectively in the \([z-z\delta]\), \([z-z']\), \([\phi-W]\), \([x-x']\), \([y-y']\) and \([t-t']\) planes.
phiw (InitialPhaseSpaceBeamParameters) – Beam parameters respectively in the \([z-z\delta]\), \([z-z']\), \([\phi-W]\), \([x-x']\), \([y-y']\) and \([t-t']\) planes.
x (InitialPhaseSpaceBeamParameters) – Beam parameters respectively in the \([z-z\delta]\), \([z-z']\), \([\phi-W]\), \([x-x']\), \([y-y']\) and \([t-t']\) planes.
y (InitialPhaseSpaceBeamParameters) – Beam parameters respectively in the \([z-z\delta]\), \([z-z']\), \([\phi-W]\), \([x-x']\), \([y-y']\) and \([t-t']\) planes.
t (InitialPhaseSpaceBeamParameters) – Beam parameters respectively in the \([z-z\delta]\), \([z-z']\), \([\phi-W]\), \([x-x']\), \([y-y']\) and \([t-t']\) planes.
phiw99 (InitialPhaseSpaceBeamParameters) – 99% beam parameters respectively in the \([\phi-W]\), \([x-x']\) and \([y-y']\) planes. Only used with multiparticle simulations.
x99 (InitialPhaseSpaceBeamParameters) – 99% beam parameters respectively in the \([\phi-W]\), \([x-x']\) and \([y-y']\) planes. Only used with multiparticle simulations.
y99 (InitialPhaseSpaceBeamParameters) – 99% beam parameters respectively in the \([\phi-W]\), \([x-x']\) and \([y-y']\) planes. Only used with multiparticle simulations.
- has(key: str) bool
Tell if the required attribute is in this class.
Notes
key = 'property_phasespace'will return True if'property'exists inphasespace. Hence, the following two commands will have the same return values:self.has('twiss_zdelta') self.zdelta.has('twiss')
See also
- get(*keys: str, to_numpy: bool = True, none_to_nan: bool = False, phase_space_name: Literal['zdelta', 'z', 'phiw', 'x', 'y', 't', 'phiw99', 'x99', 'y99'] | None = None, **kwargs: Any) Any
Get attributes from this class or its attributes.
Notes
What is particular in this getter is that all
InitialPhaseSpaceBeamParametersattributes have attributes with the same name:twiss,alpha,beta,gamma,eps,envelope_posandenvelope_energy.Hence, you must provide either a
phase_spaceargument which shall be inPHASE_SPACES, either you must append the name of the phase space to the name of the desired variable with an underscore.See also
- Parameters:
*keys (str) – Name of the desired attributes.
to_numpy (bool, optional) – If you want the list output to be converted to a np.ndarray. The default is True.
none_to_nan (bool, optional) – To convert None to np.nan. The default is True.
phase_space_name (str | None, optional) – Phase space in which you want the key. The default is None. In this case, the quantities from the
zdeltaphase space are taken. Otherwise, it must be inPHASE_SPACES.**kwargs (Any) – Other arguments passed to recursive getter.
- Returns:
out – Attribute(s) value(s).
- Return type:
Any
Look for the name of a phase-space in a key name.