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.
- 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.
Todo
q_over_mandm_over_qshould not be mandatory arguments if they are not always used.
- longitudinal(long_in, ene, key, e_rest_mev, **beam_kwargs)[source]
Convert energies between longitudinal phase spaces.
- 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:
eps_orig (
float|ndarray[tuple[Any,...],dtype[TypeVar(_ScalarT, bound=generic)]])key (
str)gamma_kin (
float|ndarray[tuple[Any,...],dtype[TypeVar(_ScalarT, bound=generic)]])beta_kin (
float|ndarray[tuple[Any,...],dtype[TypeVar(_ScalarT, bound=generic)]])lambda_bunch (
float|ndarray[tuple[Any,...],dtype[TypeVar(_ScalarT, bound=generic)]])e_rest_mev (
float|ndarray[tuple[Any,...],dtype[TypeVar(_ScalarT, bound=generic)]])
- Return type:
float|ndarray[tuple[Any,...],dtype[TypeVar(_ScalarT, bound=generic)]]
- 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:
twiss_orig (
ndarray[tuple[Any,...],dtype[TypeVar(_ScalarT, bound=generic)]])gamma_kin (
float|ndarray[tuple[Any,...],dtype[TypeVar(_ScalarT, bound=generic)]])key (
str)lambda_bunch (
float|ndarray[tuple[Any,...],dtype[TypeVar(_ScalarT, bound=generic)]])e_rest_mev (
float|ndarray[tuple[Any,...],dtype[TypeVar(_ScalarT, bound=generic)]])beta_kin (
float|ndarray[tuple[Any,...],dtype[TypeVar(_ScalarT, bound=generic)]] |None, default:None)
- Return type:
ndarray[tuple[Any,...],dtype[TypeVar(_ScalarT, bound=generic)]]