serialized_magnet#

class ConfigModel(*, name, description=None, lattice_names=None, function, elements, model=None)[source]#

Bases: ElementConfigModel

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

elements: list[str] | str#

List of magnets

function: str#

List of magnets

model: MagnetModel | None#

Object in charge of converting magnet strengths to currents

class ReadWriteSerializedHardwares(cfg, elements)[source]#

Bases: ReadWriteSerializedStrengths

set_magnet_rigidity(brho)[source]#
unit()[source]#

Get the unit of the value

class ReadWriteSerializedStrengths(cfg, elements)[source]#

Bases: ReadWriteFloatScalar

get()[source]#

Get the value

get_elements()[source]#
get_model()[source]#
set(value)[source]#

Set the value

set_and_wait(value)[source]#

Set the value and wait that setpoint is reached

set_magnet_rigidity(brho)[source]#
unit()[source]#

Get the unit of the value

class SerializedMagnets(cfg, peer=None)[source]#

Bases: Element

Class managing serialized magnets: a set of magnet with the same set point. The set point is usually managed by only one power supply but it can be covered by several ones. If several power supplies

Parameters:

cfg (ConfigModel) – Configuration object TODO: to describe

Raises:

pyaml.PyAMLException – In case of wrong initialization

attach(peer, strengths, hardwares)[source]#
get_devices()[source]#
get_magnets()[source]#
get_nb_magnets()[source]#
set_energy(energy)[source]#

Set the instrument energy on this element

property hardware: ReadWriteFloatScalar#

Gives access to the strengths of this those magnets in hardware unit when possible

property strength: ReadWriteFloatScalar#

Gives access to the strengths of those magnets in physics unit