at.load.xsuite_elements
Definition of the Xsuite-like element classes.
Classes
-
class XsElement(name, *args, **kwargs)[source]
Bases: dict, _XsFactory
Base class for Xsuite elements.
-
classmethod from_at(atelem, *, match_model=True, **kwargs)[source]
Build a XsElement element from an AT element.
- Parameters:
atelem (Element) – AT Element
match_model (bool) – If True, set the Xsuite model and integrator
matching at best the AT PassMethod. Otherwise, use Xsuite defaults,
do_warn – Function checking if a warning should be issued.
beta0 – beta of the reference particle
- Returns:
xselement – new XsElement object
-
classmethod from_dict(xsparams, name='?', do_warn=<function XsElement.<lambda>>)[source]
Build a XsElement from its dictionary representation.
- Parameters:
xsparams (dict[str, Any]) – dictionary representation of the XsElement
name (str) – Optional name of the element
do_warn (Callable[[str], bool]) – Function checking if a warning should be issued.
- Returns:
xselement – new XsElement object
-
static static_from_at(atelem, *, beta0=1.0, match_model=True, do_warn=<function XsElement.<lambda>>)[source]
Build a XsElement from an AT element.
- Parameters:
atelem (Element) – AT Element
beta0 – beta of the reference particle
match_model (bool) – If True, set the Xsuite model and integrator
matching at best the AT PassMethod. If False, the Xsuite default
model and integrator are be used.
do_warn (Callable[[str], bool]) – Function to checking if a warning should be issued.
- Returns:
xselement – new XsElement object
-
static static_from_dict(elem_dict, name='?', do_warn=<function XsElement.<lambda>>)[source]
Build a XsElement from its dictionary representation.
- Parameters:
elem_dict (dict[str, Any]) – dictionary representation of the XsElement
name (str) – Optional name of the element
do_warn (Callable[[str], bool]) – Function checking if a warning should be issued.
- Returns:
xselement – new XsElement object
-
to_at(beta0=1.0)[source]
Generate the AT element.
- Parameters:
beta0 (float) – beta of the reference particle
- Returns:
elem – new Element object
-
to_dict()[source]
Build a dictionary representation of the XsElement.
- Returns:
elem_dict – dictionary representation of the XsElement
-
name: str
Element name
-
origin: str
Xsuite class of the source element