dls-dodal 1.67.0__py3-none-any.whl → 1.69.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 (86) hide show
  1. {dls_dodal-1.67.0.dist-info → dls_dodal-1.69.0.dist-info}/METADATA +2 -32
  2. {dls_dodal-1.67.0.dist-info → dls_dodal-1.69.0.dist-info}/RECORD +79 -71
  3. dodal/_version.py +2 -2
  4. dodal/beamlines/adsim.py +30 -23
  5. dodal/beamlines/b07.py +1 -1
  6. dodal/beamlines/b07_1.py +1 -1
  7. dodal/beamlines/i02_1.py +14 -42
  8. dodal/beamlines/i02_2.py +5 -11
  9. dodal/beamlines/i03.py +4 -1
  10. dodal/beamlines/i03_supervisor.py +19 -0
  11. dodal/beamlines/i04.py +74 -179
  12. dodal/beamlines/i05.py +9 -1
  13. dodal/beamlines/i06.py +1 -1
  14. dodal/beamlines/i06_1.py +24 -0
  15. dodal/beamlines/i09.py +53 -9
  16. dodal/beamlines/i09_1.py +9 -1
  17. dodal/beamlines/i09_2.py +7 -6
  18. dodal/beamlines/i10_optics.py +1 -1
  19. dodal/beamlines/i16.py +34 -0
  20. dodal/beamlines/i17.py +1 -1
  21. dodal/beamlines/i20_1.py +14 -0
  22. dodal/beamlines/i21.py +71 -4
  23. dodal/beamlines/i23.py +19 -25
  24. dodal/beamlines/i24.py +55 -105
  25. dodal/beamlines/p60.py +12 -2
  26. dodal/common/__init__.py +2 -1
  27. dodal/common/maths.py +80 -0
  28. dodal/devices/eiger.py +44 -23
  29. dodal/devices/electron_analyser/__init__.py +0 -33
  30. dodal/devices/electron_analyser/base/__init__.py +58 -0
  31. dodal/devices/electron_analyser/base/base_controller.py +84 -0
  32. dodal/devices/electron_analyser/base/base_detector.py +214 -0
  33. dodal/devices/electron_analyser/{abstract → base}/base_driver_io.py +23 -42
  34. dodal/devices/electron_analyser/{enums.py → base/base_enums.py} +0 -5
  35. dodal/devices/electron_analyser/{abstract → base}/base_region.py +48 -11
  36. dodal/devices/electron_analyser/{util.py → base/base_util.py} +1 -1
  37. dodal/devices/electron_analyser/{energy_sources.py → base/energy_sources.py} +27 -26
  38. dodal/devices/electron_analyser/specs/__init__.py +4 -4
  39. dodal/devices/electron_analyser/specs/specs_detector.py +47 -0
  40. dodal/devices/electron_analyser/specs/{driver_io.py → specs_driver_io.py} +23 -26
  41. dodal/devices/electron_analyser/specs/{region.py → specs_region.py} +4 -3
  42. dodal/devices/electron_analyser/vgscienta/__init__.py +4 -4
  43. dodal/devices/electron_analyser/vgscienta/vgscienta_detector.py +53 -0
  44. dodal/devices/electron_analyser/vgscienta/{driver_io.py → vgscienta_driver_io.py} +25 -31
  45. dodal/devices/electron_analyser/vgscienta/{region.py → vgscienta_region.py} +6 -6
  46. dodal/devices/fast_shutter.py +108 -25
  47. dodal/devices/i04/beam_centre.py +84 -0
  48. dodal/devices/i04/max_pixel.py +4 -17
  49. dodal/devices/i04/murko_results.py +18 -3
  50. dodal/devices/i09_2_shared/i09_apple2.py +0 -72
  51. dodal/devices/i10/i10_apple2.py +7 -7
  52. dodal/devices/i17/i17_apple2.py +6 -6
  53. dodal/devices/i21/__init__.py +3 -1
  54. dodal/devices/i24/commissioning_jungfrau.py +9 -10
  55. dodal/devices/insertion_device/__init__.py +62 -0
  56. dodal/devices/insertion_device/apple2_controller.py +380 -0
  57. dodal/devices/insertion_device/apple2_undulator.py +152 -481
  58. dodal/devices/insertion_device/energy.py +88 -0
  59. dodal/devices/insertion_device/energy_motor_lookup.py +1 -1
  60. dodal/devices/insertion_device/enum.py +17 -0
  61. dodal/devices/insertion_device/lookup_table_models.py +66 -36
  62. dodal/devices/insertion_device/polarisation.py +36 -0
  63. dodal/devices/oav/oav_detector.py +66 -1
  64. dodal/devices/oav/utils.py +17 -0
  65. dodal/devices/robot.py +35 -18
  66. dodal/devices/selectable_source.py +38 -0
  67. dodal/devices/zebra/zebra.py +15 -0
  68. dodal/devices/zebra/zebra_constants_mapping.py +1 -0
  69. dodal/plans/configure_arm_trigger_and_disarm_detector.py +0 -1
  70. dodal/testing/__init__.py +0 -0
  71. dodal/testing/electron_analyser/device_factory.py +4 -4
  72. dodal/testing/fixtures/devices/apple2.py +1 -1
  73. dodal/testing/fixtures/run_engine.py +4 -0
  74. dodal/devices/electron_analyser/abstract/__init__.py +0 -25
  75. dodal/devices/electron_analyser/abstract/base_detector.py +0 -63
  76. dodal/devices/electron_analyser/abstract/types.py +0 -12
  77. dodal/devices/electron_analyser/detector.py +0 -143
  78. dodal/devices/electron_analyser/specs/detector.py +0 -34
  79. dodal/devices/electron_analyser/types.py +0 -57
  80. dodal/devices/electron_analyser/vgscienta/detector.py +0 -48
  81. {dls_dodal-1.67.0.dist-info → dls_dodal-1.69.0.dist-info}/WHEEL +0 -0
  82. {dls_dodal-1.67.0.dist-info → dls_dodal-1.69.0.dist-info}/entry_points.txt +0 -0
  83. {dls_dodal-1.67.0.dist-info → dls_dodal-1.69.0.dist-info}/licenses/LICENSE +0 -0
  84. {dls_dodal-1.67.0.dist-info → dls_dodal-1.69.0.dist-info}/top_level.txt +0 -0
  85. /dodal/devices/electron_analyser/specs/{enums.py → specs_enums.py} +0 -0
  86. /dodal/devices/electron_analyser/vgscienta/{enums.py → vgscienta_enums.py} +0 -0
@@ -0,0 +1,19 @@
1
+ from dodal.common.beamlines.beamline_utils import set_beamline as set_utils_beamline
2
+ from dodal.device_manager import DeviceManager
3
+ from dodal.devices.baton import Baton
4
+ from dodal.log import set_beamline as set_log_beamline
5
+ from dodal.utils import BeamlinePrefix, get_beamline_name
6
+
7
+ BL = get_beamline_name("i03")
8
+ set_log_beamline(BL)
9
+ set_utils_beamline(BL)
10
+
11
+ PREFIX = BeamlinePrefix(BL)
12
+
13
+
14
+ devices = DeviceManager()
15
+
16
+
17
+ @devices.factory()
18
+ def baton() -> Baton:
19
+ return Baton(f"{PREFIX.beamline_prefix}-CS-BATON-01:")
dodal/beamlines/i04.py CHANGED
@@ -1,11 +1,8 @@
1
1
  from ophyd_async.core import Reference
2
2
 
3
3
  from dodal.common.beamlines.beamline_parameters import get_beamline_parameters
4
- from dodal.common.beamlines.beamline_utils import (
5
- device_factory,
6
- device_instantiation,
7
- )
8
4
  from dodal.common.beamlines.beamline_utils import set_beamline as set_utils_beamline
5
+ from dodal.device_manager import DeviceManager
9
6
  from dodal.devices.aperturescatterguard import (
10
7
  AperturePosition,
11
8
  ApertureScatterguard,
@@ -14,13 +11,13 @@ from dodal.devices.aperturescatterguard import (
14
11
  from dodal.devices.attenuator.attenuator import BinaryFilterAttenuator
15
12
  from dodal.devices.backlight import Backlight
16
13
  from dodal.devices.baton import Baton
17
- from dodal.devices.detector import DetectorParams
18
14
  from dodal.devices.detector.detector_motion import DetectorMotion
19
15
  from dodal.devices.diamond_filter import DiamondFilter, I04Filters
20
16
  from dodal.devices.eiger import EigerDetector
21
17
  from dodal.devices.fast_grid_scan import ZebraFastGridScanThreeD
22
18
  from dodal.devices.flux import Flux
23
19
  from dodal.devices.i03.dcm import DCM
20
+ from dodal.devices.i04.beam_centre import CentreEllipseMethod
24
21
  from dodal.devices.i04.beamsize import Beamsize
25
22
  from dodal.devices.i04.constants import RedisConstants
26
23
  from dodal.devices.i04.max_pixel import MaxPixel
@@ -29,7 +26,9 @@ from dodal.devices.i04.transfocator import Transfocator
29
26
  from dodal.devices.ipin import IPin
30
27
  from dodal.devices.motors import XYZStage
31
28
  from dodal.devices.mx_phase1.beamstop import Beamstop
32
- from dodal.devices.oav.oav_detector import OAVBeamCentrePV
29
+ from dodal.devices.oav.oav_detector import (
30
+ OAVBeamCentrePV,
31
+ )
33
32
  from dodal.devices.oav.oav_parameters import OAVConfig
34
33
  from dodal.devices.oav.oav_to_redis_forwarder import OAVToRedisForwarder
35
34
  from dodal.devices.oav.pin_image_recognition import PinTipDetection
@@ -70,126 +69,85 @@ I04_ZEBRA_MAPPING = ZebraMapping(
70
69
 
71
70
  PREFIX = BeamlinePrefix(BL)
72
71
 
72
+ devices = DeviceManager()
73
73
 
74
- @device_factory()
74
+
75
+ @devices.factory()
75
76
  def smargon() -> Smargon:
76
- """Get the i04 Smargon device, instantiate it if it hasn't already been.
77
- If this is called when already instantiated in i04, it will return the existing object.
78
- """
79
77
  return Smargon(f"{PREFIX.beamline_prefix}-MO-SGON-01:")
80
78
 
81
79
 
82
- @device_factory()
80
+ @devices.factory()
83
81
  def gonio_positioner() -> XYZStage:
84
- """Get the i04 lower_gonio_stages device, instantiate it if it hasn't already been.
85
- If this is called when already instantiated in i04, it will return the existing object.
86
- """
87
82
  return XYZStage(
88
83
  f"{PREFIX.beamline_prefix}-MO-GONIO-01:",
89
84
  "lower_gonio_stages",
90
85
  )
91
86
 
92
87
 
93
- @device_factory()
88
+ @devices.factory()
94
89
  def sample_delivery_system() -> XYZStage:
95
- """Get the i04 sample_delivery_system device, instantiate it if it hasn't already been.
96
- If this is called when already instantiated in i04, it will return the existing object.
97
- """
98
90
  return XYZStage(f"{PREFIX.beamline_prefix}-MO-SDE-01:")
99
91
 
100
92
 
101
- @device_factory()
93
+ @devices.factory()
102
94
  def ipin() -> IPin:
103
- """Get the i04 ipin device, instantiate it if it hasn't already been.
104
- If this is called when already instantiated in i04, it will return the existing object.
105
- """
106
95
  return IPin(f"{PREFIX.beamline_prefix}-EA-PIN-01:")
107
96
 
108
97
 
109
- @device_factory()
98
+ @devices.factory()
110
99
  def beamstop() -> Beamstop:
111
- """Get the i04 beamstop device, instantiate it if it hasn't already been.
112
- If this is called when already instantiated in i04, it will return the existing object.
113
- """
114
100
  return Beamstop(
115
101
  f"{PREFIX.beamline_prefix}-MO-BS-01:",
116
102
  beamline_parameters=get_beamline_parameters(),
117
103
  )
118
104
 
119
105
 
120
- @device_factory()
106
+ @devices.factory()
121
107
  def sample_shutter() -> ZebraShutter:
122
- """Get the i04 sample shutter device, instantiate it if it hasn't already been.
123
- If this is called when already instantiated in i04, it will return the existing object.
124
- """
125
108
  return ZebraShutter(f"{PREFIX.beamline_prefix}-EA-SHTR-01:")
126
109
 
127
110
 
128
- @device_factory()
111
+ @devices.factory()
129
112
  def attenuator() -> BinaryFilterAttenuator:
130
- """Get the i04 attenuator device, instantiate it if it hasn't already been.
131
- If this is called when already instantiated in i04, it will return the existing object.
132
- """
133
113
  return BinaryFilterAttenuator(
134
114
  prefix=f"{PREFIX.beamline_prefix}-EA-ATTN-01:",
135
115
  num_filters=16,
136
116
  )
137
117
 
138
118
 
139
- @device_factory()
119
+ @devices.factory()
140
120
  def transfocator() -> Transfocator:
141
- """Get the i04 transfocator device, instantiate it if it hasn't already been.
142
- If this is called when already instantiated in i04, it will return the existing object.
143
- """
144
121
  return Transfocator(f"{PREFIX.beamline_prefix}-MO-FSWT-01:")
145
122
 
146
123
 
147
- @device_factory()
124
+ @devices.factory()
148
125
  def baton() -> Baton:
149
- """Get the i04 baton device, instantiate it if it hasn't already been.
150
- If this is called when already instantiated in i04, it will return the existing object.
151
- """
152
126
  return Baton(f"{PREFIX.beamline_prefix}-CS-BATON-01:")
153
127
 
154
128
 
155
- @device_factory()
156
- def xbpm_feedback() -> XBPMFeedback:
157
- """Get the i04 xbpm_feedback device, instantiate it if it hasn't already been.
158
- If this is called when already instantiated in i04, it will return the existing object.
159
- """
160
- return XBPMFeedback(f"{PREFIX.beamline_prefix}-EA-FDBK-01:", baton=baton())
129
+ @devices.factory()
130
+ def xbpm_feedback(baton: Baton) -> XBPMFeedback:
131
+ return XBPMFeedback(f"{PREFIX.beamline_prefix}-EA-FDBK-01:", baton=baton)
161
132
 
162
133
 
163
- @device_factory()
134
+ @devices.factory()
164
135
  def flux() -> Flux:
165
- """Get the i04 flux device, instantiate it if it hasn't already been.
166
- If this is called when already instantiated in i04, it will return the existing object.
167
- """
168
136
  return Flux(f"{PREFIX.beamline_prefix}-MO-FLUX-01:")
169
137
 
170
138
 
171
- @device_factory()
139
+ @devices.factory()
172
140
  def dcm() -> DCM:
173
- """Get the i04 DCM device, instantiate it if it hasn't already been.
174
- If this is called when already instantiated in i04, it will return the existing object.
175
- """
176
141
  return DCM(f"{PREFIX.beamline_prefix}-MO-DCM-01:")
177
142
 
178
143
 
179
- @device_factory()
144
+ @devices.factory()
180
145
  def backlight() -> Backlight:
181
- """Get the i04 backlight device, instantiate it if it hasn't already been.
182
- If this is called when already instantiated in i04, it will return the existing object.
183
- """
184
146
  return Backlight(PREFIX.beamline_prefix)
185
147
 
186
148
 
187
- @device_factory()
149
+ @devices.factory()
188
150
  def aperture_scatterguard() -> ApertureScatterguard:
189
- """Get the i04 aperture and scatterguard device, instantiate it if it hasn't already
190
- been. If this is called when already instantiated in i04, it will return the existing
191
- object.
192
- """
193
151
  params = get_beamline_parameters()
194
152
  return ApertureScatterguard(
195
153
  aperture_prefix=f"{PREFIX.beamline_prefix}-MO-MAPT-01:",
@@ -199,96 +157,59 @@ def aperture_scatterguard() -> ApertureScatterguard:
199
157
  )
200
158
 
201
159
 
202
- @device_factory(skip=BL == "s04")
203
- def eiger(mock: bool = False, params: DetectorParams | None = None) -> EigerDetector:
204
- """Get the i04 Eiger device, instantiate it if it hasn't already been.
205
- If this is called when already instantiated in i04, it will return the existing object.
206
- If called with params, will update those params to the Eiger object.
207
- """
208
-
209
- def set_params(eiger: EigerDetector):
210
- if params is not None:
211
- eiger.set_detector_parameters(params)
212
-
213
- return device_instantiation(
214
- device_factory=EigerDetector,
215
- name="eiger",
216
- prefix="-EA-EIGER-01:",
217
- wait=False,
218
- fake=mock,
219
- post_create=set_params,
220
- )
160
+ @devices.v1_init(EigerDetector, prefix="BL04I-EA-EIGER-01:", wait=False)
161
+ def eiger(eiger: EigerDetector) -> EigerDetector:
162
+ eiger.detector_id = 78
163
+ return eiger
221
164
 
222
165
 
223
- @device_factory()
166
+ @devices.factory()
224
167
  def zebra_fast_grid_scan() -> ZebraFastGridScanThreeD:
225
- """Get the i04 zebra_fast_grid_scan device, instantiate it if it hasn't already been.
226
- If this is called when already instantiated in i04, it will return the existing object.
227
- """
228
- return ZebraFastGridScanThreeD(
229
- prefix=f"{PREFIX.beamline_prefix}-MO-SGON-01:",
230
- )
168
+ return ZebraFastGridScanThreeD(prefix=f"{PREFIX.beamline_prefix}-MO-SGON-01:")
231
169
 
232
170
 
233
- @device_factory()
171
+ @devices.factory()
234
172
  def s4_slit_gaps() -> S4SlitGaps:
235
- """Get the i04 s4_slit_gaps device, instantiate it if it hasn't already been.
236
- If this is called when already instantiated in i04, it will return the existing object.
237
- """
238
173
  return S4SlitGaps(f"{PREFIX.beamline_prefix}-AL-SLITS-04:")
239
174
 
240
175
 
241
- @device_factory()
242
- def undulator() -> UndulatorInKeV:
243
- """Get the i04 undulator device, instantiate it if it hasn't already been.
244
- If this is called when already instantiated in i04, it will return the existing object.
245
- """
176
+ @devices.fixture
177
+ def daq_configuration_path() -> str:
178
+ return DAQ_CONFIGURATION_PATH
179
+
180
+
181
+ @devices.factory()
182
+ def undulator(baton: Baton, daq_configuration_path: str) -> UndulatorInKeV:
246
183
  return UndulatorInKeV(
247
184
  prefix=f"{PREFIX.insertion_prefix}-MO-SERVC-01:",
248
- id_gap_lookup_table_path="/dls_sw/i04/software/daq_configuration/lookup/BeamLine_Undulator_toGap.txt",
249
- baton=baton(),
185
+ id_gap_lookup_table_path=f"{daq_configuration_path}/lookup/BeamLine_Undulator_toGap.txt",
186
+ baton=baton,
250
187
  )
251
188
 
252
189
 
253
- @device_factory(skip=BL == "s04")
190
+ @devices.factory()
254
191
  def synchrotron() -> Synchrotron:
255
- """Get the i04 synchrotron device, instantiate it if it hasn't already been.
256
- If this is called when already instantiated in i04, it will return the existing object.
257
- """
258
192
  return Synchrotron()
259
193
 
260
194
 
261
- @device_factory()
195
+ @devices.factory()
262
196
  def zebra() -> Zebra:
263
- """Get the i04 zebra device, instantiate it if it hasn't already been.
264
- If this is called when already instantiated in i04, it will return the existing object.
265
- """
266
197
  return Zebra(
267
198
  prefix=f"{PREFIX.beamline_prefix}-EA-ZEBRA-01:",
268
199
  mapping=I04_ZEBRA_MAPPING,
269
200
  )
270
201
 
271
202
 
272
- @device_factory(
273
- skip=BL == "s04",
274
- )
203
+ @devices.factory()
275
204
  def oav(params: OAVConfig | None = None) -> OAVBeamCentrePV:
276
- """Get the i04 OAV device, instantiate it if it hasn't already been.
277
- If this is called when already instantiated in i04, it will return the existing object.
278
- """
279
205
  return OAVBeamCentrePV(
280
206
  prefix=f"{PREFIX.beamline_prefix}-DI-OAV-01:",
281
207
  config=params or OAVConfig(ZOOM_PARAMS_FILE),
282
208
  )
283
209
 
284
210
 
285
- @device_factory(
286
- skip=BL == "s04",
287
- )
211
+ @devices.factory()
288
212
  def oav_full_screen(params: OAVConfig | None = None) -> OAVBeamCentrePV:
289
- """Get the i04 OAV device, instantiate it if it hasn't already been.
290
- If this is called when already instantiated in i04, it will return the existing object.
291
- """
292
213
  return OAVBeamCentrePV(
293
214
  prefix=f"{PREFIX.beamline_prefix}-DI-OAV-01:",
294
215
  config=params or OAVConfig(ZOOM_PARAMS_FILE),
@@ -297,55 +218,40 @@ def oav_full_screen(params: OAVConfig | None = None) -> OAVBeamCentrePV:
297
218
  )
298
219
 
299
220
 
300
- @device_factory(
301
- skip=BL == "s04",
302
- )
221
+ @devices.factory()
303
222
  def detector_motion() -> DetectorMotion:
304
- """Get the i04 detector motion device, instantiate it if it hasn't already been.
305
- If this is called when already instantiated in i04, it will return the existing object.
306
- """
307
223
  return DetectorMotion(
308
224
  device_prefix=f"{PREFIX.beamline_prefix}-MO-DET-01:",
309
225
  pmac_prefix=f"{PREFIX.beamline_prefix}-MO-PMAC-02:",
310
226
  )
311
227
 
312
228
 
313
- @device_factory()
229
+ @devices.factory()
314
230
  def thawer() -> Thawer:
315
- """Get the i04 thawer, instantiate it if it hasn't already been.
316
- If this is called when already instantiated in i04, it will return the existing object.
317
- """
318
231
  return Thawer(f"{PREFIX.beamline_prefix}-EA-THAW-01")
319
232
 
320
233
 
321
- @device_factory()
234
+ @devices.factory()
322
235
  def robot() -> BartRobot:
323
- """Get the i04 robot device, instantiate it if it hasn't already been.
324
- If this is called when already instantiated in i04, it will return the existing object.
325
- """
326
236
  return BartRobot(f"{PREFIX.beamline_prefix}-MO-ROBOT-01:")
327
237
 
328
238
 
329
- @device_factory()
330
- def oav_to_redis_forwarder() -> OAVToRedisForwarder:
331
- """Get the i04 OAV to redis forwarder, instantiate it if it hasn't already been.
332
- If this is called when already instantiated in i04, it will return the existing object.
333
- """
239
+ @devices.factory()
240
+ def oav_to_redis_forwarder(
241
+ oav: OAVBeamCentrePV, oav_full_screen: OAVBeamCentrePV
242
+ ) -> OAVToRedisForwarder:
334
243
  return OAVToRedisForwarder(
335
244
  f"{PREFIX.beamline_prefix}-DI-OAV-01:",
336
- oav_roi=oav(),
337
- oav_fs=oav_full_screen(),
245
+ oav_roi=oav,
246
+ oav_fs=oav_full_screen,
338
247
  redis_host=RedisConstants.REDIS_HOST,
339
248
  redis_password=RedisConstants.REDIS_PASSWORD,
340
249
  redis_db=RedisConstants.MURKO_REDIS_DB,
341
250
  )
342
251
 
343
252
 
344
- @device_factory()
253
+ @devices.factory()
345
254
  def murko_results() -> MurkoResultsDevice:
346
- """Get the i04 OAV to redis forwarder, instantiate it if it hasn't already been.
347
- If this is called when already instantiated in i04, it will return the existing object.
348
- """
349
255
  return MurkoResultsDevice(
350
256
  redis_host=RedisConstants.REDIS_HOST,
351
257
  redis_password=RedisConstants.REDIS_PASSWORD,
@@ -353,60 +259,49 @@ def murko_results() -> MurkoResultsDevice:
353
259
  )
354
260
 
355
261
 
356
- @device_factory()
262
+ @devices.factory()
357
263
  def diamond_filter() -> DiamondFilter[I04Filters]:
358
- """Get the i04 diamond filter device, instantiate it if it hasn't already been.
359
- If this is called when already instantiated in i04, it will return the existing object.
360
- """
361
264
  return DiamondFilter[I04Filters](
362
265
  f"{PREFIX.beamline_prefix}-MO-FLTR-01:Y", I04Filters
363
266
  )
364
267
 
365
268
 
366
- @device_factory()
269
+ @devices.factory()
367
270
  def zocalo() -> ZocaloResults:
368
- """Get the i04 ZocaloResults device, instantiate it if it hasn't already been.
369
- If this is called when already instantiated in i04, it will return the existing object.
370
- """
371
271
  return ZocaloResults(channel="xrc.i04", results_source=ZocaloSource.CPU)
372
272
 
373
273
 
374
- @device_factory()
274
+ @devices.factory()
375
275
  def pin_tip_detection() -> PinTipDetection:
376
- """Get the i04 pin tip detection device, instantiate it if it hasn't already been.
377
- If this is called when already instantiated in i04, it will return the existing object.
378
- """
379
276
  return PinTipDetection(f"{PREFIX.beamline_prefix}-DI-OAV-01:")
380
277
 
381
278
 
382
- @device_factory()
383
- def scintillator() -> Scintillator:
384
- """Get the i04 scintillator device, instantiate it if it hasn't already been.
385
- If this is called when already instantiated in i04, it will return the existing object.
386
- """
279
+ @devices.factory()
280
+ def scintillator(aperture_scatterguard: ApertureScatterguard) -> Scintillator:
387
281
  return Scintillator(
388
282
  f"{PREFIX.beamline_prefix}-MO-SCIN-01:",
389
- Reference(aperture_scatterguard()),
283
+ Reference(aperture_scatterguard),
390
284
  get_beamline_parameters(),
391
285
  )
392
286
 
393
287
 
394
- @device_factory()
288
+ @devices.factory()
395
289
  def max_pixel() -> MaxPixel:
396
- """Get the i04 max pixel device, instantiate it if it hasn't already been.
397
- If this is called when already instantiated in i04, it will return the existing object.
398
- """
399
- return MaxPixel(
400
- f"{PREFIX.beamline_prefix}-DI-OAV-01:",
401
- )
290
+ return MaxPixel(f"{PREFIX.beamline_prefix}-DI-OAV-01:")
402
291
 
403
292
 
404
- @device_factory()
405
- def beamsize() -> Beamsize:
406
- """Get the i04 beamsize device, instantiate it if it hasn't already been.
407
- If this is called when already instantiated in i04, it will return the existing object.
408
- """
293
+ @devices.factory()
294
+ def beamsize(
295
+ transfocator: Transfocator, aperture_scatterguard: ApertureScatterguard
296
+ ) -> Beamsize:
409
297
  return Beamsize(
410
- transfocator=transfocator(),
411
- aperture_scatterguard=aperture_scatterguard(),
298
+ transfocator,
299
+ aperture_scatterguard,
300
+ )
301
+
302
+
303
+ @devices.factory()
304
+ def beam_centre() -> CentreEllipseMethod:
305
+ return CentreEllipseMethod(
306
+ f"{PREFIX.beamline_prefix}-DI-OAV-01:",
412
307
  )
dodal/beamlines/i05.py CHANGED
@@ -3,13 +3,16 @@ from dodal.common.beamlines.beamline_utils import (
3
3
  device_factory,
4
4
  )
5
5
  from dodal.common.beamlines.beamline_utils import set_beamline as set_utils_beamline
6
- from dodal.devices.insertion_device.apple2_undulator import (
6
+ from dodal.devices.insertion_device import (
7
7
  Apple2,
8
8
  UndulatorGap,
9
9
  UndulatorLockedPhaseAxes,
10
10
  )
11
11
  from dodal.devices.pgm import PlaneGratingMonochromator
12
12
  from dodal.devices.synchrotron import Synchrotron
13
+ from dodal.devices.temperture_controller import (
14
+ Lakeshore336,
15
+ )
13
16
  from dodal.log import set_beamline as set_log_beamline
14
17
  from dodal.utils import BeamlinePrefix, get_beamline_name
15
18
 
@@ -47,3 +50,8 @@ def id_phase() -> UndulatorLockedPhaseAxes:
47
50
  def id() -> Apple2:
48
51
  """i05 insertion device."""
49
52
  return Apple2(id_gap=id_gap(), id_phase=id_phase())
53
+
54
+
55
+ @device_factory()
56
+ def sample_temperature_controller() -> Lakeshore336:
57
+ return Lakeshore336(prefix=f"{PREFIX.beamline_prefix}-EA-TCTRL-02:")
dodal/beamlines/i06.py CHANGED
@@ -2,7 +2,7 @@ from dodal.common.beamlines.beamline_utils import (
2
2
  device_factory,
3
3
  )
4
4
  from dodal.common.beamlines.beamline_utils import set_beamline as set_utils_beamline
5
- from dodal.devices.insertion_device.apple2_undulator import (
5
+ from dodal.devices.insertion_device import (
6
6
  Apple2,
7
7
  UndulatorGap,
8
8
  UndulatorLockedPhaseAxes,
@@ -0,0 +1,24 @@
1
+ from dodal.common.beamlines.beamline_utils import (
2
+ device_factory,
3
+ )
4
+ from dodal.common.beamlines.beamline_utils import set_beamline as set_utils_beamline
5
+ from dodal.devices.temperture_controller import (
6
+ Lakeshore336,
7
+ )
8
+ from dodal.log import set_beamline as set_log_beamline
9
+ from dodal.utils import BeamlinePrefix, get_beamline_name
10
+
11
+ BL = get_beamline_name("i06_1")
12
+ PREFIX = BeamlinePrefix(BL, suffix="J")
13
+ set_log_beamline(BL)
14
+ set_utils_beamline(BL)
15
+
16
+
17
+ @device_factory()
18
+ def diff_cooling_temperature_controller() -> Lakeshore336:
19
+ return Lakeshore336(prefix=f"{PREFIX.beamline_prefix}-EA-TCTRL-02:")
20
+
21
+
22
+ @device_factory()
23
+ def diff_heating_temperature_controller() -> Lakeshore336:
24
+ return Lakeshore336(prefix=f"{PREFIX.beamline_prefix}-EA-TCTRL-03:")
dodal/beamlines/i09.py CHANGED
@@ -1,3 +1,5 @@
1
+ from ophyd_async.core import InOut
2
+
1
3
  from dodal.common.beamlines.beamline_utils import (
2
4
  device_factory,
3
5
  )
@@ -7,16 +9,24 @@ from dodal.devices.common_dcm import (
7
9
  PitchAndRollCrystal,
8
10
  StationaryCrystal,
9
11
  )
10
- from dodal.devices.electron_analyser import DualEnergySource
12
+ from dodal.devices.electron_analyser.base import (
13
+ DualEnergySource,
14
+ )
11
15
  from dodal.devices.electron_analyser.vgscienta import VGScientaDetector
16
+ from dodal.devices.fast_shutter import DualFastShutter, GenericFastShutter
12
17
  from dodal.devices.i09 import Grating, LensMode, PassEnergy, PsuMode
13
18
  from dodal.devices.pgm import PlaneGratingMonochromator
19
+ from dodal.devices.selectable_source import SourceSelector
14
20
  from dodal.devices.synchrotron import Synchrotron
21
+ from dodal.devices.temperture_controller import (
22
+ Lakeshore336,
23
+ )
15
24
  from dodal.log import set_beamline as set_log_beamline
16
25
  from dodal.utils import BeamlinePrefix, get_beamline_name
17
26
 
18
27
  BL = get_beamline_name("i09")
19
- PREFIX = BeamlinePrefix(BL)
28
+ I_PREFIX = BeamlinePrefix(BL, suffix="I")
29
+ J_PREFIX = BeamlinePrefix(BL, suffix="J")
20
30
  set_log_beamline(BL)
21
31
  set_utils_beamline(BL)
22
32
 
@@ -26,24 +36,51 @@ def synchrotron() -> Synchrotron:
26
36
  return Synchrotron()
27
37
 
28
38
 
39
+ @device_factory()
40
+ def source_selector() -> SourceSelector:
41
+ return SourceSelector()
42
+
43
+
29
44
  @device_factory()
30
45
  def pgm() -> PlaneGratingMonochromator:
31
46
  return PlaneGratingMonochromator(
32
- prefix=f"{BeamlinePrefix(BL, suffix='J').beamline_prefix}-MO-PGM-01:",
33
- grating=Grating,
47
+ prefix=f"{J_PREFIX.beamline_prefix}-MO-PGM-01:", grating=Grating
34
48
  )
35
49
 
36
50
 
37
51
  @device_factory()
38
52
  def dcm() -> DoubleCrystalMonochromatorWithDSpacing:
39
53
  return DoubleCrystalMonochromatorWithDSpacing(
40
- f"{PREFIX.beamline_prefix}-MO-DCM-01:", PitchAndRollCrystal, StationaryCrystal
54
+ f"{I_PREFIX.beamline_prefix}-MO-DCM-01:", PitchAndRollCrystal, StationaryCrystal
41
55
  )
42
56
 
43
57
 
44
58
  @device_factory()
45
- def energy_source() -> DualEnergySource:
46
- return DualEnergySource(dcm().energy_in_eV, pgm().energy.user_readback)
59
+ def dual_energy_source() -> DualEnergySource:
60
+ return DualEnergySource(
61
+ dcm().energy_in_eV,
62
+ pgm().energy.user_readback,
63
+ source_selector().selected_source,
64
+ )
65
+
66
+
67
+ @device_factory()
68
+ def fsi1() -> GenericFastShutter[InOut]:
69
+ return GenericFastShutter[InOut](
70
+ f"{I_PREFIX.beamline_prefix}-EA-FSHTR-01:CTRL", InOut.OUT, InOut.IN
71
+ )
72
+
73
+
74
+ @device_factory()
75
+ def fsj1() -> GenericFastShutter[InOut]:
76
+ return GenericFastShutter[InOut](
77
+ f"{J_PREFIX.beamline_prefix}-EA-FSHTR-01:CTRL", InOut.OUT, InOut.IN
78
+ )
79
+
80
+
81
+ @device_factory()
82
+ def dual_fast_shutter() -> DualFastShutter[InOut]:
83
+ return DualFastShutter[InOut](fsi1(), fsj1(), source_selector().selected_source)
47
84
 
48
85
 
49
86
  # Connect will work again after this work completed
@@ -51,9 +88,16 @@ def energy_source() -> DualEnergySource:
51
88
  @device_factory()
52
89
  def ew4000() -> VGScientaDetector[LensMode, PsuMode, PassEnergy]:
53
90
  return VGScientaDetector[LensMode, PsuMode, PassEnergy](
54
- prefix=f"{PREFIX.beamline_prefix}-EA-DET-01:CAM:",
91
+ prefix=f"{I_PREFIX.beamline_prefix}-EA-DET-01:CAM:",
55
92
  lens_mode_type=LensMode,
56
93
  psu_mode_type=PsuMode,
57
94
  pass_energy_type=PassEnergy,
58
- energy_source=energy_source(),
95
+ energy_source=dual_energy_source(),
96
+ shutter=dual_fast_shutter(),
97
+ source_selector=source_selector(),
59
98
  )
99
+
100
+
101
+ @device_factory()
102
+ def lakeshore() -> Lakeshore336:
103
+ return Lakeshore336(prefix="BL09L-VA-LAKE-01:")
dodal/beamlines/i09_1.py CHANGED
@@ -7,7 +7,7 @@ from dodal.devices.common_dcm import (
7
7
  PitchAndRollCrystal,
8
8
  StationaryCrystal,
9
9
  )
10
- from dodal.devices.electron_analyser import EnergySource
10
+ from dodal.devices.electron_analyser.base import EnergySource
11
11
  from dodal.devices.electron_analyser.specs import SpecsDetector
12
12
  from dodal.devices.i09_1 import LensMode, PsuMode
13
13
  from dodal.devices.i09_1_shared.hard_energy import HardEnergy, HardInsertionDeviceEnergy
@@ -16,6 +16,9 @@ from dodal.devices.i09_1_shared.hard_undulator_functions import (
16
16
  calculate_gap_i09_hu,
17
17
  )
18
18
  from dodal.devices.synchrotron import Synchrotron
19
+ from dodal.devices.temperture_controller import (
20
+ Lakeshore336,
21
+ )
19
22
  from dodal.devices.undulator import UndulatorInMm, UndulatorOrder
20
23
  from dodal.log import set_beamline as set_log_beamline
21
24
  from dodal.utils import BeamlinePrefix, get_beamline_name
@@ -82,3 +85,8 @@ def hu_energy() -> HardEnergy:
82
85
  dcm=dcm(),
83
86
  undulator_energy=hu_id_energy(),
84
87
  )
88
+
89
+
90
+ @device_factory()
91
+ def lakeshore() -> Lakeshore336:
92
+ return Lakeshore336(prefix=f"{PREFIX.beamline_prefix}-EA-TCTRL-01:")