phase_space_beam_parameters module
Handle the beam parameters of a single phase space.
For a list of the units associated with every parameter, see Units and conventions.
Note
In this module, angles are stored in deg, not in rad!
- class PhaseSpaceBeamParameters(phase_space_name, eps_no_normalization, eps_normalized, envelopes=None, twiss=None, sigma=None, tm_cumul=None, mismatch_factor=None)[source]
Bases:
IPhaseSpaceBeamParametersHold Twiss, emittance, envelopes of a single phase-space.
- Parameters:
phase_space_name (
Literal['phiw','phiw99','t','x','x99','y','y99','z','zdelta'])eps_no_normalization (
ndarray[tuple[Any,...],dtype[double]])envelopes (
ndarray[tuple[Any,...],dtype[double]] |None, default:None)twiss (
ndarray[tuple[Any,...],dtype[double]] |None, default:None)sigma (
ndarray[tuple[Any,...],dtype[double]] |None, default:None)tm_cumul (
ndarray[tuple[Any,...],dtype[double]] |None, default:None)mismatch_factor (
ndarray[tuple[Any,...],dtype[double]] |None, default:None)
- classmethod from_cumulated_transfer_matrices(phase_space_name, sigma_in, tm_cumul, gamma_kin, beta_kin, beam_kwargs)[source]
Compute \(\sigma\) matrix, and everything from it.
- classmethod from_sigma(phase_space_name, sigma, gamma_kin, beta_kin, beam_kwargs, **kwargs)[source]
Compute Twiss, eps, envelopes just from sigma matrix.
- classmethod from_other_phase_space(other_phase_space, phase_space_name, gamma_kin, beta_kin, beam_kwargs, **kwargs)[source]
Fully initialize from another phase space.
- classmethod from_averaging_x_and_y(phase_space_name, x_space, y_space)[source]
Create average transverse phase space from [xx’] and [yy’].
epsis always initialized.mismatch_factoris calculated if it was already calculated inx_spaceandy_space.- Parameters:
phase_space_name (
str)x_space (
Self)y_space (
Self)
- Return type:
Self
- property envelope_pos: ndarray[tuple[Any, ...], dtype[float64]] | None
Get first column of
self.envelopes.
- __init__(phase_space_name, eps_no_normalization, eps_normalized, envelopes=None, twiss=None, sigma=None, tm_cumul=None, mismatch_factor=None)
- Parameters:
phase_space_name (
Literal['phiw','phiw99','t','x','x99','y','y99','z','zdelta'])eps_no_normalization (
ndarray[tuple[Any,...],dtype[double]])envelopes (
ndarray[tuple[Any,...],dtype[double]] |None, default:None)twiss (
ndarray[tuple[Any,...],dtype[double]] |None, default:None)sigma (
ndarray[tuple[Any,...],dtype[double]] |None, default:None)tm_cumul (
ndarray[tuple[Any,...],dtype[double]] |None, default:None)mismatch_factor (
ndarray[tuple[Any,...],dtype[double]] |None, default:None)
- Return type:
None
- _abc_impl = <_abc._abc_data object at 0x7318fb6809c0>
- property envelope_energy: ndarray[tuple[Any, ...], dtype[float64]] | None
Get second column of
self.envelopes.
- property non_norm_eps: ndarray[tuple[Any, ...], dtype[float64]]
Return the non-normalized emittance.
- property sigma_in: ndarray[tuple[Any, ...], dtype[float64]]
Return the first \(\sigma\) beam matrix.
- set_mismatch(reference_phase_space, reference_z_abs, z_abs, raise_missing_twiss_error=True, **mismatch_kw)[source]
Compute and set the mismatch with
reference_phase_space.- Parameters:
reference_phase_space (
Self) – Beam parameters in the same phase space, corresponding to the reference linac.reference_z_abs (
ndarray[tuple[Any,...],dtype[double]]) – Positions corresponding toreference_phase_space.z_abs (
ndarray[tuple[Any,...],dtype[double]]) – Positions in the linac under study.raise_missing_twiss_error (
bool, default:True) – If set to True and the Twiss parameters were not calculated in current phase space, raise an error.mismatch_kw (
bool) – Keyword arguments passed to the function computing mismatch factor.
- Return type: