dodal.devices.apple2_undulator.Apple2Controller#
- class dodal.devices.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
- energy_to_motor#
Callable that converts energy and polarisation to motor positions.
- Type:
- Abstract Methods
- ----------------
- _set_motors_from_energy(value
Abstract method to set motor positions for a given energy and polarisation.
- Type:
float) -> None
- energy_to_motor#
A callable that converts energy and polarisation to motor positions.
- Type:
Notes
Subclasses must implement
_set_motors_from_energy
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)
energy_to_motor_converter (
EnergyMotorConvertor
)name (str)
apple2 – An Apple2 device.
name – Name of the device.
energy_to_motor_converter
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.)