simba.Codes.Xsuite package

Submodules

simba.Codes.Xsuite.Xsuite module

SIMBA Xsuite Module

Various objects and functions to handle Xsuite lattices and commands. See Xsuite github for more details.

Classes:

converting the frameworkObject s defined in the frameworkLattice into an Xsuite lattice object, and for tracking through it.

class xsuiteLattice(*args, **kwargs)[source]

Bases: frameworkLattice

Class for defining the Xsuite lattice object, used for converting the frameworkLattice into an Xsuite lattice object, and for tracking through it.

Parameters:
  • args (Any)

  • kwargs (Any)

beam_data: Dict = {}

Data containing beam statistics at each element

code: str = 'xsuite'

String indicating the lattice object type

compute_norm_emit(coord, mom, particles)[source]
context: Optional[Any] = None

Xsuite context object

env: Any = None

Xsuite environment object

final_screen: Any = None

Final screen object

grids: getGrids = None

Class for calculating the required number of space charge grids

hdf5_to_json(prefix='', write=True)[source]

Convert the initial HDF5 particle distribution to Xsuite format and set pin accordingly.

Parameters:
  • prefix (str) – Prefix for particle file

  • write (bool) – Flag to indicate whether to save the file

Return type:

None

line: Any = None

Xsuite line object

matrices: Optional[Dict] = None

Dictionary of R-matrices produced by tracking

names: List = None

Names of elements in the lattice

particle_definition: str = None

Initial particle distribution as a string

pic_solver: Literal['FFTSolver2p5DAveraged'] = 'FFTSolver2p5DAveraged'

PIC solver to use for space charge calculations

pin: Optional[Any] = None

Xsuite input particle distribution

postProcess()[source]

Convert the outputs from Ocelot to HDF5 format and save them to master_subdir.

Return type:

None

pout: Optional[Any] = None

Xsuite output particle distribution

preProcess()[source]

Get the initial particle distribution defined in file_block[‘input’][‘prefix’] if it exists.

Return type:

None

ref_idx: int = None

Reference particle index

ref_s: float = None

Reference s position

run()[source]

Run the code, and set tws and pout

Return type:

None

setup_collective_effects()[source]
Return type:

None

trackBeam: bool = True

Flag to indicate whether to track the beam. If False, run in single-particle mode; the beam is not tracked and the output beam distributions will be generated from Gaussians.

tws: Optional[Any] = None

Xsuite Twiss Table output

write()[source]

Create the lattice object via writeElements() and save it as a python file to master_subdir.

Return type:

None

writeElements()[source]

Create Xsuite objects for all the elements in the lattice and set the lat_obj and names.

Return type:

None

simba.Codes.Xsuite.xsuite_conversion module

Module contents