transfer_matrix_factory module
Provide an easy way to generate TransferMatrix.
- class TransferMatrixFactoryTraceWin(is_3d)[source]
Bases:
TransferMatrixFactoryProvide a method for easy creation of
TransferMatrix.- Parameters:
is_3d (
bool)
- _load_transfer_matrices(path_cal, filename='Transfer_matrix1.dat', high_def=False)[source]
Get the full transfer matrices calculated by TraceWin.
- Parameters:
filename (str, optional) – The name of the transfer matrix file produced by TraceWin. The default is ‘Transfer_matrix1.dat’.
high_def (bool, optional) – To get the transfer matrices at all the solver step, instead at the elements exit only. The default is False. Currently not implemented.
path_cal (
str)
- Return type:
- Returns:
element_numbers (numpy.ndarray) – Number of the elements.
position_in_m (numpy.ndarray) – Position of the elements.
transfer_matrices (numpy.ndarray) – Cumulated transfer matrices of the elements.
- run(tm_cumul_in, path_cal, element_to_index)[source]
Load the TraceWin transfer matrix file and create the object.
- Parameters:
tm_cumul_in (numpy.ndarray) – Cumulated transfer matrix at entrance of linac or linac subset.
path_cal (str) – Full path to transfer matrix file.
element_to_index (Callable) – to doc
- Returns:
transfer_matrix – Object holding the various transfer matrices in the \([x-x']\), \([y-y']\) and \([z-\delta]\) planes.
- Return type:
- _abc_impl = <_abc._abc_data object at 0x73dca7feddc0>