at.tracking.utils#
Utility functions for tracking simulations
Functions
|
decorator to ensure that r_in is Fortran-aligned |
|
Function to get the bunches particles 6D coordinates |
|
Function to format the ouput of parallelized tracking |
|
Function to get the bunches standard deviation and center of mass |
|
Function to unfold the beam based on the ring fill pattern. |
|
True if any element involves collective effects |
|
Function to initialize keyword arguments for lattice tracking |
|
Function to disable collective effects elements |
|
- format_results(results, r_in, losses)[source]#
Function to format the ouput of parallelized tracking
- fortran_align(func)[source]#
decorator to ensure that r_in is Fortran-aligned
fortran_align()
ensures that the 2nd argument (usually r_in) of the decorated function is Fortran-aligned before calling the functionExample
>>> @fortran_align ... def element_pass(element: Element, r_in, **kwargs): ... ...
Ensure that r_in is Fortran-aligned
- get_bunches(r_in, nbunch, selected_bunches=None)[source]#
Function to get the bunches particles 6D coordinates
- Parameters:
- Returns:
List of ndarray containing the 6 x n particles coordinates
of the selected bunches
- get_bunches_std_mean(r_in, nbunch, selected_bunches=None)[source]#
Function to get the bunches standard deviation and center of mass
- Parameters:
- Returns:
Lists of ndarray containing the 6D standard deviation
and center of mass (std, mean)
- initialize_lpass(lattice, nturns, kwargs)[source]#
Function to initialize keyword arguments for lattice tracking
- unfold_beam(ring, beam, **kwargs)[source]#
Function to unfold the beam based on the ring fill pattern. The input particle distribution has to be in on bucket 0. Particle are distributed in bunches using
i%ring.nbunch
where i is the particle index. For each bunches the absolutect
is computed using the 6D closed orbit search, this closed orbit is added to the input particles.- Parameters:
- Keyword Arguments:
convergence (float) – Convergence criterion for 6D orbit Default:
DConstant.OrbConvergence
max_iterations (int) – Maximum number of iterations for 6D orbit. Default:
DConstant.OrbMaxIter
- Returns:
beam (numpy.ndarray) – unfolded beam
- Return type: