dodal.devices.insertion_device.apple2_undulator.Apple2Controller#

class dodal.devices.insertion_device.apple2_undulator.Apple2Controller[source]#

Abstract base class for controlling an Apple2 undulator device.

This class manages the undulator’s gap and phase motors, and provides an interface for controlling polarisation and energy settings. It exposes derived signals for energy and polarisation, and handles conversion between energy/polarisation and motor positions via a user-supplied conversion callable.

apple2#

Reference to the Apple2 device containing gap and phase motors.

Type:

Reference[Apple2Type]

energy#

Derived signal for moving and reading back energy.

Type:

derived_signal_rw

polarisation_setpoint#

Soft signal for the polarisation setpoint.

Type:

SignalR

polarisation#

Hardware-backed signal for polarisation readback and control.

Type:

derived_signal_rw

gap_energy_to_motor_converter#

Callable that converts energy and polarisation to gap motor positions.

Type:

EnergyMotorConvertor

phase_energy_to_motor_converter#

Callable that converts energy and polarisation to phase motor positions.

Type:

EnergyMotorConvertor

Abstract Methods
----------------
_get_apple2_value(gap

Abstract method to return the Apple2Val used to set the apple2 with.

Type:

float, phase: float) -> Apple2Val

Notes

  • Subclasses must implement _get_apple2_value for beamline-specific logic.

  • LH3 polarisation is indistinguishable from LH in hardware; special handling is provided.

  • Supports multiple polarisation modes, including linear horizontal (LH), linear vertical (LV), positive circular (PC), negative circular (NC), and linear arbitrary (LA).

Parameters:
  • apple2 (Apple2)

  • gap_energy_motor_converter (EnergyMotorConvertor)

  • phase_energy_motor_converter (EnergyMotorConvertor)

  • units (str, default: 'eV')

  • name (str)

  • apple2 – An Apple2 device.

  • name – Name of the device.

  • gap_energy_motor_converter

  • phase_energy_motor_converter

  • units

Methods

determine_phase_from_hardware(top_outer, ...)

Determine polarisation and phase value using motor position patterns.

Attributes

determine_phase_from_hardware(top_outer: float, top_inner: float, btm_inner: float, btm_outer: float, gap: float) tuple[Pol, float][source]#

Determine polarisation and phase value using motor position patterns. However there is no way to return lh3 polarisation or higher harmonic setting. (May be for future one can use the inverse poly to work out the energy and try to match it with the current energy to workout the polarisation but during my test the inverse poly is too unstable for general use.)

Parameters:
Return type:

tuple[Pol, float]