diff --git a/mx_bec/devices/beam_profile.py b/mx_bec/devices/beam_profile.py index ead1ae8..05dabcc 100644 --- a/mx_bec/devices/beam_profile.py +++ b/mx_bec/devices/beam_profile.py @@ -1,5 +1,6 @@ """A device for determining beam shape and location from sample camera image analysis.""" +from abc import ABC, abstractmethod from typing import Literal from ophyd import Component as Cpt @@ -7,7 +8,22 @@ from ophyd import EpicsSignal, EpicsSignalRO, Kind from ophyd_devices.interfaces.base_classes.psi_device_base import PSIDeviceBase -class BeamProfile(PSIDeviceBase): +class BeamProfile(PSIDeviceBase, ABC): + """Common interface for different methods of getting beam location and size""" + + # Readback + x_pos_px = Cpt[EpicsSignalRO] + y_pos_px = Cpt[EpicsSignalRO] + x_sig_px = Cpt[EpicsSignalRO] + y_sig_px = Cpt[EpicsSignalRO] + + @abstractmethod + def enable_computation(self): ... + @abstractmethod + def disable_computation(self): ... + + +class GaussianBeamProfile(BeamProfile): """Use image analysis of the scintillator to determine the beam centre and width on the sample camera image and convert it to physical units, by fitting a Gaussian to the image profile. The analysis is provided by AD plugins in EPICS, we merely configure it and read the results.""" @@ -38,3 +54,6 @@ class BeamProfile(PSIDeviceBase): st2 = self.x_compute.set(enabled) st3 = self.y_compute.set(enabled) return st1 and st2 and st3 + + +class ThresholdBeamProfile(BeamProfile): ... diff --git a/mx_bec/devices/beam_steering.py b/mx_bec/devices/beam_steering.py index 5eb1aa7..68cb600 100644 --- a/mx_bec/devices/beam_steering.py +++ b/mx_bec/devices/beam_steering.py @@ -9,6 +9,7 @@ from ophyd import Component as Cpt from ophyd import Kind, Signal from ophyd_devices import EpicsMotorEC from ophyd_devices.interfaces.base_classes.psi_device_base import PSIDeviceBase +from ophyd_devices.utils.psi_device_base_utils import MoveStatus, Status from mx_bec.devices.beam_profile import BeamProfile @@ -89,7 +90,7 @@ class BeamSteerer(PSIDeviceBase): return x_status if y_status is not None: return y_status - return None + return Status(done=True) def trigger(self): """External interface for 'step_towards_centre'"""