laura package

Subpackages

Submodules

laura.laura module

LAURA Main Module

The main class for handling a full particle accelerator lattice.

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

Bases: MachineModel

LAURA Main Class

The main class for handling a full particle accelerator lattice.

Parameters:
  • args (Any)

  • kwargs (Any)

__all_elements(element_class=None, element_type=None)

Get a set of all elements of a given class and/or type

Parameters:
  • element_class (Union[str, list, None]) – Class of the element (e.g., ‘magnet’, ‘rf’, ‘diagnostic’)

  • element_type (Union[str, list, None]) – Type of the element (e.g., ‘quadrupole’, ‘dipole’, ‘BPM’)

Return type:

set

Returns:

Set of element names

__get_combined_corrector_sub_correctors(elem)

Split a Combined_Corrector into its sub-correctors

Parameters:

elem (str) – Name of the combined corrector element

Return type:

list[str]

Returns:

Names of sub-corrector elements (if they exist) or the original element name

_drift_length(start, end)[source]
Parameters:
  • start (list[float])

  • end (list[float])

property all_beam_position_monitors: set

Get all BPM devices in the machine :return: Set of all BPM names

property all_cameras: list

Get all camera devices in the machine :return: List of all camera device names

property all_charge_diagnostics: set

Get all charge diagnostics in the machine :return: Set of all charge diagnostic names

property all_combined_correctors: set

Get all combined corrector magnets in the machine :return: Set of all combined corrector magnet names

property all_correctors: set

Get all corrector magnets in the machine :return: Set of all corrector magnet names

property all_diagnostics: set

Get all diagnostic devices in the machine :return: Set of all diagnostic device names

property all_dipoles: set

Get all dipole magnets in the machine :return: Set of all dipole magnet names

property all_elements: set

Get all elements in the machine :return: Set of all element names

property all_horizontal_correctors: set

Get all horizontal corrector magnets in the machine :return: Set of all horizontal corrector magnet names

property all_magnets: set

Get all magnets in the machine :return: Set of all magnet names

property all_position_diagnostics: set

Get all position diagnostic devices in the machine :return: Set of all position diagnostic device names

property all_quadrupoles: set

Get all quadrupole magnets in the machine :return: Set of all quadrupole magnet names

property all_rf_cavities: set

Get all rf cavities in the machine :return: Set of all cavity names

property all_screens_and_cameras: Dict

Get all screens with their associated cameras in the machine :return: Dict of all screens with camera names

property all_separate_magnets: set

Get all separate magnets in the machine :return: Set of all separate magnet names

property all_sextupoles: set

Get all sextupole magnets in the machine :return: Set of all sextupole magnet names

property all_shutters: set

Get all shutter elements in the machine :return: Set of all shutter element names

property all_solenoids: set

Get all solenoid magnets in the machine :return: Set of all solenoid magnet names

property all_vacuum_components: set

Get all vacuum components in the machine :return: Set of all vacuum component names

property all_vertical_correctors: set

Get all vertical corrector magnets in the machine :return: Set of all vertical corrector magnet names

createDrifts(end=None, start=None, path=None)[source]

Insert drifts into a sequence of ‘elements’

Parameters:
  • end (Optional[str]) – Name of the last element in the sequence

  • start (Optional[str]) – Name of the first element in the sequence

  • path (Optional[str]) – Name of the lattice path to use

Return type:

Dict

Returns:

Dictionary of elements with drifts inserted

element_list: Union[str, List[baseElement]]

List containing all elements in the machine model, either as a path to a YAML file/directory or as a list of element objects.

exclude_keys: Optional[List[str]] = None

List of top-level keys to exclude when reading YAML files

get_beam_position_monitors(end=None, start=None, path=None)[source]

Get all BPM devices between start and end

Parameters:
  • end (Optional[str]) – Name of the last element in the sequence

  • start (Optional[str]) – Name of the first element in the sequence

  • path (Optional[str]) – Name of the lattice path to use

Return type:

list[str]

Returns:

List of BPM devices names

get_cameras(end=None, start=None, path=None)[source]

Get all camera devices between start and end

Parameters:
  • end (Optional[str]) – Name of the last element in the sequence

  • start (Optional[str]) – Name of the first element in the sequence

  • path (Optional[str]) – Name of the lattice path to use

Return type:

list[str]

Returns:

List of camera devices names

get_charge_diagnostics(end=None, start=None, path=None)[source]

Get all charge diagnostic devices between start and end

Parameters:
  • end (Optional[str]) – Name of the last element in the sequence

  • start (Optional[str]) – Name of the first element in the sequence

  • path (Optional[str]) – Name of the lattice path to use

Return type:

list[str]

Returns:

List of charge diagnostic devices names

get_combined_correctors(end=None, start=None, path=None)[source]

Get all combined corrector magnets between start and end

Parameters:
  • end (Optional[str]) – Name of the last element in the sequence

  • start (Optional[str]) – Name of the first element in the sequence

  • path (Optional[str]) – Name of the lattice path to use

Return type:

list[str]

Returns:

List of combined corrector magnet names

get_correctors(end=None, start=None, path=None)[source]

Get all corrector magnets between start and end

Parameters:
  • end (Optional[str]) – Name of the last element in the sequence

  • start (Optional[str]) – Name of the first element in the sequence

  • path (Optional[str]) – Name of the lattice path to use

Return type:

list[str]

Returns:

List of corrector magnet names

get_diagnostics(end=None, start=None, path=None)[source]

Get all diagnostic devices between start and end

Parameters:
  • end (Optional[str]) – Name of the last element in the sequence

  • start (Optional[str]) – Name of the first element in the sequence

  • path (Optional[str]) – Name of the lattice path to use

Return type:

list[str]

Returns:

List of diagnostic devices names

get_dipoles(end=None, start=None, path=None)[source]

Get all dipole magnets between start and end

Parameters:
  • end (Optional[str]) – Name of the last element in the sequence

  • start (Optional[str]) – Name of the first element in the sequence

  • path (Optional[str]) – Name of the lattice path to use

Return type:

list[str]

Returns:

List of dipole magnet names

get_elements(end=None, start=None, path=None)[source]

Get all elements between start and end

Parameters:
  • end (Optional[str]) – Name of the last element in the sequence

  • start (Optional[str]) – Name of the first element in the sequence

  • path (Optional[str]) – Name of the lattice path to use

Return type:

list[str]

Returns:

List of element names

get_elements_s_pos(end=None, start=None, path=None)[source]

Get s positions of all elements between start and end

Parameters:
  • end (Optional[str]) – Name of the last element in the sequence

  • start (Optional[str]) – Name of the first element in the sequence

  • path (Optional[str]) – Name of the lattice path to use

Return type:

Dict[str, float]

Returns:

Dictionary of element names and their s positions

get_horizontal_correctors(end=None, start=None, path=None)[source]

Get all horizontal corrector magnets between start and end

Parameters:
  • end (Optional[str]) – Name of the last element in the sequence

  • start (Optional[str]) – Name of the first element in the sequence

  • path (Optional[str]) – Name of the lattice path to use

Return type:

list[str]

Returns:

List of horizontal corrector magnet names

get_lattice_correctors(end=None, start=None, path=None)[source]

Get all corrector magnets between start and end

Parameters:
  • end (Optional[str]) – Name of the last element in the sequence

  • start (Optional[str]) – Name of the first element in the sequence

  • path (Optional[str]) – Name of the lattice path to use

Return type:

list[str]

Returns:

List of corrector magnet names

get_magnets(end=None, start=None, path=None)[source]

Get all magnets between start and end

Parameters:
  • end (Optional[str]) – Name of the last element in the sequence

  • start (Optional[str]) – Name of the first element in the sequence

  • path (Optional[str]) – Name of the lattice path to use

Return type:

list[str]

Returns:

List of magnet names

get_position_diagnostics(end=None, start=None, path=None)[source]

Get all position diagnostic devices between start and end

Parameters:
  • end (Optional[str]) – Name of the last element in the sequence

  • start (Optional[str]) – Name of the first element in the sequence

  • path (Optional[str]) – Name of the lattice path to use

Return type:

list[str]

Returns:

List of position diagnostic devices names

get_quadrupoles(end=None, start=None, path=None)[source]

Get all quadrupole magnets between start and end

Parameters:
  • end (Optional[str]) – Name of the last element in the sequence

  • start (Optional[str]) – Name of the first element in the sequence

  • path (Optional[str]) – Name of the lattice path to use

Return type:

list[str]

Returns:

List of quadrupole magnet names

get_rf_cavities(end=None, start=None, path=None)[source]

Get all RF cavities between start and end

Parameters:
  • end (Optional[str]) – Name of the last element in the sequence

  • start (Optional[str]) – Name of the first element in the sequence

  • path (Optional[str]) – Name of the lattice path to use

Return type:

list[str]

Returns:

List of RF cavity names

get_screens_and_cameras(end=None, start=None, path=None)[source]

Get all screen devices with their associated cameras between start and end

Parameters:
  • end (Optional[str]) – Name of the last element in the sequence

  • start (Optional[str]) – Name of the first element in the sequence

  • path (Optional[str]) – Name of the lattice path to use

Return type:

Dict[str, str]

Returns:

Dict of screens with camera names

get_separate_magnets(end=None, start=None, path=None)[source]

Get all magnet between start and end and separate combined correctors into their sub-correctors

Parameters:
  • end (Optional[str]) – Name of the last element in the sequence

  • start (Optional[str]) – Name of the first element in the sequence

  • path (Optional[str]) – Name of the lattice path to use

Return type:

list[str]

Returns:

List of magnet names

get_sextupoles(end=None, start=None, path=None)[source]

Get all sectupole magnets between start and end

Parameters:
  • end (Optional[str]) – Name of the last element in the sequence

  • start (Optional[str]) – Name of the first element in the sequence

  • path (Optional[str]) – Name of the lattice path to use

Return type:

list[str]

Returns:

List of sectupole magnet names

get_shutters(end=None, start=None, path=None)[source]

Get all shutter devices between start and end

Parameters:
  • end (Optional[str]) – Name of the last element in the sequence

  • start (Optional[str]) – Name of the first element in the sequence

  • path (Optional[str]) – Name of the lattice path to use

Return type:

list[str]

Returns:

List of shutter devices names

get_solenoids(end=None, start=None, path=None)[source]

Get all solenoid magnets between start and end

Parameters:
  • end (Optional[str]) – Name of the last element in the sequence

  • start (Optional[str]) – Name of the first element in the sequence

  • path (Optional[str]) – Name of the lattice path to use

Return type:

list[str]

Returns:

List of solenoid magnet names

get_vacuum_components(end=None, start=None, path=None)[source]

Get all vacuum components between start and end

Parameters:
  • end (Optional[str]) – Name of the last element in the sequence

  • start (Optional[str]) – Name of the first element in the sequence

  • path (Optional[str]) – Name of the lattice path to use

Return type:

list[str]

Returns:

List of vacuum component names

get_vertical_correctors(end=None, start=None, path=None)[source]

Get all vertical corrector magnets between start and end

Parameters:
  • end (Optional[str]) – Name of the last element in the sequence

  • start (Optional[str]) – Name of the first element in the sequence

  • path (Optional[str]) – Name of the lattice path to use

Return type:

list[str]

Returns:

List of vertical corrector magnet names

validate_element_list()
add_bool()[source]
chunks()[source]

Yield successive n-sized chunks from l.

dot(a, b)[source]
Return type:

float

flatten()[source]

Flatten a list of lists.

Module contents

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

Bases: MachineModel

LAURA Main Class

The main class for handling a full particle accelerator lattice.

Parameters:
  • args (Any)

  • kwargs (Any)

__all_elements(element_class=None, element_type=None)

Get a set of all elements of a given class and/or type

Parameters:
  • element_class (Union[str, list, None]) – Class of the element (e.g., ‘magnet’, ‘rf’, ‘diagnostic’)

  • element_type (Union[str, list, None]) – Type of the element (e.g., ‘quadrupole’, ‘dipole’, ‘BPM’)

Return type:

set

Returns:

Set of element names

__get_combined_corrector_sub_correctors(elem)

Split a Combined_Corrector into its sub-correctors

Parameters:

elem (str) – Name of the combined corrector element

Return type:

list[str]

Returns:

Names of sub-corrector elements (if they exist) or the original element name

_drift_length(start, end)[source]
Parameters:
  • start (list[float])

  • end (list[float])

property all_beam_position_monitors: set

Get all BPM devices in the machine :return: Set of all BPM names

property all_cameras: list

Get all camera devices in the machine :return: List of all camera device names

property all_charge_diagnostics: set

Get all charge diagnostics in the machine :return: Set of all charge diagnostic names

property all_combined_correctors: set

Get all combined corrector magnets in the machine :return: Set of all combined corrector magnet names

property all_correctors: set

Get all corrector magnets in the machine :return: Set of all corrector magnet names

property all_diagnostics: set

Get all diagnostic devices in the machine :return: Set of all diagnostic device names

property all_dipoles: set

Get all dipole magnets in the machine :return: Set of all dipole magnet names

property all_elements: set

Get all elements in the machine :return: Set of all element names

property all_horizontal_correctors: set

Get all horizontal corrector magnets in the machine :return: Set of all horizontal corrector magnet names

property all_magnets: set

Get all magnets in the machine :return: Set of all magnet names

property all_position_diagnostics: set

Get all position diagnostic devices in the machine :return: Set of all position diagnostic device names

property all_quadrupoles: set

Get all quadrupole magnets in the machine :return: Set of all quadrupole magnet names

property all_rf_cavities: set

Get all rf cavities in the machine :return: Set of all cavity names

property all_screens_and_cameras: Dict

Get all screens with their associated cameras in the machine :return: Dict of all screens with camera names

property all_separate_magnets: set

Get all separate magnets in the machine :return: Set of all separate magnet names

property all_sextupoles: set

Get all sextupole magnets in the machine :return: Set of all sextupole magnet names

property all_shutters: set

Get all shutter elements in the machine :return: Set of all shutter element names

property all_solenoids: set

Get all solenoid magnets in the machine :return: Set of all solenoid magnet names

property all_vacuum_components: set

Get all vacuum components in the machine :return: Set of all vacuum component names

property all_vertical_correctors: set

Get all vertical corrector magnets in the machine :return: Set of all vertical corrector magnet names

createDrifts(end=None, start=None, path=None)[source]

Insert drifts into a sequence of ‘elements’

Parameters:
  • end (Optional[str]) – Name of the last element in the sequence

  • start (Optional[str]) – Name of the first element in the sequence

  • path (Optional[str]) – Name of the lattice path to use

Return type:

Dict

Returns:

Dictionary of elements with drifts inserted

element_list: Union[str, List[baseElement]]

List containing all elements in the machine model, either as a path to a YAML file/directory or as a list of element objects.

exclude_keys: Optional[List[str]] = None

List of top-level keys to exclude when reading YAML files

get_beam_position_monitors(end=None, start=None, path=None)[source]

Get all BPM devices between start and end

Parameters:
  • end (Optional[str]) – Name of the last element in the sequence

  • start (Optional[str]) – Name of the first element in the sequence

  • path (Optional[str]) – Name of the lattice path to use

Return type:

list[str]

Returns:

List of BPM devices names

get_cameras(end=None, start=None, path=None)[source]

Get all camera devices between start and end

Parameters:
  • end (Optional[str]) – Name of the last element in the sequence

  • start (Optional[str]) – Name of the first element in the sequence

  • path (Optional[str]) – Name of the lattice path to use

Return type:

list[str]

Returns:

List of camera devices names

get_charge_diagnostics(end=None, start=None, path=None)[source]

Get all charge diagnostic devices between start and end

Parameters:
  • end (Optional[str]) – Name of the last element in the sequence

  • start (Optional[str]) – Name of the first element in the sequence

  • path (Optional[str]) – Name of the lattice path to use

Return type:

list[str]

Returns:

List of charge diagnostic devices names

get_combined_correctors(end=None, start=None, path=None)[source]

Get all combined corrector magnets between start and end

Parameters:
  • end (Optional[str]) – Name of the last element in the sequence

  • start (Optional[str]) – Name of the first element in the sequence

  • path (Optional[str]) – Name of the lattice path to use

Return type:

list[str]

Returns:

List of combined corrector magnet names

get_correctors(end=None, start=None, path=None)[source]

Get all corrector magnets between start and end

Parameters:
  • end (Optional[str]) – Name of the last element in the sequence

  • start (Optional[str]) – Name of the first element in the sequence

  • path (Optional[str]) – Name of the lattice path to use

Return type:

list[str]

Returns:

List of corrector magnet names

get_diagnostics(end=None, start=None, path=None)[source]

Get all diagnostic devices between start and end

Parameters:
  • end (Optional[str]) – Name of the last element in the sequence

  • start (Optional[str]) – Name of the first element in the sequence

  • path (Optional[str]) – Name of the lattice path to use

Return type:

list[str]

Returns:

List of diagnostic devices names

get_dipoles(end=None, start=None, path=None)[source]

Get all dipole magnets between start and end

Parameters:
  • end (Optional[str]) – Name of the last element in the sequence

  • start (Optional[str]) – Name of the first element in the sequence

  • path (Optional[str]) – Name of the lattice path to use

Return type:

list[str]

Returns:

List of dipole magnet names

get_elements(end=None, start=None, path=None)[source]

Get all elements between start and end

Parameters:
  • end (Optional[str]) – Name of the last element in the sequence

  • start (Optional[str]) – Name of the first element in the sequence

  • path (Optional[str]) – Name of the lattice path to use

Return type:

list[str]

Returns:

List of element names

get_elements_s_pos(end=None, start=None, path=None)[source]

Get s positions of all elements between start and end

Parameters:
  • end (Optional[str]) – Name of the last element in the sequence

  • start (Optional[str]) – Name of the first element in the sequence

  • path (Optional[str]) – Name of the lattice path to use

Return type:

Dict[str, float]

Returns:

Dictionary of element names and their s positions

get_horizontal_correctors(end=None, start=None, path=None)[source]

Get all horizontal corrector magnets between start and end

Parameters:
  • end (Optional[str]) – Name of the last element in the sequence

  • start (Optional[str]) – Name of the first element in the sequence

  • path (Optional[str]) – Name of the lattice path to use

Return type:

list[str]

Returns:

List of horizontal corrector magnet names

get_lattice_correctors(end=None, start=None, path=None)[source]

Get all corrector magnets between start and end

Parameters:
  • end (Optional[str]) – Name of the last element in the sequence

  • start (Optional[str]) – Name of the first element in the sequence

  • path (Optional[str]) – Name of the lattice path to use

Return type:

list[str]

Returns:

List of corrector magnet names

get_magnets(end=None, start=None, path=None)[source]

Get all magnets between start and end

Parameters:
  • end (Optional[str]) – Name of the last element in the sequence

  • start (Optional[str]) – Name of the first element in the sequence

  • path (Optional[str]) – Name of the lattice path to use

Return type:

list[str]

Returns:

List of magnet names

get_position_diagnostics(end=None, start=None, path=None)[source]

Get all position diagnostic devices between start and end

Parameters:
  • end (Optional[str]) – Name of the last element in the sequence

  • start (Optional[str]) – Name of the first element in the sequence

  • path (Optional[str]) – Name of the lattice path to use

Return type:

list[str]

Returns:

List of position diagnostic devices names

get_quadrupoles(end=None, start=None, path=None)[source]

Get all quadrupole magnets between start and end

Parameters:
  • end (Optional[str]) – Name of the last element in the sequence

  • start (Optional[str]) – Name of the first element in the sequence

  • path (Optional[str]) – Name of the lattice path to use

Return type:

list[str]

Returns:

List of quadrupole magnet names

get_rf_cavities(end=None, start=None, path=None)[source]

Get all RF cavities between start and end

Parameters:
  • end (Optional[str]) – Name of the last element in the sequence

  • start (Optional[str]) – Name of the first element in the sequence

  • path (Optional[str]) – Name of the lattice path to use

Return type:

list[str]

Returns:

List of RF cavity names

get_screens_and_cameras(end=None, start=None, path=None)[source]

Get all screen devices with their associated cameras between start and end

Parameters:
  • end (Optional[str]) – Name of the last element in the sequence

  • start (Optional[str]) – Name of the first element in the sequence

  • path (Optional[str]) – Name of the lattice path to use

Return type:

Dict[str, str]

Returns:

Dict of screens with camera names

get_separate_magnets(end=None, start=None, path=None)[source]

Get all magnet between start and end and separate combined correctors into their sub-correctors

Parameters:
  • end (Optional[str]) – Name of the last element in the sequence

  • start (Optional[str]) – Name of the first element in the sequence

  • path (Optional[str]) – Name of the lattice path to use

Return type:

list[str]

Returns:

List of magnet names

get_sextupoles(end=None, start=None, path=None)[source]

Get all sectupole magnets between start and end

Parameters:
  • end (Optional[str]) – Name of the last element in the sequence

  • start (Optional[str]) – Name of the first element in the sequence

  • path (Optional[str]) – Name of the lattice path to use

Return type:

list[str]

Returns:

List of sectupole magnet names

get_shutters(end=None, start=None, path=None)[source]

Get all shutter devices between start and end

Parameters:
  • end (Optional[str]) – Name of the last element in the sequence

  • start (Optional[str]) – Name of the first element in the sequence

  • path (Optional[str]) – Name of the lattice path to use

Return type:

list[str]

Returns:

List of shutter devices names

get_solenoids(end=None, start=None, path=None)[source]

Get all solenoid magnets between start and end

Parameters:
  • end (Optional[str]) – Name of the last element in the sequence

  • start (Optional[str]) – Name of the first element in the sequence

  • path (Optional[str]) – Name of the lattice path to use

Return type:

list[str]

Returns:

List of solenoid magnet names

get_vacuum_components(end=None, start=None, path=None)[source]

Get all vacuum components between start and end

Parameters:
  • end (Optional[str]) – Name of the last element in the sequence

  • start (Optional[str]) – Name of the first element in the sequence

  • path (Optional[str]) – Name of the lattice path to use

Return type:

list[str]

Returns:

List of vacuum component names

get_vertical_correctors(end=None, start=None, path=None)[source]

Get all vertical corrector magnets between start and end

Parameters:
  • end (Optional[str]) – Name of the last element in the sequence

  • start (Optional[str]) – Name of the first element in the sequence

  • path (Optional[str]) – Name of the lattice path to use

Return type:

list[str]

Returns:

List of vertical corrector magnet names

validate_element_list()