mx-bluesky 1.5.8__py3-none-any.whl → 1.5.10__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/experiment_plans/i04_grid_detect_then_xray_centre_plan.py +35 -12
- mx_bluesky/beamlines/i24/jungfrau_commissioning/experiment_plans/__init__.py +0 -0
- mx_bluesky/beamlines/i24/jungfrau_commissioning/experiment_plans/do_darks.py +78 -0
- mx_bluesky/beamlines/i24/jungfrau_commissioning/plan_stubs/__init__.py +1 -0
- mx_bluesky/beamlines/i24/jungfrau_commissioning/{do_external_acquisition.py → plan_stubs/do_external_acquisition.py} +7 -6
- mx_bluesky/beamlines/i24/jungfrau_commissioning/{do_internal_acquisition.py → plan_stubs/do_internal_acquisition.py} +4 -3
- mx_bluesky/beamlines/i24/jungfrau_commissioning/{plan_utils.py → plan_stubs/plan_utils.py} +21 -28
- mx_bluesky/common/device_setup_plans/__init__.py +0 -0
- mx_bluesky/common/device_setup_plans/manipulate_sample.py +2 -2
- mx_bluesky/common/device_setup_plans/robot_load_unload.py +10 -6
- mx_bluesky/common/device_setup_plans/setup_oav.py +1 -1
- mx_bluesky/common/device_setup_plans/setup_zebra_and_shutter.py +245 -0
- mx_bluesky/common/device_setup_plans/xbpm_feedback.py +4 -4
- mx_bluesky/common/experiment_plans/common_flyscan_xray_centre_plan.py +10 -22
- mx_bluesky/common/experiment_plans/inner_plans/__init__.py +0 -0
- mx_bluesky/common/experiment_plans/inner_plans/do_fgs.py +5 -3
- mx_bluesky/common/experiment_plans/inner_plans/read_hardware.py +3 -3
- mx_bluesky/common/experiment_plans/oav_grid_detection_plan.py +2 -2
- mx_bluesky/common/external_interaction/callbacks/common/ispyb_mapping.py +4 -3
- mx_bluesky/common/external_interaction/callbacks/xray_centre/ispyb_callback.py +34 -25
- mx_bluesky/common/parameters/device_composites.py +2 -2
- mx_bluesky/hyperion/device_setup_plans/setup_zebra.py +2 -100
- mx_bluesky/hyperion/experiment_plans/hyperion_flyscan_xray_centre_plan.py +13 -12
- mx_bluesky/hyperion/experiment_plans/load_centre_collect_full_plan.py +52 -38
- mx_bluesky/hyperion/experiment_plans/pin_tip_centring_plan.py +2 -2
- mx_bluesky/hyperion/experiment_plans/rotation_scan_plan.py +5 -3
- mx_bluesky/hyperion/external_interaction/callbacks/alert_on_container_change.py +14 -5
- mx_bluesky/hyperion/external_interaction/callbacks/robot_actions/__init__.py +0 -0
- mx_bluesky/hyperion/parameters/device_composites.py +2 -2
- mx_bluesky/hyperion/parameters/rotation.py +4 -6
- mx_bluesky/hyperion/utils/context.py +6 -1
- {mx_bluesky-1.5.8.dist-info → mx_bluesky-1.5.10.dist-info}/METADATA +4 -4
- {mx_bluesky-1.5.8.dist-info → mx_bluesky-1.5.10.dist-info}/RECORD +39 -33
- mx_bluesky/phase1_zebra/device_setup_plans/setup_zebra.py +0 -112
- /mx_bluesky/{common/experiment_plans/inner_plans/__init__ .py → beamlines/i04/callbacks/__init__.py} +0 -0
- {mx_bluesky-1.5.8.dist-info → mx_bluesky-1.5.10.dist-info}/WHEEL +0 -0
- {mx_bluesky-1.5.8.dist-info → mx_bluesky-1.5.10.dist-info}/entry_points.txt +0 -0
- {mx_bluesky-1.5.8.dist-info → mx_bluesky-1.5.10.dist-info}/licenses/LICENSE +0 -0
- {mx_bluesky-1.5.8.dist-info → mx_bluesky-1.5.10.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.10'
|
|
32
|
+
__version_tuple__ = version_tuple = (1, 5, 10)
|
|
33
33
|
|
|
34
34
|
__commit_id__ = commit_id = None
|
|
@@ -6,10 +6,10 @@ import bluesky.plan_stubs as bps
|
|
|
6
6
|
import bluesky.preprocessors as bpp
|
|
7
7
|
from bluesky.utils import MsgGenerator
|
|
8
8
|
from dodal.common import inject
|
|
9
|
-
from dodal.devices.aperturescatterguard import ApertureScatterguard
|
|
9
|
+
from dodal.devices.aperturescatterguard import ApertureScatterguard, ApertureValue
|
|
10
10
|
from dodal.devices.attenuator.attenuator import BinaryFilterAttenuator
|
|
11
11
|
from dodal.devices.backlight import Backlight
|
|
12
|
-
from dodal.devices.common_dcm import
|
|
12
|
+
from dodal.devices.common_dcm import DoubleCrystalMonochromator
|
|
13
13
|
from dodal.devices.detector.detector_motion import DetectorMotion
|
|
14
14
|
from dodal.devices.eiger import EigerDetector
|
|
15
15
|
from dodal.devices.fast_grid_scan import (
|
|
@@ -17,6 +17,7 @@ from dodal.devices.fast_grid_scan import (
|
|
|
17
17
|
set_fast_grid_scan_params,
|
|
18
18
|
)
|
|
19
19
|
from dodal.devices.flux import Flux
|
|
20
|
+
from dodal.devices.i04.transfocator import Transfocator
|
|
20
21
|
from dodal.devices.mx_phase1.beamstop import Beamstop
|
|
21
22
|
from dodal.devices.oav.oav_detector import OAV
|
|
22
23
|
from dodal.devices.oav.pin_image_recognition import PinTipDetection
|
|
@@ -33,6 +34,10 @@ from dodal.plans.preprocessors.verify_undulator_gap import (
|
|
|
33
34
|
verify_undulator_gap_before_run_decorator,
|
|
34
35
|
)
|
|
35
36
|
|
|
37
|
+
from mx_bluesky.common.device_setup_plans.setup_zebra_and_shutter import (
|
|
38
|
+
setup_zebra_for_gridscan,
|
|
39
|
+
tidy_up_zebra_after_gridscan,
|
|
40
|
+
)
|
|
36
41
|
from mx_bluesky.common.experiment_plans.common_flyscan_xray_centre_plan import (
|
|
37
42
|
BeamlineSpecificFGSFeatures,
|
|
38
43
|
construct_beamline_specific_FGS_features,
|
|
@@ -67,10 +72,22 @@ from mx_bluesky.common.preprocessors.preprocessors import (
|
|
|
67
72
|
transmission_and_xbpm_feedback_for_collection_decorator,
|
|
68
73
|
)
|
|
69
74
|
from mx_bluesky.common.utils.log import LOGGER
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
75
|
+
|
|
76
|
+
DEFAULT_BEAMSIZE_MICRONS = 20
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
def _change_beamsize(
|
|
80
|
+
transfocator: Transfocator, beamsize: float, parameters: GridCommon
|
|
81
|
+
):
|
|
82
|
+
"""i04 always uses the large aperture and changes beamsize with the transfocator.
|
|
83
|
+
|
|
84
|
+
An aperture is needed to reduce scatter but the transfocator is best used for beamsize
|
|
85
|
+
changes as it gives more flux compared to a bigger beam with a small aperture.
|
|
86
|
+
"""
|
|
87
|
+
parameters.selected_aperture = ApertureValue.LARGE
|
|
88
|
+
yield from bps.abs_set(
|
|
89
|
+
transfocator, beamsize, group=PlanGroupCheckpointConstants.GRID_READY_FOR_DC
|
|
90
|
+
)
|
|
74
91
|
|
|
75
92
|
|
|
76
93
|
# See https://github.com/DiamondLightSource/blueapi/issues/506 for using device composites
|
|
@@ -80,7 +97,7 @@ def i04_grid_detect_then_xray_centre(
|
|
|
80
97
|
attenuator: BinaryFilterAttenuator = inject("attenuator"),
|
|
81
98
|
backlight: Backlight = inject("backlight"),
|
|
82
99
|
beamstop: Beamstop = inject("beamstop"),
|
|
83
|
-
dcm:
|
|
100
|
+
dcm: DoubleCrystalMonochromator = inject("dcm"),
|
|
84
101
|
zebra_fast_grid_scan: ZebraFastGridScanThreeD = inject("zebra_fast_grid_scan"),
|
|
85
102
|
flux: Flux = inject("flux"),
|
|
86
103
|
oav: OAV = inject("oav"),
|
|
@@ -96,6 +113,7 @@ def i04_grid_detect_then_xray_centre(
|
|
|
96
113
|
zocalo: ZocaloResults = inject("zocalo"),
|
|
97
114
|
smargon: Smargon = inject("smargon"),
|
|
98
115
|
detector_motion: DetectorMotion = inject("detector_motion"),
|
|
116
|
+
transfocator: Transfocator = inject("transfocator"),
|
|
99
117
|
oav_config: str = OavConstants.OAV_CONFIG_JSON,
|
|
100
118
|
udc: bool = False,
|
|
101
119
|
) -> MsgGenerator:
|
|
@@ -108,7 +126,7 @@ def i04_grid_detect_then_xray_centre(
|
|
|
108
126
|
|
|
109
127
|
|
|
110
128
|
i04's implementation of this plan is very similar to Hyperion. However, since i04
|
|
111
|
-
isn't running in a
|
|
129
|
+
isn't running in a continuous Bluesky UDC loop, we take additional steps in beamline
|
|
112
130
|
tidy-up.
|
|
113
131
|
"""
|
|
114
132
|
|
|
@@ -134,8 +152,9 @@ def i04_grid_detect_then_xray_centre(
|
|
|
134
152
|
robot,
|
|
135
153
|
sample_shutter,
|
|
136
154
|
)
|
|
155
|
+
initial_beamsize = yield from bps.rd(transfocator.beamsize_set_microns)
|
|
137
156
|
|
|
138
|
-
def
|
|
157
|
+
def tidy_beamline():
|
|
139
158
|
if not udc:
|
|
140
159
|
yield from get_ready_for_oav_and_close_shutter(
|
|
141
160
|
composite.smargon,
|
|
@@ -143,8 +162,9 @@ def i04_grid_detect_then_xray_centre(
|
|
|
143
162
|
composite.aperture_scatterguard,
|
|
144
163
|
composite.detector_motion,
|
|
145
164
|
)
|
|
165
|
+
yield from bps.mv(transfocator, initial_beamsize)
|
|
146
166
|
|
|
147
|
-
@bpp.finalize_decorator(
|
|
167
|
+
@bpp.finalize_decorator(tidy_beamline)
|
|
148
168
|
def _inner_grid_detect_then_xrc():
|
|
149
169
|
# These callbacks let us talk to ISPyB and Nexgen. They aren't included in the common plan because
|
|
150
170
|
# Hyperion handles its callbacks differently to BlueAPI-managed plans, see
|
|
@@ -167,6 +187,7 @@ def i04_grid_detect_then_xray_centre(
|
|
|
167
187
|
|
|
168
188
|
yield from grid_detect_then_xray_centre_with_callbacks()
|
|
169
189
|
|
|
190
|
+
yield from _change_beamsize(transfocator, DEFAULT_BEAMSIZE_MICRONS, parameters)
|
|
170
191
|
yield from _inner_grid_detect_then_xrc()
|
|
171
192
|
|
|
172
193
|
|
|
@@ -178,7 +199,7 @@ def get_ready_for_oav_and_close_shutter(
|
|
|
178
199
|
):
|
|
179
200
|
yield from bps.wait(PlanGroupCheckpointConstants.GRID_READY_FOR_DC)
|
|
180
201
|
group = "get_ready_for_oav_and_close_shutter"
|
|
181
|
-
LOGGER.info("Non-udc tidy:
|
|
202
|
+
LOGGER.info("Non-udc tidy: Setting up beamline for OAV")
|
|
182
203
|
yield from setup_beamline_for_OAV(
|
|
183
204
|
smargon, backlight, aperture_scatterguard, group=group
|
|
184
205
|
)
|
|
@@ -247,7 +268,9 @@ def construct_i04_specific_features(
|
|
|
247
268
|
)
|
|
248
269
|
fgs_motors = xrc_composite.zebra_fast_grid_scan
|
|
249
270
|
return construct_beamline_specific_FGS_features(
|
|
250
|
-
|
|
271
|
+
partial(
|
|
272
|
+
setup_zebra_for_gridscan,
|
|
273
|
+
),
|
|
251
274
|
tidy_plan,
|
|
252
275
|
set_flyscan_params_plan,
|
|
253
276
|
fgs_motors,
|
|
File without changes
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import bluesky.preprocessors as bpp
|
|
2
|
+
from bluesky import plan_stubs as bps
|
|
3
|
+
from bluesky.utils import MsgGenerator
|
|
4
|
+
from dodal.common import inject
|
|
5
|
+
from dodal.devices.i24.commissioning_jungfrau import CommissioningJungfrau
|
|
6
|
+
from ophyd_async.core import WatchableAsyncStatus
|
|
7
|
+
from ophyd_async.fastcs.jungfrau import (
|
|
8
|
+
AcquisitionType,
|
|
9
|
+
GainMode,
|
|
10
|
+
create_jungfrau_pedestal_triggering_info,
|
|
11
|
+
)
|
|
12
|
+
from pydantic import PositiveInt
|
|
13
|
+
|
|
14
|
+
from mx_bluesky.beamlines.i24.jungfrau_commissioning.plan_stubs.plan_utils import (
|
|
15
|
+
fly_jungfrau,
|
|
16
|
+
override_file_path,
|
|
17
|
+
)
|
|
18
|
+
from mx_bluesky.common.utils.log import LOGGER
|
|
19
|
+
|
|
20
|
+
PEDESTAL_DARKS_RUN = "PEDESTAL DARKS RUN"
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
def do_pedestal_darks(
|
|
24
|
+
exp_time_s: float = 0.001,
|
|
25
|
+
pedestal_frames: PositiveInt = 20,
|
|
26
|
+
pedestal_loops: PositiveInt = 200,
|
|
27
|
+
jungfrau: CommissioningJungfrau = inject("jungfrau"),
|
|
28
|
+
path_of_output_file: str | None = None,
|
|
29
|
+
) -> MsgGenerator[WatchableAsyncStatus]:
|
|
30
|
+
"""Acquire darks in pedestal mode, using dynamic gain mode. This calibrates the offsets
|
|
31
|
+
for the jungfrau, and must be performed before acquiring real data in dynamic gain mode.
|
|
32
|
+
|
|
33
|
+
When Bluesky triggers the detector in pedestal mode, with pedestal frames F and pedestal loops L,
|
|
34
|
+
the acquisition is managed at the driver level to:
|
|
35
|
+
1. Acquire F-1 frames in dynamic gain mode
|
|
36
|
+
2. Acquire 1 frame in ForceSwitchG1 gain mode
|
|
37
|
+
3. Repeat steps 1-2 L times
|
|
38
|
+
4. Do the first three steps a second time, except use ForceSwitchG2 instead of ForceSwitchG1
|
|
39
|
+
during step 2.
|
|
40
|
+
|
|
41
|
+
Args:
|
|
42
|
+
exp_time_s: Length of detector exposure for each frame.
|
|
43
|
+
pedestal_frames: Number of frames acquired per pedestal loop.
|
|
44
|
+
pedestal_loops: Number of times to acquire a set of pedestal_frames
|
|
45
|
+
jungfrau: Jungfrau device
|
|
46
|
+
path_of_output_file: Absolute path of the detector file output, including file name. If None, then use the PathProvider
|
|
47
|
+
set during Jungfrau device instantiation
|
|
48
|
+
"""
|
|
49
|
+
|
|
50
|
+
@bpp.set_run_key_decorator(PEDESTAL_DARKS_RUN)
|
|
51
|
+
@bpp.run_decorator(md={"subplan_name": PEDESTAL_DARKS_RUN})
|
|
52
|
+
@bpp.stage_decorator([jungfrau])
|
|
53
|
+
def _do_decorated_plan():
|
|
54
|
+
if path_of_output_file:
|
|
55
|
+
override_file_path(jungfrau, path_of_output_file)
|
|
56
|
+
|
|
57
|
+
trigger_info = create_jungfrau_pedestal_triggering_info(
|
|
58
|
+
exp_time_s, pedestal_frames, pedestal_loops
|
|
59
|
+
)
|
|
60
|
+
LOGGER.info(
|
|
61
|
+
"Jungfrau will be triggered in pedestal mode and in dynamic gain mode"
|
|
62
|
+
)
|
|
63
|
+
yield from bps.mv(
|
|
64
|
+
jungfrau.drv.acquisition_type,
|
|
65
|
+
AcquisitionType.PEDESTAL,
|
|
66
|
+
jungfrau.drv.gain_mode,
|
|
67
|
+
GainMode.DYNAMIC,
|
|
68
|
+
)
|
|
69
|
+
return (
|
|
70
|
+
yield from fly_jungfrau(
|
|
71
|
+
jungfrau,
|
|
72
|
+
trigger_info,
|
|
73
|
+
wait=True,
|
|
74
|
+
log_on_percentage_prefix="Jungfrau pedestal dynamic gain mode darks triggers recieved",
|
|
75
|
+
)
|
|
76
|
+
)
|
|
77
|
+
|
|
78
|
+
return (yield from _do_decorated_plan())
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"""Jungfrau plan stubs should be used as part of Jungfrau experiment plans, and should not be run in isolation."""
|
|
@@ -9,7 +9,7 @@ from ophyd_async.fastcs.jungfrau import (
|
|
|
9
9
|
)
|
|
10
10
|
from pydantic import PositiveInt
|
|
11
11
|
|
|
12
|
-
from mx_bluesky.beamlines.i24.jungfrau_commissioning.plan_utils import (
|
|
12
|
+
from mx_bluesky.beamlines.i24.jungfrau_commissioning.plan_stubs.plan_utils import (
|
|
13
13
|
fly_jungfrau,
|
|
14
14
|
override_file_path,
|
|
15
15
|
)
|
|
@@ -18,14 +18,15 @@ from mx_bluesky.beamlines.i24.jungfrau_commissioning.plan_utils import (
|
|
|
18
18
|
def do_external_acquisition(
|
|
19
19
|
exp_time_s: float,
|
|
20
20
|
total_triggers: PositiveInt = 1,
|
|
21
|
-
|
|
21
|
+
output_file_path: str | None = None,
|
|
22
22
|
wait: bool = False,
|
|
23
23
|
jungfrau: CommissioningJungfrau = inject("commissioning_jungfrau"),
|
|
24
24
|
) -> MsgGenerator[WatchableAsyncStatus]:
|
|
25
25
|
"""
|
|
26
26
|
Kickoff external triggering on the Jungfrau, and optionally wait for completion.
|
|
27
27
|
|
|
28
|
-
|
|
28
|
+
Any plan using this stub MUST stage the Jungfrau with the stage_decorator and open a run,
|
|
29
|
+
ideally using the run_decorator.
|
|
29
30
|
|
|
30
31
|
Args:
|
|
31
32
|
exp_time_s: Length of detector exposure for each frame.
|
|
@@ -36,9 +37,9 @@ def do_external_acquisition(
|
|
|
36
37
|
wait: Optionally block until data collection is complete.
|
|
37
38
|
"""
|
|
38
39
|
|
|
39
|
-
if
|
|
40
|
-
override_file_path(jungfrau,
|
|
40
|
+
if output_file_path:
|
|
41
|
+
override_file_path(jungfrau, output_file_path)
|
|
41
42
|
|
|
42
43
|
trigger_info = create_jungfrau_external_triggering_info(total_triggers, exp_time_s)
|
|
43
|
-
status = yield from fly_jungfrau(jungfrau, trigger_info, wait)
|
|
44
|
+
status = yield from fly_jungfrau(jungfrau, trigger_info, wait=wait)
|
|
44
45
|
return status
|
|
@@ -9,7 +9,7 @@ from ophyd_async.fastcs.jungfrau import (
|
|
|
9
9
|
)
|
|
10
10
|
from pydantic import PositiveInt
|
|
11
11
|
|
|
12
|
-
from mx_bluesky.beamlines.i24.jungfrau_commissioning.plan_utils import (
|
|
12
|
+
from mx_bluesky.beamlines.i24.jungfrau_commissioning.plan_stubs.plan_utils import (
|
|
13
13
|
fly_jungfrau,
|
|
14
14
|
override_file_path,
|
|
15
15
|
)
|
|
@@ -26,7 +26,8 @@ def do_internal_acquisition(
|
|
|
26
26
|
Kickoff internal triggering on the Jungfrau, and optionally wait for completion. Frames
|
|
27
27
|
per trigger will trigger as rapidly as possible according to the Jungfrau deadtime.
|
|
28
28
|
|
|
29
|
-
|
|
29
|
+
Any plan using this stub MUST stage the Jungfrau with the stage_decorator and open a run,
|
|
30
|
+
ideally using the run_decorator.
|
|
30
31
|
|
|
31
32
|
Args:
|
|
32
33
|
exp_time_s: Length of detector exposure for each frame.
|
|
@@ -42,5 +43,5 @@ def do_internal_acquisition(
|
|
|
42
43
|
override_file_path(jungfrau, path_of_output_file)
|
|
43
44
|
|
|
44
45
|
trigger_info = create_jungfrau_internal_triggering_info(total_frames, exp_time_s)
|
|
45
|
-
status = yield from fly_jungfrau(jungfrau, trigger_info, wait)
|
|
46
|
+
status = yield from fly_jungfrau(jungfrau, trigger_info, wait=wait)
|
|
46
47
|
return status
|
|
@@ -2,7 +2,6 @@ from pathlib import PurePath
|
|
|
2
2
|
from typing import cast
|
|
3
3
|
|
|
4
4
|
import bluesky.plan_stubs as bps
|
|
5
|
-
import bluesky.preprocessors as bpp
|
|
6
5
|
from bluesky.utils import MsgGenerator
|
|
7
6
|
from dodal.common.watcher_utils import log_on_percentage_complete
|
|
8
7
|
from dodal.devices.i24.commissioning_jungfrau import CommissioningJungfrau
|
|
@@ -19,44 +18,38 @@ JF_COMPLETE_GROUP = "JF complete"
|
|
|
19
18
|
|
|
20
19
|
|
|
21
20
|
def fly_jungfrau(
|
|
22
|
-
jungfrau: CommissioningJungfrau,
|
|
21
|
+
jungfrau: CommissioningJungfrau,
|
|
22
|
+
trigger_info: TriggerInfo,
|
|
23
|
+
wait: bool = False,
|
|
24
|
+
log_on_percentage_prefix="Jungfrau data collection triggers recieved",
|
|
23
25
|
) -> MsgGenerator[WatchableAsyncStatus]:
|
|
24
26
|
"""Stage, prepare, and kickoff Jungfrau with a configured TriggerInfo. Optionally wait
|
|
25
27
|
for completion.
|
|
26
28
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
+
Any plan using this stub MUST stage the Jungfrau with the stage_decorator and open a run,
|
|
30
|
+
ideally using the run_decorator.
|
|
29
31
|
|
|
30
32
|
Args:
|
|
31
33
|
jungfrau: Jungfrau device.
|
|
32
|
-
trigger_info: TriggerInfo which should be acquired using jungfrau util functions
|
|
33
|
-
or create_jungfrau_external_triggering_info.
|
|
34
|
+
trigger_info: TriggerInfo which should be acquired using jungfrau util functions.
|
|
34
35
|
wait: Optionally block until data collection is complete.
|
|
36
|
+
log_on_percentage_prefix: String that will be appended to the "percentage completion" logging message.
|
|
35
37
|
"""
|
|
36
38
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
)
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
yield from bps.prepare(jungfrau, trigger_info, wait=True)
|
|
44
|
-
LOGGER.info("Detector prepared. Starting acquisition")
|
|
45
|
-
yield from bps.kickoff(jungfrau, wait=True)
|
|
46
|
-
LOGGER.info("Waiting for acquisition to complete...")
|
|
47
|
-
status = yield from bps.complete(jungfrau, group=JF_COMPLETE_GROUP)
|
|
48
|
-
|
|
49
|
-
# StandardDetector.complete converts regular status to watchable status,
|
|
50
|
-
# but bluesky plan stubs can't see this currently
|
|
51
|
-
status = cast(WatchableAsyncStatus, status)
|
|
52
|
-
log_on_percentage_complete(
|
|
53
|
-
status, "Jungfrau data collection triggers recieved", 10
|
|
54
|
-
)
|
|
55
|
-
if wait:
|
|
56
|
-
yield from bps.wait(JF_COMPLETE_GROUP)
|
|
57
|
-
return status
|
|
39
|
+
LOGGER.info("Preparing detector...")
|
|
40
|
+
yield from bps.prepare(jungfrau, trigger_info, wait=True)
|
|
41
|
+
LOGGER.info("Detector prepared. Starting acquisition")
|
|
42
|
+
yield from bps.kickoff(jungfrau, wait=True)
|
|
43
|
+
LOGGER.info("Waiting for acquisition to complete...")
|
|
44
|
+
status = yield from bps.complete(jungfrau, group=JF_COMPLETE_GROUP)
|
|
58
45
|
|
|
59
|
-
|
|
46
|
+
# StandardDetector.complete converts regular status to watchable status,
|
|
47
|
+
# but bluesky plan stubs can't see this currently
|
|
48
|
+
status = cast(WatchableAsyncStatus, status)
|
|
49
|
+
log_on_percentage_complete(status, log_on_percentage_prefix, 10)
|
|
50
|
+
if wait:
|
|
51
|
+
yield from bps.wait(JF_COMPLETE_GROUP)
|
|
52
|
+
return status
|
|
60
53
|
|
|
61
54
|
|
|
62
55
|
def override_file_path(jungfrau: CommissioningJungfrau, path_of_output_file: str):
|
|
File without changes
|
|
@@ -9,8 +9,8 @@ from dodal.devices.backlight import Backlight, InOut
|
|
|
9
9
|
from dodal.devices.detector.detector_motion import DetectorMotion
|
|
10
10
|
from dodal.devices.smargon import CombinedMove, Smargon
|
|
11
11
|
|
|
12
|
+
from mx_bluesky.common.parameters.constants import PlanGroupCheckpointConstants
|
|
12
13
|
from mx_bluesky.common.utils.log import LOGGER
|
|
13
|
-
from mx_bluesky.hyperion.parameters.constants import CONST
|
|
14
14
|
|
|
15
15
|
LOWER_DETECTOR_SHUTTER_AFTER_SCAN = True
|
|
16
16
|
|
|
@@ -48,7 +48,7 @@ def move_aperture_if_required(
|
|
|
48
48
|
|
|
49
49
|
else:
|
|
50
50
|
LOGGER.info(f"Setting aperture position to {aperture_value}")
|
|
51
|
-
yield from bps.wait(
|
|
51
|
+
yield from bps.wait(PlanGroupCheckpointConstants.PREPARE_APERTURE)
|
|
52
52
|
yield from bps.abs_set(
|
|
53
53
|
aperture_scatterguard.selected_aperture,
|
|
54
54
|
aperture_value,
|
|
@@ -7,10 +7,14 @@ from dodal.devices.aperturescatterguard import ApertureScatterguard, ApertureVal
|
|
|
7
7
|
from dodal.devices.motors import XYZStage
|
|
8
8
|
from dodal.devices.robot import BartRobot
|
|
9
9
|
from dodal.devices.smargon import CombinedMove, Smargon, StubPosition
|
|
10
|
-
from dodal.plan_stubs.motor_utils import
|
|
10
|
+
from dodal.plan_stubs.motor_utils import MoveTooLargeError, home_and_reset_wrapper
|
|
11
11
|
|
|
12
|
+
from mx_bluesky.common.parameters.constants import (
|
|
13
|
+
DocDescriptorNames,
|
|
14
|
+
HardwareConstants,
|
|
15
|
+
PlanNameConstants,
|
|
16
|
+
)
|
|
12
17
|
from mx_bluesky.common.utils.log import LOGGER
|
|
13
|
-
from mx_bluesky.hyperion.parameters.constants import CONST
|
|
14
18
|
|
|
15
19
|
SLEEP_PER_CHECK = 0.1
|
|
16
20
|
|
|
@@ -35,7 +39,7 @@ def wait_for_smargon_not_disabled(smargon: Smargon, timeout=60):
|
|
|
35
39
|
|
|
36
40
|
def _raise_exception_if_moved_out_of_cryojet(exception):
|
|
37
41
|
yield from bps.null()
|
|
38
|
-
if isinstance(exception,
|
|
42
|
+
if isinstance(exception, MoveTooLargeError):
|
|
39
43
|
raise Exception(
|
|
40
44
|
f"Moving {exception.axis} back to {exception.position} after \
|
|
41
45
|
robot load would move it out of the cryojet. The max safe \
|
|
@@ -60,7 +64,7 @@ def do_plan_while_lower_gonio_at_home(plan: MsgGenerator, lower_gonio: XYZStage)
|
|
|
60
64
|
plan,
|
|
61
65
|
lower_gonio,
|
|
62
66
|
BartRobot.LOAD_TOLERANCE_MM,
|
|
63
|
-
|
|
67
|
+
HardwareConstants.CRYOJET_MARGIN_MM,
|
|
64
68
|
"lower_gonio",
|
|
65
69
|
wait_for_all=False,
|
|
66
70
|
),
|
|
@@ -100,7 +104,7 @@ def robot_unload(
|
|
|
100
104
|
|
|
101
105
|
@bpp.run_decorator(
|
|
102
106
|
md={
|
|
103
|
-
"subplan_name":
|
|
107
|
+
"subplan_name": PlanNameConstants.ROBOT_UNLOAD,
|
|
104
108
|
"metadata": {"visit": visit, "sample_id": sample_id},
|
|
105
109
|
"activate_callbacks": [
|
|
106
110
|
"RobotLoadISPyBCallback",
|
|
@@ -108,7 +112,7 @@ def robot_unload(
|
|
|
108
112
|
},
|
|
109
113
|
)
|
|
110
114
|
def do_robot_unload_and_send_to_ispyb():
|
|
111
|
-
yield from bps.create(name=
|
|
115
|
+
yield from bps.create(name=DocDescriptorNames.ROBOT_UPDATE)
|
|
112
116
|
yield from bps.read(robot)
|
|
113
117
|
yield from bps.save()
|
|
114
118
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
from functools import partial
|
|
2
2
|
|
|
3
3
|
import bluesky.plan_stubs as bps
|
|
4
|
-
from dodal.devices.areadetector.plugins.
|
|
4
|
+
from dodal.devices.areadetector.plugins.cam import ColorMode
|
|
5
5
|
from dodal.devices.oav.oav_detector import OAV
|
|
6
6
|
from dodal.devices.oav.oav_parameters import OAVParameters
|
|
7
7
|
from dodal.devices.oav.pin_image_recognition import PinTipDetection
|