dls-dodal 1.38.0__py3-none-any.whl → 1.40.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. {dls_dodal-1.38.0.dist-info → dls_dodal-1.40.0.dist-info}/METADATA +2 -2
  2. {dls_dodal-1.38.0.dist-info → dls_dodal-1.40.0.dist-info}/RECORD +49 -40
  3. dodal/_version.py +2 -2
  4. dodal/beamlines/__init__.py +2 -0
  5. dodal/beamlines/adsim.py +3 -2
  6. dodal/beamlines/b01_1.py +3 -3
  7. dodal/beamlines/i03.py +144 -285
  8. dodal/beamlines/i04.py +112 -198
  9. dodal/beamlines/i13_1.py +5 -4
  10. dodal/beamlines/i18.py +124 -0
  11. dodal/beamlines/i19_1.py +74 -0
  12. dodal/beamlines/i19_2.py +61 -0
  13. dodal/beamlines/i20_1.py +37 -22
  14. dodal/beamlines/i22.py +7 -7
  15. dodal/beamlines/i24.py +100 -145
  16. dodal/beamlines/p38.py +12 -8
  17. dodal/beamlines/p45.py +5 -4
  18. dodal/beamlines/training_rig.py +4 -4
  19. dodal/common/beamlines/beamline_utils.py +2 -3
  20. dodal/common/beamlines/device_helpers.py +3 -1
  21. dodal/devices/aperturescatterguard.py +150 -64
  22. dodal/devices/apple2_undulator.py +86 -113
  23. dodal/devices/eiger.py +24 -14
  24. dodal/devices/fast_grid_scan.py +29 -20
  25. dodal/devices/hutch_shutter.py +25 -12
  26. dodal/devices/i04/transfocator.py +22 -29
  27. dodal/devices/i10/rasor/rasor_scaler_cards.py +4 -4
  28. dodal/devices/i13_1/merlin.py +4 -3
  29. dodal/devices/i13_1/merlin_controller.py +2 -7
  30. dodal/devices/i18/KBMirror.py +19 -0
  31. dodal/devices/i18/diode.py +17 -0
  32. dodal/devices/i18/table.py +14 -0
  33. dodal/devices/i18/thor_labs_stage.py +12 -0
  34. dodal/devices/i19/__init__.py +0 -0
  35. dodal/devices/i19/shutter.py +57 -0
  36. dodal/devices/i22/nxsas.py +4 -4
  37. dodal/devices/motors.py +2 -2
  38. dodal/devices/oav/oav_detector.py +10 -19
  39. dodal/devices/pressure_jump_cell.py +33 -16
  40. dodal/devices/robot.py +30 -11
  41. dodal/devices/tetramm.py +8 -3
  42. dodal/devices/turbo_slit.py +7 -6
  43. dodal/devices/zocalo/zocalo_results.py +21 -4
  44. dodal/plans/save_panda.py +30 -14
  45. dodal/utils.py +54 -15
  46. {dls_dodal-1.38.0.dist-info → dls_dodal-1.40.0.dist-info}/LICENSE +0 -0
  47. {dls_dodal-1.38.0.dist-info → dls_dodal-1.40.0.dist-info}/WHEEL +0 -0
  48. {dls_dodal-1.38.0.dist-info → dls_dodal-1.40.0.dist-info}/entry_points.txt +0 -0
  49. {dls_dodal-1.38.0.dist-info → dls_dodal-1.40.0.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,74 @@
1
+ from dodal.common.beamlines.beamline_utils import (
2
+ device_factory,
3
+ )
4
+ from dodal.common.beamlines.beamline_utils import (
5
+ set_beamline as set_utils_beamline,
6
+ )
7
+ from dodal.devices.i19.shutter import HutchConditionalShutter, HutchState
8
+ from dodal.devices.oav.oav_detector import OAV
9
+ from dodal.devices.oav.oav_parameters import OAVConfig
10
+ from dodal.devices.synchrotron import Synchrotron
11
+ from dodal.devices.zebra.zebra import Zebra
12
+ from dodal.devices.zebra.zebra_constants_mapping import (
13
+ ZebraMapping,
14
+ ZebraSources,
15
+ ZebraTTLOutputs,
16
+ )
17
+ from dodal.log import set_beamline as set_log_beamline
18
+ from dodal.utils import BeamlinePrefix, get_beamline_name
19
+
20
+ # NOTE All PVs for both hutches and the optics have the prefix BL19I
21
+ BL = get_beamline_name("i19_1")
22
+ PREFIX = BeamlinePrefix("i19", "I")
23
+ set_log_beamline(BL)
24
+ set_utils_beamline(BL)
25
+
26
+
27
+ I19_1_ZEBRA_MAPPING = ZebraMapping(
28
+ outputs=ZebraTTLOutputs(TTL_PILATUS=1),
29
+ sources=ZebraSources(),
30
+ )
31
+
32
+ ZOOM_PARAMS_FILE = (
33
+ "/dls_sw/i19-1/software/gda_versions/gda/config/xml/jCameraManZoomLevels.xml"
34
+ )
35
+ DISPLAY_CONFIG = "/dls_sw/i19-1/software/daq_configuration/domain/display.configuration"
36
+
37
+
38
+ @device_factory()
39
+ def oav() -> OAV:
40
+ return OAV(
41
+ prefix=f"{PREFIX.beamline_prefix}-DI-OAV-01:",
42
+ config=OAVConfig(ZOOM_PARAMS_FILE, DISPLAY_CONFIG),
43
+ )
44
+
45
+
46
+ @device_factory()
47
+ def zebra() -> Zebra:
48
+ """Get the i19-1 zebra device, instantiate it if it hasn't already been.
49
+ If this is called when already instantiated in i19-1, it will return the existing object.
50
+ """
51
+ return Zebra(
52
+ mapping=I19_1_ZEBRA_MAPPING,
53
+ name="zebra",
54
+ prefix=f"{PREFIX.beamline_prefix}-EA-ZEBRA-03:",
55
+ )
56
+
57
+
58
+ @device_factory()
59
+ def shutter() -> HutchConditionalShutter:
60
+ """Get the i19-2 hutch shutter device, instantiate it if it hasn't already been.
61
+ If this is called when already instantiated, it will return the existing object.
62
+ """
63
+ return HutchConditionalShutter(
64
+ prefix=f"{PREFIX.beamline_prefix}-PS-SHTR-01:",
65
+ hutch=HutchState.EH1,
66
+ )
67
+
68
+
69
+ @device_factory()
70
+ def synchrotron() -> Synchrotron:
71
+ """Get the i19-1 synchrotron device, instantiate it if it hasn't already been.
72
+ If this is called when already instantiated in i19-1, it will return the existing object.
73
+ """
74
+ return Synchrotron()
@@ -0,0 +1,61 @@
1
+ from dodal.common.beamlines.beamline_utils import (
2
+ device_factory,
3
+ )
4
+ from dodal.common.beamlines.beamline_utils import (
5
+ set_beamline as set_utils_beamline,
6
+ )
7
+ from dodal.devices.i19.shutter import HutchConditionalShutter, HutchState
8
+ from dodal.devices.synchrotron import Synchrotron
9
+ from dodal.devices.zebra.zebra import Zebra
10
+ from dodal.devices.zebra.zebra_constants_mapping import (
11
+ ZebraMapping,
12
+ ZebraSources,
13
+ ZebraTTLOutputs,
14
+ )
15
+ from dodal.log import set_beamline as set_log_beamline
16
+ from dodal.utils import BeamlinePrefix
17
+
18
+ # NOTE all workstations on I19 default to i19-1 as beamline name
19
+ # Unless variable is exported (which is not usually done by scientists)
20
+ # NOTE All PVs for both hutches and the optics have the prefix BL19I
21
+ BL = "i19-2"
22
+ PREFIX = BeamlinePrefix("i19", "I")
23
+ set_log_beamline(BL)
24
+ set_utils_beamline(BL)
25
+
26
+
27
+ I19_2_ZEBRA_MAPPING = ZebraMapping(
28
+ outputs=ZebraTTLOutputs(),
29
+ sources=ZebraSources(),
30
+ )
31
+
32
+
33
+ @device_factory()
34
+ def zebra() -> Zebra:
35
+ """Get the i19-2 zebra device, instantiate it if it hasn't already been.
36
+ If this is called when already instantiated in i19-2, it will return the existing object.
37
+ """
38
+ return Zebra(
39
+ mapping=I19_2_ZEBRA_MAPPING,
40
+ name="zebra",
41
+ prefix=f"{PREFIX.beamline_prefix}-EA-ZEBRA-01:",
42
+ )
43
+
44
+
45
+ @device_factory()
46
+ def shutter() -> HutchConditionalShutter:
47
+ """Get the i19-2 hutch shutter device, instantiate it if it hasn't already been.
48
+ If this is called when already instantiated, it will return the existing object.
49
+ """
50
+ return HutchConditionalShutter(
51
+ prefix=f"{PREFIX.beamline_prefix}-PS-SHTR-01:",
52
+ hutch=HutchState.EH2,
53
+ )
54
+
55
+
56
+ @device_factory()
57
+ def synchrotron() -> Synchrotron:
58
+ """Get the i19-2 synchrotron device, instantiate it if it hasn't already been.
59
+ If this is called when already instantiated in i19-2, it will return the existing object.
60
+ """
61
+ return Synchrotron()
dodal/beamlines/i20_1.py CHANGED
@@ -1,43 +1,58 @@
1
- from dodal.common.beamlines.beamline_utils import device_instantiation
1
+ from pathlib import Path
2
+
3
+ from dodal.common.beamlines.beamline_utils import (
4
+ device_factory,
5
+ set_path_provider,
6
+ )
2
7
  from dodal.common.beamlines.beamline_utils import set_beamline as set_utils_beamline
8
+ from dodal.common.visit import RemoteDirectoryServiceClient, StaticVisitPathProvider
9
+ from dodal.devices.synchrotron import Synchrotron
3
10
  from dodal.devices.turbo_slit import TurboSlit
4
11
  from dodal.devices.xspress3.xspress3 import Xspress3
5
12
  from dodal.log import set_beamline as set_log_beamline
6
- from dodal.utils import get_beamline_name
13
+ from dodal.utils import BeamlinePrefix, get_beamline_name
7
14
 
8
- BL = get_beamline_name("i20_1")
15
+ BL = get_beamline_name("i20-1")
16
+ PREFIX = BeamlinePrefix(BL, suffix="J")
9
17
  set_log_beamline(BL)
10
18
  set_utils_beamline(BL)
11
19
 
12
20
 
13
- def turbo_slit(
14
- wait_for_connection: bool = True, fake_with_ophyd_sim: bool = False
15
- ) -> TurboSlit:
21
+ # Currently we must hard-code the visit, determining the visit at runtime requires
22
+ # infrastructure that is still WIP.
23
+ # Communication with GDA is also WIP so for now we determine an arbitrary scan number
24
+ # locally and write the commissioning directory. The scan number is not guaranteed to
25
+ # be unique and the data is at risk - this configuration is for testing only.
26
+ set_path_provider(
27
+ StaticVisitPathProvider(
28
+ BL,
29
+ Path("/dls/i20-1/data/2023/cm33897-5/bluesky"),
30
+ client=RemoteDirectoryServiceClient("http://i20-1-control:8088/api"),
31
+ )
32
+ )
33
+
34
+
35
+ @device_factory()
36
+ def turbo_slit() -> TurboSlit:
16
37
  """
17
38
  turboslit for selecting energy from the polychromator
18
39
  """
19
40
 
20
- return device_instantiation(
21
- TurboSlit,
22
- prefix="-OP-PCHRO-01:TS:",
23
- name="turbo_slit",
24
- wait=wait_for_connection,
25
- fake=fake_with_ophyd_sim,
26
- )
41
+ return TurboSlit(f"{PREFIX.beamline_prefix}-OP-PCHRO-01:TS:")
27
42
 
28
43
 
29
- def xspress3(
30
- wait_for_connection: bool = True, fake_with_ophyd_sim: bool = False
31
- ) -> Xspress3:
44
+ @device_factory(skip=True)
45
+ def xspress3() -> Xspress3:
32
46
  """
33
47
  16 channels Xspress3 detector
34
48
  """
35
49
 
36
- return device_instantiation(
37
- Xspress3,
38
- prefix="-EA-DET-03:",
39
- name="Xspress3",
50
+ return Xspress3(
51
+ f"{PREFIX.beamline_prefix}-EA-DET-03:",
40
52
  num_channels=16,
41
- wait=wait_for_connection,
42
- fake=fake_with_ophyd_sim,
43
53
  )
54
+
55
+
56
+ @device_factory()
57
+ def synchrotron() -> Synchrotron:
58
+ return Synchrotron()
dodal/beamlines/i22.py CHANGED
@@ -10,7 +10,7 @@ from dodal.common.beamlines.beamline_utils import (
10
10
  set_path_provider,
11
11
  )
12
12
  from dodal.common.beamlines.beamline_utils import set_beamline as set_utils_beamline
13
- from dodal.common.beamlines.device_helpers import HDF5_PREFIX
13
+ from dodal.common.beamlines.device_helpers import CAM_SUFFIX, DET_SUFFIX, HDF5_SUFFIX
14
14
  from dodal.common.crystal_metadata import (
15
15
  MaterialsEnum,
16
16
  make_crystal_metadata_from_material,
@@ -63,8 +63,8 @@ def saxs() -> PilatusDetector:
63
63
  return NXSasPilatus(
64
64
  prefix=f"{PREFIX.beamline_prefix}-EA-PILAT-01:",
65
65
  path_provider=get_path_provider(),
66
- drv_suffix="CAM:",
67
- hdf_suffix=HDF5_PREFIX,
66
+ drv_suffix=CAM_SUFFIX,
67
+ fileio_suffix=HDF5_SUFFIX,
68
68
  metadata_holder=metadata_holder,
69
69
  )
70
70
 
@@ -88,8 +88,8 @@ def waxs() -> PilatusDetector:
88
88
  return NXSasPilatus(
89
89
  prefix=f"{PREFIX.beamline_prefix}-EA-PILAT-03:",
90
90
  path_provider=get_path_provider(),
91
- drv_suffix="CAM:",
92
- hdf_suffix=HDF5_PREFIX,
91
+ drv_suffix=CAM_SUFFIX,
92
+ fileio_suffix=HDF5_SUFFIX,
93
93
  metadata_holder=metadata_holder,
94
94
  )
95
95
 
@@ -248,8 +248,8 @@ def oav() -> AravisDetector:
248
248
  )
249
249
  return NXSasOAV(
250
250
  prefix=f"{PREFIX.beamline_prefix}-DI-OAV-01:",
251
- drv_suffix="DET:",
252
- hdf_suffix=HDF5_PREFIX,
251
+ drv_suffix=DET_SUFFIX,
252
+ fileio_suffix=HDF5_SUFFIX,
253
253
  path_provider=get_path_provider(),
254
254
  metadata_holder=metadata_holder,
255
255
  )
dodal/beamlines/i24.py CHANGED
@@ -1,8 +1,9 @@
1
- from dodal.common.beamlines.beamline_utils import BL, device_instantiation
1
+ from dodal.common.beamlines.beamline_utils import (
2
+ BL,
3
+ device_factory,
4
+ )
2
5
  from dodal.common.beamlines.beamline_utils import set_beamline as set_utils_beamline
3
6
  from dodal.devices.attenuator.attenuator import ReadOnlyAttenuator
4
- from dodal.devices.detector import DetectorParams
5
- from dodal.devices.eiger import EigerDetector
6
7
  from dodal.devices.hutch_shutter import HutchShutter
7
8
  from dodal.devices.i24.aperture import Aperture
8
9
  from dodal.devices.i24.beam_center import DetectorBeamCenter
@@ -23,7 +24,7 @@ from dodal.devices.zebra.zebra_constants_mapping import (
23
24
  ZebraTTLOutputs,
24
25
  )
25
26
  from dodal.log import set_beamline as set_log_beamline
26
- from dodal.utils import get_beamline_name, skip_device
27
+ from dodal.utils import BeamlinePrefix, get_beamline_name
27
28
 
28
29
  ZOOM_PARAMS_FILE = (
29
30
  "/dls_sw/i24/software/gda_versions/gda/config/xml/jCameraManZoomLevels.xml"
@@ -40,234 +41,188 @@ I24_ZEBRA_MAPPING = ZebraMapping(
40
41
  sources=ZebraSources(),
41
42
  )
42
43
 
44
+ PREFIX = BeamlinePrefix(BL)
45
+
43
46
 
44
- def attenuator(
45
- wait_for_connection: bool = True, fake_with_ophyd_sim: bool = False
46
- ) -> ReadOnlyAttenuator:
47
+ @device_factory()
48
+ def attenuator() -> ReadOnlyAttenuator:
47
49
  """Get a read-only attenuator device for i24, instantiate it if it hasn't already
48
50
  been. If this is called when already instantiated in i24, it will return the
49
51
  existing object."""
50
- return device_instantiation(
51
- ReadOnlyAttenuator,
52
+ return ReadOnlyAttenuator(
53
+ f"{PREFIX.beamline_prefix}-OP-ATTN-01:",
52
54
  "attenuator",
53
- "-OP-ATTN-01:",
54
- wait_for_connection,
55
- fake_with_ophyd_sim,
56
55
  )
57
56
 
58
57
 
59
- def aperture(
60
- wait_for_connection: bool = True, fake_with_ophyd_sim: bool = False
61
- ) -> Aperture:
58
+ @device_factory()
59
+ def aperture() -> Aperture:
62
60
  """Get the i24 aperture device, instantiate it if it hasn't already been.
63
61
  If this is called when already instantiated in i24, it will return the existing object.
64
62
  """
65
- return device_instantiation(
66
- Aperture, "aperture", "-AL-APTR-01:", wait_for_connection, fake_with_ophyd_sim
63
+ return Aperture(
64
+ f"{PREFIX.beamline_prefix}-AL-APTR-01:",
65
+ "aperture",
67
66
  )
68
67
 
69
68
 
70
- def beamstop(
71
- wait_for_connection: bool = True, fake_with_ophyd_sim: bool = False
72
- ) -> Beamstop:
69
+ @device_factory()
70
+ def beamstop() -> Beamstop:
73
71
  """Get the i24 beamstop device, instantiate it if it hasn't already been.
74
72
  If this is called when already instantiated in i24, it will return the existing object.
75
73
  """
76
- return device_instantiation(
77
- Beamstop,
74
+ return Beamstop(
75
+ f"{PREFIX.beamline_prefix}-MO-BS-01:",
78
76
  "beamstop",
79
- "-MO-BS-01:",
80
- wait_for_connection,
81
- fake_with_ophyd_sim,
82
77
  )
83
78
 
84
79
 
85
- def backlight(
86
- wait_for_connection: bool = True, fake_with_ophyd_sim: bool = False
87
- ) -> DualBacklight:
80
+ @device_factory()
81
+ def backlight() -> DualBacklight:
88
82
  """Get the i24 backlight device, instantiate it if it hasn't already been.
89
83
  If this is called when already instantiated in i24, it will return the existing object.
90
84
  """
91
- return device_instantiation(
92
- device_factory=DualBacklight,
85
+ return DualBacklight(
86
+ prefix=PREFIX.beamline_prefix,
93
87
  name="backlight",
94
- prefix="",
95
- wait=wait_for_connection,
96
- fake=fake_with_ophyd_sim,
97
88
  )
98
89
 
99
90
 
100
- def detector_motion(
101
- wait_for_connection: bool = True, fake_with_ophyd_sim: bool = False
102
- ) -> DetectorMotion:
91
+ @device_factory()
92
+ def detector_motion() -> DetectorMotion:
103
93
  """Get the i24 detector motion device, instantiate it if it hasn't already been.
104
94
  If this is called when already instantiated in i24, it will return the existing object.
105
95
  """
106
- return device_instantiation(
107
- device_factory=DetectorMotion,
96
+ return DetectorMotion(
108
97
  name="detector_motion",
109
- prefix="-EA-DET-01:",
110
- wait=wait_for_connection,
111
- fake=fake_with_ophyd_sim,
98
+ prefix=f"{PREFIX.beamline_prefix}-EA-DET-01:",
112
99
  )
113
100
 
114
101
 
115
- def dcm(wait_for_connection: bool = True, fake_with_ophyd_sim: bool = False) -> DCM:
102
+ @device_factory()
103
+ def dcm() -> DCM:
116
104
  """Get the i24 DCM device, instantiate it if it hasn't already been.
117
105
  If this is called when already instantiated in i24, it will return the existing object.
118
106
  """
119
- return device_instantiation(
120
- device_factory=DCM,
107
+ return DCM(
121
108
  name="dcm",
122
- prefix="",
123
- wait=wait_for_connection,
124
- fake=fake_with_ophyd_sim,
125
- )
126
-
127
-
128
- @skip_device(lambda: BL == "s24")
129
- def eiger(
130
- wait_for_connection: bool = True,
131
- fake_with_ophyd_sim: bool = False,
132
- params: DetectorParams | None = None,
133
- ) -> EigerDetector:
134
- """Get the i24 Eiger device, instantiate it if it hasn't already been.
135
- If this is called when already instantiated, it will return the existing object.
136
- If called with params, will update those params to the Eiger object.
137
- """
138
-
139
- def set_params(eiger: EigerDetector):
140
- if params is not None:
141
- eiger.set_detector_parameters(params)
142
-
143
- return device_instantiation(
144
- device_factory=EigerDetector,
145
- name="eiger",
146
- prefix="-EA-EIGER-01:",
147
- wait=wait_for_connection,
148
- fake=fake_with_ophyd_sim,
149
- post_create=set_params,
150
- )
151
-
152
-
153
- def pmac(wait_for_connection: bool = True, fake_with_ophyd_sim: bool = False) -> PMAC:
109
+ prefix=PREFIX.beamline_prefix,
110
+ )
111
+
112
+
113
+ # TODO implement ophyd-async eiger see
114
+ # https://github.com/DiamondLightSource/mx-bluesky/issues/62
115
+ # @skip_device(lambda: BL == "s24")
116
+ # def eiger(
117
+ # wait_for_connection: bool = True,
118
+ # fake_with_ophyd_sim: bool = False,
119
+ # params: DetectorParams | None = None,
120
+ # ) -> EigerDetector:
121
+ # """Get the i24 Eiger device, instantiate it if it hasn't already been.
122
+ # If this is called when already instantiated, it will return the existing object.
123
+ # If called with params, will update those params to the Eiger object.
124
+ # """
125
+ #
126
+ # def set_params(eiger: EigerDetector):
127
+ # if params is not None:
128
+ # eiger.set_detector_parameters(params)
129
+ #
130
+ # return device_instantiation(
131
+ # device_factory=EigerDetector,
132
+ # name="eiger",
133
+ # prefix="-EA-EIGER-01:",
134
+ # wait=wait_for_connection,
135
+ # fake=fake_with_ophyd_sim,
136
+ # post_create=set_params,
137
+ # )
138
+
139
+
140
+ @device_factory()
141
+ def pmac() -> PMAC:
154
142
  """Get the i24 PMAC device, instantiate it if it hasn't already been.
155
143
  If this is called when already instantiated in i24, it will return the existing object.
156
144
  """
157
145
  # prefix not BL but ME14E
158
- return device_instantiation(
159
- PMAC,
160
- "pmac",
146
+ return PMAC(
161
147
  "ME14E-MO-CHIP-01:",
162
- wait_for_connection,
163
- fake_with_ophyd_sim,
164
- bl_prefix=False,
148
+ "pmac",
165
149
  )
166
150
 
167
151
 
168
- @skip_device(lambda: BL == "s24")
169
- def oav(wait_for_connection: bool = True, fake_with_ophyd_sim: bool = False) -> OAV:
170
- return device_instantiation(
171
- OAV,
172
- "oav",
173
- "-DI-OAV-01:",
174
- wait_for_connection,
175
- fake_with_ophyd_sim,
152
+ @device_factory(skip=BL == "s24")
153
+ def oav() -> OAV:
154
+ return OAV(
155
+ prefix=f"{PREFIX.beamline_prefix}-DI-OAV-01:",
156
+ name="oav",
176
157
  config=OAVConfig(ZOOM_PARAMS_FILE, DISPLAY_CONFIG),
177
158
  )
178
159
 
179
160
 
180
- def vgonio(
181
- wait_for_connection: bool = True, fake_with_ophyd_sim: bool = False
182
- ) -> VerticalGoniometer:
161
+ @device_factory()
162
+ def vgonio() -> VerticalGoniometer:
183
163
  """Get the i24 vertical goniometer device, instantiate it if it hasn't already been.
184
164
  If this is called when already instantiated, it will return the existing object.
185
165
  """
186
- return device_instantiation(
187
- VerticalGoniometer,
166
+ return VerticalGoniometer(
167
+ f"{PREFIX.beamline_prefix}-MO-VGON-01:",
188
168
  "vgonio",
189
- "-MO-VGON-01:",
190
- wait_for_connection,
191
- fake_with_ophyd_sim,
192
169
  )
193
170
 
194
171
 
195
- def zebra(wait_for_connection: bool = True, fake_with_ophyd_sim: bool = False) -> Zebra:
172
+ @device_factory()
173
+ def zebra() -> Zebra:
196
174
  """Get the i24 zebra device, instantiate it if it hasn't already been.
197
175
  If this is called when already instantiated in i24, it will return the existing object.
198
176
  """
199
- return device_instantiation(
200
- Zebra,
201
- "zebra",
202
- "-EA-ZEBRA-01:",
203
- wait_for_connection,
204
- fake_with_ophyd_sim,
177
+ return Zebra(
178
+ name="zebra",
179
+ prefix=f"{PREFIX.beamline_prefix}-EA-ZEBRA-01:",
205
180
  mapping=I24_ZEBRA_MAPPING,
206
181
  )
207
182
 
208
183
 
209
- def shutter(
210
- wait_for_connection: bool = True, fake_with_ophyd_sim: bool = False
211
- ) -> HutchShutter:
184
+ @device_factory()
185
+ def shutter() -> HutchShutter:
212
186
  """Get the i24 hutch shutter device, instantiate it if it hasn't already been.
213
187
  If this is called when already instantiated, it will return the existing object.
214
188
  """
215
- return device_instantiation(
216
- HutchShutter,
189
+ return HutchShutter(
190
+ f"{PREFIX.beamline_prefix}-PS-SHTR-01:",
217
191
  "shutter",
218
- "-PS-SHTR-01:",
219
- wait_for_connection,
220
- fake_with_ophyd_sim,
221
192
  )
222
193
 
223
194
 
224
- def focus_mirrors(
225
- wait_for_connection: bool = True, fake_with_ophyd_sim: bool = False
226
- ) -> FocusMirrorsMode:
195
+ @device_factory()
196
+ def focus_mirrors() -> FocusMirrorsMode:
227
197
  """Get the i24 focus mirror devise to find the beam size."""
228
- return device_instantiation(
229
- FocusMirrorsMode,
198
+ return FocusMirrorsMode(
199
+ f"{PREFIX.beamline_prefix}-OP-MFM-01:",
230
200
  "focus_mirrors",
231
- "-OP-MFM-01:",
232
- wait_for_connection,
233
- fake_with_ophyd_sim,
234
201
  )
235
202
 
236
203
 
237
- def eiger_beam_center(
238
- wait_for_connection: bool = True, fake_with_ophyd_sim: bool = False
239
- ) -> DetectorBeamCenter:
204
+ @device_factory()
205
+ def eiger_beam_center() -> DetectorBeamCenter:
240
206
  """A device for setting/reading the beamcenter from the eiger on i24."""
241
- return device_instantiation(
242
- DetectorBeamCenter,
207
+ return DetectorBeamCenter(
208
+ f"{PREFIX.beamline_prefix}-EA-EIGER-01:CAM:",
243
209
  "eiger_bc",
244
- "-EA-EIGER-01:CAM:",
245
- wait_for_connection,
246
- fake_with_ophyd_sim,
247
210
  )
248
211
 
249
212
 
250
- def pilatus_beam_center(
251
- wait_for_connection: bool = True, fake_with_ophyd_sim: bool = False
252
- ) -> DetectorBeamCenter:
213
+ @device_factory()
214
+ def pilatus_beam_center() -> DetectorBeamCenter:
253
215
  """A device for setting/reading the beamcenter from the pilatus on i24."""
254
- return device_instantiation(
255
- DetectorBeamCenter,
216
+ return DetectorBeamCenter(
217
+ f"{PREFIX.beamline_prefix}-EA-PILAT-01:cam1:",
256
218
  "pilatus_bc",
257
- "-EA-PILAT-01:cam1:",
258
- wait_for_connection,
259
- fake_with_ophyd_sim,
260
219
  )
261
220
 
262
221
 
263
- def pilatus_metadata(
264
- wait_for_connection: bool = True, fake_with_ophyd_sim: bool = False
265
- ) -> PilatusMetadata:
222
+ @device_factory()
223
+ def pilatus_metadata() -> PilatusMetadata:
266
224
  """A small pilatus driver device for figuring out the filename template."""
267
- return device_instantiation(
268
- PilatusMetadata,
225
+ return PilatusMetadata(
226
+ f"{PREFIX.beamline_prefix}-EA-PILAT-01:",
269
227
  "pilatus_meta",
270
- "-EA-PILAT-01:",
271
- wait_for_connection,
272
- fake_with_ophyd_sim,
273
228
  )
dodal/beamlines/p38.py CHANGED
@@ -9,7 +9,11 @@ from dodal.common.beamlines.beamline_utils import (
9
9
  set_path_provider,
10
10
  )
11
11
  from dodal.common.beamlines.beamline_utils import set_beamline as set_utils_beamline
12
- from dodal.common.beamlines.device_helpers import numbered_slits
12
+ from dodal.common.beamlines.device_helpers import (
13
+ DET_SUFFIX,
14
+ HDF5_SUFFIX,
15
+ numbered_slits,
16
+ )
13
17
  from dodal.common.crystal_metadata import (
14
18
  MaterialsEnum,
15
19
  make_crystal_metadata_from_material,
@@ -54,8 +58,8 @@ def d3(
54
58
  "-DI-DCAM-01:",
55
59
  wait_for_connection,
56
60
  fake_with_ophyd_sim,
57
- drv_suffix="DET:",
58
- hdf_suffix="HDF5:",
61
+ drv_suffix=DET_SUFFIX,
62
+ fileio_suffix=HDF5_SUFFIX,
59
63
  path_provider=get_path_provider(),
60
64
  )
61
65
 
@@ -71,8 +75,8 @@ def d11(
71
75
  "-DI-DCAM-03:",
72
76
  wait_for_connection,
73
77
  fake_with_ophyd_sim,
74
- drv_suffix="DET:",
75
- hdf_suffix="HDF5:",
78
+ drv_suffix=DET_SUFFIX,
79
+ fileio_suffix=HDF5_SUFFIX,
76
80
  path_provider=get_path_provider(),
77
81
  )
78
82
 
@@ -86,8 +90,8 @@ def d12(
86
90
  "-DI-DCAM-04:",
87
91
  wait_for_connection,
88
92
  fake_with_ophyd_sim,
89
- drv_suffix="DET:",
90
- hdf_suffix="HDF5:",
93
+ drv_suffix=DET_SUFFIX,
94
+ fileio_suffix=HDF5_SUFFIX,
91
95
  path_provider=get_path_provider(),
92
96
  )
93
97
 
@@ -338,7 +342,7 @@ def high_pressure_xray_cell(
338
342
  return device_instantiation(
339
343
  PressureJumpCell,
340
344
  "high_pressure_xray_cell",
341
- f"{BeamlinePrefix(BL).insertion_prefix}-EA",
345
+ "-EA",
342
346
  wait_for_connection,
343
347
  fake_with_ophyd_sim,
344
348
  cell_prefix="-HPXC-01:",