at.physics.frequency_maps#

Frequency analysis (FMAP) using .harmonic_analysis lib and pyat parallel tracking (patpass)

Functions

fmap_parallel_track(ring[, coords, steps, ...])

Computes frequency maps

fmap_parallel_track(ring, coords=[-10, 10, -10, 10], steps=[100, 100], scale='linear', turns=512, orbit=None, add_offset6D=array([0., 0., 0., 0., 0., 0.]), verbose=False, lossmap=False, **kwargs)[source]#

Computes frequency maps

This function calculates the norm of the transverse tune variation per turn for a particle tracked along a ring with a set of offsets in the initial coordinates.

It returns a numpy array containing 7 columns:

[xoffset, yoffset, nux, nuy, dnux, dnuy,
log10(sqrt(dnux*dnux + dnuy*dnuy)/tns )]

for every tracked particle that survives 2*turns. Particles lost before 2*turns are ignored. The log10 tune variation is limited to the interval from -10 to -2; values above or below are set to the closer limit.

The transverse offsets are given inside a rectangular coordinate window

coords=[xmin, xmax, ymin, *ymax]

in millimeters, where the window is divided in n steps=[xsteps,ysteps]. For each yoffset, particle tracking over the whole set of xoffsets is done in parallel.

The frequency analysis uses a library that is not parallelized.

The closed orbit is calculated and added to the initial particle offset of every particle. Otherwise, one could set orbit = numpy.zeros(6) to avoid it. Additionally, a numpy array (add_offset6D) with 6 values could be used to arbitrarily offset the initial coordinates of every particle.

A dictionary with particle losses is saved for every vertical offset. See the patpass() documentation.

Parameters:
  • ring – a valid pyat ring

  • coords – default [-10,10,-10,10] in mm

  • steps – (xsteps, ysteps): number of steps in each plane

  • scale – default ‘linear’; or ‘non-linear’

  • turns – default 512

  • orbit – If None, the closed orbit is computed and added to the coordinates

  • add_offset6D – default numpy.zeros((6,1))

  • verbose – prints additional info

  • lossmap – default false

Optional:

pool_size:number of processes. See patpass()

Returns:
  • xy_nuxy_lognudiff_array – numpy array with columns [xcoor, ycoor, nux, ny, dnux, dnuy, log10(sqrt(sum(dnu**2)/turns)) ]

  • loss_map_array – experimental format. if loss_map is True, it returns the losses dictionary provided by patpass() per every vertical offset. if loss_map is False, it returns a one-element list.

Warning

points with NaN tracking results or non-defined frequency in x,y are ignored.

Warning

loss map format is experimental