at.load.elegant#

Load a lattice from an Elegant file (.lte).

This is not complete but can parse the example files that I have. This parser is quite similar to the Tracy parser in tracy.py.

The Elegant file format is described briefly here. It is similar to the MAD-X format.

Note that Elegant scales magnet polynomials in a different way to AT, so the parsed coefficients need to be divided by n! for the coefficient of order n.

Functions

load_elegant(filename, **kwargs)

Create a Lattice from an Elegant file

load_elegant(filename, **kwargs)[source]#

Create a Lattice from an Elegant file

Parameters:

filename (str) – Name of an Elegant file

Keyword Arguments:
  • name (str) – Name of the lattice. Default: taken from the file.

  • energy (float) – Energy of the lattice [eV]

  • periodicity (int) – Number of periods. Default: taken from the elements, or 1

  • * – All other keywords will be set as Lattice attributes

Returns:

lattice (Lattice) – New Lattice object

See also

load_lattice() for a generic lattice-loading function.