dls-dodal 1.49.0__py3-none-any.whl → 1.50.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.49.0.dist-info → dls_dodal-1.50.0.dist-info}/METADATA +1 -1
- {dls_dodal-1.49.0.dist-info → dls_dodal-1.50.0.dist-info}/RECORD +9 -8
- dodal/_version.py +2 -2
- dodal/devices/hutch_shutter.py +6 -6
- dodal/plans/bimorph.py +333 -0
- {dls_dodal-1.49.0.dist-info → dls_dodal-1.50.0.dist-info}/WHEEL +0 -0
- {dls_dodal-1.49.0.dist-info → dls_dodal-1.50.0.dist-info}/entry_points.txt +0 -0
- {dls_dodal-1.49.0.dist-info → dls_dodal-1.50.0.dist-info}/licenses/LICENSE +0 -0
- {dls_dodal-1.49.0.dist-info → dls_dodal-1.50.0.dist-info}/top_level.txt +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
dls_dodal-1.
|
|
1
|
+
dls_dodal-1.50.0.dist-info/licenses/LICENSE,sha256=tAkwu8-AdEyGxGoSvJ2gVmQdcicWw3j1ZZueVV74M-E,11357
|
|
2
2
|
dodal/__init__.py,sha256=Ksms_WJF8LTkbm38gEpm1jBpGqcQ8NGvmb2ZJlOE1j8,198
|
|
3
3
|
dodal/__main__.py,sha256=kP2S2RPitnOWpNGokjZ1Yq-1umOtp5sNOZk2B3tBPLM,111
|
|
4
|
-
dodal/_version.py,sha256=
|
|
4
|
+
dodal/_version.py,sha256=EDlHUWODqx60XSwjWm_Ktz1n2BnxgiT-qk2UvfHj1II,513
|
|
5
5
|
dodal/cli.py,sha256=NieWNUgLUxyck1rHoFAPJjX1xXLzHNdQ-s4wvxYFfps,3757
|
|
6
6
|
dodal/log.py,sha256=Rt5O3hFZfMnJvQueZvgagQuXnPqHrFxhponOvVkpfrk,9871
|
|
7
7
|
dodal/utils.py,sha256=rqQNalufZPxUPSD2SYuUgWSCpefb8FnqvR6N0t-YcEY,19675
|
|
@@ -67,7 +67,7 @@ dodal/devices/fast_grid_scan.py,sha256=NfP746FfuHW-SWs7c7-O9oocWyVjBpu89WW7kaanl
|
|
|
67
67
|
dodal/devices/fluorescence_detector_motion.py,sha256=-1qCSvW0PdT0m6BcoLxrtc0OJ5UDIBsEe11EOLr-gFw,501
|
|
68
68
|
dodal/devices/flux.py,sha256=1CDsq9yU2-ho8MfYBl50Tl9ABZwpUBHnV486PQXKNoQ,462
|
|
69
69
|
dodal/devices/focusing_mirror.py,sha256=vdUPkwyCAZBSR3LQ-EojDOoxVy1ZmOaD_nevETbj7BA,6592
|
|
70
|
-
dodal/devices/hutch_shutter.py,sha256=
|
|
70
|
+
dodal/devices/hutch_shutter.py,sha256=iY3qWxDr8mDlAvN_BYe2gqpXRM1hlfV3ewdwkwh0_v0,3889
|
|
71
71
|
dodal/devices/ipin.py,sha256=eq5jlKw7WGQi8VLrAWpaAIsZmfiVf-5Q0td_B22H6A4,473
|
|
72
72
|
dodal/devices/linkam3.py,sha256=2sf-_heIsDg4qmqae-w9C2Py8pG8bPB3mT0TFPQIzd0,3869
|
|
73
73
|
dodal/devices/motors.py,sha256=WSNPt9Pi7f-16yDtzAHApLOlUh1Y0aqnFICJIy2zOEs,1671
|
|
@@ -215,6 +215,7 @@ dodal/plan_stubs/data_session.py,sha256=Syc6XKaN1usf7bNWOez8_vAH3byrcROqskmBrSUW
|
|
|
215
215
|
dodal/plan_stubs/motor_utils.py,sha256=Mf8utOA_xmxUa2dLmQ1uRkdfyDTip7D8YcKeCBCQLUQ,4458
|
|
216
216
|
dodal/plan_stubs/wrapped.py,sha256=kC8HH7bx3-sLYu2oieY_502tAdT2OECF8n-fqoL5Bfc,4266
|
|
217
217
|
dodal/plans/__init__.py,sha256=nH1jNxw3DzDMg9O8Uda0kqKIalRVEWBrq07OLY6Ey38,93
|
|
218
|
+
dodal/plans/bimorph.py,sha256=JxDmZDiEvZnz5f22tlaoyivpnaNGiX8kSL82qz5uvMM,11738
|
|
218
219
|
dodal/plans/configure_arm_trigger_and_disarm_detector.py,sha256=pI1AkTH_5hIU56GmmrBdHMhepuDCuQz44V-O4XIaueg,5384
|
|
219
220
|
dodal/plans/save_panda.py,sha256=1fumH7Ih8uDIv8ahAtgQ_vUuR3dz0sfUs4n9TEtEbSs,3053
|
|
220
221
|
dodal/plans/scanspec.py,sha256=Q0AcvTKRT401iGMRDSqK-D523UX5_ofiVMZ_rNXKOx8,2074
|
|
@@ -222,8 +223,8 @@ dodal/plans/verify_undulator_gap.py,sha256=OcDN09-eCoMzsmhKGxvzsH5EapG2zYz0yGCqU
|
|
|
222
223
|
dodal/plans/wrapped.py,sha256=BPMw__RcWvk9v5XnhMsi9_k4KsDEbmXogzD2n1ecbUg,2098
|
|
223
224
|
dodal/plans/preprocessors/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
224
225
|
dodal/plans/preprocessors/verify_undulator_gap.py,sha256=cBZEGq8TW1jrXFXB00iClQVXSEaE_jP_rHMY9WTgYyY,1813
|
|
225
|
-
dls_dodal-1.
|
|
226
|
-
dls_dodal-1.
|
|
227
|
-
dls_dodal-1.
|
|
228
|
-
dls_dodal-1.
|
|
229
|
-
dls_dodal-1.
|
|
226
|
+
dls_dodal-1.50.0.dist-info/METADATA,sha256=HHVwD53GPNpl389XdyNTqmiuW6uEBg1tsRZh7j8HU1g,16839
|
|
227
|
+
dls_dodal-1.50.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
228
|
+
dls_dodal-1.50.0.dist-info/entry_points.txt,sha256=bycw_EKUzup_rxfCetOwcauXV4kLln_OPpPT8jEnr-I,94
|
|
229
|
+
dls_dodal-1.50.0.dist-info/top_level.txt,sha256=xIozdmZk_wmMV4wugpq9-6eZs0vgADNUKz3j2UAwlhc,6
|
|
230
|
+
dls_dodal-1.50.0.dist-info/RECORD,,
|
dodal/_version.py
CHANGED
dodal/devices/hutch_shutter.py
CHANGED
|
@@ -81,14 +81,14 @@ class HutchShutter(StandardReadable, Movable[ShutterDemand]):
|
|
|
81
81
|
|
|
82
82
|
@AsyncStatus.wrap
|
|
83
83
|
async def set(self, value: ShutterDemand):
|
|
84
|
-
interlock_state = await self.interlock.shutter_safe_to_operate()
|
|
85
|
-
if not interlock_state and not TEST_MODE:
|
|
86
|
-
# If not in test mode, fail. If in test mode, the optics hutch may be open.
|
|
87
|
-
raise ShutterNotSafeToOperateError(
|
|
88
|
-
"The hutch has not been locked, not operating shutter."
|
|
89
|
-
)
|
|
90
84
|
if not TEST_MODE:
|
|
91
85
|
if value == ShutterDemand.OPEN:
|
|
86
|
+
interlock_state = await self.interlock.shutter_safe_to_operate()
|
|
87
|
+
if not interlock_state:
|
|
88
|
+
# If not in test mode, fail. If in test mode, the optics hutch may be open.
|
|
89
|
+
raise ShutterNotSafeToOperateError(
|
|
90
|
+
"The hutch has not been locked, not operating shutter."
|
|
91
|
+
)
|
|
92
92
|
await self.control.set(ShutterDemand.RESET, wait=True)
|
|
93
93
|
await self.control.set(value, wait=True)
|
|
94
94
|
return await wait_for_value(
|
dodal/plans/bimorph.py
ADDED
|
@@ -0,0 +1,333 @@
|
|
|
1
|
+
from collections.abc import Generator
|
|
2
|
+
from dataclasses import dataclass
|
|
3
|
+
from enum import Enum
|
|
4
|
+
from typing import Any
|
|
5
|
+
|
|
6
|
+
import bluesky.plan_stubs as bps
|
|
7
|
+
import bluesky.preprocessors as bpp
|
|
8
|
+
from bluesky.protocols import Preparable, Readable
|
|
9
|
+
from bluesky.utils import MsgGenerator
|
|
10
|
+
from numpy import linspace
|
|
11
|
+
from ophyd_async.core import TriggerInfo
|
|
12
|
+
|
|
13
|
+
from dodal.devices.bimorph_mirror import BimorphMirror
|
|
14
|
+
from dodal.devices.slits import Slits
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
class SlitDimension(str, Enum):
|
|
18
|
+
"""Enum representing the dimensions of a 2d slit
|
|
19
|
+
|
|
20
|
+
Used to describe which dimension the pencil beam scan should move across.
|
|
21
|
+
The other dimension will be held constant.
|
|
22
|
+
|
|
23
|
+
Attributes:
|
|
24
|
+
X: Represents X dimension
|
|
25
|
+
Y: Represents Y dimension
|
|
26
|
+
"""
|
|
27
|
+
|
|
28
|
+
X = "X"
|
|
29
|
+
Y = "Y"
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
def move_slits(slits: Slits, dimension: SlitDimension, gap: float, center: float):
|
|
33
|
+
"""Moves ones dimension of Slits object to given position.
|
|
34
|
+
|
|
35
|
+
Args:
|
|
36
|
+
slits: Slits to move
|
|
37
|
+
dimension: SlitDimension (X or Y)
|
|
38
|
+
gap: float size of gap
|
|
39
|
+
center: float position of center
|
|
40
|
+
"""
|
|
41
|
+
if dimension == SlitDimension.X:
|
|
42
|
+
yield from bps.mv(slits.x_gap, gap)
|
|
43
|
+
yield from bps.mv(slits.x_centre, center)
|
|
44
|
+
else:
|
|
45
|
+
yield from bps.mv(slits.y_gap, gap)
|
|
46
|
+
yield from bps.mv(slits.y_centre, center)
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
def check_valid_bimorph_state(
|
|
50
|
+
voltage_list: list[float], abs_range: float, abs_diff: float
|
|
51
|
+
) -> bool:
|
|
52
|
+
"""Checks that a set of bimorph voltages is valid.
|
|
53
|
+
Args:
|
|
54
|
+
voltage_list: float amount each actuator will be increased by per scan
|
|
55
|
+
abs_range: float absolute value of maximum possible voltage of each actuator
|
|
56
|
+
abs_diff: float absolute maximum difference between two consecutive actuators
|
|
57
|
+
|
|
58
|
+
Returns:
|
|
59
|
+
Bool representing state validity
|
|
60
|
+
"""
|
|
61
|
+
for voltage in voltage_list:
|
|
62
|
+
if abs(voltage) > abs_range:
|
|
63
|
+
return False
|
|
64
|
+
|
|
65
|
+
for i in range(len(voltage_list) - 1):
|
|
66
|
+
if abs(voltage_list[i] - voltage_list[i - 1]) > abs_diff:
|
|
67
|
+
return False
|
|
68
|
+
|
|
69
|
+
return True
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
def validate_bimorph_plan(
|
|
73
|
+
initial_voltage_list: list[float],
|
|
74
|
+
voltage_increment: float,
|
|
75
|
+
abs_range: float,
|
|
76
|
+
abs_diff: float,
|
|
77
|
+
) -> bool:
|
|
78
|
+
"""Checks that every position the bimorph will move through will not error.
|
|
79
|
+
|
|
80
|
+
Args:
|
|
81
|
+
initial_voltage_list: float list starting position
|
|
82
|
+
voltage_increment: float amount each actuator will be increased by per scan
|
|
83
|
+
abs_range: float absolute value of maximum possible voltage of each actuator
|
|
84
|
+
abs_diff: float absolute maximum difference between two consecutive actuators
|
|
85
|
+
|
|
86
|
+
Raises:
|
|
87
|
+
Exception if the plan will lead to an error state"""
|
|
88
|
+
voltage_list = initial_voltage_list.copy()
|
|
89
|
+
|
|
90
|
+
if not check_valid_bimorph_state(voltage_list, abs_range, abs_diff):
|
|
91
|
+
raise ValueError(f"Bimorph plan reaches invalid state at: {voltage_list}")
|
|
92
|
+
|
|
93
|
+
for i in range(len(initial_voltage_list)):
|
|
94
|
+
voltage_list[i] += voltage_increment
|
|
95
|
+
|
|
96
|
+
if not check_valid_bimorph_state(voltage_list, abs_range, abs_diff):
|
|
97
|
+
raise ValueError(f"Bimorph plan reaches invalid state at: {voltage_list}")
|
|
98
|
+
|
|
99
|
+
return True
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
@dataclass
|
|
103
|
+
class BimorphState:
|
|
104
|
+
"""Data class containing positions of BimorphMirror and Slits"""
|
|
105
|
+
|
|
106
|
+
voltages: list[float]
|
|
107
|
+
x_gap: float
|
|
108
|
+
y_gap: float
|
|
109
|
+
x_center: float
|
|
110
|
+
y_center: float
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
def capture_bimorph_state(mirror: BimorphMirror, slits: Slits):
|
|
114
|
+
"""Plan stub that captures current position of BimorphMirror and Slits.
|
|
115
|
+
|
|
116
|
+
Args:
|
|
117
|
+
mirror: BimorphMirror to read from
|
|
118
|
+
slits: Slits to read from
|
|
119
|
+
|
|
120
|
+
Returns:
|
|
121
|
+
A BimorphState containing BimorphMirror and Slits positions"""
|
|
122
|
+
original_voltage_list = []
|
|
123
|
+
|
|
124
|
+
for channel in mirror.channels.values():
|
|
125
|
+
position = yield from bps.rd(channel.output_voltage)
|
|
126
|
+
original_voltage_list.append(position)
|
|
127
|
+
|
|
128
|
+
original_x_gap = yield from bps.rd(slits.x_gap)
|
|
129
|
+
original_y_gap = yield from bps.rd(slits.y_gap)
|
|
130
|
+
original_x_center = yield from bps.rd(slits.x_centre)
|
|
131
|
+
original_y_center = yield from bps.rd(slits.y_centre)
|
|
132
|
+
return BimorphState(
|
|
133
|
+
original_voltage_list,
|
|
134
|
+
original_x_gap,
|
|
135
|
+
original_y_gap,
|
|
136
|
+
original_x_center,
|
|
137
|
+
original_y_center,
|
|
138
|
+
)
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
def restore_bimorph_state(mirror: BimorphMirror, slits: Slits, state: BimorphState):
|
|
142
|
+
"""Moves BimorphMirror and Slits to state given in BirmophState.
|
|
143
|
+
|
|
144
|
+
Args:
|
|
145
|
+
mirror: BimorphMirror to move
|
|
146
|
+
slits: Slits to move
|
|
147
|
+
state: BimorphState to move to.
|
|
148
|
+
"""
|
|
149
|
+
yield from move_slits(slits, SlitDimension.X, state.x_gap, state.x_center)
|
|
150
|
+
yield from move_slits(slits, SlitDimension.Y, state.y_gap, state.y_center)
|
|
151
|
+
|
|
152
|
+
yield from bps.mv(mirror, state.voltages) # type: ignore
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+
def bimorph_position_generator(
|
|
156
|
+
initial_voltage_list: list[float], voltage_increment: float
|
|
157
|
+
) -> Generator[list[float], None, None]:
|
|
158
|
+
"""Generator that produces bimorph positions, starting with the initial_voltage_list.
|
|
159
|
+
|
|
160
|
+
Args:
|
|
161
|
+
initial_voltage_list: list starting position for bimorph
|
|
162
|
+
voltage_increment: float amount to increase each actuator by in turn
|
|
163
|
+
|
|
164
|
+
Yields:
|
|
165
|
+
List bimorph positions, starting with initial_voltage_list
|
|
166
|
+
"""
|
|
167
|
+
voltage_list = initial_voltage_list.copy()
|
|
168
|
+
|
|
169
|
+
for i in range(-1, len(initial_voltage_list)):
|
|
170
|
+
yield [
|
|
171
|
+
voltage + voltage_increment if i >= j else voltage
|
|
172
|
+
for (j, voltage) in enumerate(voltage_list)
|
|
173
|
+
]
|
|
174
|
+
|
|
175
|
+
|
|
176
|
+
def bimorph_optimisation(
|
|
177
|
+
detectors: list[Readable],
|
|
178
|
+
mirror: BimorphMirror,
|
|
179
|
+
slits: Slits,
|
|
180
|
+
voltage_increment: float,
|
|
181
|
+
active_dimension: SlitDimension,
|
|
182
|
+
active_slit_center_start: float,
|
|
183
|
+
active_slit_center_end: float,
|
|
184
|
+
active_slit_size: float,
|
|
185
|
+
inactive_slit_center: float,
|
|
186
|
+
inactive_slit_size: float,
|
|
187
|
+
number_of_slit_positions: int,
|
|
188
|
+
bimorph_settle_time: float,
|
|
189
|
+
slit_settle_time: float,
|
|
190
|
+
initial_voltage_list: list | None = None,
|
|
191
|
+
metadata: dict[str, Any] | None = None,
|
|
192
|
+
) -> MsgGenerator:
|
|
193
|
+
"""Plan for performing bimorph mirror optimisation.
|
|
194
|
+
|
|
195
|
+
Bluesky plan that performs a series of pencil beam scans across one axis of a
|
|
196
|
+
bimorph mirror, of using a 2-dimensional slit.
|
|
197
|
+
|
|
198
|
+
Args:
|
|
199
|
+
detectors: list[Readable] detectors
|
|
200
|
+
bimorph: BimorphMirror to move
|
|
201
|
+
slit: Slits
|
|
202
|
+
voltage_increment: float voltage increment applied to each bimorph electrode
|
|
203
|
+
active_dimension: SlitDimension that slit will move in (X or Y)
|
|
204
|
+
active_slit_center_start: float start position of center of slit in active dimension
|
|
205
|
+
active_slit_center_end: float final position of center of slit in active dimension
|
|
206
|
+
active_slit_size: float size of slit in active dimension
|
|
207
|
+
inactive_slit_center: float center of slit in inactive dimension
|
|
208
|
+
inactive_slit_size: float size of slit in inactive dimension
|
|
209
|
+
number_of_slit_positions: int number of slit positions per pencil beam scan
|
|
210
|
+
bimorph_settle_time: float time in seconds to wait after bimorph move
|
|
211
|
+
slit_settle_time: float time in seconds to wait after slit move
|
|
212
|
+
initial_voltage_list: optional list[float] starting voltages for bimorph (defaults to current voltages)
|
|
213
|
+
metadata: optional dict[str, Any] metadata to add to start document
|
|
214
|
+
"""
|
|
215
|
+
|
|
216
|
+
_metadata = {
|
|
217
|
+
"plan_args": {
|
|
218
|
+
"detectors": {det.name for det in detectors},
|
|
219
|
+
"mirror": mirror.name,
|
|
220
|
+
"slits": slits.name,
|
|
221
|
+
"voltage_increment": voltage_increment,
|
|
222
|
+
"active_dimension": active_dimension,
|
|
223
|
+
"active_slit_center_start": active_slit_center_start,
|
|
224
|
+
"active_slit_center_end": active_slit_center_end,
|
|
225
|
+
"active_slit_size": active_slit_size,
|
|
226
|
+
"inactive_slit_center": inactive_slit_center,
|
|
227
|
+
"inactive_slit_size": inactive_slit_size,
|
|
228
|
+
"number_of_slit_positions": number_of_slit_positions,
|
|
229
|
+
"bimorph_settle_time": bimorph_settle_time,
|
|
230
|
+
"slit_settle_time": slit_settle_time,
|
|
231
|
+
"initial_voltage_list": initial_voltage_list,
|
|
232
|
+
},
|
|
233
|
+
"plan_name": "bimorph_optimisation",
|
|
234
|
+
"shape": [len(mirror.channels), number_of_slit_positions],
|
|
235
|
+
**(metadata or {}),
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
state = yield from capture_bimorph_state(mirror, slits)
|
|
239
|
+
|
|
240
|
+
# If a starting set of voltages is not provided, default to current:
|
|
241
|
+
initial_voltage_list = initial_voltage_list or state.voltages
|
|
242
|
+
|
|
243
|
+
bimorph_positions = bimorph_position_generator(
|
|
244
|
+
initial_voltage_list, voltage_increment
|
|
245
|
+
)
|
|
246
|
+
|
|
247
|
+
validate_bimorph_plan(initial_voltage_list, voltage_increment, 1000, 500)
|
|
248
|
+
|
|
249
|
+
inactive_dimension = (
|
|
250
|
+
SlitDimension.Y if active_dimension == SlitDimension.X else SlitDimension.X
|
|
251
|
+
)
|
|
252
|
+
|
|
253
|
+
@bpp.run_decorator(md=_metadata)
|
|
254
|
+
@bpp.stage_decorator((*detectors, mirror, slits))
|
|
255
|
+
def outer_scan():
|
|
256
|
+
"""Outer plan stub, which moves mirror and calls inner_scan."""
|
|
257
|
+
for detector in detectors:
|
|
258
|
+
if isinstance(detector, Preparable):
|
|
259
|
+
yield from bps.prepare(detector, TriggerInfo(), wait=True)
|
|
260
|
+
|
|
261
|
+
stream_name = "0"
|
|
262
|
+
yield from bps.declare_stream(*detectors, mirror, slits, name=stream_name)
|
|
263
|
+
|
|
264
|
+
# Move slits into starting position:
|
|
265
|
+
yield from move_slits(
|
|
266
|
+
slits, active_dimension, active_slit_size, active_slit_center_start
|
|
267
|
+
)
|
|
268
|
+
yield from move_slits(
|
|
269
|
+
slits, inactive_dimension, inactive_slit_size, inactive_slit_center
|
|
270
|
+
)
|
|
271
|
+
yield from bps.sleep(slit_settle_time)
|
|
272
|
+
|
|
273
|
+
for bimorph_position in bimorph_positions:
|
|
274
|
+
yield from bps.mv(
|
|
275
|
+
mirror, # type: ignore
|
|
276
|
+
bimorph_position, # type: ignore
|
|
277
|
+
)
|
|
278
|
+
yield from bps.sleep(bimorph_settle_time)
|
|
279
|
+
|
|
280
|
+
yield from bps.declare_stream(*detectors, mirror, slits, name=stream_name)
|
|
281
|
+
|
|
282
|
+
yield from inner_scan(
|
|
283
|
+
detectors,
|
|
284
|
+
mirror,
|
|
285
|
+
slits,
|
|
286
|
+
active_dimension,
|
|
287
|
+
active_slit_center_start,
|
|
288
|
+
active_slit_center_end,
|
|
289
|
+
active_slit_size,
|
|
290
|
+
number_of_slit_positions,
|
|
291
|
+
slit_settle_time,
|
|
292
|
+
stream_name,
|
|
293
|
+
)
|
|
294
|
+
|
|
295
|
+
stream_name = str(int(stream_name) + 1)
|
|
296
|
+
|
|
297
|
+
yield from outer_scan()
|
|
298
|
+
|
|
299
|
+
yield from restore_bimorph_state(mirror, slits, state)
|
|
300
|
+
|
|
301
|
+
|
|
302
|
+
def inner_scan(
|
|
303
|
+
detectors: list[Readable],
|
|
304
|
+
mirror: BimorphMirror,
|
|
305
|
+
slits: Slits,
|
|
306
|
+
active_dimension: SlitDimension,
|
|
307
|
+
active_slit_center_start: float,
|
|
308
|
+
active_slit_center_end: float,
|
|
309
|
+
active_slit_size: float,
|
|
310
|
+
number_of_slit_positions: int,
|
|
311
|
+
slit_settle_time: float,
|
|
312
|
+
stream_name: str,
|
|
313
|
+
):
|
|
314
|
+
"""Inner plan stub, which moves Slits and performs a read.
|
|
315
|
+
|
|
316
|
+
Args:
|
|
317
|
+
mirror: BimorphMirror to move
|
|
318
|
+
slit: Slits
|
|
319
|
+
oav: oav on-axis viewer
|
|
320
|
+
active_dimension: SlitDimension that slit will move in (X or Y)
|
|
321
|
+
active_slit_center_start: float start position of center of slit in active dimension
|
|
322
|
+
active_slit_center_end: float final position of center of slit in active dimension
|
|
323
|
+
active_slit_size: float size of slit in active dimension
|
|
324
|
+
number_of_slit_positions: int number of slit positions per pencil beam scan
|
|
325
|
+
slit_settle_time: float time in seconds to wait after slit move
|
|
326
|
+
stream_name: str name to pass to trigger_and_read
|
|
327
|
+
"""
|
|
328
|
+
for value in linspace(
|
|
329
|
+
active_slit_center_start, active_slit_center_end, number_of_slit_positions
|
|
330
|
+
):
|
|
331
|
+
yield from move_slits(slits, active_dimension, active_slit_size, value)
|
|
332
|
+
yield from bps.sleep(slit_settle_time)
|
|
333
|
+
yield from bps.trigger_and_read([*detectors, mirror, slits], name=stream_name)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|