pyaml.arrays.cfm_magnet_array#

Combined function magnet array module.

This module provides combined function magnet array functionality.

Classes

CombinedFunctionMagnetArray(arrayName, magnets)

Class that implements access to a combined function magnet array

RWMagnetHardwares(name, magnets)

Array accessor for the hardware values of combined-function magnets.

RWMagnetStrengths(name, magnets)

Array accessor for the multipole strengths of combined-function magnets.

class pyaml.arrays.cfm_magnet_array.CombinedFunctionMagnetArray(arrayName, magnets, use_aggregator=False)#

Bases: ElementArray

Class that implements access to a combined function magnet array

Parameters:
  • arrayName (str) – Array name

  • magnets (list[CombinedFunctionMagnet]) – Magnet 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 parallel access to underlying devices.

Attributes

strengths

Give access to strength of each magnet of this array

hardwares

Give access to hardware value of each magnet of this array

property hardwares: RWMagnetHardwares#

Give access to hardware value of each magnet of this array

property strengths: RWMagnetStrengths#

Give access to strength of each magnet of this array

class pyaml.arrays.cfm_magnet_array.RWMagnetHardwares(name, magnets)#

Bases: ReadWriteFloatArray

Array accessor for the hardware values of combined-function magnets.

Parameters:
  • name (str) – Name of the array, used when the accessor is reported or logged.

  • magnets (list[CombinedFunctionMagnet]) – Combined-function magnets making up the array; each contributes one entry per multipole.

Methods

get()

Return the hardware value of every multipole, concatenated over the magnets.

set()

Set the hardware value of every multipole, concatenated over the magnets.

set_and_wait()

Set every hardware value and wait for the readbacks to converge.

unit()

Return the hardware unit of every multipole.

get()#

Return the hardware value of every multipole, concatenated over the magnets.

set(value)#

Set the hardware value of every multipole, concatenated over the magnets.

Parameters:

value (np.array) – Hardware value of every multipole, concatenated magnet by magnet. A scalar is broadcast to all of them.

set_and_wait(value)#

Set every hardware value and wait for the readbacks to converge.

Parameters:

value (np.array) – Hardware value of every multipole, concatenated magnet by magnet. A scalar is broadcast to all of them.

Raises:

NotImplementedError – Waiting for readback convergence is not implemented for this accessor.

unit()#

Return the hardware unit of every multipole.

class pyaml.arrays.cfm_magnet_array.RWMagnetStrengths(name, magnets)#

Bases: ReadWriteFloatArray

Array accessor for the multipole strengths of combined-function magnets.

Parameters:
  • name (str) – Name of the array, used when the accessor is reported or logged.

  • magnets (list[CombinedFunctionMagnet]) – Combined-function magnets making up the array; each contributes one entry per multipole.

Methods

get()

Return the strength of every multipole, concatenated over the magnets.

set()

Set the strength of every multipole, concatenated over the magnets.

set_and_wait()

Set every multipole strength and wait for the readbacks to converge.

unit()

Return the strength unit of every multipole.

get()#

Return the strength of every multipole, concatenated over the magnets.

set(value)#

Set the strength of every multipole, concatenated over the magnets.

Parameters:

value (np.array) – Strength of every multipole, concatenated magnet by magnet. A scalar is broadcast to all of them.

set_and_wait(value)#

Set every multipole strength and wait for the readbacks to converge.

Parameters:

value (np.array) – Strength of every multipole, concatenated magnet by magnet. A scalar is broadcast to all of them.

Raises:

NotImplementedError – Waiting for readback convergence is not implemented for this accessor.

unit()#

Return the strength unit of every multipole.