Skip to content

Commit d8cb85e

Browse files
committed
Add beamsize devices to device factories
1 parent aeb7256 commit d8cb85e

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

src/dodal/beamlines/i03.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
from dodal.devices.focusing_mirror import FocusingMirrorWithStripes, MirrorVoltages
3232
from dodal.devices.hutch_shutter import HutchShutter
3333
from dodal.devices.i03 import Beamstop
34+
from dodal.devices.i03.beamsize import Beamsize
3435
from dodal.devices.i03.dcm import DCM
3536
from dodal.devices.i03.undulator_dcm import UndulatorDCM
3637
from dodal.devices.motors import XYZStage
@@ -456,3 +457,13 @@ def collimation_table() -> CollimationTable:
456457
If this is called when already instantiated in i03, it will return the existing object.
457458
"""
458459
return CollimationTable(prefix=f"{PREFIX.beamline_prefix}-MO-TABLE-01")
460+
461+
462+
@device_factory()
463+
def beamsize() -> Beamsize:
464+
"""Get the i03 beamstop device, instantiate it if it hasn't already been.
465+
If this is called when already instantiated in i03, it will return the existing object.
466+
"""
467+
return Beamsize(
468+
aperture_scatterguard=aperture_scatterguard(),
469+
)

src/dodal/beamlines/i04.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
from dodal.devices.fast_grid_scan import ZebraFastGridScanThreeD
2121
from dodal.devices.flux import Flux
2222
from dodal.devices.i03.dcm import DCM
23+
from dodal.devices.i04.beamsize import Beamsize
2324
from dodal.devices.i04.constants import RedisConstants
2425
from dodal.devices.i04.murko_results import MurkoResultsDevice
2526
from dodal.devices.i04.transfocator import Transfocator
@@ -377,3 +378,14 @@ def scintillator() -> Scintillator:
377378
Reference(aperture_scatterguard()),
378379
get_beamline_parameters(),
379380
)
381+
382+
383+
@device_factory()
384+
def beamsize() -> Beamsize:
385+
"""Get the i03 beamstop device, instantiate it if it hasn't already been.
386+
If this is called when already instantiated in i03, it will return the existing object.
387+
"""
388+
return Beamsize(
389+
transfocator=transfocator(),
390+
aperture_scatterguard=aperture_scatterguard(),
391+
)

0 commit comments

Comments
 (0)