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: IPhaseSpaceBeamParameters

Hold Twiss, emittance, envelopes of a single phase-space.

Parameters:
eps_no_normalization: ndarray[tuple[Any, ...], dtype[float64]]
eps_normalized: ndarray[tuple[Any, ...], dtype[float64]]
mismatch_factor: ndarray[tuple[Any, ...], dtype[float64]] | None = 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.

Parameters:
Return type:

Self

classmethod from_sigma(phase_space_name, sigma, gamma_kin, beta_kin, beam_kwargs, **kwargs)[source]

Compute Twiss, eps, envelopes just from sigma matrix.

Parameters:
Return type:

Self

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.

Parameters:
Return type:

Self

classmethod from_averaging_x_and_y(phase_space_name, x_space, y_space)[source]

Create average transverse phase space from [xx’] and [yy’].

eps is always initialized. mismatch_factor is calculated if it was already calculated in x_space and y_space.

Parameters:
  • phase_space_name (str)

  • x_space (Self)

  • y_space (Self)

Return type:

Self

property alpha: ndarray[tuple[Any, ...], dtype[float64]] | None

Get first column of self.twiss.

property beta: ndarray[tuple[Any, ...], dtype[float64]] | None

Get second column of self.twiss.

property gamma: ndarray[tuple[Any, ...], dtype[float64]] | None

Get third column of self.twiss.

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:
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 eps: ndarray[tuple[Any, ...], dtype[float64]]

Return the normalized emittance.

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 to reference_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:

None