dls-dodal 1.66.0__py3-none-any.whl → 1.68.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 (83) hide show
  1. {dls_dodal-1.66.0.dist-info → dls_dodal-1.68.0.dist-info}/METADATA +2 -2
  2. {dls_dodal-1.66.0.dist-info → dls_dodal-1.68.0.dist-info}/RECORD +75 -65
  3. dodal/_version.py +2 -2
  4. dodal/beamlines/b07.py +1 -1
  5. dodal/beamlines/b07_1.py +1 -1
  6. dodal/beamlines/i03.py +92 -208
  7. dodal/beamlines/i04.py +22 -1
  8. dodal/beamlines/i05.py +1 -1
  9. dodal/beamlines/i06.py +1 -1
  10. dodal/beamlines/i09.py +1 -1
  11. dodal/beamlines/i09_1.py +27 -3
  12. dodal/beamlines/i09_2.py +58 -2
  13. dodal/beamlines/i10_optics.py +44 -25
  14. dodal/beamlines/i16.py +23 -0
  15. dodal/beamlines/i17.py +7 -3
  16. dodal/beamlines/i19_1.py +26 -14
  17. dodal/beamlines/i19_2.py +49 -38
  18. dodal/beamlines/i21.py +61 -2
  19. dodal/beamlines/i22.py +16 -1
  20. dodal/beamlines/p60.py +1 -1
  21. dodal/beamlines/training_rig.py +0 -16
  22. dodal/cli.py +26 -12
  23. dodal/common/coordination.py +3 -2
  24. dodal/device_manager.py +604 -0
  25. dodal/devices/cryostream.py +28 -57
  26. dodal/devices/eiger.py +41 -27
  27. dodal/devices/electron_analyser/__init__.py +0 -33
  28. dodal/devices/electron_analyser/base/__init__.py +58 -0
  29. dodal/devices/electron_analyser/base/base_controller.py +73 -0
  30. dodal/devices/electron_analyser/base/base_detector.py +214 -0
  31. dodal/devices/electron_analyser/{abstract → base}/base_driver_io.py +23 -42
  32. dodal/devices/electron_analyser/{abstract → base}/base_region.py +47 -11
  33. dodal/devices/electron_analyser/{util.py → base/base_util.py} +1 -1
  34. dodal/devices/electron_analyser/{energy_sources.py → base/energy_sources.py} +1 -1
  35. dodal/devices/electron_analyser/specs/__init__.py +4 -4
  36. dodal/devices/electron_analyser/specs/specs_detector.py +46 -0
  37. dodal/devices/electron_analyser/specs/{driver_io.py → specs_driver_io.py} +23 -26
  38. dodal/devices/electron_analyser/specs/{region.py → specs_region.py} +4 -3
  39. dodal/devices/electron_analyser/vgscienta/__init__.py +4 -4
  40. dodal/devices/electron_analyser/vgscienta/vgscienta_detector.py +52 -0
  41. dodal/devices/electron_analyser/vgscienta/{driver_io.py → vgscienta_driver_io.py} +25 -31
  42. dodal/devices/electron_analyser/vgscienta/{region.py → vgscienta_region.py} +6 -6
  43. dodal/devices/i04/max_pixel.py +38 -0
  44. dodal/devices/i09_1_shared/__init__.py +8 -1
  45. dodal/devices/i09_1_shared/hard_energy.py +112 -0
  46. dodal/devices/i09_2_shared/__init__.py +0 -0
  47. dodal/devices/i09_2_shared/i09_apple2.py +14 -0
  48. dodal/devices/i10/i10_apple2.py +24 -22
  49. dodal/devices/i17/i17_apple2.py +32 -20
  50. dodal/devices/i19/access_controlled/attenuator_motor_squad.py +61 -0
  51. dodal/devices/i19/access_controlled/blueapi_device.py +9 -1
  52. dodal/devices/i19/access_controlled/shutter.py +2 -4
  53. dodal/devices/i21/__init__.py +3 -1
  54. dodal/devices/insertion_device/__init__.py +58 -0
  55. dodal/devices/{apple2_undulator.py → insertion_device/apple2_undulator.py} +102 -44
  56. dodal/devices/insertion_device/energy_motor_lookup.py +88 -0
  57. dodal/devices/insertion_device/id_enum.py +17 -0
  58. dodal/devices/insertion_device/lookup_table_models.py +317 -0
  59. dodal/devices/motors.py +14 -0
  60. dodal/devices/robot.py +16 -11
  61. dodal/plans/__init__.py +1 -1
  62. dodal/plans/configure_arm_trigger_and_disarm_detector.py +2 -4
  63. dodal/testing/electron_analyser/device_factory.py +4 -4
  64. dodal/testing/fixtures/devices/__init__.py +0 -0
  65. dodal/testing/fixtures/devices/apple2.py +78 -0
  66. dodal/testing/fixtures/run_engine.py +4 -0
  67. dodal/utils.py +6 -3
  68. dodal/devices/electron_analyser/abstract/__init__.py +0 -25
  69. dodal/devices/electron_analyser/abstract/base_detector.py +0 -63
  70. dodal/devices/electron_analyser/abstract/types.py +0 -12
  71. dodal/devices/electron_analyser/detector.py +0 -143
  72. dodal/devices/electron_analyser/specs/detector.py +0 -34
  73. dodal/devices/electron_analyser/types.py +0 -57
  74. dodal/devices/electron_analyser/vgscienta/detector.py +0 -48
  75. dodal/devices/util/lookup_tables_apple2.py +0 -390
  76. {dls_dodal-1.66.0.dist-info → dls_dodal-1.68.0.dist-info}/WHEEL +0 -0
  77. {dls_dodal-1.66.0.dist-info → dls_dodal-1.68.0.dist-info}/entry_points.txt +0 -0
  78. {dls_dodal-1.66.0.dist-info → dls_dodal-1.68.0.dist-info}/licenses/LICENSE +0 -0
  79. {dls_dodal-1.66.0.dist-info → dls_dodal-1.68.0.dist-info}/top_level.txt +0 -0
  80. /dodal/devices/electron_analyser/{enums.py → base/base_enums.py} +0 -0
  81. /dodal/devices/electron_analyser/specs/{enums.py → specs_enums.py} +0 -0
  82. /dodal/devices/electron_analyser/vgscienta/{enums.py → vgscienta_enums.py} +0 -0
  83. /dodal/plans/{scanspec.py → spec_path.py} +0 -0
dodal/beamlines/i03.py CHANGED
@@ -1,17 +1,14 @@
1
- from ophyd_async.core import Reference
1
+ from functools import cache
2
+
3
+ from ophyd_async.core import PathProvider, Reference
2
4
  from ophyd_async.fastcs.eiger import EigerDetector as FastEiger
3
5
  from ophyd_async.fastcs.panda import HDFPanda
4
6
  from yarl import URL
5
7
 
6
8
  from dodal.common.beamlines.beamline_parameters import get_beamline_parameters
7
- from dodal.common.beamlines.beamline_utils import (
8
- device_factory,
9
- device_instantiation,
10
- get_path_provider,
11
- set_path_provider,
12
- )
13
9
  from dodal.common.beamlines.beamline_utils import set_beamline as set_utils_beamline
14
10
  from dodal.common.udc_directory_provider import PandASubpathProvider
11
+ from dodal.device_manager import DeviceManager
15
12
  from dodal.devices.aperturescatterguard import (
16
13
  AperturePosition,
17
14
  ApertureScatterguard,
@@ -21,7 +18,11 @@ from dodal.devices.attenuator.attenuator import BinaryFilterAttenuator
21
18
  from dodal.devices.backlight import Backlight
22
19
  from dodal.devices.baton import Baton
23
20
  from dodal.devices.collimation_table import CollimationTable
24
- from dodal.devices.cryostream import CryoStream, CryoStreamGantry
21
+ from dodal.devices.cryostream import (
22
+ CryoStreamGantry,
23
+ OxfordCryoJet,
24
+ OxfordCryoStream,
25
+ )
25
26
  from dodal.devices.detector.detector_motion import DetectorMotion
26
27
  from dodal.devices.diamond_filter import DiamondFilter, I03Filters
27
28
  from dodal.devices.eiger import EigerDetector
@@ -71,8 +72,6 @@ BL = get_beamline_name("i03")
71
72
  set_log_beamline(BL)
72
73
  set_utils_beamline(BL)
73
74
 
74
- set_path_provider(PandASubpathProvider())
75
-
76
75
  I03_ZEBRA_MAPPING = ZebraMapping(
77
76
  outputs=ZebraTTLOutputs(TTL_DETECTOR=1, TTL_SHUTTER=2, TTL_XSPRESS3=3, TTL_PANDA=4),
78
77
  sources=ZebraSources(),
@@ -80,13 +79,22 @@ I03_ZEBRA_MAPPING = ZebraMapping(
80
79
 
81
80
  PREFIX = BeamlinePrefix(BL)
82
81
 
82
+ devices = DeviceManager()
83
+
84
+
85
+ @devices.fixture
86
+ @cache
87
+ def path_provider() -> PathProvider:
88
+ return PandASubpathProvider()
89
+
90
+
91
+ @devices.fixture
92
+ def daq_configuration_path() -> str:
93
+ return DAQ_CONFIGURATION_PATH
83
94
 
84
- @device_factory()
95
+
96
+ @devices.factory()
85
97
  def aperture_scatterguard() -> ApertureScatterguard:
86
- """Get the i03 aperture and scatterguard device, instantiate it if it hasn't already
87
- been. If this is called when already instantiated in i03, it will return the existing
88
- object.
89
- """
90
98
  params = get_beamline_parameters()
91
99
  return ApertureScatterguard(
92
100
  aperture_prefix=f"{PREFIX.beamline_prefix}-MO-MAPT-01:",
@@ -96,37 +104,28 @@ def aperture_scatterguard() -> ApertureScatterguard:
96
104
  )
97
105
 
98
106
 
99
- @device_factory()
107
+ @devices.factory()
100
108
  def attenuator() -> BinaryFilterAttenuator:
101
- """Get the i03 attenuator device, instantiate it if it hasn't already been.
102
- If this is called when already instantiated in i03, it will return the existing object.
103
- """
104
109
  return BinaryFilterAttenuator(
105
110
  prefix=f"{PREFIX.beamline_prefix}-EA-ATTN-01:",
106
111
  num_filters=16,
107
112
  )
108
113
 
109
114
 
110
- @device_factory()
115
+ @devices.factory()
111
116
  def beamstop() -> Beamstop:
112
- """Get the i03 beamstop device, instantiate it if it hasn't already been.
113
- If this is called when already instantiated in i03, it will return the existing object.
114
- """
115
117
  return Beamstop(
116
118
  prefix=f"{PREFIX.beamline_prefix}-MO-BS-01:",
117
119
  beamline_parameters=get_beamline_parameters(),
118
120
  )
119
121
 
120
122
 
121
- @device_factory()
123
+ @devices.factory()
122
124
  def dcm() -> DCM:
123
- """Get the i03 DCM device, instantiate it if it hasn't already been.
124
- If this is called when already instantiated in i03, it will return the existing object.
125
- """
126
125
  return DCM(prefix=f"{PREFIX.beamline_prefix}-MO-DCM-01:")
127
126
 
128
127
 
129
- @device_factory()
128
+ @devices.factory()
130
129
  def vfm() -> FocusingMirrorWithStripes:
131
130
  return FocusingMirrorWithStripes(
132
131
  prefix=f"{PREFIX.beamline_prefix}-OP-VFM-01:",
@@ -137,7 +136,7 @@ def vfm() -> FocusingMirrorWithStripes:
137
136
  )
138
137
 
139
138
 
140
- @device_factory()
139
+ @devices.factory()
141
140
  def mirror_voltages() -> MirrorVoltages:
142
141
  return MirrorVoltages(
143
142
  prefix=f"{PREFIX.beamline_prefix}-MO-PSU-01:",
@@ -145,334 +144,219 @@ def mirror_voltages() -> MirrorVoltages:
145
144
  )
146
145
 
147
146
 
148
- @device_factory()
147
+ @devices.factory()
149
148
  def backlight() -> Backlight:
150
- """Get the i03 backlight device, instantiate it if it hasn't already been.
151
- If this is called when already instantiated in i03, it will return the existing object.
152
- """
153
149
  return Backlight(prefix=PREFIX.beamline_prefix)
154
150
 
155
151
 
156
- @device_factory()
152
+ @devices.factory()
157
153
  def detector_motion() -> DetectorMotion:
158
- """Get the i03 detector motion device, instantiate it if it hasn't already been.
159
- If this is called when already instantiated in i03, it will return the existing object.
160
- """
161
154
  return DetectorMotion(
162
155
  device_prefix=f"{PREFIX.beamline_prefix}-MO-DET-01:",
163
156
  pmac_prefix=f"{PREFIX.beamline_prefix}-MO-PMAC-02:",
164
157
  )
165
158
 
166
159
 
167
- @device_factory()
168
- def eiger(mock: bool = False) -> EigerDetector:
169
- """Get the i03 Eiger device, instantiate it if it hasn't already been.
170
- If this is called when already instantiated in i03, it will return the existing object.
171
- """
172
-
173
- return device_instantiation(
174
- device_factory=EigerDetector,
175
- name="eiger",
176
- prefix="-EA-EIGER-01:",
177
- wait=False,
178
- fake=mock,
179
- )
180
-
160
+ @devices.v1_init(EigerDetector, prefix="BL03I-EA-EIGER-01:", wait=False)
161
+ def eiger(eiger: EigerDetector) -> EigerDetector:
162
+ return eiger
181
163
 
182
- @device_factory()
183
- def fastcs_eiger() -> FastEiger:
184
- """Get the i03 FastCS Eiger device, instantiate it if it hasn't already been.
185
- If this is called when already instantiated in i03, it will return the existing object.
186
- """
187
164
 
165
+ @devices.factory()
166
+ def fastcs_eiger(path_provider: PathProvider) -> FastEiger:
188
167
  return FastEiger(
189
168
  prefix=PREFIX.beamline_prefix,
190
- path_provider=get_path_provider(),
169
+ path_provider=path_provider,
191
170
  drv_suffix="-EA-EIGER-02:",
192
171
  hdf_suffix="-EA-EIGER-01:OD:",
193
172
  )
194
173
 
195
174
 
196
- @device_factory()
175
+ @devices.factory()
197
176
  def zebra_fast_grid_scan() -> ZebraFastGridScanThreeD:
198
- """Get the i03 zebra_fast_grid_scan device, instantiate it if it hasn't already been.
199
- If this is called when already instantiated in i03, it will return the existing object.
200
- """
201
177
  return ZebraFastGridScanThreeD(
202
178
  prefix=f"{PREFIX.beamline_prefix}-MO-SGON-01:",
203
179
  )
204
180
 
205
181
 
206
- @device_factory()
182
+ @devices.factory()
207
183
  def panda_fast_grid_scan() -> PandAFastGridScan:
208
- """Get the i03 panda_fast_grid_scan device, instantiate it if it hasn't already been.
209
- If this is called when already instantiated in i03, it will return the existing object.
210
- This is used instead of the zebra_fast_grid_scan device when using the PandA.
211
- """
184
+ """This is used instead of the zebra_fast_grid_scan device when using the PandA."""
212
185
  return PandAFastGridScan(prefix=f"{PREFIX.beamline_prefix}-MO-SGON-01:")
213
186
 
214
187
 
215
- @device_factory()
188
+ @devices.factory()
216
189
  def oav(
217
190
  params: OAVConfigBeamCentre | None = None,
218
191
  ) -> OAVBeamCentreFile:
219
- """Get the i03 OAV device, instantiate it if it hasn't already been.
220
- If this is called when already instantiated in i03, it will return the existing object.
221
- """
222
192
  return OAVBeamCentreFile(
223
193
  prefix=f"{PREFIX.beamline_prefix}-DI-OAV-01:",
224
194
  config=params or OAVConfigBeamCentre(ZOOM_PARAMS_FILE, DISPLAY_CONFIG),
225
195
  )
226
196
 
227
197
 
228
- @device_factory()
198
+ @devices.factory()
229
199
  def pin_tip_detection() -> PinTipDetection:
230
- """Get the i03 pin tip detection device, instantiate it if it hasn't already been.
231
- If this is called when already instantiated in i03, it will return the existing object.
232
- """
233
200
  return PinTipDetection(f"{PREFIX.beamline_prefix}-DI-OAV-01:")
234
201
 
235
202
 
236
- @device_factory()
203
+ @devices.factory()
237
204
  def smargon() -> Smargon:
238
- """Get the i03 Smargon device, instantiate it if it hasn't already been.
239
- If this is called when already instantiated in i03, it will return the existing object.
240
- """
241
205
  return Smargon(f"{PREFIX.beamline_prefix}-MO-SGON-01:")
242
206
 
243
207
 
244
- @device_factory()
208
+ @devices.factory()
245
209
  def s4_slit_gaps() -> S4SlitGaps:
246
- """Get the i03 s4_slit_gaps device, instantiate it if it hasn't already been.
247
- If this is called when already instantiated in i03, it will return the existing object.
248
- """
249
210
  return S4SlitGaps(f"{PREFIX.beamline_prefix}-AL-SLITS-04:")
250
211
 
251
212
 
252
- @device_factory()
213
+ @devices.factory()
253
214
  def synchrotron() -> Synchrotron:
254
- """Get the i03 synchrotron device, instantiate it if it hasn't already been.
255
- If this is called when already instantiated in i03, it will return the existing object.
256
- """
257
215
  return Synchrotron()
258
216
 
259
217
 
260
- @device_factory()
261
- def undulator(daq_configuration_path: str | None = None) -> UndulatorInKeV:
262
- """Get the i03 undulator device, instantiate it if it hasn't already been.
263
- If this is called when already instantiated in i03, it will return the existing object.
264
- """
218
+ @devices.factory()
219
+ def undulator(baton: Baton, daq_configuration_path: str) -> UndulatorInKeV:
265
220
  return UndulatorInKeV(
266
221
  f"{BeamlinePrefix(BL).insertion_prefix}-MO-SERVC-01:",
267
- # evaluate here not as parameter default to enable post-import mocking
268
- id_gap_lookup_table_path=f"{daq_configuration_path or DAQ_CONFIGURATION_PATH}/lookup/BeamLine_Undulator_toGap.txt",
269
- baton=baton(),
222
+ id_gap_lookup_table_path=f"{daq_configuration_path}/lookup/BeamLine_Undulator_toGap.txt",
223
+ baton=baton,
270
224
  )
271
225
 
272
226
 
273
- @device_factory()
274
- def undulator_dcm(daq_configuration_path: str | None = None) -> UndulatorDCM:
275
- """Get the i03 undulator DCM device, instantiate it if it hasn't already been.
276
- If this is called when already instantiated in i03, it will return the existing object.
277
- """
278
- # evaluate here not as parameter default to enable post-import mocking
279
- undulator_singleton = (
280
- undulator(daq_configuration_path=daq_configuration_path)
281
- if daq_configuration_path and daq_configuration_path != DAQ_CONFIGURATION_PATH
282
- else undulator()
283
- )
227
+ @devices.factory()
228
+ def undulator_dcm(
229
+ undulator: UndulatorInKeV, dcm: DCM, daq_configuration_path: str
230
+ ) -> UndulatorDCM:
284
231
  return UndulatorDCM(
285
- undulator=undulator_singleton,
286
- dcm=dcm(),
287
- daq_configuration_path=daq_configuration_path or DAQ_CONFIGURATION_PATH,
232
+ undulator=undulator,
233
+ dcm=dcm,
234
+ daq_configuration_path=daq_configuration_path,
288
235
  )
289
236
 
290
237
 
291
- @device_factory()
238
+ @devices.factory()
292
239
  def zebra() -> Zebra:
293
- """Get the i03 zebra device, instantiate it if it hasn't already been.
294
- If this is called when already instantiated in i03, it will return the existing object.
295
- """
296
240
  return Zebra(
297
241
  prefix=f"{PREFIX.beamline_prefix}-EA-ZEBRA-01:",
298
242
  mapping=I03_ZEBRA_MAPPING,
299
243
  )
300
244
 
301
245
 
302
- @device_factory()
246
+ @devices.factory()
303
247
  def xspress3mini() -> Xspress3:
304
- """Get the i03 Xspress3Mini device, instantiate it if it hasn't already been.
305
- If this is called when already instantiated in i03, it will return the existing object.
306
- """
307
248
  return Xspress3(f"{PREFIX.beamline_prefix}-EA-XSP3-01:")
308
249
 
309
250
 
310
- @device_factory()
311
- def panda() -> HDFPanda:
312
- """Get the i03 panda device, instantiate it if it hasn't already been.
313
- If this is called when already instantiated in i03, it will return the existing object.
314
- """
251
+ @devices.factory()
252
+ def panda(path_provider: PathProvider) -> HDFPanda:
315
253
  return HDFPanda(
316
254
  f"{PREFIX.beamline_prefix}-EA-PANDA-01:",
317
- path_provider=get_path_provider(),
255
+ path_provider=path_provider,
318
256
  )
319
257
 
320
258
 
321
- @device_factory()
259
+ @devices.factory()
322
260
  def sample_shutter() -> ZebraShutter:
323
- """Get the i03 sample shutter device, instantiate it if it hasn't already been.
324
- If this is called when already instantiated in i03, it will return the existing object.
325
- """
326
261
  return ZebraShutter(f"{PREFIX.beamline_prefix}-EA-SHTR-01:")
327
262
 
328
263
 
329
- @device_factory()
264
+ @devices.factory()
330
265
  def hutch_shutter() -> HutchShutter:
331
- """Get the i03 hutch shutter device, instantiate it if it hasn't already been.
332
- If this is called when already instantiated in i03, it will return the existing object.
333
- """
334
266
  return HutchShutter(f"{PREFIX.beamline_prefix}-PS-SHTR-01:")
335
267
 
336
268
 
337
- @device_factory()
269
+ @devices.factory()
338
270
  def flux() -> Flux:
339
- """Get the i03 flux device, instantiate it if it hasn't already been.
340
- If this is called when already instantiated in i03, it will return the existing object.
341
- """
342
271
  return Flux(f"{PREFIX.beamline_prefix}-MO-FLUX-01:")
343
272
 
344
273
 
345
- @device_factory()
346
- def xbpm_feedback() -> XBPMFeedback:
347
- """Get the i03 XBPM feeback device, instantiate it if it hasn't already been.
348
- If this is called when already instantiated in i03, it will return the existing object.
349
- """
350
- return XBPMFeedback(f"{PREFIX.beamline_prefix}-EA-FDBK-01:", baton=baton())
274
+ @devices.factory()
275
+ def xbpm_feedback(baton: Baton) -> XBPMFeedback:
276
+ return XBPMFeedback(f"{PREFIX.beamline_prefix}-EA-FDBK-01:", baton=baton)
351
277
 
352
278
 
353
- @device_factory()
279
+ @devices.factory()
354
280
  def zocalo() -> ZocaloResults:
355
- """Get the i03 ZocaloResults device, instantiate it if it hasn't already been.
356
- If this is called when already instantiated in i03, it will return the existing object.
357
- """
358
281
  return ZocaloResults(results_source=ZocaloSource.GPU)
359
282
 
360
283
 
361
- @device_factory()
284
+ @devices.factory()
362
285
  def robot() -> BartRobot:
363
- """Get the i03 robot device, instantiate it if it hasn't already been.
364
- If this is called when already instantiated in i03, it will return the existing object.
365
- """
366
286
  return BartRobot(f"{PREFIX.beamline_prefix}-MO-ROBOT-01:")
367
287
 
368
288
 
369
- @device_factory()
289
+ @devices.factory()
370
290
  def webcam() -> Webcam:
371
- """Get the i03 webcam, instantiate it if it hasn't already been.
372
- If this is called when already instantiated in i03, it will return the existing object.
373
- """
374
291
  return Webcam(url=URL("http://i03-webcam1/axis-cgi/jpg/image.cgi"))
375
292
 
376
293
 
377
- @device_factory()
294
+ @devices.factory()
378
295
  def thawer() -> Thawer:
379
- """Get the i03 thawer, instantiate it if it hasn't already been.
380
- If this is called when already instantiated in i03, it will return the existing object.
381
- """
382
296
  return Thawer(f"{PREFIX.beamline_prefix}-EA-THAW-01")
383
297
 
384
298
 
385
- @device_factory()
299
+ @devices.factory()
386
300
  def lower_gonio() -> XYZStage:
387
- """Get the i03 lower gonio device, instantiate it if it hasn't already been.
388
- If this is called when already instantiated in i03, it will return the existing object.
389
- """
390
301
  return XYZStage(f"{PREFIX.beamline_prefix}-MO-GONP-01:")
391
302
 
392
303
 
393
- @device_factory()
394
- def cryostream() -> CryoStream:
395
- """Get the i03 cryostream device, instantiate it if it hasn't already been.
396
- If this is called when already instantiated in i03, it will return the existing object.
397
- """
398
- return CryoStream(PREFIX.beamline_prefix)
304
+ @devices.factory()
305
+ def cryostream() -> OxfordCryoStream:
306
+ return OxfordCryoStream(f"{PREFIX.beamline_prefix}-EA-CSTRM-01:")
307
+
399
308
 
309
+ @devices.factory()
310
+ def cryojet() -> OxfordCryoJet:
311
+ return OxfordCryoJet(f"{PREFIX.beamline_prefix}-EA-CJET-01:")
400
312
 
401
- @device_factory()
313
+
314
+ @devices.factory()
402
315
  def cryostream_gantry() -> CryoStreamGantry:
403
- """Get the i03 cryostream gantry device, instantiate it if it hasn't already been.
404
- If this is called when already instantiated in i03, it will return the existing object.
405
- """
406
316
  return CryoStreamGantry(PREFIX.beamline_prefix)
407
317
 
408
318
 
409
- @device_factory()
319
+ @devices.factory()
410
320
  def diamond_filter() -> DiamondFilter[I03Filters]:
411
- """Get the i03 diamond filter device, instantiate it if it hasn't already been.
412
- If this is called when already instantiated in i03, it will return the existing object.
413
- """
414
321
  return DiamondFilter[I03Filters](
415
322
  f"{PREFIX.beamline_prefix}-MO-FLTR-01:Y", I03Filters
416
323
  )
417
324
 
418
325
 
419
- @device_factory()
326
+ @devices.factory()
420
327
  def qbpm() -> QBPM:
421
- """Get the i03 qbpm device, instantiate it if it hasn't already been.
422
- If this is called when already instantiated in i03, it will return the existing object.
423
- """
424
328
  return QBPM(f"{PREFIX.beamline_prefix}-DI-QBPM-01:")
425
329
 
426
330
 
427
- @device_factory()
331
+ @devices.factory()
428
332
  def baton() -> Baton:
429
- """Get the i03 baton device, instantiate it if it hasn't already been.
430
- If this is called when already instantiated in i03, it will return the existing object.
431
- """
432
333
  return Baton(f"{PREFIX.beamline_prefix}-CS-BATON-01:")
433
334
 
434
335
 
435
- @device_factory()
336
+ @devices.factory()
436
337
  def fluorescence_det_motion() -> FluorescenceDetector:
437
- """Get the i03 device for moving the fluorescence detector, instantiate it if it hasn't already been.
438
- If this is called when already instantiated in i03, it will return the existing object.
439
- """
440
338
  return FluorescenceDetector(f"{PREFIX.beamline_prefix}-EA-FLU-01:")
441
339
 
442
340
 
443
- @device_factory()
444
- def scintillator() -> Scintillator:
445
- """Get the i03 scintillator device, instantiate it if it hasn't already been.
446
- If this is called when already instantiated in i03, it will return the existing object.
447
- """
341
+ @devices.factory()
342
+ def scintillator(aperture_scatterguard: ApertureScatterguard) -> Scintillator:
448
343
  return Scintillator(
449
344
  f"{PREFIX.beamline_prefix}-MO-SCIN-01:",
450
- Reference(aperture_scatterguard()),
345
+ Reference(aperture_scatterguard),
451
346
  get_beamline_parameters(),
452
347
  )
453
348
 
454
349
 
455
- @device_factory()
350
+ @devices.factory()
456
351
  def collimation_table() -> CollimationTable:
457
- """Get the i03 device for moving the collimation table, instantiate it if it hasn't already been.
458
- If this is called when already instantiated in i03, it will return the existing object.
459
- """
460
352
  return CollimationTable(prefix=f"{PREFIX.beamline_prefix}-MO-TABLE-01")
461
353
 
462
354
 
463
- @device_factory()
464
- def beamsize() -> Beamsize:
465
- """Get the i03 beamsize device, instantiate it if it hasn't already been.
466
- If this is called when already instantiated in i03, it will return the existing object.
467
- """
468
- return Beamsize(
469
- aperture_scatterguard=aperture_scatterguard(),
470
- )
355
+ @devices.factory()
356
+ def beamsize(aperture_scatterguard: ApertureScatterguard) -> Beamsize:
357
+ return Beamsize(aperture_scatterguard)
471
358
 
472
359
 
473
- @device_factory()
360
+ @devices.factory()
474
361
  def ipin() -> IPin:
475
- """Get the i03 ipin device, instantiate it if it hasn't already been.
476
- If this is called when already instantiated in i04, it will return the existing object.
477
- """
478
362
  return IPin(f"{PREFIX.beamline_prefix}-EA-PIN-01:")
dodal/beamlines/i04.py CHANGED
@@ -13,6 +13,7 @@ from dodal.devices.aperturescatterguard import (
13
13
  )
14
14
  from dodal.devices.attenuator.attenuator import BinaryFilterAttenuator
15
15
  from dodal.devices.backlight import Backlight
16
+ from dodal.devices.baton import Baton
16
17
  from dodal.devices.detector import DetectorParams
17
18
  from dodal.devices.detector.detector_motion import DetectorMotion
18
19
  from dodal.devices.diamond_filter import DiamondFilter, I04Filters
@@ -22,6 +23,7 @@ from dodal.devices.flux import Flux
22
23
  from dodal.devices.i03.dcm import DCM
23
24
  from dodal.devices.i04.beamsize import Beamsize
24
25
  from dodal.devices.i04.constants import RedisConstants
26
+ from dodal.devices.i04.max_pixel import MaxPixel
25
27
  from dodal.devices.i04.murko_results import MurkoResultsDevice
26
28
  from dodal.devices.i04.transfocator import Transfocator
27
29
  from dodal.devices.ipin import IPin
@@ -142,12 +144,20 @@ def transfocator() -> Transfocator:
142
144
  return Transfocator(f"{PREFIX.beamline_prefix}-MO-FSWT-01:")
143
145
 
144
146
 
147
+ @device_factory()
148
+ 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
+ return Baton(f"{PREFIX.beamline_prefix}-CS-BATON-01:")
153
+
154
+
145
155
  @device_factory()
146
156
  def xbpm_feedback() -> XBPMFeedback:
147
157
  """Get the i04 xbpm_feedback device, instantiate it if it hasn't already been.
148
158
  If this is called when already instantiated in i04, it will return the existing object.
149
159
  """
150
- return XBPMFeedback(f"{PREFIX.beamline_prefix}-EA-FDBK-01:")
160
+ return XBPMFeedback(f"{PREFIX.beamline_prefix}-EA-FDBK-01:", baton=baton())
151
161
 
152
162
 
153
163
  @device_factory()
@@ -236,6 +246,7 @@ def undulator() -> UndulatorInKeV:
236
246
  return UndulatorInKeV(
237
247
  prefix=f"{PREFIX.insertion_prefix}-MO-SERVC-01:",
238
248
  id_gap_lookup_table_path="/dls_sw/i04/software/daq_configuration/lookup/BeamLine_Undulator_toGap.txt",
249
+ baton=baton(),
239
250
  )
240
251
 
241
252
 
@@ -380,6 +391,16 @@ def scintillator() -> Scintillator:
380
391
  )
381
392
 
382
393
 
394
+ @device_factory()
395
+ 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
+ )
402
+
403
+
383
404
  @device_factory()
384
405
  def beamsize() -> Beamsize:
385
406
  """Get the i04 beamsize device, instantiate it if it hasn't already been.
dodal/beamlines/i05.py CHANGED
@@ -3,7 +3,7 @@ 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.apple2_undulator import (
6
+ from dodal.devices.insertion_device import (
7
7
  Apple2,
8
8
  UndulatorGap,
9
9
  UndulatorLockedPhaseAxes,
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.apple2_undulator import (
5
+ from dodal.devices.insertion_device import (
6
6
  Apple2,
7
7
  UndulatorGap,
8
8
  UndulatorLockedPhaseAxes,
dodal/beamlines/i09.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 DualEnergySource
10
+ from dodal.devices.electron_analyser.base import DualEnergySource
11
11
  from dodal.devices.electron_analyser.vgscienta import VGScientaDetector
12
12
  from dodal.devices.i09 import Grating, LensMode, PassEnergy, PsuMode
13
13
  from dodal.devices.pgm import PlaneGratingMonochromator
dodal/beamlines/i09_1.py CHANGED
@@ -7,9 +7,14 @@ 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
+ from dodal.devices.i09_1_shared.hard_energy import HardEnergy, HardInsertionDeviceEnergy
14
+ from dodal.devices.i09_1_shared.hard_undulator_functions import (
15
+ calculate_energy_i09_hu,
16
+ calculate_gap_i09_hu,
17
+ )
13
18
  from dodal.devices.synchrotron import Synchrotron
14
19
  from dodal.devices.undulator import UndulatorInMm, UndulatorOrder
15
20
  from dodal.log import set_beamline as set_log_beamline
@@ -52,9 +57,28 @@ def analyser() -> SpecsDetector[LensMode, PsuMode]:
52
57
 
53
58
  @device_factory()
54
59
  def undulator() -> UndulatorInMm:
55
- return UndulatorInMm(prefix=f"{PREFIX.beamline_prefix}-MO-UND-01:")
60
+ return UndulatorInMm(prefix=f"{BeamlinePrefix(BL).insertion_prefix}-MO-SERVC-01:")
56
61
 
57
62
 
58
63
  @device_factory()
59
64
  def harmonics() -> UndulatorOrder:
60
- return UndulatorOrder(name="harmonics")
65
+ return UndulatorOrder()
66
+
67
+
68
+ @device_factory()
69
+ def hu_id_energy() -> HardInsertionDeviceEnergy:
70
+ return HardInsertionDeviceEnergy(
71
+ undulator_order=harmonics(),
72
+ undulator=undulator(),
73
+ lut={}, # ToDo https://github.com/DiamondLightSource/sm-bluesky/issues/239
74
+ gap_to_energy_func=calculate_energy_i09_hu,
75
+ energy_to_gap_func=calculate_gap_i09_hu,
76
+ )
77
+
78
+
79
+ @device_factory()
80
+ def hu_energy() -> HardEnergy:
81
+ return HardEnergy(
82
+ dcm=dcm(),
83
+ undulator_energy=hu_id_energy(),
84
+ )