at.lattice.axisdef#

Helper functions for axis and plane descriptions

Functions

axis_(axis[, key])

Return axis descriptions

plane_(plane[, key])

Return plane descriptions

axis_(axis, key=None)[source]#

Return axis descriptions

Parameters:
  • axis (str | int | slice | None | ellipsis | Tuple[str | int | slice | None | ellipsis, str | int | slice | None | ellipsis]) –

    axis code or tuple of axis codes selecting axes in the standard AT coordinate system. codes for the 6 axes are:

    0, ‘x’, ‘X’

    1, ‘px’, PX’

    2, ‘y’, ‘Y’

    3, ‘py’, ‘PY’

    4, ‘dp’, ‘DP’, ‘delta’

    5, ‘ct’, ‘CT’, ‘s’, ‘S’

    None and Ellipsis select all axes

  • key (str | None) –

    key in the coordinate descriptor dictionary, selecting the desired information. One of :

    ’index’

    index in the standard AT coordinate vector

    ’code’

    string representation

    ’label’

    label for plot annotation

    ’unit’

    coordinate unit

    None

    entire description dictionary

Returns:

descr – value or tuple[values]

Examples

>>> axis_(('x','dp'), key='index')
(0, 4)

returns the indices in the standard coordinate vector

>>> dplabel = axis_('dp', key='label')
>>> print(dplabel)
$\delta$

returns the coordinate label for plot annotation

>>> axis_((0,'dp'))
({'plane': 0, 'label': 'x', 'unit': ' [m]', 'code': 'x'},
 {'plane': 4, 'label': '$\\delta$', 'unit': '', 'code': 'dp'})

returns the entire description directories

plane_(plane, key=None)[source]#

Return plane descriptions

Parameters:
  • plane (str | int | slice | None | ellipsis | Tuple[str | int | slice | None | ellipsis, str | int | slice | None | ellipsis]) –

    plane code or tuple of plane codes selecting planes. codes for the 3 planes are:

    0, ‘x’, ‘X’, ‘h’, ‘H’ for horizontal plane,

    1, ‘y’, ‘Y’, ‘v’, ‘V’ for vertical plane,

    2, ‘z’, ‘Z’ for the longitudinal plane

    None, slice(None) and Ellipsis selects all planes

  • key (str | None) –

    key in the plane descriptor dictionary, selecting the desired information. One of :

    ’plane’

    plane in the optics data

    ’code’

    string representation

    ’label’

    label for plot annotation

    ’unit’

    coordinate unit

    None

    entire description dictionary

Returns:

descr – value or tuple[values]

Examples

>>> plane_('v', key='index')
1

returns the indices in the standard coordinate vector

>>> plane_(('x','y'))
({'plane': 0, 'label': 'h', 'unit': ' [m]', 'code': 'h'},
 {'plane': 1, 'label': 'v', 'unit': ' [m]', 'code': 'v'})

returns the entire description directories