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:
xsuiteLattice: The Xsuite lattice object, used for
converting the
frameworkObjects defined in theframeworkLatticeinto an Xsuite lattice object, and for tracking through it.
- class xsuiteLattice(*args, **kwargs)[source]
Bases:
frameworkLatticeClass for defining the Xsuite lattice object, used for converting the
frameworkLatticeinto 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
-
context:
Optional[Any] = None Xsuite context object
-
env:
Any= None Xsuite environment object
-
final_screen:
Any= None Final screen object
- hdf5_to_json(prefix='', write=True)[source]
Convert the initial HDF5 particle distribution to Xsuite format and set
pinaccordingly.- 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
-
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