converters module

All functions to change units.

Todo

The eps_phiw is not correct. Does not match TraceWin (even if what I compute seems right). Check the zdelta -> phiw conversion.

position(pos_in, beta, key, omega_0_bunch, **beam_kwargs)[source]

Phase/position converters.

Parameters:
Return type:

float | ndarray

energy(energy_in, key, q_over_m, m_over_q, e_rest_mev, **beam_kwargs)[source]

Convert energy or Lorentz factor into another related quantity.

Parameters:
Return type:

float | ndarray

longitudinal(long_in, ene, key, e_rest_mev, **beam_kwargs)[source]

Convert energies between longitudinal phase spaces.

Parameters:
Return type:

float | ndarray

emittance(eps_orig, key, gamma_kin, beta_kin, lambda_bunch, e_rest_mev, **beam_kwargs)[source]

Convert emittance from a phase space to another, or handle norm.

Parameters:
Return type:

float | ndarray

twiss(twiss_orig, gamma_kin, key, lambda_bunch, e_rest_mev, beta_kin=None, **beam_kwargs)[source]

Convert Twiss array from a phase space to another.

Parameters:
Return type:

ndarray