at.physics.magnet_tools#

Magnet tools.

Functions

feeddown_polynomba(polb, pola[, xoffset, ...])

Return the feeddown due to a transverse offset.

feeddown_from_nth_order(nthorder, ...[, ...])

Return the feeddown polynoms from an nth-order magnet component transverse offset.

feeddown_pol_from_element(ele[, verbose])

Return the feed down polynoms due to a transverse offset on an element.

feeddown_from_nth_order(nthorder, nthpolcomp, xoffset, yoffset, poltype='B', verbose=False)[source]#

Return the feeddown polynoms from an nth-order magnet component transverse offset.

Parameters:
  • nthorder (int) – integer order of the magnet component, e.g. 1 for dipole, 2 for quadrupoles, 3 for sextupoles, etc.

  • nthpolcomp (float) – float. nth component of the polynom, i.e. the value of PolynomA/B[nthorder-1].

  • xoffset (float) – float. Horizontal offset in meters.

  • yoffset (float) – float. Vertical offset in meters.

  • poltype (str) – Default ‘B’. Could be ‘B’ or ‘A’, otherwise ignored.

  • verbose (bool) – print info on input and output parameters.

Returns:

Tuple of two numpy arrays with PolynomB and PolynomA from feeddown.

feeddown_pol_from_element(ele, verbose=False, **kwargs)[source]#

Return the feed down polynoms due to a transverse offset on an element.

Parameters:
  • ele (Element) – a ring element.

  • verbose (bool) – prints additional info. Default: False.

  • kwargs (dict[str, any]) –

    offset:(x,y) horizontal and vertical offset in meters.

    Default taken from T2 or T1. Otherwise, zero.

Returns:

Dictionary with PolynomB and PolynomA feeddown components.

Note: Thin lens approximation, T2=-T1.

Bending angles are ignored.

feeddown_polynomba(polb, pola, xoffset=0, yoffset=0, verbose=False)[source]#

Return the feeddown due to a transverse offset.

Parameters:
  • polb (Sequence[float]) – PolynomB.

  • pola (Sequence[float]) – PolynomA.

  • xoffset (float) – Default zero. Horizontal offset in meters.

  • yoffset (float) – Default zero. Vertical offset in meters.

  • verbose (bool) – prints additional info.

Returns:

Dictionary with PolynomB and PolynomA feeddown components.

Note

If only one polynom is passed, it is assumed to be PolynomB.