NOcelot

converters.nocelot.ocelot2cheetah(element, warnings: bool = True, device=None, dtype=torch.float32) Element

Translate an Ocelot element to a Cheetah element.

NOTE Object not supported by Cheetah are translated to drift sections. Screen objects are created only from ocelot.Monitor objects when the string “BSC” is contained in their id attribute. Their screen properties are always set to default values and most likely need adjusting afterwards. BPM objects are only created from ocelot.Monitor objects when their id has a substring “BPM”.

Parameters:
  • element – Ocelot element object representing an element of particle accelerator.

  • warnings – Whether to print warnings when elements might not be converted as expected.

Returns:

Cheetah element object representing an element of particle accelerator.

converters.nocelot.subcell_of_ocelot(cell: list, start: str, end: str) list

Extract a subcell [start, end] from an Ocelot cell.