pyaml.magnet.identity_cfm_model#

Identity conversion model for combined-function magnets.

This model provides direct per-multipole conversion without excitation-curve interpolation.

Classes

IdentityCFMagnetModel(multipoles[, ...])

Identity combined-function magnet model.

class pyaml.magnet.identity_cfm_model.IdentityCFMagnetModel(multipoles, powerconverters=None, physics=None, units=None)#

Bases: MagnetModel, DynamicValidation

Identity combined-function magnet model.

This magnet model maps strengths and hardware values directly to the underlying devices without applying any conversion. It is intended for cases where the physics values and hardware values are identical, so the model acts as an identity transform for all supported multipoles.

Parameters

multipoles : list[str] List of supported multipoles, for example [“B0”, “A1”, “B2”]. powerconverters : list[str | None] | None, optional Names of the power converter devices used for hardware access. physics : list[str | None] | None, optional Names of the physics devices used for strength access. units : list[str] | None, optional List of units for the supported multipoles.

Raises

PyAMLException If both physics and powerconverters are missing, if both are provided at the same time, or if the configuration lengths do not match.

Parameters:
  • multipoles (list[str]) – List of supported multipoles, for example [“B0”, “A1”, “B2”].

  • powerconverters (list[str | None] | None) – Names of the power converter devices used for hardware access.

  • physics (list[str | None] | None) – Names of the physics devices used for strength access.

  • units (list[str] | None) – List of units for the supported multipoles.

Methods

compute_hardware_values()

Convert magnet strengths to hardware values.

compute_strengths()

Convert hardware values to magnet strengths.

get_strength_units()

Return the units of magnet strengths.

get_hardware_units()

Return the units of hardware values.

get_device_names()

Return the associated device names.

set_magnet_rigidity()

Set the magnetic rigidity used for conversion.

has_physics()

Return whether the model provides physics strengths.

has_hardware()

Return whether the model provides hardware values.

Configuration

type: pyaml.magnet.identity_cfm_model
multipoles: [B2, B0, A0]
units: [1/m**2, rad, rad]
physics:
  - DEVICE/SEXTUPOLE_STRENGTH
  - DEVICE/HORIZONTAL_KICK
  - DEVICE/VERTICAL_KICK
compute_hardware_values(strengths)#

Convert magnet strengths to hardware values.

Parameters:

strengths (np.array) – Strength of each magnet function, ordered as declared by the model.

Returns:

np.array – Hardware value of each power converter, ordered as declared by the model.

Return type:

array

compute_strengths(currents)#

Convert hardware values to magnet strengths.

Parameters:

currents (np.array) – Hardware value of each power converter, ordered as declared by the model.

Returns:

np.array – Strength of each magnet function, ordered as declared by the model.

Return type:

array

get_device_names()#

Return the associated device names.

get_hardware_units()#

Return the units of hardware values.

get_strength_units()#

Return the units of magnet strengths.

has_hardware()#

Return whether the model provides hardware values.

has_physics()#

Return whether the model provides physics strengths.

set_magnet_rigidity(brho)#

Set the magnetic rigidity used for conversion.

Parameters:

brho (np.double) – Magnetic rigidity in tesla metres. Ignored: an identity model applies no rigidity scaling.