mx-bluesky 1.4.2__py3-none-any.whl → 1.4.3__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/i24/serial/dcid.py +3 -3
- mx_bluesky/beamlines/i24/serial/extruder/i24ssx_Extruder_Collect_py3v2.py +24 -9
- mx_bluesky/beamlines/i24/serial/fixed_target/i24ssx_Chip_Collect_py3v1.py +13 -4
- mx_bluesky/beamlines/i24/serial/fixed_target/i24ssx_Chip_Manager_py3v1.py +1 -1
- mx_bluesky/beamlines/i24/serial/parameters/__init__.py +2 -1
- mx_bluesky/beamlines/i24/serial/parameters/constants.py +13 -5
- mx_bluesky/beamlines/i24/serial/parameters/experiment_parameters.py +20 -4
- mx_bluesky/beamlines/i24/serial/setup_beamline/setup_beamline.py +40 -11
- mx_bluesky/beamlines/i24/serial/setup_beamline/setup_zebra_plans.py +81 -40
- mx_bluesky/{hyperion/external_interaction/callbacks → common/external_interaction/callbacks/common}/aperture_change_callback.py +1 -1
- mx_bluesky/{hyperion/external_interaction/callbacks → common/external_interaction/callbacks/common}/grid_detection_callback.py +19 -1
- mx_bluesky/{hyperion/external_interaction/callbacks → common/external_interaction/callbacks/common}/ispyb_callback_base.py +40 -34
- mx_bluesky/{hyperion → common}/external_interaction/callbacks/common/ispyb_mapping.py +4 -4
- mx_bluesky/{hyperion/external_interaction/callbacks → common/external_interaction/callbacks/common}/logging_callback.py +1 -1
- mx_bluesky/{hyperion/external_interaction/callbacks → common/external_interaction/callbacks/common}/zocalo_callback.py +14 -9
- mx_bluesky/{hyperion → common}/external_interaction/callbacks/xray_centre/ispyb_callback.py +39 -34
- mx_bluesky/{hyperion → common}/external_interaction/callbacks/xray_centre/ispyb_mapping.py +2 -2
- mx_bluesky/{hyperion → common}/external_interaction/callbacks/xray_centre/nexus_callback.py +20 -15
- mx_bluesky/common/external_interaction/config_server.py +11 -0
- mx_bluesky/common/external_interaction/ispyb/__init__.py +0 -0
- mx_bluesky/{hyperion → common}/external_interaction/ispyb/data_model.py +2 -0
- mx_bluesky/{hyperion → common}/external_interaction/ispyb/exp_eye_store.py +5 -5
- mx_bluesky/{hyperion → common}/external_interaction/ispyb/ispyb_store.py +20 -18
- mx_bluesky/{hyperion → common}/external_interaction/ispyb/ispyb_utils.py +2 -2
- mx_bluesky/common/external_interaction/nexus/__init__.py +0 -0
- mx_bluesky/{hyperion → common}/external_interaction/nexus/nexus_utils.py +21 -6
- mx_bluesky/{hyperion → common}/external_interaction/nexus/write_nexus.py +5 -5
- mx_bluesky/common/external_interaction/test_config_server.py +38 -0
- mx_bluesky/common/parameters/components.py +9 -7
- mx_bluesky/common/parameters/constants.py +1 -0
- mx_bluesky/common/parameters/gridscan.py +102 -53
- mx_bluesky/common/plans/do_fgs.py +4 -4
- mx_bluesky/{hyperion → common/utils}/exceptions.py +15 -1
- mx_bluesky/common/utils/log.py +17 -7
- mx_bluesky/hyperion/__main__.py +15 -14
- mx_bluesky/hyperion/device_setup_plans/check_beamstop.py +27 -0
- mx_bluesky/hyperion/device_setup_plans/dcm_pitch_roll_mirror_adjuster.py +13 -6
- mx_bluesky/hyperion/device_setup_plans/manipulate_sample.py +1 -1
- mx_bluesky/hyperion/device_setup_plans/position_detector.py +1 -1
- mx_bluesky/hyperion/device_setup_plans/read_hardware_for_setup.py +3 -3
- mx_bluesky/hyperion/device_setup_plans/setup_panda.py +21 -4
- mx_bluesky/hyperion/device_setup_plans/setup_zebra.py +62 -36
- mx_bluesky/hyperion/device_setup_plans/smargon.py +1 -1
- mx_bluesky/hyperion/device_setup_plans/utils.py +4 -0
- mx_bluesky/hyperion/device_setup_plans/xbpm_feedback.py +8 -8
- mx_bluesky/hyperion/experiment_plans/change_aperture_then_move_plan.py +28 -17
- mx_bluesky/hyperion/experiment_plans/common/xrc_result.py +10 -1
- mx_bluesky/hyperion/experiment_plans/experiment_registry.py +9 -9
- mx_bluesky/hyperion/experiment_plans/flyscan_xray_centre_plan.py +39 -49
- mx_bluesky/hyperion/experiment_plans/grid_detect_then_xray_centre_plan.py +22 -23
- mx_bluesky/hyperion/experiment_plans/load_centre_collect_full_plan.py +4 -11
- mx_bluesky/hyperion/experiment_plans/oav_grid_detection_plan.py +3 -3
- mx_bluesky/hyperion/experiment_plans/optimise_attenuation_plan.py +6 -14
- mx_bluesky/hyperion/experiment_plans/pin_centre_then_xray_centre_plan.py +12 -11
- mx_bluesky/hyperion/experiment_plans/pin_tip_centring_plan.py +2 -2
- mx_bluesky/hyperion/experiment_plans/robot_load_and_change_energy.py +9 -4
- mx_bluesky/hyperion/experiment_plans/robot_load_then_centre_plan.py +10 -11
- mx_bluesky/hyperion/experiment_plans/rotation_scan_plan.py +33 -14
- mx_bluesky/hyperion/experiment_plans/set_energy_plan.py +2 -2
- mx_bluesky/hyperion/external_interaction/callbacks/__main__.py +28 -21
- mx_bluesky/hyperion/external_interaction/callbacks/common/callback_util.py +43 -32
- mx_bluesky/hyperion/external_interaction/callbacks/robot_load/ispyb_callback.py +22 -15
- mx_bluesky/hyperion/external_interaction/callbacks/rotation/ispyb_callback.py +25 -24
- mx_bluesky/hyperion/external_interaction/callbacks/rotation/ispyb_mapping.py +1 -1
- mx_bluesky/hyperion/external_interaction/callbacks/rotation/nexus_callback.py +13 -9
- mx_bluesky/hyperion/external_interaction/callbacks/sample_handling/sample_handling_callback.py +12 -46
- mx_bluesky/hyperion/external_interaction/config_server.py +15 -1
- mx_bluesky/hyperion/parameters/components.py +3 -2
- mx_bluesky/hyperion/parameters/constants.py +1 -0
- mx_bluesky/hyperion/parameters/gridscan.py +56 -89
- mx_bluesky/hyperion/parameters/load_centre_collect.py +51 -6
- mx_bluesky/hyperion/parameters/robot_load.py +40 -0
- mx_bluesky/hyperion/parameters/rotation.py +28 -3
- mx_bluesky/hyperion/utils/context.py +1 -1
- mx_bluesky/hyperion/utils/validation.py +4 -2
- {mx_bluesky-1.4.2.dist-info → mx_bluesky-1.4.3.dist-info}/METADATA +6 -6
- {mx_bluesky-1.4.2.dist-info → mx_bluesky-1.4.3.dist-info}/RECORD +89 -87
- {mx_bluesky-1.4.2.dist-info → mx_bluesky-1.4.3.dist-info}/WHEEL +1 -1
- mx_bluesky/common/parameters/robot_load.py +0 -16
- mx_bluesky/hyperion/external_interaction/exceptions.py +0 -4
- mx_bluesky/hyperion/log.py +0 -15
- /mx_bluesky/{hyperion/external_interaction/callbacks/xray_centre → common/external_interaction}/__init__.py +0 -0
- /mx_bluesky/{hyperion/external_interaction/ispyb → common/external_interaction/callbacks/common}/__init__.py +0 -0
- /mx_bluesky/{hyperion → common}/external_interaction/callbacks/common/abstract_event.py +0 -0
- /mx_bluesky/{hyperion/external_interaction/callbacks → common/external_interaction/callbacks/common}/log_uid_tag_callback.py +0 -0
- /mx_bluesky/{hyperion/external_interaction/callbacks → common/external_interaction/callbacks/common}/plan_reactive_callback.py +0 -0
- /mx_bluesky/{hyperion/external_interaction/nexus → common/external_interaction/callbacks/xray_centre}/__init__.py +0 -0
- /mx_bluesky/{hyperion → common}/utils/utils.py +0 -0
- {mx_bluesky-1.4.2.dist-info → mx_bluesky-1.4.3.dist-info}/LICENSE +0 -0
- {mx_bluesky-1.4.2.dist-info → mx_bluesky-1.4.3.dist-info}/entry_points.txt +0 -0
- {mx_bluesky-1.4.2.dist-info → mx_bluesky-1.4.3.dist-info}/top_level.txt +0 -0
|
@@ -9,7 +9,7 @@ from blueapi.core import BlueskyContext
|
|
|
9
9
|
from bluesky import plan_stubs as bps
|
|
10
10
|
from bluesky.utils import MsgGenerator
|
|
11
11
|
from dodal.devices.aperturescatterguard import ApertureScatterguard
|
|
12
|
-
from dodal.devices.attenuator import
|
|
12
|
+
from dodal.devices.attenuator.attenuator import BinaryFilterAttenuator
|
|
13
13
|
from dodal.devices.backlight import Backlight
|
|
14
14
|
from dodal.devices.dcm import DCM
|
|
15
15
|
from dodal.devices.detector.detector_motion import DetectorMotion
|
|
@@ -17,6 +17,7 @@ from dodal.devices.eiger import EigerDetector
|
|
|
17
17
|
from dodal.devices.fast_grid_scan import PandAFastGridScan, ZebraFastGridScan
|
|
18
18
|
from dodal.devices.flux import Flux
|
|
19
19
|
from dodal.devices.focusing_mirror import FocusingMirrorWithStripes, MirrorVoltages
|
|
20
|
+
from dodal.devices.i03.beamstop import Beamstop
|
|
20
21
|
from dodal.devices.motors import XYZPositioner
|
|
21
22
|
from dodal.devices.oav.oav_detector import OAV
|
|
22
23
|
from dodal.devices.oav.pin_image_recognition import PinTipDetection
|
|
@@ -29,14 +30,13 @@ from dodal.devices.undulator import Undulator
|
|
|
29
30
|
from dodal.devices.undulator_dcm import UndulatorDCM
|
|
30
31
|
from dodal.devices.webcam import Webcam
|
|
31
32
|
from dodal.devices.xbpm_feedback import XBPMFeedback
|
|
32
|
-
from dodal.devices.zebra import Zebra
|
|
33
|
-
from dodal.devices.zebra_controlled_shutter import ZebraShutter
|
|
33
|
+
from dodal.devices.zebra.zebra import Zebra
|
|
34
|
+
from dodal.devices.zebra.zebra_controlled_shutter import ZebraShutter
|
|
34
35
|
from dodal.devices.zocalo import ZocaloResults
|
|
35
36
|
from dodal.log import LOGGER
|
|
36
37
|
from ophyd_async.fastcs.panda import HDFPanda
|
|
37
38
|
|
|
38
39
|
from mx_bluesky.common.parameters.constants import OavConstants
|
|
39
|
-
from mx_bluesky.common.parameters.gridscan import RobotLoadThenCentre
|
|
40
40
|
from mx_bluesky.hyperion.device_setup_plans.utils import (
|
|
41
41
|
fill_in_energy_if_not_supplied,
|
|
42
42
|
start_preparing_data_collection_then_do_plan,
|
|
@@ -63,13 +63,14 @@ from mx_bluesky.hyperion.experiment_plans.set_energy_plan import (
|
|
|
63
63
|
set_energy_plan,
|
|
64
64
|
)
|
|
65
65
|
from mx_bluesky.hyperion.parameters.constants import CONST
|
|
66
|
+
from mx_bluesky.hyperion.parameters.robot_load import RobotLoadThenCentre
|
|
66
67
|
|
|
67
68
|
|
|
68
69
|
@pydantic.dataclasses.dataclass(config={"arbitrary_types_allowed": True})
|
|
69
70
|
class RobotLoadThenCentreComposite:
|
|
70
71
|
# common fields
|
|
71
72
|
xbpm_feedback: XBPMFeedback
|
|
72
|
-
attenuator:
|
|
73
|
+
attenuator: BinaryFilterAttenuator
|
|
73
74
|
|
|
74
75
|
# GridDetectThenXRayCentreComposite fields
|
|
75
76
|
aperture_scatterguard: ApertureScatterguard
|
|
@@ -101,10 +102,7 @@ class RobotLoadThenCentreComposite:
|
|
|
101
102
|
robot: BartRobot
|
|
102
103
|
webcam: Webcam
|
|
103
104
|
lower_gonio: XYZPositioner
|
|
104
|
-
|
|
105
|
-
@property
|
|
106
|
-
def sample_motors(self):
|
|
107
|
-
return self.smargon
|
|
105
|
+
beamstop: Beamstop
|
|
108
106
|
|
|
109
107
|
|
|
110
108
|
def create_devices(context: BlueskyContext) -> RobotLoadThenCentreComposite:
|
|
@@ -120,7 +118,7 @@ def _flyscan_plan_from_robot_load_params(
|
|
|
120
118
|
):
|
|
121
119
|
yield from pin_centre_then_flyscan_plan(
|
|
122
120
|
cast(GridDetectThenXRayCentreComposite, composite),
|
|
123
|
-
params.pin_centre_then_xray_centre_params
|
|
121
|
+
params.pin_centre_then_xray_centre_params,
|
|
124
122
|
)
|
|
125
123
|
|
|
126
124
|
|
|
@@ -131,7 +129,7 @@ def _robot_load_then_flyscan_plan(
|
|
|
131
129
|
):
|
|
132
130
|
yield from robot_load_and_change_energy_plan(
|
|
133
131
|
cast(RobotLoadAndEnergyChangeComposite, composite),
|
|
134
|
-
params.robot_load_params
|
|
132
|
+
params.robot_load_params,
|
|
135
133
|
)
|
|
136
134
|
|
|
137
135
|
yield from _flyscan_plan_from_robot_load_params(composite, params, oav_config_file)
|
|
@@ -211,6 +209,7 @@ def robot_load_then_xray_centre(
|
|
|
211
209
|
eiger.set_detector_parameters(detector_params)
|
|
212
210
|
|
|
213
211
|
yield from start_preparing_data_collection_then_do_plan(
|
|
212
|
+
composite.beamstop,
|
|
214
213
|
eiger,
|
|
215
214
|
composite.detector_motion,
|
|
216
215
|
parameters.detector_distance_mm,
|
|
@@ -8,12 +8,13 @@ import pydantic
|
|
|
8
8
|
from blueapi.core import BlueskyContext
|
|
9
9
|
from bluesky.utils import MsgGenerator
|
|
10
10
|
from dodal.devices.aperturescatterguard import ApertureScatterguard
|
|
11
|
-
from dodal.devices.attenuator import
|
|
11
|
+
from dodal.devices.attenuator.attenuator import BinaryFilterAttenuator
|
|
12
12
|
from dodal.devices.backlight import Backlight
|
|
13
13
|
from dodal.devices.dcm import DCM
|
|
14
14
|
from dodal.devices.detector.detector_motion import DetectorMotion
|
|
15
15
|
from dodal.devices.eiger import EigerDetector
|
|
16
16
|
from dodal.devices.flux import Flux
|
|
17
|
+
from dodal.devices.i03.beamstop import Beamstop
|
|
17
18
|
from dodal.devices.oav.oav_detector import OAV
|
|
18
19
|
from dodal.devices.oav.oav_parameters import OAVParameters
|
|
19
20
|
from dodal.devices.robot import BartRobot
|
|
@@ -22,13 +23,14 @@ from dodal.devices.smargon import Smargon
|
|
|
22
23
|
from dodal.devices.synchrotron import Synchrotron
|
|
23
24
|
from dodal.devices.undulator import Undulator
|
|
24
25
|
from dodal.devices.xbpm_feedback import XBPMFeedback
|
|
25
|
-
from dodal.devices.zebra import RotationDirection, Zebra
|
|
26
|
-
from dodal.devices.zebra_controlled_shutter import ZebraShutter
|
|
26
|
+
from dodal.devices.zebra.zebra import RotationDirection, Zebra
|
|
27
|
+
from dodal.devices.zebra.zebra_controlled_shutter import ZebraShutter
|
|
27
28
|
from dodal.plan_stubs.check_topup import check_topup_and_wait_if_necessary
|
|
28
29
|
|
|
29
30
|
from mx_bluesky.common.device_setup_plans.read_hardware_for_setup import (
|
|
30
31
|
read_hardware_for_zocalo,
|
|
31
32
|
)
|
|
33
|
+
from mx_bluesky.common.utils.log import LOGGER
|
|
32
34
|
from mx_bluesky.hyperion.device_setup_plans.manipulate_sample import (
|
|
33
35
|
cleanup_sample_environment,
|
|
34
36
|
move_phi_chi_omega,
|
|
@@ -55,7 +57,6 @@ from mx_bluesky.hyperion.experiment_plans.oav_snapshot_plan import (
|
|
|
55
57
|
oav_snapshot_plan,
|
|
56
58
|
setup_beamline_for_OAV,
|
|
57
59
|
)
|
|
58
|
-
from mx_bluesky.hyperion.log import LOGGER
|
|
59
60
|
from mx_bluesky.hyperion.parameters.constants import CONST
|
|
60
61
|
from mx_bluesky.hyperion.parameters.rotation import (
|
|
61
62
|
MultiRotationScan,
|
|
@@ -69,8 +70,9 @@ class RotationScanComposite(OavSnapshotComposite):
|
|
|
69
70
|
"""All devices which are directly or indirectly required by this plan"""
|
|
70
71
|
|
|
71
72
|
aperture_scatterguard: ApertureScatterguard
|
|
72
|
-
attenuator:
|
|
73
|
+
attenuator: BinaryFilterAttenuator
|
|
73
74
|
backlight: Backlight
|
|
75
|
+
beamstop: Beamstop
|
|
74
76
|
dcm: DCM
|
|
75
77
|
detector_motion: DetectorMotion
|
|
76
78
|
eiger: EigerDetector
|
|
@@ -126,13 +128,26 @@ def calculate_motion_profile(
|
|
|
126
128
|
See https://github.com/DiamondLightSource/hyperion/wiki/rotation-scan-geometry
|
|
127
129
|
for a simple pictorial explanation."""
|
|
128
130
|
|
|
129
|
-
|
|
131
|
+
assert params.rotation_increment_deg > 0
|
|
132
|
+
|
|
133
|
+
direction = params.rotation_direction
|
|
134
|
+
start_scan_deg = params.omega_start_deg
|
|
135
|
+
|
|
136
|
+
if params.features.omega_flip:
|
|
137
|
+
# If omega_flip is True then the motor omega axis is inverted with respect to the
|
|
138
|
+
# hyperion coordinate system.
|
|
139
|
+
start_scan_deg = -start_scan_deg
|
|
140
|
+
direction = (
|
|
141
|
+
direction.POSITIVE
|
|
142
|
+
if direction == direction.NEGATIVE
|
|
143
|
+
else direction.NEGATIVE
|
|
144
|
+
)
|
|
145
|
+
|
|
130
146
|
num_images = params.num_images
|
|
131
147
|
shutter_time_s = params.shutter_opening_time_s
|
|
132
148
|
image_width_deg = params.rotation_increment_deg
|
|
133
149
|
exposure_time_s = params.exposure_time_s
|
|
134
150
|
motor_time_to_speed_s *= ACCELERATION_MARGIN
|
|
135
|
-
start_scan_deg = params.omega_start_deg
|
|
136
151
|
|
|
137
152
|
LOGGER.info("Calculating rotation scan motion profile:")
|
|
138
153
|
LOGGER.info(
|
|
@@ -153,9 +168,9 @@ def calculate_motion_profile(
|
|
|
153
168
|
f"{acceleration_offset_deg=} = {motor_time_to_speed_s=} * {speed_for_rotation_deg_s=}"
|
|
154
169
|
)
|
|
155
170
|
|
|
156
|
-
start_motion_deg = start_scan_deg - (acceleration_offset_deg * direction)
|
|
171
|
+
start_motion_deg = start_scan_deg - (acceleration_offset_deg * direction.multiplier)
|
|
157
172
|
LOGGER.info(
|
|
158
|
-
f"{start_motion_deg=} = {start_scan_deg=} - ({acceleration_offset_deg=} * {direction=})"
|
|
173
|
+
f"{start_motion_deg=} = {start_scan_deg=} - ({acceleration_offset_deg=} * {direction.multiplier=})"
|
|
159
174
|
)
|
|
160
175
|
|
|
161
176
|
shutter_opening_deg = speed_for_rotation_deg_s * shutter_time_s
|
|
@@ -173,7 +188,7 @@ def calculate_motion_profile(
|
|
|
173
188
|
|
|
174
189
|
distance_to_move_deg = (
|
|
175
190
|
scan_width_deg + shutter_opening_deg + acceleration_offset_deg * 2
|
|
176
|
-
) * direction
|
|
191
|
+
) * direction.multiplier
|
|
177
192
|
LOGGER.info(
|
|
178
193
|
f"{distance_to_move_deg=} = ({scan_width_deg=} + {shutter_opening_deg=} + {acceleration_offset_deg=} * 2) * {direction=})"
|
|
179
194
|
)
|
|
@@ -183,7 +198,7 @@ def calculate_motion_profile(
|
|
|
183
198
|
start_motion_deg=start_motion_deg,
|
|
184
199
|
scan_width_deg=scan_width_deg,
|
|
185
200
|
shutter_time_s=shutter_time_s,
|
|
186
|
-
direction=
|
|
201
|
+
direction=direction,
|
|
187
202
|
speed_for_rotation_deg_s=speed_for_rotation_deg_s,
|
|
188
203
|
acceleration_offset_deg=acceleration_offset_deg,
|
|
189
204
|
shutter_opening_deg=shutter_opening_deg,
|
|
@@ -344,6 +359,8 @@ def rotation_scan(
|
|
|
344
359
|
parameters: RotationScan,
|
|
345
360
|
oav_params: OAVParameters | None = None,
|
|
346
361
|
) -> MsgGenerator:
|
|
362
|
+
parameters.features.update_self_from_server()
|
|
363
|
+
|
|
347
364
|
if not oav_params:
|
|
348
365
|
oav_params = OAVParameters(context="xrayCentring")
|
|
349
366
|
|
|
@@ -353,7 +370,7 @@ def rotation_scan(
|
|
|
353
370
|
"subplan_name": CONST.PLAN.ROTATION_OUTER,
|
|
354
371
|
CONST.TRIGGER.ZOCALO: CONST.PLAN.ROTATION_MAIN,
|
|
355
372
|
"zocalo_environment": CONST.ZOCALO_ENV,
|
|
356
|
-
"
|
|
373
|
+
"mx_bluesky_parameters": parameters.model_dump_json(),
|
|
357
374
|
"activate_callbacks": [
|
|
358
375
|
"RotationISPyBCallback",
|
|
359
376
|
"RotationNexusFileCallback",
|
|
@@ -377,6 +394,7 @@ def rotation_scan(
|
|
|
377
394
|
|
|
378
395
|
LOGGER.info("setting up and staging eiger...")
|
|
379
396
|
yield from start_preparing_data_collection_then_do_plan(
|
|
397
|
+
composite.beamstop,
|
|
380
398
|
eiger,
|
|
381
399
|
composite.detector_motion,
|
|
382
400
|
params.detector_distance_mm,
|
|
@@ -393,6 +411,7 @@ def multi_rotation_scan(
|
|
|
393
411
|
parameters: MultiRotationScan,
|
|
394
412
|
oav_params: OAVParameters | None = None,
|
|
395
413
|
) -> MsgGenerator:
|
|
414
|
+
parameters.features.update_self_from_server()
|
|
396
415
|
if not oav_params:
|
|
397
416
|
oav_params = OAVParameters(context="xrayCentring")
|
|
398
417
|
eiger: EigerDetector = composite.eiger
|
|
@@ -425,8 +444,7 @@ def multi_rotation_scan(
|
|
|
425
444
|
md={
|
|
426
445
|
"subplan_name": CONST.PLAN.ROTATION_OUTER,
|
|
427
446
|
CONST.TRIGGER.ZOCALO: CONST.PLAN.ROTATION_MAIN,
|
|
428
|
-
"
|
|
429
|
-
"hyperion_parameters": single_scan.model_dump_json(),
|
|
447
|
+
"mx_bluesky_parameters": single_scan.model_dump_json(),
|
|
430
448
|
}
|
|
431
449
|
)
|
|
432
450
|
def rotation_scan_core(
|
|
@@ -438,6 +456,7 @@ def multi_rotation_scan(
|
|
|
438
456
|
|
|
439
457
|
LOGGER.info("setting up and staging eiger...")
|
|
440
458
|
yield from start_preparing_data_collection_then_do_plan(
|
|
459
|
+
composite.beamstop,
|
|
441
460
|
eiger,
|
|
442
461
|
composite.detector_motion,
|
|
443
462
|
parameters.detector_distance_mm,
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
import pydantic
|
|
9
9
|
from bluesky import plan_stubs as bps
|
|
10
|
-
from dodal.devices.attenuator import
|
|
10
|
+
from dodal.devices.attenuator.attenuator import BinaryFilterAttenuator
|
|
11
11
|
from dodal.devices.dcm import DCM
|
|
12
12
|
from dodal.devices.focusing_mirror import FocusingMirrorWithStripes, MirrorVoltages
|
|
13
13
|
from dodal.devices.undulator_dcm import UndulatorDCM
|
|
@@ -30,7 +30,7 @@ class SetEnergyComposite:
|
|
|
30
30
|
dcm: DCM
|
|
31
31
|
undulator_dcm: UndulatorDCM
|
|
32
32
|
xbpm_feedback: XBPMFeedback
|
|
33
|
-
attenuator:
|
|
33
|
+
attenuator: BinaryFilterAttenuator
|
|
34
34
|
|
|
35
35
|
|
|
36
36
|
def _set_energy_plan(
|
|
@@ -7,10 +7,24 @@ from bluesky.callbacks.zmq import Proxy, RemoteDispatcher
|
|
|
7
7
|
from dodal.log import LOGGER as dodal_logger
|
|
8
8
|
from dodal.log import set_up_all_logging_handlers
|
|
9
9
|
|
|
10
|
-
from mx_bluesky.common.
|
|
11
|
-
from mx_bluesky.hyperion.external_interaction.callbacks.log_uid_tag_callback import (
|
|
10
|
+
from mx_bluesky.common.external_interaction.callbacks.common.log_uid_tag_callback import (
|
|
12
11
|
LogUidTaggingCallback,
|
|
13
12
|
)
|
|
13
|
+
from mx_bluesky.common.external_interaction.callbacks.common.zocalo_callback import (
|
|
14
|
+
ZocaloCallback,
|
|
15
|
+
)
|
|
16
|
+
from mx_bluesky.common.external_interaction.callbacks.xray_centre.ispyb_callback import (
|
|
17
|
+
GridscanISPyBCallback,
|
|
18
|
+
)
|
|
19
|
+
from mx_bluesky.common.external_interaction.callbacks.xray_centre.nexus_callback import (
|
|
20
|
+
GridscanNexusFileCallback,
|
|
21
|
+
)
|
|
22
|
+
from mx_bluesky.common.utils.log import (
|
|
23
|
+
ISPYB_ZOCALO_CALLBACK_LOGGER,
|
|
24
|
+
NEXUS_LOGGER,
|
|
25
|
+
_get_logging_dir,
|
|
26
|
+
tag_filter,
|
|
27
|
+
)
|
|
14
28
|
from mx_bluesky.hyperion.external_interaction.callbacks.robot_load.ispyb_callback import (
|
|
15
29
|
RobotLoadISPyBCallback,
|
|
16
30
|
)
|
|
@@ -23,21 +37,12 @@ from mx_bluesky.hyperion.external_interaction.callbacks.rotation.nexus_callback
|
|
|
23
37
|
from mx_bluesky.hyperion.external_interaction.callbacks.sample_handling.sample_handling_callback import (
|
|
24
38
|
SampleHandlingCallback,
|
|
25
39
|
)
|
|
26
|
-
from mx_bluesky.hyperion.external_interaction.callbacks.xray_centre.ispyb_callback import (
|
|
27
|
-
GridscanISPyBCallback,
|
|
28
|
-
)
|
|
29
|
-
from mx_bluesky.hyperion.external_interaction.callbacks.xray_centre.nexus_callback import (
|
|
30
|
-
GridscanNexusFileCallback,
|
|
31
|
-
)
|
|
32
|
-
from mx_bluesky.hyperion.external_interaction.callbacks.zocalo_callback import (
|
|
33
|
-
ZocaloCallback,
|
|
34
|
-
)
|
|
35
|
-
from mx_bluesky.hyperion.log import (
|
|
36
|
-
ISPYB_LOGGER,
|
|
37
|
-
NEXUS_LOGGER,
|
|
38
|
-
)
|
|
39
40
|
from mx_bluesky.hyperion.parameters.cli import parse_callback_dev_mode_arg
|
|
40
41
|
from mx_bluesky.hyperion.parameters.constants import CONST
|
|
42
|
+
from mx_bluesky.hyperion.parameters.gridscan import (
|
|
43
|
+
GridCommonWithHyperionDetectorParams,
|
|
44
|
+
HyperionSpecifiedThreeDGridScan,
|
|
45
|
+
)
|
|
41
46
|
|
|
42
47
|
LIVENESS_POLL_SECONDS = 1
|
|
43
48
|
ERROR_LOG_BUFFER_LINES = 5000
|
|
@@ -46,8 +51,10 @@ ERROR_LOG_BUFFER_LINES = 5000
|
|
|
46
51
|
def setup_callbacks():
|
|
47
52
|
zocalo = ZocaloCallback()
|
|
48
53
|
return [
|
|
49
|
-
GridscanNexusFileCallback(),
|
|
50
|
-
GridscanISPyBCallback(
|
|
54
|
+
GridscanNexusFileCallback(param_type=HyperionSpecifiedThreeDGridScan),
|
|
55
|
+
GridscanISPyBCallback(
|
|
56
|
+
param_type=GridCommonWithHyperionDetectorParams, emit=zocalo
|
|
57
|
+
),
|
|
51
58
|
RotationNexusFileCallback(),
|
|
52
59
|
RotationISPyBCallback(emit=zocalo),
|
|
53
60
|
LogUidTaggingCallback(),
|
|
@@ -58,7 +65,7 @@ def setup_callbacks():
|
|
|
58
65
|
|
|
59
66
|
def setup_logging(dev_mode: bool):
|
|
60
67
|
for logger, filename in [
|
|
61
|
-
(
|
|
68
|
+
(ISPYB_ZOCALO_CALLBACK_LOGGER, "hyperion_ispyb_callback.log"),
|
|
62
69
|
(NEXUS_LOGGER, "hyperion_nexus_callback.log"),
|
|
63
70
|
]:
|
|
64
71
|
if logger.handlers == []:
|
|
@@ -74,7 +81,7 @@ def setup_logging(dev_mode: bool):
|
|
|
74
81
|
log_info(f"Loggers initialised with dev_mode={dev_mode}")
|
|
75
82
|
nexgen_logger = logging.getLogger("nexgen")
|
|
76
83
|
nexgen_logger.parent = NEXUS_LOGGER
|
|
77
|
-
dodal_logger.parent =
|
|
84
|
+
dodal_logger.parent = ISPYB_ZOCALO_CALLBACK_LOGGER
|
|
78
85
|
log_debug("nexgen logger added to nexus logger")
|
|
79
86
|
|
|
80
87
|
|
|
@@ -94,12 +101,12 @@ def setup_threads():
|
|
|
94
101
|
|
|
95
102
|
|
|
96
103
|
def log_info(msg, *args, **kwargs):
|
|
97
|
-
|
|
104
|
+
ISPYB_ZOCALO_CALLBACK_LOGGER.info(msg, *args, **kwargs)
|
|
98
105
|
NEXUS_LOGGER.info(msg, *args, **kwargs)
|
|
99
106
|
|
|
100
107
|
|
|
101
108
|
def log_debug(msg, *args, **kwargs):
|
|
102
|
-
|
|
109
|
+
ISPYB_ZOCALO_CALLBACK_LOGGER.debug(msg, *args, **kwargs)
|
|
103
110
|
NEXUS_LOGGER.debug(msg, *args, **kwargs)
|
|
104
111
|
|
|
105
112
|
|
|
@@ -2,6 +2,15 @@ from collections.abc import Callable
|
|
|
2
2
|
|
|
3
3
|
from bluesky.callbacks import CallbackBase
|
|
4
4
|
|
|
5
|
+
from mx_bluesky.common.external_interaction.callbacks.common.zocalo_callback import (
|
|
6
|
+
ZocaloCallback,
|
|
7
|
+
)
|
|
8
|
+
from mx_bluesky.common.external_interaction.callbacks.xray_centre.ispyb_callback import (
|
|
9
|
+
GridscanISPyBCallback,
|
|
10
|
+
)
|
|
11
|
+
from mx_bluesky.common.external_interaction.callbacks.xray_centre.nexus_callback import (
|
|
12
|
+
GridscanNexusFileCallback,
|
|
13
|
+
)
|
|
5
14
|
from mx_bluesky.hyperion.external_interaction.callbacks.robot_load.ispyb_callback import (
|
|
6
15
|
RobotLoadISPyBCallback,
|
|
7
16
|
)
|
|
@@ -14,54 +23,56 @@ from mx_bluesky.hyperion.external_interaction.callbacks.rotation.nexus_callback
|
|
|
14
23
|
from mx_bluesky.hyperion.external_interaction.callbacks.sample_handling.sample_handling_callback import (
|
|
15
24
|
SampleHandlingCallback,
|
|
16
25
|
)
|
|
17
|
-
from mx_bluesky.hyperion.
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
from mx_bluesky.hyperion.external_interaction.callbacks.xray_centre.nexus_callback import (
|
|
21
|
-
GridscanNexusFileCallback,
|
|
22
|
-
)
|
|
23
|
-
from mx_bluesky.hyperion.external_interaction.callbacks.zocalo_callback import (
|
|
24
|
-
ZocaloCallback,
|
|
26
|
+
from mx_bluesky.hyperion.parameters.gridscan import (
|
|
27
|
+
GridCommonWithHyperionDetectorParams,
|
|
28
|
+
HyperionSpecifiedThreeDGridScan,
|
|
25
29
|
)
|
|
26
30
|
|
|
27
31
|
CallbacksFactory = Callable[[], tuple[CallbackBase, ...]]
|
|
28
32
|
|
|
29
33
|
|
|
30
|
-
def create_robot_load_and_centre_callbacks() ->
|
|
31
|
-
|
|
32
|
-
|
|
34
|
+
def create_robot_load_and_centre_callbacks() -> tuple[
|
|
35
|
+
GridscanNexusFileCallback, GridscanISPyBCallback, RobotLoadISPyBCallback
|
|
36
|
+
]:
|
|
33
37
|
return (
|
|
34
|
-
GridscanNexusFileCallback(),
|
|
35
|
-
GridscanISPyBCallback(
|
|
38
|
+
GridscanNexusFileCallback(param_type=HyperionSpecifiedThreeDGridScan),
|
|
39
|
+
GridscanISPyBCallback(
|
|
40
|
+
param_type=GridCommonWithHyperionDetectorParams, emit=ZocaloCallback()
|
|
41
|
+
),
|
|
36
42
|
RobotLoadISPyBCallback(),
|
|
37
43
|
)
|
|
38
44
|
|
|
39
45
|
|
|
40
|
-
def create_gridscan_callbacks() ->
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
return (
|
|
46
|
+
def create_gridscan_callbacks() -> tuple[
|
|
47
|
+
GridscanNexusFileCallback, GridscanISPyBCallback
|
|
48
|
+
]:
|
|
49
|
+
return (
|
|
50
|
+
GridscanNexusFileCallback(param_type=HyperionSpecifiedThreeDGridScan),
|
|
51
|
+
GridscanISPyBCallback(
|
|
52
|
+
param_type=GridCommonWithHyperionDetectorParams, emit=ZocaloCallback()
|
|
53
|
+
),
|
|
54
|
+
)
|
|
44
55
|
|
|
45
56
|
|
|
46
|
-
def create_rotation_callbacks() ->
|
|
47
|
-
|
|
48
|
-
|
|
57
|
+
def create_rotation_callbacks() -> tuple[
|
|
58
|
+
RotationNexusFileCallback, RotationISPyBCallback
|
|
59
|
+
]:
|
|
49
60
|
return (RotationNexusFileCallback(), RotationISPyBCallback(emit=ZocaloCallback()))
|
|
50
61
|
|
|
51
62
|
|
|
52
|
-
def create_load_centre_collect_callbacks() ->
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
]
|
|
61
|
-
):
|
|
63
|
+
def create_load_centre_collect_callbacks() -> tuple[
|
|
64
|
+
GridscanNexusFileCallback,
|
|
65
|
+
GridscanISPyBCallback,
|
|
66
|
+
RobotLoadISPyBCallback,
|
|
67
|
+
RotationNexusFileCallback,
|
|
68
|
+
RotationISPyBCallback,
|
|
69
|
+
SampleHandlingCallback,
|
|
70
|
+
]:
|
|
62
71
|
return (
|
|
63
|
-
GridscanNexusFileCallback(),
|
|
64
|
-
GridscanISPyBCallback(
|
|
72
|
+
GridscanNexusFileCallback(param_type=HyperionSpecifiedThreeDGridScan),
|
|
73
|
+
GridscanISPyBCallback(
|
|
74
|
+
param_type=GridCommonWithHyperionDetectorParams, emit=ZocaloCallback()
|
|
75
|
+
),
|
|
65
76
|
RobotLoadISPyBCallback(),
|
|
66
77
|
RotationNexusFileCallback(),
|
|
67
78
|
RotationISPyBCallback(emit=ZocaloCallback()),
|
|
@@ -2,18 +2,18 @@ from __future__ import annotations
|
|
|
2
2
|
|
|
3
3
|
from typing import TYPE_CHECKING
|
|
4
4
|
|
|
5
|
-
from mx_bluesky.
|
|
5
|
+
from mx_bluesky.common.external_interaction.callbacks.common.ispyb_mapping import (
|
|
6
6
|
get_proposal_and_session_from_visit_string,
|
|
7
7
|
)
|
|
8
|
-
from mx_bluesky.
|
|
8
|
+
from mx_bluesky.common.external_interaction.callbacks.common.plan_reactive_callback import (
|
|
9
9
|
PlanReactiveCallback,
|
|
10
10
|
)
|
|
11
|
-
from mx_bluesky.
|
|
11
|
+
from mx_bluesky.common.external_interaction.ispyb.exp_eye_store import (
|
|
12
12
|
BLSampleStatus,
|
|
13
13
|
ExpeyeInteraction,
|
|
14
14
|
RobotActionID,
|
|
15
15
|
)
|
|
16
|
-
from mx_bluesky.
|
|
16
|
+
from mx_bluesky.common.utils.log import ISPYB_ZOCALO_CALLBACK_LOGGER
|
|
17
17
|
from mx_bluesky.hyperion.parameters.constants import CONST
|
|
18
18
|
|
|
19
19
|
if TYPE_CHECKING:
|
|
@@ -22,18 +22,23 @@ if TYPE_CHECKING:
|
|
|
22
22
|
|
|
23
23
|
class RobotLoadISPyBCallback(PlanReactiveCallback):
|
|
24
24
|
def __init__(self) -> None:
|
|
25
|
-
|
|
26
|
-
super().__init__(log=
|
|
25
|
+
ISPYB_ZOCALO_CALLBACK_LOGGER.debug("Initialising ISPyB Robot Load Callback")
|
|
26
|
+
super().__init__(log=ISPYB_ZOCALO_CALLBACK_LOGGER)
|
|
27
27
|
self._metadata: dict | None = None
|
|
28
|
+
|
|
28
29
|
self.run_uid: str | None = None
|
|
29
30
|
self.descriptors: dict[str, EventDescriptor] = {}
|
|
30
31
|
self.action_id: RobotActionID | None = None
|
|
31
32
|
self.expeye = ExpeyeInteraction()
|
|
32
33
|
|
|
33
34
|
def activity_gated_start(self, doc: RunStart):
|
|
34
|
-
|
|
35
|
+
ISPYB_ZOCALO_CALLBACK_LOGGER.debug(
|
|
36
|
+
"ISPyB robot load callback received start document."
|
|
37
|
+
)
|
|
35
38
|
if doc.get("subplan_name") == CONST.PLAN.ROBOT_LOAD:
|
|
36
|
-
|
|
39
|
+
ISPYB_ZOCALO_CALLBACK_LOGGER.debug(
|
|
40
|
+
f"ISPyB robot load callback received: {doc}"
|
|
41
|
+
)
|
|
37
42
|
self.run_uid = doc.get("uid")
|
|
38
43
|
self._metadata = doc.get("metadata")
|
|
39
44
|
assert isinstance(self._metadata, dict)
|
|
@@ -59,9 +64,9 @@ class RobotLoadISPyBCallback(PlanReactiveCallback):
|
|
|
59
64
|
event_descriptor
|
|
60
65
|
and event_descriptor.get("name") == CONST.DESCRIPTORS.ROBOT_LOAD
|
|
61
66
|
):
|
|
62
|
-
assert (
|
|
63
|
-
|
|
64
|
-
)
|
|
67
|
+
assert self.action_id is not None, (
|
|
68
|
+
"ISPyB Robot load callback event called unexpectedly"
|
|
69
|
+
)
|
|
65
70
|
barcode = doc["data"]["robot-barcode"]
|
|
66
71
|
oav_snapshot = doc["data"]["oav-snapshot-last_saved_path"]
|
|
67
72
|
webcam_snapshot = doc["data"]["webcam-last_saved_path"]
|
|
@@ -73,11 +78,13 @@ class RobotLoadISPyBCallback(PlanReactiveCallback):
|
|
|
73
78
|
return super().activity_gated_event(doc)
|
|
74
79
|
|
|
75
80
|
def activity_gated_stop(self, doc: RunStop) -> RunStop | None:
|
|
76
|
-
|
|
81
|
+
ISPYB_ZOCALO_CALLBACK_LOGGER.debug(
|
|
82
|
+
"ISPyB robot load callback received stop document."
|
|
83
|
+
)
|
|
77
84
|
if doc.get("run_start") == self.run_uid:
|
|
78
|
-
assert (
|
|
79
|
-
|
|
80
|
-
)
|
|
85
|
+
assert self.action_id is not None, (
|
|
86
|
+
"ISPyB Robot load callback stop called unexpectedly"
|
|
87
|
+
)
|
|
81
88
|
exit_status = doc.get("exit_status")
|
|
82
89
|
assert exit_status, "Exit status not available in stop document!"
|
|
83
90
|
assert self._metadata, "Metadata not received before stop document."
|
|
@@ -3,28 +3,27 @@ from __future__ import annotations
|
|
|
3
3
|
from collections.abc import Callable, Sequence
|
|
4
4
|
from typing import TYPE_CHECKING, Any, cast
|
|
5
5
|
|
|
6
|
-
from mx_bluesky.common.
|
|
7
|
-
from mx_bluesky.common.utils.log import set_dcgid_tag
|
|
8
|
-
from mx_bluesky.hyperion.external_interaction.callbacks.common.ispyb_mapping import (
|
|
9
|
-
populate_data_collection_group,
|
|
10
|
-
populate_remaining_data_collection_info,
|
|
11
|
-
)
|
|
12
|
-
from mx_bluesky.hyperion.external_interaction.callbacks.ispyb_callback_base import (
|
|
6
|
+
from mx_bluesky.common.external_interaction.callbacks.common.ispyb_callback_base import (
|
|
13
7
|
BaseISPyBCallback,
|
|
14
8
|
)
|
|
15
|
-
from mx_bluesky.
|
|
16
|
-
|
|
9
|
+
from mx_bluesky.common.external_interaction.callbacks.common.ispyb_mapping import (
|
|
10
|
+
populate_data_collection_group,
|
|
11
|
+
populate_remaining_data_collection_info,
|
|
17
12
|
)
|
|
18
|
-
from mx_bluesky.
|
|
13
|
+
from mx_bluesky.common.external_interaction.ispyb.data_model import (
|
|
19
14
|
DataCollectionInfo,
|
|
20
15
|
DataCollectionPositionInfo,
|
|
21
16
|
ScanDataInfo,
|
|
22
17
|
)
|
|
23
|
-
from mx_bluesky.
|
|
18
|
+
from mx_bluesky.common.external_interaction.ispyb.ispyb_store import (
|
|
24
19
|
IspybIds,
|
|
25
20
|
StoreInIspyb,
|
|
26
21
|
)
|
|
27
|
-
from mx_bluesky.
|
|
22
|
+
from mx_bluesky.common.parameters.components import IspybExperimentType
|
|
23
|
+
from mx_bluesky.common.utils.log import ISPYB_ZOCALO_CALLBACK_LOGGER, set_dcgid_tag
|
|
24
|
+
from mx_bluesky.hyperion.external_interaction.callbacks.rotation.ispyb_mapping import (
|
|
25
|
+
populate_data_collection_info_for_rotation,
|
|
26
|
+
)
|
|
28
27
|
from mx_bluesky.hyperion.parameters.constants import CONST
|
|
29
28
|
from mx_bluesky.hyperion.parameters.rotation import RotationScan
|
|
30
29
|
|
|
@@ -58,10 +57,10 @@ class RotationISPyBCallback(BaseISPyBCallback):
|
|
|
58
57
|
|
|
59
58
|
def activity_gated_start(self, doc: RunStart):
|
|
60
59
|
if doc.get("subplan_name") == CONST.PLAN.ROTATION_OUTER:
|
|
61
|
-
|
|
60
|
+
ISPYB_ZOCALO_CALLBACK_LOGGER.info(
|
|
62
61
|
"ISPyB callback received start document with experiment parameters."
|
|
63
62
|
)
|
|
64
|
-
hyperion_params = doc.get("
|
|
63
|
+
hyperion_params = doc.get("mx_bluesky_parameters")
|
|
65
64
|
assert isinstance(hyperion_params, str)
|
|
66
65
|
self.params = RotationScan.model_validate_json(hyperion_params)
|
|
67
66
|
dcgid = (
|
|
@@ -73,16 +72,18 @@ class RotationISPyBCallback(BaseISPyBCallback):
|
|
|
73
72
|
self.params.ispyb_experiment_type
|
|
74
73
|
== IspybExperimentType.CHARACTERIZATION
|
|
75
74
|
):
|
|
76
|
-
|
|
75
|
+
ISPYB_ZOCALO_CALLBACK_LOGGER.info(
|
|
76
|
+
"Screening collection - using new DCG"
|
|
77
|
+
)
|
|
77
78
|
dcgid = None
|
|
78
79
|
self.last_sample_id = None
|
|
79
80
|
else:
|
|
80
|
-
|
|
81
|
+
ISPYB_ZOCALO_CALLBACK_LOGGER.info(
|
|
81
82
|
f"Collection is {self.params.ispyb_experiment_type} - storing sampleID to bundle images"
|
|
82
83
|
)
|
|
83
84
|
self.last_sample_id = self.params.sample_id
|
|
84
85
|
self.ispyb = StoreInIspyb(self.ispyb_config)
|
|
85
|
-
|
|
86
|
+
ISPYB_ZOCALO_CALLBACK_LOGGER.info("Beginning ispyb deposition")
|
|
86
87
|
data_collection_group_info = populate_data_collection_group(self.params)
|
|
87
88
|
data_collection_info = populate_data_collection_info_for_rotation(
|
|
88
89
|
cast(RotationScan, self.params)
|
|
@@ -100,7 +101,7 @@ class RotationISPyBCallback(BaseISPyBCallback):
|
|
|
100
101
|
self.ispyb_ids = self.ispyb.begin_deposition(
|
|
101
102
|
data_collection_group_info, [scan_data_info]
|
|
102
103
|
)
|
|
103
|
-
|
|
104
|
+
ISPYB_ZOCALO_CALLBACK_LOGGER.info("ISPYB handler received start document.")
|
|
104
105
|
if doc.get("subplan_name") == CONST.PLAN.ROTATION_MAIN:
|
|
105
106
|
self.uid_to_finalize_on = doc.get("uid")
|
|
106
107
|
return super().activity_gated_start(doc)
|
|
@@ -111,9 +112,9 @@ class RotationISPyBCallback(BaseISPyBCallback):
|
|
|
111
112
|
event_sourced_position_info: DataCollectionPositionInfo | None,
|
|
112
113
|
params,
|
|
113
114
|
) -> Sequence[ScanDataInfo]:
|
|
114
|
-
assert (
|
|
115
|
-
|
|
116
|
-
)
|
|
115
|
+
assert self.ispyb_ids.data_collection_ids, (
|
|
116
|
+
"Expect an existing DataCollection to update"
|
|
117
|
+
)
|
|
117
118
|
|
|
118
119
|
return [
|
|
119
120
|
ScanDataInfo(
|
|
@@ -131,9 +132,9 @@ class RotationISPyBCallback(BaseISPyBCallback):
|
|
|
131
132
|
doc["data"]["smargon-y"],
|
|
132
133
|
doc["data"]["smargon-z"],
|
|
133
134
|
]
|
|
134
|
-
assert (
|
|
135
|
-
|
|
136
|
-
)
|
|
135
|
+
assert self.params, (
|
|
136
|
+
"handle_ispyb_hardware_read triggered before activity_gated_start"
|
|
137
|
+
)
|
|
137
138
|
motor_positions_um = [position * 1000 for position in motor_positions_mm]
|
|
138
139
|
comment = f"Sample position (µm): ({motor_positions_um[0]:.0f}, {motor_positions_um[1]:.0f}, {motor_positions_um[2]:.0f}) {self.params.comment} "
|
|
139
140
|
scan_data_infos[0].data_collection_info.comments = comment
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
|
|
3
|
-
from mx_bluesky.
|
|
3
|
+
from mx_bluesky.common.external_interaction.ispyb.data_model import DataCollectionInfo
|
|
4
4
|
from mx_bluesky.hyperion.parameters.rotation import RotationScan
|
|
5
5
|
|
|
6
6
|
|