bpm_array#

class BPMArray(arrayName, bpms, use_aggregator=True)[source]#

Bases: ElementArray

Class that implements access to a BPM array.

Parameters:
  • arrayName (str) – Array name

  • bpms (list[pyaml.bpm.bpm.BPM]) – BPM list, all elements must be attached to the same instance of either a (Simulator or a ControlSystem).

  • use_aggregator (bool) – Use aggregator to increase performance by using paralell access to underlying devices.

Example

An array can be retrieved from the configuration as in the following example:

>>> sr = Accelerator.load("acc.yaml") # Load the accelerator
>>> bpms = sr.design.get_bpms("BPM")  # Retrieve BPM array
>>> orbit = bpms.positions.get()      # Get the orbit

or can be created by code using pyaml.arrays.bpm.BPM.

property h: RWBPMSinglePosition#

Returns horizontal position of each bpm of this array

property positions: RWBPMPosition#

Returns position of each bpm of this array

property v: RWBPMSinglePosition#

Returns vertical position of each bpm of this array

class RWBPMPosition(name, bpms)[source]#

Bases: ReadFloatArray

Read/write access to BPM positions (horizontal and vertical).

This class provides access to both horizontal and vertical positions of a list of BPMs. It supports both individual access and aggregated access through a device access list for improved performance.

Parameters:
get()[source]#

Get BPM positions.

Returns:

np.array – Array of shape (n_bpms, 2) containing horizontal and vertical positions for each BPM

set_aggregator(agg)[source]#

Set the device access list aggregator for improved performance.

Parameters:

agg (DeviceAccessList) – Device access list for aggregated reads

unit()[source]#

Get the units for BPM positions.

Returns:

list[str] – List of unit strings for each BPM

class RWBPMSinglePosition(name, bpms, idx)[source]#

Bases: ReadFloatArray

Read/write access to single axis BPM positions.

This class provides access to either horizontal or vertical positions of a list of BPMs. It supports both individual access and aggregated access through a device access list for improved performance.

Parameters:
  • name (str) – Name of the position accessor

  • bpms (list[pyaml.bpm.bpm.BPM]) – List of BPM objects to access

  • idx (int) – Index for the position axis (0 for horizontal, 1 for vertical)

get()[source]#

Get single axis BPM positions.

Returns:

np.array – Array of positions for the specified axis (horizontal or vertical)

set_aggregator(agg)[source]#

Set the device access list aggregator for improved performance.

Parameters:

agg (DeviceAccessList) – Device access list for aggregated reads

unit()[source]#

Get the units for BPM positions.

Returns:

list[str] – List of unit strings for each BPM