at.tracking.utils#

Utility functions for tracking simulations

Functions

get_bunches(r_in, nbunch[, selected_bunches])

Function to get the bunches particles 6D coordinates

get_bunches_std_mean(r_in, nbunch[, ...])

Function to get the bunches standard deviation and center of mass

unfold_beam(ring, beam, **kwargs)

Function to unfold the beam based on the ring fill pattern.

get_bunches(r_in, nbunch, selected_bunches=None)[source]#

Function to get the bunches particles 6D coordinates

Parameters:
  • r_in (ndarray) – 6 x n_particles Fortran-ordered numpy array.

  • nbunch (int) – integer, total number of bunches

  • selected_bunches (Optional[ndarray]) – integer or array of integers, index

  • bunches (of the selected) –

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:
  • r_in (ndarray) – 6 x n_particles Fortran-ordered numpy array.

  • nbunch (int) – integer, total number of bunches

  • selected_bunches (Optional[ndarray]) – integer or array of integers, index

  • bunches (of the selected) –

Returns:
  • Lists of ndarray containing the 6D standard deviation

  • and center of mass (std, mean)

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 absolute ct is computed using the 6D closed orbit search, this closed orbit is added to the input particles.

Parameters:
  • ring (Lattice) – Lattice description

  • beam (ndarray) – array with shape(6, nparticles)

Keyword Arguments:
Returns:

beam (numpy.ndarray) – unfolded beam

Return type:

ndarray