From e97910d080346aba6bd2a0c9dc9ef52fe942b088 Mon Sep 17 00:00:00 2001 From: "Ware, Joseph (DLSLtd,RAL,LSCI)" Date: Mon, 22 Apr 2024 16:37:49 +0100 Subject: [PATCH] Add saxs and waxs Pilatus detectors to i22 beamline - Adds DLS standard constructor for ophyd-async Pilatus implementation --- src/dodal/beamlines/i22.py | 29 +++++++++++++++++++++++ src/dodal/devices/areadetector/pilatus.py | 13 ++++++++++ 2 files changed, 42 insertions(+) create mode 100644 src/dodal/devices/areadetector/pilatus.py diff --git a/src/dodal/beamlines/i22.py b/src/dodal/beamlines/i22.py index ed669446e4..bd2f3a9d95 100644 --- a/src/dodal/beamlines/i22.py +++ b/src/dodal/beamlines/i22.py @@ -1,5 +1,8 @@ +from ophyd_async.epics.areadetector import PilatusDetector + from dodal.beamlines.beamline_utils import device_instantiation, get_directory_provider from dodal.beamlines.beamline_utils import set_beamline as set_utils_beamline +from dodal.devices.areadetector.pilatus import DLSPilatus from dodal.devices.tetramm import TetrammDetector from dodal.log import set_beamline as set_log_beamline from dodal.utils import get_beamline_name @@ -35,3 +38,29 @@ def it( fake_with_ophyd_sim, directory_provider=get_directory_provider(), ) + + +def saxs( + wait_for_connection: bool = True, fake_with_ophyd_sim: bool = False +) -> PilatusDetector: + return device_instantiation( + DLSPilatus, + "saxs", + "-EA-PILAT-01:", + wait_for_connection, + fake_with_ophyd_sim, + directory_provider=get_directory_provider(), + ) + + +def waxs( + wait_for_connection: bool = True, fake_with_ophyd_sim: bool = False +) -> PilatusDetector: + return device_instantiation( + DLSPilatus, + "waxs", + "-EA-PILAT-03:", + wait_for_connection, + fake_with_ophyd_sim, + directory_provider=get_directory_provider(), + ) diff --git a/src/dodal/devices/areadetector/pilatus.py b/src/dodal/devices/areadetector/pilatus.py new file mode 100644 index 0000000000..3bf81563a0 --- /dev/null +++ b/src/dodal/devices/areadetector/pilatus.py @@ -0,0 +1,13 @@ +from ophyd_async.core import DirectoryProvider +from ophyd_async.epics.areadetector import PilatusDetector +from ophyd_async.epics.areadetector.drivers import PilatusDriver +from ophyd_async.epics.areadetector.writers import NDFileHDF + + +def DLSPilatus(prefix: str, name: str, directory_provider: DirectoryProvider) -> PilatusDetector: + return PilatusDetector( + name=name, + directory_provider=directory_provider, + driver=PilatusDriver(prefix + "DRV:"), + hdf=NDFileHDF(prefix + "HDF:"), + )