at.plot.specific#

AT plotting functions

Functions

pldata_beta_disp(ring, refpts, **kwargs)

Generates data for plotting beta functions and dispersion

pldata_linear(ring, refpts, *keys, **kwargs)

data extraction function for plotting results of get_optics

plot_beta(ring, **kwargs)

Plot beta functions and dispersion

plot_linear(ring, *keys, **kwargs)

Plot linear optical functions returned by get_optics()

plot_trajectory(ring, r_in[, nturns])

Plot a particle's trajectory

pldata_beta_disp(ring, refpts, **kwargs)[source]#

Generates data for plotting beta functions and dispersion

pldata_linear(ring, refpts, *keys, **kwargs)[source]#

data extraction function for plotting results of get_optics

plot_beta(ring, **kwargs)[source]#

Plot beta functions and dispersion

Parameters:

ring (Lattice) – Lattice description.

Keyword Arguments:
  • dp (float) – Momentum deviation.

  • dct (float) – Path lengthening. If specified, dp is ignored and the off-momentum is deduced from the path lengthening.

  • orbit (Orbit) – Avoids looking for the closed orbit if is already known ((6,) array)

  • method (Callable) –

    Method for linear optics (see get_optics()):

    linopt2: no longitudinal motion, no H/V coupling,

    linopt4: no longitudinal motion, Sagan/Rubin 4D-analysis of coupled motion,

    linopt6 (default): with or without longitudinal motion, normal mode analysis

  • keep_lattice (bool) – Assume no lattice change since the previous tracking. Defaults to False

  • XYStep (float) – Step size. Default: DConstant.XYStep

  • DPStep (float) – Momentum step size. Default: DConstant.DPStep

  • twiss_in – Initial conditions for transfer line optics. Record array as output by linopt2(), linopt6(), or dictionary.

  • s_range – Lattice range of interest, default: unchanged, initially set to the full cell.

  • axes (tuple[Axes, Optional[Axes]) – Axes for plotting as (primary_axes, secondary_axes). Default: create new axes

  • slices (int) – Number of slices. Default: 400

  • legend (bool) – Show a legend on the plot

  • labels (Refpts) – display the name of selected elements. Default: None

  • block (bool) – If True, block until the figure is closed. Default: False

  • dipole (dict) – Dictionary of properties overloading the default properties of dipole representation. See plot_synopt() for details

  • quadrupole (dict) – Same definition as for dipole

  • sextupole (dict) – Same definition as for dipole

  • multipole (dict) – Same definition as for dipole

  • monitor (dict) – Same definition as for dipole

plot_linear(ring, *keys, **kwargs)[source]#

Plot linear optical functions returned by get_optics()

Parameters:

ring (Lattice) – Lattice description.

Keyword Arguments:
  • left

    Left axis description as a tuple: (key[, indices[, indices]])

    key: ‘beta’, ‘closed_orbit’,… See get_optics()

    indices: integer, sequence of integers, or slice

    The number if sequences of indices is data[key].ndim-1 The number of indices is the number of curves to plot. All sequences must have the same length.

  • Examples

    ('beta', [0, 1]): beta_x, beta_z

    ('dispersion', 0): eta_x

    ('closed_orbit', [1, 3]): x’, z’

    ('m44', 2, 2): T33

    ('m44', [0, 0], [0, 1]): T11, T12

    ('m44', 2, slice(4)): T31, T32, T33, T34 as a single block

    ('m44', [2,2,2,2], [0,1,2,3]): T31, T32, T33, T34

  • right – Right axis (optional). See left

  • title (str) – Plot title, defaults to “Linear optics”

  • dp (float) – Momentum deviation.

  • dct (float) – Path lengthening. If specified, dp is ignored and the off-momentum is deduced from the path lengthening.

  • orbit (Orbit) – Avoids looking for the closed orbit if is already known ((6,) array)

  • method (Callable) –

    Method for linear optics (see get_optics()):

    linopt2: no longitudinal motion, no H/V coupling,

    linopt4: no longitudinal motion, Sagan/Rubin 4D-analysis of coupled motion,

    linopt6 (default): with or without longitudinal motion, normal mode analysis

  • keep_lattice (bool) – Assume no lattice change since the previous tracking. Defaults to False

  • XYStep (float) – Step size. Default: DConstant.XYStep

  • DPStep (float) – Momentum step size. Default: DConstant.DPStep

  • twiss_in – Initial conditions for transfer line optics. Record array as output by linopt2(), linopt6(), or dictionary.

  • s_range – Lattice range of interest, default: unchanged, initially set to the full cell.

  • axes (tuple[Axes, Optional[Axes]) – Axes for plotting as (primary_axes, secondary_axes). Default: create new axes

  • slices (int) – Number of slices. Default: 400

  • legend (bool) – Show a legend on the plot

  • labels (Refpts) – display the name of selected elements. Default: None

  • block (bool) – If True, block until the figure is closed. Default: False

  • dipole (dict) – Dictionary of properties overloading the default properties of dipole representation. See plot_synopt() for details

  • quadrupole (dict) – Same definition as for dipole

  • sextupole (dict) – Same definition as for dipole

  • multipole (dict) – Same definition as for dipole

  • monitor (dict) – Same definition as for dipole

plot_trajectory(ring, r_in, nturns=1, **kwargs)[source]#

Plot a particle’s trajectory

Parameters:
  • ring (Lattice) – Lattice object

  • r_in – (6,n) array: input coordinates of n particles

  • nturns (int) – Number of turns

Keyword Arguments:
  • keep_lattice (bool) – Assume no lattice change since the previous tracking. Defaults to False

  • s_range – Lattice range of interest, default: unchanged, initially set to the full cell.

  • axes (tuple[Axes, Optional[Axes]) – Axes for plotting as (primary_axes, secondary_axes). Default: create new axes

  • slices (int) – Number of slices. Default: 400

  • legend (bool) – Show a legend on the plot

  • block (bool) – If True, block until the figure is closed. Default: False

  • dipole (dict) – Dictionary of properties overloading the default properties of dipole representation. See plot_synopt() for details

  • quadrupole (dict) – Same definition as for dipole

  • sextupole (dict) – Same definition as for dipole

  • multipole (dict) – Same definition as for dipole

  • monitor (dict) – Same definition as for dipole