dls-dodal 1.38.0__py3-none-any.whl → 1.39.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.
- {dls_dodal-1.38.0.dist-info → dls_dodal-1.39.0.dist-info}/METADATA +2 -2
- {dls_dodal-1.38.0.dist-info → dls_dodal-1.39.0.dist-info}/RECORD +11 -11
- dodal/_version.py +2 -2
- dodal/beamlines/i03.py +15 -5
- dodal/devices/eiger.py +21 -12
- dodal/devices/fast_grid_scan.py +13 -2
- dodal/devices/i04/transfocator.py +22 -29
- {dls_dodal-1.38.0.dist-info → dls_dodal-1.39.0.dist-info}/LICENSE +0 -0
- {dls_dodal-1.38.0.dist-info → dls_dodal-1.39.0.dist-info}/WHEEL +0 -0
- {dls_dodal-1.38.0.dist-info → dls_dodal-1.39.0.dist-info}/entry_points.txt +0 -0
- {dls_dodal-1.38.0.dist-info → dls_dodal-1.39.0.dist-info}/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.2
|
|
2
2
|
Name: dls-dodal
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.39.0
|
|
4
4
|
Summary: Ophyd devices and other utils that could be used across DLS beamlines
|
|
5
5
|
Author-email: Dominic Oram <dominic.oram@diamond.ac.uk>
|
|
6
6
|
License: Apache License
|
|
@@ -216,7 +216,7 @@ Description-Content-Type: text/markdown
|
|
|
216
216
|
License-File: LICENSE
|
|
217
217
|
Requires-Dist: click
|
|
218
218
|
Requires-Dist: ophyd
|
|
219
|
-
Requires-Dist: ophyd-async
|
|
219
|
+
Requires-Dist: ophyd-async==0.9.0a1
|
|
220
220
|
Requires-Dist: bluesky
|
|
221
221
|
Requires-Dist: pyepics
|
|
222
222
|
Requires-Dist: dataclasses-json
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
dodal/__init__.py,sha256=Ksms_WJF8LTkbm38gEpm1jBpGqcQ8NGvmb2ZJlOE1j8,198
|
|
2
2
|
dodal/__main__.py,sha256=kP2S2RPitnOWpNGokjZ1Yq-1umOtp5sNOZk2B3tBPLM,111
|
|
3
|
-
dodal/_version.py,sha256=
|
|
3
|
+
dodal/_version.py,sha256=axP7CWypT2Bz3lKPHWWB933rMLqtEo77MpRXglYR8Ng,413
|
|
4
4
|
dodal/cli.py,sha256=NieWNUgLUxyck1rHoFAPJjX1xXLzHNdQ-s4wvxYFfps,3757
|
|
5
5
|
dodal/log.py,sha256=ry8WMq1S4WMIAPqtqGeKuegMRN7Jy3qdVTJlkpKXkL8,9503
|
|
6
6
|
dodal/utils.py,sha256=h2sNmTlsaznfxusV1Xj_mXtNjzsWjWAgmps6I0YNA3U,18097
|
|
@@ -11,7 +11,7 @@ dodal/beamlines/__init__.py,sha256=FsS1hMz9nqwTP12UtCJsfVn712mFElcBq2kKKpscp9k,3
|
|
|
11
11
|
dodal/beamlines/adsim.py,sha256=DUAFS1ueoZ6DK2cmZkiEm3NElnaro1mUvyodv14pSmU,1839
|
|
12
12
|
dodal/beamlines/b01_1.py,sha256=0gLjg0O9ttMjHzszSyJ_GT3fnoAB6u4aJ4MdAfjJbHA,1788
|
|
13
13
|
dodal/beamlines/i02_1.py,sha256=d2IyqFMgeaSEyZYm7GMSjTKr7_02SakyC_oARx-XwnY,1204
|
|
14
|
-
dodal/beamlines/i03.py,sha256=
|
|
14
|
+
dodal/beamlines/i03.py,sha256=qm6bAY_M-EZ7ZSxBH3iwOxP9X_xyPXtzzzXGAHKSvcI,19397
|
|
15
15
|
dodal/beamlines/i04.py,sha256=3_cMBAnRuLkzC9ELf0-a-Rq2c76YPNTIJomHqIjys5U,14926
|
|
16
16
|
dodal/beamlines/i10.py,sha256=lkn_xg0pt-vFuWkUGyl62A0xT-Rzs71JztJ1EeQkMi0,11487
|
|
17
17
|
dodal/beamlines/i13_1.py,sha256=MYl2TLomSXvAdEAEMWbNfEIcX46elaugbKtkehLvB8Q,2371
|
|
@@ -46,9 +46,9 @@ dodal/devices/bimorph_mirror.py,sha256=kG9waIdTkKglUrvY_wD9w533oKPqa7fct1-wa_GCF
|
|
|
46
46
|
dodal/devices/cryostream.py,sha256=K-ldpredpeDTzNt4qtQMg99nKJNjBYoXBbK0WJGexzw,656
|
|
47
47
|
dodal/devices/dcm.py,sha256=JbyxLnrS68nnnv39l9XEWgJgXUBqxX6aFo19MZnL36E,2574
|
|
48
48
|
dodal/devices/diamond_filter.py,sha256=A--RHd7WuH-IBhvCyENcRCTP4K-mm_Kqpa0pojpHZow,1098
|
|
49
|
-
dodal/devices/eiger.py,sha256=
|
|
49
|
+
dodal/devices/eiger.py,sha256=YPXriWxsMwRxRcXrdvMzs4Ho5EMqTMbshMir1L0dFmw,15738
|
|
50
50
|
dodal/devices/eiger_odin.py,sha256=ytUH_18YuM1nJDhplS6OTdtADloYvHpO6ppENjVd4jU,7411
|
|
51
|
-
dodal/devices/fast_grid_scan.py,sha256=
|
|
51
|
+
dodal/devices/fast_grid_scan.py,sha256=3obvHokmUf46MehQ6z--wIPthZaVSfc3idNKNnnax6s,11661
|
|
52
52
|
dodal/devices/fluorescence_detector_motion.py,sha256=-1qCSvW0PdT0m6BcoLxrtc0OJ5UDIBsEe11EOLr-gFw,501
|
|
53
53
|
dodal/devices/flux.py,sha256=1CDsq9yU2-ho8MfYBl50Tl9ABZwpUBHnV486PQXKNoQ,462
|
|
54
54
|
dodal/devices/focusing_mirror.py,sha256=vdUPkwyCAZBSR3LQ-EojDOoxVy1ZmOaD_nevETbj7BA,6592
|
|
@@ -96,7 +96,7 @@ dodal/devices/detector/detector.py,sha256=syzkl52kGaMINXCXEviFuYPbgNatm5tioVPDmj
|
|
|
96
96
|
dodal/devices/detector/detector_motion.py,sha256=UGDQriDWRluDZOZh1mDX9w_fPjMD-_BGe11kA36Kezs,1616
|
|
97
97
|
dodal/devices/i03/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
98
98
|
dodal/devices/i03/beamstop.py,sha256=D1-QeGNpNlUE1qtFz-XxgzQGZbvM5bdb09f69yDB7U0,2802
|
|
99
|
-
dodal/devices/i04/transfocator.py,sha256=
|
|
99
|
+
dodal/devices/i04/transfocator.py,sha256=sVI4Bgv-2-DH4-F1nIXMp5Aktevrm3agZnCA-WgjmW8,3780
|
|
100
100
|
dodal/devices/i10/i10_apple2.py,sha256=pEZes8wVCPHiOOcuVhEtqPvtnyphMxqbdp39mDp6xXQ,13165
|
|
101
101
|
dodal/devices/i10/i10_setting_data.py,sha256=69XWgE-YNTiW7C3t67MNcTL5JDDhOo7h-X7DCTpFE5g,164
|
|
102
102
|
dodal/devices/i10/mirrors.py,sha256=E0M5keGI3LGaDHyXQkCCyj6xmixNY1xTSkIaaYwtnP8,794
|
|
@@ -166,9 +166,9 @@ dodal/plans/__init__.py,sha256=nH1jNxw3DzDMg9O8Uda0kqKIalRVEWBrq07OLY6Ey38,93
|
|
|
166
166
|
dodal/plans/save_panda.py,sha256=PHFlkerBhkkU0-o5dNEdi2P95_jD9Lk8yYgaqn9R97o,2538
|
|
167
167
|
dodal/plans/scanspec.py,sha256=Q0AcvTKRT401iGMRDSqK-D523UX5_ofiVMZ_rNXKOx8,2074
|
|
168
168
|
dodal/plans/wrapped.py,sha256=BPMw__RcWvk9v5XnhMsi9_k4KsDEbmXogzD2n1ecbUg,2098
|
|
169
|
-
dls_dodal-1.
|
|
170
|
-
dls_dodal-1.
|
|
171
|
-
dls_dodal-1.
|
|
172
|
-
dls_dodal-1.
|
|
173
|
-
dls_dodal-1.
|
|
174
|
-
dls_dodal-1.
|
|
169
|
+
dls_dodal-1.39.0.dist-info/LICENSE,sha256=tAkwu8-AdEyGxGoSvJ2gVmQdcicWw3j1ZZueVV74M-E,11357
|
|
170
|
+
dls_dodal-1.39.0.dist-info/METADATA,sha256=f1fvkdiyW_ca594EvxsHQeU_S9w_omhpDw0Ph2bdfo0,16696
|
|
171
|
+
dls_dodal-1.39.0.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
|
172
|
+
dls_dodal-1.39.0.dist-info/entry_points.txt,sha256=bycw_EKUzup_rxfCetOwcauXV4kLln_OPpPT8jEnr-I,94
|
|
173
|
+
dls_dodal-1.39.0.dist-info/top_level.txt,sha256=xIozdmZk_wmMV4wugpq9-6eZs0vgADNUKz3j2UAwlhc,6
|
|
174
|
+
dls_dodal-1.39.0.dist-info/RECORD,,
|
dodal/_version.py
CHANGED
dodal/beamlines/i03.py
CHANGED
|
@@ -335,7 +335,9 @@ def synchrotron(
|
|
|
335
335
|
|
|
336
336
|
|
|
337
337
|
def undulator(
|
|
338
|
-
wait_for_connection: bool = True,
|
|
338
|
+
wait_for_connection: bool = True,
|
|
339
|
+
fake_with_ophyd_sim: bool = False,
|
|
340
|
+
daq_configuration_path: str | None = None,
|
|
339
341
|
) -> Undulator:
|
|
340
342
|
"""Get the i03 undulator device, instantiate it if it hasn't already been.
|
|
341
343
|
If this is called when already instantiated in i03, it will return the existing object.
|
|
@@ -347,12 +349,15 @@ def undulator(
|
|
|
347
349
|
wait_for_connection,
|
|
348
350
|
fake_with_ophyd_sim,
|
|
349
351
|
bl_prefix=False,
|
|
350
|
-
|
|
352
|
+
# evaluate here not as parameter default to enable post-import mocking
|
|
353
|
+
id_gap_lookup_table_path=f"{daq_configuration_path or DAQ_CONFIGURATION_PATH}/lookup/BeamLine_Undulator_toGap.txt",
|
|
351
354
|
)
|
|
352
355
|
|
|
353
356
|
|
|
354
357
|
def undulator_dcm(
|
|
355
|
-
wait_for_connection: bool = True,
|
|
358
|
+
wait_for_connection: bool = True,
|
|
359
|
+
fake_with_ophyd_sim: bool = False,
|
|
360
|
+
daq_configuration_path: str | None = None,
|
|
356
361
|
) -> UndulatorDCM:
|
|
357
362
|
"""Get the i03 undulator DCM device, instantiate it if it hasn't already been.
|
|
358
363
|
If this is called when already instantiated in i03, it will return the existing object.
|
|
@@ -363,9 +368,14 @@ def undulator_dcm(
|
|
|
363
368
|
prefix="",
|
|
364
369
|
wait=wait_for_connection,
|
|
365
370
|
fake=fake_with_ophyd_sim,
|
|
366
|
-
undulator=undulator(
|
|
371
|
+
undulator=undulator(
|
|
372
|
+
wait_for_connection,
|
|
373
|
+
fake_with_ophyd_sim,
|
|
374
|
+
daq_configuration_path=daq_configuration_path,
|
|
375
|
+
),
|
|
367
376
|
dcm=dcm(wait_for_connection, fake_with_ophyd_sim),
|
|
368
|
-
|
|
377
|
+
# evaluate here not as parameter default to enable post-import mocking
|
|
378
|
+
daq_configuration_path=daq_configuration_path or DAQ_CONFIGURATION_PATH,
|
|
369
379
|
)
|
|
370
380
|
|
|
371
381
|
|
dodal/devices/eiger.py
CHANGED
|
@@ -62,6 +62,9 @@ class EigerDetector(Device):
|
|
|
62
62
|
arming_status = Status()
|
|
63
63
|
arming_status.set_finished()
|
|
64
64
|
|
|
65
|
+
disarming_status = Status()
|
|
66
|
+
disarming_status.set_finished()
|
|
67
|
+
|
|
65
68
|
def __init__(self, beamline: str = "i03", *args, **kwargs):
|
|
66
69
|
super().__init__(*args, **kwargs)
|
|
67
70
|
self.beamline = beamline
|
|
@@ -140,6 +143,7 @@ class EigerDetector(Device):
|
|
|
140
143
|
def unstage(self) -> bool:
|
|
141
144
|
assert self.detector_params is not None
|
|
142
145
|
try:
|
|
146
|
+
self.disarming_status = Status()
|
|
143
147
|
self.wait_on_arming_if_started()
|
|
144
148
|
if self.detector_params.trigger_mode == TriggerMode.FREE_RUN:
|
|
145
149
|
# In free run mode we have to manually stop odin
|
|
@@ -158,23 +162,28 @@ class EigerDetector(Device):
|
|
|
158
162
|
self.timeouts.general_status_timeout
|
|
159
163
|
)
|
|
160
164
|
self.disable_roi_mode()
|
|
165
|
+
self.disarming_status.set_finished()
|
|
161
166
|
return status_ok
|
|
162
167
|
|
|
163
168
|
def stop(self, *args):
|
|
164
169
|
"""Emergency stop the device, mainly used to clean up after error."""
|
|
165
170
|
LOGGER.info("Eiger stop() called - cleaning up...")
|
|
166
|
-
self.
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
171
|
+
if not self.disarming_status.done:
|
|
172
|
+
LOGGER.info("Eiger still disarming, waiting on disarm")
|
|
173
|
+
self.disarming_status.wait(self.timeouts.arming_timeout)
|
|
174
|
+
else:
|
|
175
|
+
self.wait_on_arming_if_started()
|
|
176
|
+
stop_status = self.odin.stop()
|
|
177
|
+
self.odin.file_writer.start_timeout.set(1).wait(
|
|
178
|
+
self.timeouts.general_status_timeout
|
|
179
|
+
)
|
|
180
|
+
self.disarm_detector()
|
|
181
|
+
stop_status &= self.disable_roi_mode()
|
|
182
|
+
stop_status.wait(self.timeouts.general_status_timeout)
|
|
183
|
+
# See https://github.com/DiamondLightSource/hyperion/issues/1395
|
|
184
|
+
LOGGER.info("Turning off Eiger dev/shm streaming")
|
|
185
|
+
self.odin.fan.dev_shm_enable.set(0).wait()
|
|
186
|
+
LOGGER.info("Eiger has successfully been stopped")
|
|
178
187
|
|
|
179
188
|
def disable_roi_mode(self):
|
|
180
189
|
return self.change_roi_mode(False)
|
dodal/devices/fast_grid_scan.py
CHANGED
|
@@ -45,8 +45,19 @@ class GridAxis:
|
|
|
45
45
|
# refering to the first position
|
|
46
46
|
return self.steps_to_motor_position(self.full_steps - 1)
|
|
47
47
|
|
|
48
|
-
def is_within(self, steps):
|
|
49
|
-
|
|
48
|
+
def is_within(self, steps: float):
|
|
49
|
+
"""
|
|
50
|
+
Determine whether a single axis coordinate is within the grid.
|
|
51
|
+
The coordinate is from a continuous coordinate space based on the
|
|
52
|
+
XRC grid where the origin corresponds to the centre of the first grid box.
|
|
53
|
+
|
|
54
|
+
Args:
|
|
55
|
+
steps: The coordinate to check
|
|
56
|
+
|
|
57
|
+
Returns:
|
|
58
|
+
True if the coordinate falls within the grid.
|
|
59
|
+
"""
|
|
60
|
+
return -0.5 <= steps <= self.full_steps - 0.5
|
|
50
61
|
|
|
51
62
|
|
|
52
63
|
class GridScanParamsCommon(AbstractExperimentWithBeamParams):
|
|
@@ -37,32 +37,18 @@ class Transfocator(StandardReadable):
|
|
|
37
37
|
|
|
38
38
|
super().__init__(name=name)
|
|
39
39
|
|
|
40
|
-
async def
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
await self.number_filters_sp.set(value)
|
|
53
|
-
await self.start.set(1)
|
|
54
|
-
LOGGER.info("Waiting for start_rbv to change to 1")
|
|
55
|
-
await wait_for_value(self.start_rbv, 1, self.TIMEOUT)
|
|
56
|
-
LOGGER.info("Waiting for start_rbv to change to 0")
|
|
57
|
-
await wait_for_value(self.start_rbv, 0, self.TIMEOUT)
|
|
58
|
-
self.latest_pred_vertical_num_lenses = value
|
|
59
|
-
is_set_filters_done = True
|
|
60
|
-
|
|
61
|
-
# The value hasn't changed so assume the device is already set up correctly
|
|
62
|
-
async for value in observe_value(self.predicted_vertical_num_lenses):
|
|
63
|
-
await set_based_on_prediction(value)
|
|
64
|
-
if is_set_filters_done:
|
|
65
|
-
break
|
|
40
|
+
async def set_based_on_prediction(self, value: float):
|
|
41
|
+
# We can only put an integer number of lenses in the beam but the
|
|
42
|
+
# calculation in the IOC returns the theoretical float number of lenses
|
|
43
|
+
value = round(value)
|
|
44
|
+
LOGGER.info(f"Transfocator setting {value} filters")
|
|
45
|
+
await self.number_filters_sp.set(value)
|
|
46
|
+
await self.start.set(1)
|
|
47
|
+
LOGGER.info("Waiting for start_rbv to change to 1")
|
|
48
|
+
await wait_for_value(self.start_rbv, 1, self.TIMEOUT)
|
|
49
|
+
LOGGER.info("Waiting for start_rbv to change to 0")
|
|
50
|
+
await wait_for_value(self.start_rbv, 0, self.TIMEOUT)
|
|
51
|
+
self.latest_pred_vertical_num_lenses = value
|
|
66
52
|
|
|
67
53
|
@AsyncStatus.wrap
|
|
68
54
|
async def set(self, value: float):
|
|
@@ -81,10 +67,17 @@ class Transfocator(StandardReadable):
|
|
|
81
67
|
|
|
82
68
|
if await self.beamsize_set_microns.get_value() != value:
|
|
83
69
|
# Logic in the IOC calculates predicted_vertical_num_lenses when beam_set_microns changes
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
70
|
+
|
|
71
|
+
# Register an observer before setting beamsize_set_microns to ensure we don't miss changes
|
|
72
|
+
predicted_vertical_num_lenses_iterator = observe_value(
|
|
73
|
+
self.predicted_vertical_num_lenses, timeout=self.TIMEOUT
|
|
87
74
|
)
|
|
75
|
+
# Keep initial prediction before setting to later compare with change after setting
|
|
76
|
+
current_prediction = await anext(predicted_vertical_num_lenses_iterator)
|
|
77
|
+
await self.beamsize_set_microns.set(value)
|
|
78
|
+
accepted_prediction = await anext(predicted_vertical_num_lenses_iterator)
|
|
79
|
+
if not math.isclose(current_prediction, accepted_prediction, abs_tol=1e-8):
|
|
80
|
+
await self.set_based_on_prediction(accepted_prediction)
|
|
88
81
|
|
|
89
82
|
number_filters_rbv, vertical_lens_size_rbv = await asyncio.gather(
|
|
90
83
|
self.number_filters_sp.get_value(),
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|