simba.Codes.Cheetah package

Submodules

simba.Codes.Cheetah.Cheetah module

SIMBA Cheetah Module

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

Classes:

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

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

Bases: frameworkLattice

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

Parameters:
  • args (Any)

  • kwargs (Any)

cheetahglobal: Dict = {}

Global settings for Cheetah, read in from cheetahLattice.settings[“global”][“Cheetahsettings”] and cheetah_defaults.yaml

code: str = 'cheetah'

String indicating the lattice object type

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

Convert the initial HDF5 particle distribution to OpenPMD 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

particle_definition: str = None

Initial particle distribution as a string

pin: Optional[Any] = None

Initial particle distribution as a Cheetah `ParticleArray`_

postProcess()[source]

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

Return type:

None

pout: Optional[Any] = None

Final particle distribution as a Cheetah `ParticleArray`_

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

screen_threaded_function: ClassVar[ScatterGatherDescriptor]

Function for converting all screen outputs from ELEGANT into the SIMBA generic beam object and writing files

segment: Optional[Any] = None

Lattice elements arranged into a Cheetah Segment

trackBeam: bool = True

Flag to indicate whether to track the beam

tws: tuple[Tensor, ...] | Tensor | None = None

Tensor or tuple of Tensors containing Twiss parameters

write()[source]

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

Return type:

None

writeElements()[source]

Create Cheetah objects for all the elements in the lattice and set the segment.

Returns:

True if successful

Return type:

bool

simba.Codes.Cheetah.cheetah_conversion module

Module contents