mx-bluesky 1.5.4__py3-none-any.whl → 1.5.5__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.
- mx_bluesky/_version.py +2 -2
- mx_bluesky/beamlines/i04/__init__.py +6 -1
- mx_bluesky/beamlines/i04/redis_to_murko_forwarder.py +2 -3
- mx_bluesky/beamlines/i04/thawing_plan.py +173 -59
- mx_bluesky/beamlines/i24/serial/blueapi_config.yaml +1 -1
- mx_bluesky/beamlines/i24/serial/dcid.py +4 -25
- mx_bluesky/beamlines/i24/serial/extruder/EX-gui-edm/DetStage.edl +4 -7
- mx_bluesky/beamlines/i24/serial/extruder/EX-gui-edm/DiamondExtruder-I24-py3v1.edl +5 -5
- mx_bluesky/beamlines/i24/serial/extruder/i24ssx_Extruder_Collect_py3v2.py +18 -107
- mx_bluesky/beamlines/i24/serial/fixed_target/FT-gui-edm/CustomChip_py3v1.edl +1 -1
- mx_bluesky/beamlines/i24/serial/fixed_target/FT-gui-edm/DetStage.edl +1 -4
- mx_bluesky/beamlines/i24/serial/fixed_target/FT-gui-edm/DiamondChipI24-py3v1.edl +13 -13
- mx_bluesky/beamlines/i24/serial/fixed_target/FT-gui-edm/MappingLite-oxford_py3v1.edl +8 -8
- mx_bluesky/beamlines/i24/serial/fixed_target/FT-gui-edm/pumpprobe-py3v1.edl +7 -7
- mx_bluesky/beamlines/i24/serial/fixed_target/i24ssx_Chip_Collect_py3v1.py +8 -92
- mx_bluesky/beamlines/i24/serial/fixed_target/i24ssx_Chip_Manager_py3v1.py +2 -18
- mx_bluesky/beamlines/i24/serial/parameters/constants.py +0 -2
- mx_bluesky/beamlines/i24/serial/parameters/experiment_parameters.py +1 -6
- mx_bluesky/beamlines/i24/serial/parameters/fixed_target/cs/cs_maker.json +3 -3
- mx_bluesky/beamlines/i24/serial/run_extruder.sh +15 -0
- mx_bluesky/beamlines/i24/serial/run_fixed_target.sh +17 -0
- mx_bluesky/beamlines/i24/serial/set_visit_directory.sh +1 -1
- mx_bluesky/beamlines/i24/serial/setup_beamline/__init__.py +1 -2
- mx_bluesky/beamlines/i24/serial/setup_beamline/pv.py +0 -25
- mx_bluesky/beamlines/i24/serial/setup_beamline/pv_abstract.py +1 -30
- mx_bluesky/beamlines/i24/serial/setup_beamline/setup_beamline.py +0 -94
- mx_bluesky/beamlines/i24/serial/setup_beamline/setup_detector.py +4 -10
- mx_bluesky/beamlines/i24/serial/setup_beamline/setup_zebra_plans.py +12 -20
- mx_bluesky/beamlines/i24/serial/web_gui_plans/general_plans.py +4 -13
- mx_bluesky/beamlines/i24/serial/write_nexus.py +34 -9
- mx_bluesky/common/external_interaction/callbacks/common/ispyb_callback_base.py +1 -1
- mx_bluesky/common/external_interaction/callbacks/common/plan_reactive_callback.py +2 -2
- mx_bluesky/common/external_interaction/callbacks/xray_centre/ispyb_callback.py +2 -2
- mx_bluesky/common/external_interaction/callbacks/xray_centre/nexus_callback.py +2 -2
- mx_bluesky/hyperion/baton_handler.py +41 -4
- mx_bluesky/hyperion/external_interaction/alerting/constants.py +2 -7
- mx_bluesky/hyperion/external_interaction/callbacks/rotation/ispyb_callback.py +2 -2
- {mx_bluesky-1.5.4.dist-info → mx_bluesky-1.5.5.dist-info}/METADATA +2 -2
- {mx_bluesky-1.5.4.dist-info → mx_bluesky-1.5.5.dist-info}/RECORD +43 -43
- {mx_bluesky-1.5.4.dist-info → mx_bluesky-1.5.5.dist-info}/WHEEL +0 -0
- {mx_bluesky-1.5.4.dist-info → mx_bluesky-1.5.5.dist-info}/entry_points.txt +0 -0
- {mx_bluesky-1.5.4.dist-info → mx_bluesky-1.5.5.dist-info}/licenses/LICENSE +0 -0
- {mx_bluesky-1.5.4.dist-info → mx_bluesky-1.5.5.dist-info}/top_level.txt +0 -0
mx_bluesky/_version.py
CHANGED
|
@@ -28,7 +28,7 @@ version_tuple: VERSION_TUPLE
|
|
|
28
28
|
commit_id: COMMIT_ID
|
|
29
29
|
__commit_id__: COMMIT_ID
|
|
30
30
|
|
|
31
|
-
__version__ = version = '1.5.
|
|
32
|
-
__version_tuple__ = version_tuple = (1, 5,
|
|
31
|
+
__version__ = version = '1.5.5'
|
|
32
|
+
__version_tuple__ = version_tuple = (1, 5, 5)
|
|
33
33
|
|
|
34
34
|
__commit_id__ = commit_id = None
|
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
from mx_bluesky.beamlines.i04.experiment_plans.i04_grid_detect_then_xray_centre_plan import (
|
|
2
2
|
i04_grid_detect_then_xray_centre,
|
|
3
3
|
)
|
|
4
|
-
from mx_bluesky.beamlines.i04.thawing_plan import
|
|
4
|
+
from mx_bluesky.beamlines.i04.thawing_plan import (
|
|
5
|
+
thaw,
|
|
6
|
+
thaw_and_murko_centre,
|
|
7
|
+
thaw_and_stream_to_redis,
|
|
8
|
+
)
|
|
5
9
|
|
|
6
10
|
__all__ = [
|
|
7
11
|
"thaw",
|
|
8
12
|
"thaw_and_stream_to_redis",
|
|
9
13
|
"i04_grid_detect_then_xray_centre",
|
|
14
|
+
"thaw_and_murko_centre",
|
|
10
15
|
]
|
|
@@ -7,6 +7,7 @@ from typing import TypedDict
|
|
|
7
7
|
import numpy as np
|
|
8
8
|
import zmq
|
|
9
9
|
from dodal.devices.i04.constants import RedisConstants
|
|
10
|
+
from dodal.devices.i04.murko_results import FullMurkoResults, MurkoResult
|
|
10
11
|
from numpy.typing import NDArray
|
|
11
12
|
from PIL import Image
|
|
12
13
|
from redis import StrictRedis
|
|
@@ -15,9 +16,6 @@ from mx_bluesky.common.utils.log import LOGGER
|
|
|
15
16
|
|
|
16
17
|
MURKO_ADDRESS = "tcp://i04-murko-prod.diamond.ac.uk:8008"
|
|
17
18
|
|
|
18
|
-
MurkoResult = dict
|
|
19
|
-
FullMurkoResults = dict[str, list[MurkoResult]]
|
|
20
|
-
|
|
21
19
|
|
|
22
20
|
class MurkoRequest(TypedDict):
|
|
23
21
|
"""See https://github.com/MartinSavko/murko#usage for more information."""
|
|
@@ -96,6 +94,7 @@ class BatchMurkoForwarder:
|
|
|
96
94
|
],
|
|
97
95
|
"prefix": uuids,
|
|
98
96
|
}
|
|
97
|
+
|
|
99
98
|
results = send_to_murko_and_get_results(request_arguments)
|
|
100
99
|
results_with_uuids = _correlate_results_to_uuids(request_arguments, results)
|
|
101
100
|
self._send_murko_results_to_redis(sample_id, results_with_uuids)
|
|
@@ -2,10 +2,11 @@ from collections.abc import Callable
|
|
|
2
2
|
|
|
3
3
|
import bluesky.plan_stubs as bps
|
|
4
4
|
import bluesky.preprocessors as bpp
|
|
5
|
-
from bluesky.preprocessors import run_decorator, subs_decorator
|
|
5
|
+
from bluesky.preprocessors import run_decorator, stage_wrapper, subs_decorator
|
|
6
6
|
from bluesky.utils import MsgGenerator
|
|
7
7
|
from dodal.common import inject
|
|
8
8
|
from dodal.devices.i04.constants import RedisConstants
|
|
9
|
+
from dodal.devices.i04.murko_results import MurkoResultsDevice
|
|
9
10
|
from dodal.devices.oav.oav_detector import OAV
|
|
10
11
|
from dodal.devices.oav.oav_to_redis_forwarder import OAVToRedisForwarder, Source
|
|
11
12
|
from dodal.devices.robot import BartRobot
|
|
@@ -15,6 +16,26 @@ from dodal.devices.thawer import OnOff, Thawer
|
|
|
15
16
|
from mx_bluesky.beamlines.i04.callbacks.murko_callback import MurkoCallback
|
|
16
17
|
|
|
17
18
|
|
|
19
|
+
def thaw(
|
|
20
|
+
time_to_thaw: float,
|
|
21
|
+
rotation: float = 360,
|
|
22
|
+
thawer: Thawer = inject("thawer"),
|
|
23
|
+
smargon: Smargon = inject("smargon"),
|
|
24
|
+
) -> MsgGenerator:
|
|
25
|
+
"""Turns on the thawer and rotates the sample by {rotation} degrees to thaw it, then
|
|
26
|
+
rotates {rotation} degrees back and turns the thawer off. The speed of the goniometer
|
|
27
|
+
is set such that the process takes whole process will take {time_to_thaw} time.
|
|
28
|
+
|
|
29
|
+
Args:
|
|
30
|
+
time_to_thaw (float): Time to thaw for, in seconds.
|
|
31
|
+
rotation (float, optional): How much to rotate by whilst thawing, in degrees.
|
|
32
|
+
Defaults to 360.
|
|
33
|
+
... devices: These are the specific ophyd-devices used for the plan, the
|
|
34
|
+
defaults are always correct.
|
|
35
|
+
"""
|
|
36
|
+
yield from _thaw(time_to_thaw, rotation, thawer, smargon)
|
|
37
|
+
|
|
38
|
+
|
|
18
39
|
def thaw_and_stream_to_redis(
|
|
19
40
|
time_to_thaw: float,
|
|
20
41
|
rotation: float = 360,
|
|
@@ -24,19 +45,162 @@ def thaw_and_stream_to_redis(
|
|
|
24
45
|
oav: OAV = inject("oav"),
|
|
25
46
|
oav_to_redis_forwarder: OAVToRedisForwarder = inject("oav_to_redis_forwarder"),
|
|
26
47
|
) -> MsgGenerator:
|
|
27
|
-
|
|
28
|
-
|
|
48
|
+
"""Turns on the thawer and rotates the sample by {rotation} degrees to thaw it, then
|
|
49
|
+
rotates {rotation} degrees back and turns the thawer off. The speed of the goniometer
|
|
50
|
+
is set such that the process takes whole process will take {time_to_thaw} time.
|
|
29
51
|
|
|
30
|
-
|
|
31
|
-
|
|
52
|
+
At the same time streams OAV images to redis for later processing (e.g. by murko).
|
|
53
|
+
On the first rotation the images from the large ROI are streamed, on the second the
|
|
54
|
+
smaller ROI is used.
|
|
32
55
|
|
|
33
|
-
|
|
56
|
+
Args:
|
|
57
|
+
time_to_thaw (float): Time to thaw for, in seconds.
|
|
58
|
+
rotation (float, optional): How much to rotate by whilst thawing, in degrees.
|
|
59
|
+
Defaults to 360.
|
|
60
|
+
... devices: These are the specific ophyd-devices used for the plan, the
|
|
61
|
+
defaults are always correct
|
|
62
|
+
"""
|
|
34
63
|
|
|
35
64
|
def switch_forwarder_to_ROI() -> MsgGenerator:
|
|
36
65
|
yield from bps.complete(oav_to_redis_forwarder, wait=True)
|
|
37
66
|
yield from bps.mv(oav_to_redis_forwarder.selected_source, Source.ROI.value)
|
|
38
67
|
yield from bps.kickoff(oav_to_redis_forwarder, wait=True)
|
|
39
68
|
|
|
69
|
+
yield from _thaw_and_stream_to_redis(
|
|
70
|
+
time_to_thaw,
|
|
71
|
+
rotation,
|
|
72
|
+
robot,
|
|
73
|
+
thawer,
|
|
74
|
+
smargon,
|
|
75
|
+
oav,
|
|
76
|
+
oav_to_redis_forwarder,
|
|
77
|
+
switch_forwarder_to_ROI,
|
|
78
|
+
)
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
def thaw_and_murko_centre(
|
|
82
|
+
time_to_thaw: float,
|
|
83
|
+
rotation: float = 360,
|
|
84
|
+
robot: BartRobot = inject("robot"),
|
|
85
|
+
thawer: Thawer = inject("thawer"),
|
|
86
|
+
smargon: Smargon = inject("smargon"),
|
|
87
|
+
oav: OAV = inject("oav"),
|
|
88
|
+
murko_results: MurkoResultsDevice = inject("murko_results"),
|
|
89
|
+
oav_to_redis_forwarder: OAVToRedisForwarder = inject("oav_to_redis_forwarder"),
|
|
90
|
+
) -> MsgGenerator:
|
|
91
|
+
"""Thaws the sample and centres it using murko by:
|
|
92
|
+
1. Turns on the thawer
|
|
93
|
+
2. Rotates the sample by {rotation} degrees, whilst this is happening images from
|
|
94
|
+
the large ROI of the OAV are being fed to murko
|
|
95
|
+
3. After the rotation has completed moves to the average centre returned by murko
|
|
96
|
+
from these images
|
|
97
|
+
4. Rotate {rotation} degrees back to the start, whilst this is happening images
|
|
98
|
+
from the small ROI of the OAV are being fed to murko
|
|
99
|
+
5. Turns off the thawer
|
|
100
|
+
|
|
101
|
+
The speed of the goniometer is set so that all of the above takes about {time_to_thaw}
|
|
102
|
+
seconds to complete.
|
|
103
|
+
|
|
104
|
+
Args:
|
|
105
|
+
time_to_thaw (float): Time to thaw for, in seconds.
|
|
106
|
+
rotation (float, optional): How much to rotate by whilst thawing, in degrees.
|
|
107
|
+
Defaults to 360.
|
|
108
|
+
... devices: These are the specific ophyd-devices used for the plan, the
|
|
109
|
+
defaults are always correct
|
|
110
|
+
"""
|
|
111
|
+
|
|
112
|
+
def centre_then_switch_forwarder_to_ROI() -> MsgGenerator:
|
|
113
|
+
yield from bps.complete(oav_to_redis_forwarder, wait=True)
|
|
114
|
+
|
|
115
|
+
yield from bps.trigger(murko_results, group="get_results")
|
|
116
|
+
|
|
117
|
+
yield from bps.mv(oav_to_redis_forwarder.selected_source, Source.ROI.value)
|
|
118
|
+
|
|
119
|
+
yield from bps.wait("get_results")
|
|
120
|
+
x_predict = yield from bps.rd(murko_results.x_mm)
|
|
121
|
+
y_predict = yield from bps.rd(murko_results.y_mm)
|
|
122
|
+
z_predict = yield from bps.rd(murko_results.z_mm)
|
|
123
|
+
|
|
124
|
+
yield from bps.rel_set(smargon.x, x_predict)
|
|
125
|
+
yield from bps.rel_set(smargon.y, y_predict)
|
|
126
|
+
yield from bps.rel_set(smargon.z, z_predict)
|
|
127
|
+
|
|
128
|
+
yield from bps.kickoff(oav_to_redis_forwarder, wait=True)
|
|
129
|
+
|
|
130
|
+
yield from stage_wrapper(
|
|
131
|
+
_thaw_and_stream_to_redis(
|
|
132
|
+
time_to_thaw,
|
|
133
|
+
rotation,
|
|
134
|
+
robot,
|
|
135
|
+
thawer,
|
|
136
|
+
smargon,
|
|
137
|
+
oav,
|
|
138
|
+
oav_to_redis_forwarder,
|
|
139
|
+
centre_then_switch_forwarder_to_ROI,
|
|
140
|
+
),
|
|
141
|
+
[murko_results],
|
|
142
|
+
)
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
def _thaw(
|
|
146
|
+
time_to_thaw: float,
|
|
147
|
+
rotation: float,
|
|
148
|
+
thawer: Thawer,
|
|
149
|
+
smargon: Smargon,
|
|
150
|
+
plan_between_rotations: Callable[[], MsgGenerator] | None = None,
|
|
151
|
+
) -> MsgGenerator:
|
|
152
|
+
"""Turns on the thawer and rotates the sample by {rotation} degrees to thaw it, then
|
|
153
|
+
rotates {rotation} degrees back and turns the thawer off. The speed of the goniometer
|
|
154
|
+
is set such that the process takes whole process will take {time_to_thaw} time.
|
|
155
|
+
|
|
156
|
+
Args:
|
|
157
|
+
time_to_thaw (float): Time to thaw for, in seconds.
|
|
158
|
+
rotation (float): How much to rotate by whilst thawing, in degrees.
|
|
159
|
+
thawer (Thawer): The thawing device.
|
|
160
|
+
smargon (Smargon): The smargon used to rotate.
|
|
161
|
+
plan_between_rotations (MsgGenerator, optional): A plan to run between rotations
|
|
162
|
+
of the smargon. Defaults to no plan.
|
|
163
|
+
"""
|
|
164
|
+
inital_velocity = yield from bps.rd(smargon.omega.velocity)
|
|
165
|
+
new_velocity = abs(rotation / time_to_thaw) * 2.0
|
|
166
|
+
|
|
167
|
+
def do_thaw():
|
|
168
|
+
yield from bps.abs_set(smargon.omega.velocity, new_velocity, wait=True)
|
|
169
|
+
yield from bps.abs_set(thawer.control, OnOff.ON, wait=True)
|
|
170
|
+
yield from bps.rel_set(smargon.omega, rotation, wait=True)
|
|
171
|
+
if plan_between_rotations:
|
|
172
|
+
yield from plan_between_rotations()
|
|
173
|
+
yield from bps.rel_set(smargon.omega, -rotation, wait=True)
|
|
174
|
+
|
|
175
|
+
def cleanup():
|
|
176
|
+
yield from bps.abs_set(smargon.omega.velocity, inital_velocity, wait=True)
|
|
177
|
+
yield from bps.abs_set(thawer.control, OnOff.OFF, wait=True)
|
|
178
|
+
|
|
179
|
+
# Always cleanup even if there is a failure
|
|
180
|
+
yield from bpp.contingency_wrapper(
|
|
181
|
+
do_thaw(),
|
|
182
|
+
final_plan=cleanup,
|
|
183
|
+
)
|
|
184
|
+
|
|
185
|
+
|
|
186
|
+
def _thaw_and_stream_to_redis(
|
|
187
|
+
time_to_thaw: float,
|
|
188
|
+
rotation: float,
|
|
189
|
+
robot: BartRobot,
|
|
190
|
+
thawer: Thawer,
|
|
191
|
+
smargon: Smargon,
|
|
192
|
+
oav: OAV,
|
|
193
|
+
oav_to_redis_forwarder: OAVToRedisForwarder,
|
|
194
|
+
plan_between_rotations: Callable[[], MsgGenerator],
|
|
195
|
+
) -> MsgGenerator:
|
|
196
|
+
zoom_percentage = yield from bps.rd(oav.zoom_controller.percentage)
|
|
197
|
+
sample_id = yield from bps.rd(robot.sample_id)
|
|
198
|
+
|
|
199
|
+
sample_id = int(sample_id)
|
|
200
|
+
zoom_level_before_thawing = yield from bps.rd(oav.zoom_controller.level)
|
|
201
|
+
|
|
202
|
+
yield from bps.mv(oav.zoom_controller.level, "1.0x")
|
|
203
|
+
|
|
40
204
|
microns_per_pixel_x = yield from bps.rd(oav.microns_per_pixel_x)
|
|
41
205
|
microns_per_pixel_y = yield from bps.rd(oav.microns_per_pixel_y)
|
|
42
206
|
beam_centre_i = yield from bps.rd(oav.beam_centre_i)
|
|
@@ -59,7 +223,7 @@ def thaw_and_stream_to_redis(
|
|
|
59
223
|
"sample_id": sample_id,
|
|
60
224
|
}
|
|
61
225
|
)
|
|
62
|
-
def
|
|
226
|
+
def _main_plan():
|
|
63
227
|
yield from bps.mv(
|
|
64
228
|
oav_to_redis_forwarder.sample_id,
|
|
65
229
|
sample_id,
|
|
@@ -71,7 +235,7 @@ def thaw_and_stream_to_redis(
|
|
|
71
235
|
yield from bps.monitor(smargon.omega.user_readback, name="smargon")
|
|
72
236
|
yield from bps.monitor(oav_to_redis_forwarder.uuid, name="oav")
|
|
73
237
|
yield from _thaw(
|
|
74
|
-
time_to_thaw, rotation, thawer, smargon,
|
|
238
|
+
time_to_thaw, rotation, thawer, smargon, plan_between_rotations
|
|
75
239
|
)
|
|
76
240
|
yield from bps.complete(oav_to_redis_forwarder)
|
|
77
241
|
|
|
@@ -79,56 +243,6 @@ def thaw_and_stream_to_redis(
|
|
|
79
243
|
yield from bps.mv(oav.zoom_controller.level, zoom_level_before_thawing)
|
|
80
244
|
|
|
81
245
|
yield from bpp.contingency_wrapper(
|
|
82
|
-
|
|
83
|
-
final_plan=cleanup,
|
|
84
|
-
)
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
def thaw(
|
|
88
|
-
time_to_thaw: float,
|
|
89
|
-
rotation: float = 360,
|
|
90
|
-
thawer: Thawer = inject("thawer"),
|
|
91
|
-
smargon: Smargon = inject("smargon"),
|
|
92
|
-
) -> MsgGenerator:
|
|
93
|
-
yield from _thaw(time_to_thaw, rotation, thawer, smargon)
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
def _thaw(
|
|
97
|
-
time_to_thaw: float,
|
|
98
|
-
rotation: float = 360,
|
|
99
|
-
thawer: Thawer = inject("thawer"),
|
|
100
|
-
smargon: Smargon = inject("smargon"),
|
|
101
|
-
plan_between_rotations: Callable[[], MsgGenerator] | None = None,
|
|
102
|
-
) -> MsgGenerator:
|
|
103
|
-
"""Rotates the sample and thaws it at the same time.
|
|
104
|
-
|
|
105
|
-
Args:
|
|
106
|
-
time_to_thaw (float): Time to thaw for, in seconds.
|
|
107
|
-
rotation (float, optional): How much to rotate by whilst thawing, in degrees.
|
|
108
|
-
Defaults to 360.
|
|
109
|
-
thawer (Thawer, optional): The thawing device. Defaults to inject("thawer").
|
|
110
|
-
smargon (Smargon, optional): The smargon used to rotate.
|
|
111
|
-
Defaults to inject("smargon")
|
|
112
|
-
plan_between_rotations (MsgGenerator, optional): A plan to run between rotations
|
|
113
|
-
of the smargon. Defaults to no plan.
|
|
114
|
-
"""
|
|
115
|
-
inital_velocity = yield from bps.rd(smargon.omega.velocity)
|
|
116
|
-
new_velocity = abs(rotation / time_to_thaw) * 2.0
|
|
117
|
-
|
|
118
|
-
def do_thaw():
|
|
119
|
-
yield from bps.abs_set(smargon.omega.velocity, new_velocity, wait=True)
|
|
120
|
-
yield from bps.abs_set(thawer.control, OnOff.ON, wait=True)
|
|
121
|
-
yield from bps.rel_set(smargon.omega, rotation, wait=True)
|
|
122
|
-
if plan_between_rotations:
|
|
123
|
-
yield from plan_between_rotations()
|
|
124
|
-
yield from bps.rel_set(smargon.omega, -rotation, wait=True)
|
|
125
|
-
|
|
126
|
-
def cleanup():
|
|
127
|
-
yield from bps.abs_set(smargon.omega.velocity, inital_velocity, wait=True)
|
|
128
|
-
yield from bps.abs_set(thawer.control, OnOff.OFF, wait=True)
|
|
129
|
-
|
|
130
|
-
# Always cleanup even if there is a failure
|
|
131
|
-
yield from bpp.contingency_wrapper(
|
|
132
|
-
do_thaw(),
|
|
246
|
+
_main_plan(),
|
|
133
247
|
final_plan=cleanup,
|
|
134
248
|
)
|
|
@@ -11,7 +11,6 @@ from bluesky.utils import MsgGenerator
|
|
|
11
11
|
from dodal.devices.i24.beam_center import DetectorBeamCenter
|
|
12
12
|
from dodal.devices.i24.dcm import DCM
|
|
13
13
|
from dodal.devices.i24.focus_mirrors import FocusMirrorsMode
|
|
14
|
-
from dodal.devices.i24.pilatus_metadata import PilatusMetadata
|
|
15
14
|
|
|
16
15
|
from mx_bluesky.beamlines.i24.serial.fixed_target.ft_utils import PumpProbeSetting
|
|
17
16
|
from mx_bluesky.beamlines.i24.serial.log import SSX_LOGGER
|
|
@@ -21,7 +20,7 @@ from mx_bluesky.beamlines.i24.serial.parameters import (
|
|
|
21
20
|
ExtruderParameters,
|
|
22
21
|
FixedTargetParameters,
|
|
23
22
|
)
|
|
24
|
-
from mx_bluesky.beamlines.i24.serial.setup_beamline import Detector, Eiger
|
|
23
|
+
from mx_bluesky.beamlines.i24.serial.setup_beamline import Detector, Eiger
|
|
25
24
|
|
|
26
25
|
# Collection start/end script to kick off analysis
|
|
27
26
|
COLLECTION_START_SCRIPT = "/dls_sw/i24/scripts/RunAtStartOfCollect-i24-ssx.sh"
|
|
@@ -67,9 +66,7 @@ def read_beam_info_from_hardware(
|
|
|
67
66
|
wavelength = yield from bps.rd(dcm.wavelength_in_a)
|
|
68
67
|
beamsize_x = yield from bps.rd(mirrors.beam_size_x)
|
|
69
68
|
beamsize_y = yield from bps.rd(mirrors.beam_size_y)
|
|
70
|
-
pixel_size = (
|
|
71
|
-
Eiger().pixel_size_mm if detector_name == "eiger" else Pilatus().pixel_size_mm
|
|
72
|
-
)
|
|
69
|
+
pixel_size = Eiger().pixel_size_mm
|
|
73
70
|
beam_center_x = yield from bps.rd(beam_center.beam_x)
|
|
74
71
|
beam_center_y = yield from bps.rd(beam_center.beam_y)
|
|
75
72
|
return BeamSettings(
|
|
@@ -115,8 +112,6 @@ class DCID:
|
|
|
115
112
|
match expt_params.detector_name:
|
|
116
113
|
case "eiger":
|
|
117
114
|
self.detector = Eiger()
|
|
118
|
-
case "pilatus":
|
|
119
|
-
self.detector = Pilatus()
|
|
120
115
|
|
|
121
116
|
self.server = server or DEFAULT_ISPYB_SERVER
|
|
122
117
|
self.emit_errors = emit_errors
|
|
@@ -161,9 +156,7 @@ class DCID:
|
|
|
161
156
|
transmission = self.parameters.transmission * 100
|
|
162
157
|
xbeam, ybeam = beam_settings.beam_center_in_mm
|
|
163
158
|
|
|
164
|
-
if isinstance(self.detector,
|
|
165
|
-
startImageNumber = 0
|
|
166
|
-
elif isinstance(self.detector, Eiger):
|
|
159
|
+
if isinstance(self.detector, Eiger):
|
|
167
160
|
startImageNumber = 1
|
|
168
161
|
else:
|
|
169
162
|
raise ValueError("Unknown detector:", self.detector)
|
|
@@ -361,20 +354,6 @@ class DCID:
|
|
|
361
354
|
SSX_LOGGER.warning("Error completing DCID: %s (%s)", e, resp_str)
|
|
362
355
|
|
|
363
356
|
|
|
364
|
-
def get_pilatus_filename_template_from_device(
|
|
365
|
-
pilatus_metadata: PilatusMetadata,
|
|
366
|
-
) -> MsgGenerator[str]:
|
|
367
|
-
"""
|
|
368
|
-
Get the template file path by querying the detector PVs, mirror the construction \
|
|
369
|
-
that the PPU does.
|
|
370
|
-
|
|
371
|
-
Returns:
|
|
372
|
-
A template string, with the image numbers replaced with '#'
|
|
373
|
-
"""
|
|
374
|
-
filename_template = yield from bps.rd(pilatus_metadata.filename_template)
|
|
375
|
-
return filename_template
|
|
376
|
-
|
|
377
|
-
|
|
378
357
|
def get_resolution(detector: Detector, distance: float, wavelength: float) -> float:
|
|
379
358
|
""" Calculate the inscribed resolution for detector.
|
|
380
359
|
|
|
@@ -382,7 +361,7 @@ def get_resolution(detector: Detector, distance: float, wavelength: float) -> fl
|
|
|
382
361
|
position parameters yet.
|
|
383
362
|
|
|
384
363
|
Args:
|
|
385
|
-
detector (Detector): Detector instance, Eiger()
|
|
364
|
+
detector (Detector): Detector instance, Eiger().
|
|
386
365
|
distance (float): Distance to detector, in mm.
|
|
387
366
|
wavelength (float): Beam wavelength, in Å.
|
|
388
367
|
|
|
@@ -3,8 +3,8 @@ beginScreenProperties
|
|
|
3
3
|
major 4
|
|
4
4
|
minor 0
|
|
5
5
|
release 1
|
|
6
|
-
x
|
|
7
|
-
y
|
|
6
|
+
x 2937
|
|
7
|
+
y 184
|
|
8
8
|
w 450
|
|
9
9
|
h 180
|
|
10
10
|
font "arial-medium-r-18.0"
|
|
@@ -78,20 +78,17 @@ fgColour index 14
|
|
|
78
78
|
bgColour index 4
|
|
79
79
|
topShadowColour index 1
|
|
80
80
|
botShadowColour index 8
|
|
81
|
-
controlPv "BL24I-
|
|
81
|
+
controlPv "BL24I-MO-IOC-13:GP15"
|
|
82
82
|
font "arial-medium-r-18.0"
|
|
83
83
|
numItems 2
|
|
84
84
|
symbolTag {
|
|
85
85
|
0 "Eiger"
|
|
86
|
-
1 "Pilatus"
|
|
87
86
|
}
|
|
88
87
|
symbol0 {
|
|
89
88
|
0 "E9M"
|
|
90
|
-
1 "P6M"
|
|
91
89
|
}
|
|
92
90
|
PV0 {
|
|
93
91
|
0 "eiger"
|
|
94
|
-
1 "pilatus"
|
|
95
92
|
}
|
|
96
93
|
endObjectProperties
|
|
97
94
|
|
|
@@ -113,7 +110,7 @@ font "arial-medium-r-18.0"
|
|
|
113
110
|
buttonLabel "Move Stage"
|
|
114
111
|
numCmds 1
|
|
115
112
|
command {
|
|
116
|
-
0 "blueapi -c CONFIG_LOCATION controller run setup_detector_stage '\{\"expt_type\":\"Serial Jet\"\}'"
|
|
113
|
+
0 "blueapi -c CONFIG_LOCATION controller run -i $INSTRUMENT_SESSION setup_detector_stage '\{\"expt_type\":\"Serial Jet\"\}'"
|
|
117
114
|
}
|
|
118
115
|
endObjectProperties
|
|
119
116
|
|
|
@@ -370,7 +370,7 @@ font "arial-medium-r-24.0"
|
|
|
370
370
|
buttonLabel "Start"
|
|
371
371
|
numCmds 1
|
|
372
372
|
command {
|
|
373
|
-
0 "blueapi -c CONFIG_LOCATION controller run run_extruder_plan"
|
|
373
|
+
0 "blueapi -c CONFIG_LOCATION controller run -i $INSTRUMENT_SESSION run_extruder_plan"
|
|
374
374
|
}
|
|
375
375
|
endObjectProperties
|
|
376
376
|
|
|
@@ -832,7 +832,7 @@ botShadowColor index 11
|
|
|
832
832
|
font "arial-medium-r-18.0"
|
|
833
833
|
numCmds 1
|
|
834
834
|
command {
|
|
835
|
-
0 "blueapi -c CONFIG_LOCATION controller run initialise_extruder"
|
|
835
|
+
0 "blueapi -c CONFIG_LOCATION controller run -i $INSTRUMENT_SESSION initialise_extruder"
|
|
836
836
|
}
|
|
837
837
|
endObjectProperties
|
|
838
838
|
|
|
@@ -2179,7 +2179,7 @@ font "arial-medium-r-20.0"
|
|
|
2179
2179
|
buttonLabel "Laser On"
|
|
2180
2180
|
numCmds 1
|
|
2181
2181
|
command {
|
|
2182
|
-
0 "blueapi -c CONFIG_LOCATION controller run laser_check '\{\"mode\":\"laseron\"\}'"
|
|
2182
|
+
0 "blueapi -c CONFIG_LOCATION controller run -i $INSTRUMENT_SESSION laser_check '\{\"mode\":\"laseron\"\}'"
|
|
2183
2183
|
}
|
|
2184
2184
|
endObjectProperties
|
|
2185
2185
|
|
|
@@ -2201,7 +2201,7 @@ font "arial-medium-r-20.0"
|
|
|
2201
2201
|
buttonLabel "Laser Off"
|
|
2202
2202
|
numCmds 1
|
|
2203
2203
|
command {
|
|
2204
|
-
0 "blueapi -c CONFIG_LOCATION controller run laser_check '\{\"mode\":\"laseroff\"\}'"
|
|
2204
|
+
0 "blueapi -c CONFIG_LOCATION controller run -i $INSTRUMENT_SESSION laser_check '\{\"mode\":\"laseroff\"\}'"
|
|
2205
2205
|
}
|
|
2206
2206
|
endObjectProperties
|
|
2207
2207
|
|
|
@@ -2223,7 +2223,7 @@ font "arial-medium-r-18.0"
|
|
|
2223
2223
|
buttonLabel "Enter hutch"
|
|
2224
2224
|
numCmds 1
|
|
2225
2225
|
command {
|
|
2226
|
-
0 "blueapi -c CONFIG_LOCATION controller run enter_hutch"
|
|
2226
|
+
0 "blueapi -c CONFIG_LOCATION controller run -i $INSTRUMENT_SESSION enter_hutch"
|
|
2227
2227
|
}
|
|
2228
2228
|
endObjectProperties
|
|
2229
2229
|
|