transfer_matrix_factory module
Provide an easy way to generate TransferMatrix.
- class TransferMatrixFactoryTraceWin(is_3d: bool)
Bases:
TransferMatrixFactoryProvide a method for easy creation of
TransferMatrix.- _load_transfer_matrices(path_cal: str, filename: str = 'Transfer_matrix1.dat', high_def: bool = False) tuple[ndarray, ndarray, ndarray]
Get the full transfer matrices calculated by TraceWin.
- Parameters:
- 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: ndarray, path_cal: str, element_to_index: Callable) TransferMatrix
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 0x7f36f84b1240>