mx-bluesky 1.5.3__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.
Files changed (63) hide show
  1. mx_bluesky/_version.py +2 -2
  2. mx_bluesky/beamlines/aithre_lasershaping/__init__.py +2 -0
  3. mx_bluesky/beamlines/aithre_lasershaping/beamline_safe.py +17 -0
  4. mx_bluesky/beamlines/i04/__init__.py +6 -1
  5. mx_bluesky/beamlines/i04/experiment_plans/i04_grid_detect_then_xray_centre_plan.py +0 -8
  6. mx_bluesky/beamlines/i04/redis_to_murko_forwarder.py +2 -3
  7. mx_bluesky/beamlines/i04/thawing_plan.py +174 -60
  8. mx_bluesky/beamlines/i24/serial/blueapi_config.yaml +1 -1
  9. mx_bluesky/beamlines/i24/serial/dcid.py +4 -25
  10. mx_bluesky/beamlines/i24/serial/extruder/EX-gui-edm/DetStage.edl +4 -7
  11. mx_bluesky/beamlines/i24/serial/extruder/EX-gui-edm/DiamondExtruder-I24-py3v1.edl +5 -5
  12. mx_bluesky/beamlines/i24/serial/extruder/i24ssx_Extruder_Collect_py3v2.py +18 -107
  13. mx_bluesky/beamlines/i24/serial/fixed_target/FT-gui-edm/CustomChip_py3v1.edl +11 -11
  14. mx_bluesky/beamlines/i24/serial/fixed_target/FT-gui-edm/DetStage.edl +2 -5
  15. mx_bluesky/beamlines/i24/serial/fixed_target/FT-gui-edm/DiamondChipI24-py3v1.edl +80 -80
  16. mx_bluesky/beamlines/i24/serial/fixed_target/FT-gui-edm/ME14E-GeneralPurpose.edl +120 -120
  17. mx_bluesky/beamlines/i24/serial/fixed_target/FT-gui-edm/MappingLite-oxford_py3v1.edl +143 -143
  18. mx_bluesky/beamlines/i24/serial/fixed_target/FT-gui-edm/PMAC_Command.edl +2 -2
  19. mx_bluesky/beamlines/i24/serial/fixed_target/FT-gui-edm/Shutter_Control.edl +3 -3
  20. mx_bluesky/beamlines/i24/serial/fixed_target/FT-gui-edm/nudgechip.edl +24 -24
  21. mx_bluesky/beamlines/i24/serial/fixed_target/FT-gui-edm/pumpprobe-py3v1.edl +19 -19
  22. mx_bluesky/beamlines/i24/serial/fixed_target/i24ssx_Chip_Collect_py3v1.py +8 -92
  23. mx_bluesky/beamlines/i24/serial/fixed_target/i24ssx_Chip_Manager_py3v1.py +15 -30
  24. mx_bluesky/beamlines/i24/serial/fixed_target/i24ssx_moveonclick.py +10 -10
  25. mx_bluesky/beamlines/i24/serial/parameters/constants.py +0 -2
  26. mx_bluesky/beamlines/i24/serial/parameters/experiment_parameters.py +1 -6
  27. mx_bluesky/beamlines/i24/serial/parameters/fixed_target/cs/cs_maker.json +3 -3
  28. mx_bluesky/beamlines/i24/serial/parameters/utils.py +1 -1
  29. mx_bluesky/beamlines/i24/serial/run_extruder.sh +15 -0
  30. mx_bluesky/beamlines/i24/serial/run_fixed_target.sh +17 -0
  31. mx_bluesky/beamlines/i24/serial/set_visit_directory.sh +1 -1
  32. mx_bluesky/beamlines/i24/serial/setup_beamline/__init__.py +1 -2
  33. mx_bluesky/beamlines/i24/serial/setup_beamline/pv.py +142 -160
  34. mx_bluesky/beamlines/i24/serial/setup_beamline/pv_abstract.py +1 -30
  35. mx_bluesky/beamlines/i24/serial/setup_beamline/setup_beamline.py +0 -94
  36. mx_bluesky/beamlines/i24/serial/setup_beamline/setup_detector.py +4 -10
  37. mx_bluesky/beamlines/i24/serial/setup_beamline/setup_zebra_plans.py +12 -20
  38. mx_bluesky/beamlines/i24/serial/web_gui_plans/general_plans.py +4 -13
  39. mx_bluesky/beamlines/i24/serial/write_nexus.py +34 -9
  40. mx_bluesky/common/device_setup_plans/manipulate_sample.py +2 -2
  41. mx_bluesky/common/experiment_plans/common_grid_detect_then_xray_centre_plan.py +2 -2
  42. mx_bluesky/common/experiment_plans/inner_plans/udc_default_state.py +65 -0
  43. mx_bluesky/common/experiment_plans/oav_snapshot_plan.py +2 -2
  44. mx_bluesky/common/external_interaction/callbacks/common/grid_detection_callback.py +35 -17
  45. mx_bluesky/common/external_interaction/callbacks/common/ispyb_callback_base.py +1 -1
  46. mx_bluesky/common/external_interaction/callbacks/common/plan_reactive_callback.py +2 -2
  47. mx_bluesky/common/external_interaction/callbacks/sample_handling/sample_handling_callback.py +3 -2
  48. mx_bluesky/common/external_interaction/callbacks/xray_centre/ispyb_callback.py +2 -2
  49. mx_bluesky/common/external_interaction/callbacks/xray_centre/nexus_callback.py +2 -2
  50. mx_bluesky/common/parameters/constants.py +1 -0
  51. mx_bluesky/hyperion/baton_handler.py +50 -8
  52. mx_bluesky/hyperion/experiment_plans/load_centre_collect_full_plan.py +5 -1
  53. mx_bluesky/hyperion/experiment_plans/robot_load_and_change_energy.py +6 -2
  54. mx_bluesky/hyperion/external_interaction/alerting/constants.py +2 -7
  55. mx_bluesky/hyperion/external_interaction/callbacks/__main__.py +4 -0
  56. mx_bluesky/hyperion/external_interaction/callbacks/alert_on_container_change.py +54 -0
  57. mx_bluesky/hyperion/external_interaction/callbacks/rotation/ispyb_callback.py +2 -2
  58. {mx_bluesky-1.5.3.dist-info → mx_bluesky-1.5.5.dist-info}/METADATA +2 -2
  59. {mx_bluesky-1.5.3.dist-info → mx_bluesky-1.5.5.dist-info}/RECORD +63 -61
  60. {mx_bluesky-1.5.3.dist-info → mx_bluesky-1.5.5.dist-info}/WHEEL +0 -0
  61. {mx_bluesky-1.5.3.dist-info → mx_bluesky-1.5.5.dist-info}/entry_points.txt +0 -0
  62. {mx_bluesky-1.5.3.dist-info → mx_bluesky-1.5.5.dist-info}/licenses/LICENSE +0 -0
  63. {mx_bluesky-1.5.3.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.3'
32
- __version_tuple__ = version_tuple = (1, 5, 3)
31
+ __version__ = version = '1.5.5'
32
+ __version_tuple__ = version_tuple = (1, 5, 5)
33
33
 
34
34
  __commit_id__ = commit_id = None
@@ -1,4 +1,5 @@
1
1
  from mx_bluesky.beamlines.aithre_lasershaping.beamline_safe import (
2
+ go_to_zero,
2
3
  set_beamline_safe_on_robot,
3
4
  )
4
5
  from mx_bluesky.beamlines.aithre_lasershaping.check_goniometer_performance import (
@@ -18,4 +19,5 @@ __all__ = [
18
19
  "go_to_furthest_maximum",
19
20
  "rotate_goniometer_relative",
20
21
  "jog_sample",
22
+ "go_to_zero",
21
23
  ]
@@ -34,3 +34,20 @@ def set_beamline_safe_on_robot(
34
34
  else ForceBit.NO.value
35
35
  )
36
36
  yield from bps.abs_set(robot.set_beamline_safe, set_value, wait=True)
37
+
38
+
39
+ def go_to_zero(
40
+ goniometer: Goniometer = inject("goniometer"), group="move_to_zero", wait=True
41
+ ) -> MsgGenerator:
42
+ """
43
+ Rotate the goniometer and set stages to zero in preparation for robot load/unload.
44
+ Pass wait=False to avoid waiting for the move to complete.
45
+ """
46
+ yield from bps.abs_set(goniometer.omega, 0, group=group)
47
+ yield from bps.abs_set(goniometer.x, 0, group=group)
48
+ yield from bps.abs_set(goniometer.y, 0, group=group)
49
+ yield from bps.abs_set(goniometer.z, 0, group=group)
50
+ yield from bps.abs_set(goniometer.sampy, 0, group=group)
51
+ yield from bps.abs_set(goniometer.sampz, 0, group=group)
52
+ if wait:
53
+ yield from bps.wait(group=group)
@@ -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 thaw, thaw_and_stream_to_redis
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
  ]
@@ -4,7 +4,6 @@ from functools import partial
4
4
 
5
5
  import bluesky.plan_stubs as bps
6
6
  import bluesky.preprocessors as bpp
7
- from blueapi.core import BlueskyContext
8
7
  from bluesky.utils import MsgGenerator
9
8
  from dodal.common import inject
10
9
  from dodal.devices.aperturescatterguard import ApertureScatterguard
@@ -66,7 +65,6 @@ from mx_bluesky.common.parameters.gridscan import GridCommon, SpecifiedThreeDGri
66
65
  from mx_bluesky.common.preprocessors.preprocessors import (
67
66
  transmission_and_xbpm_feedback_for_collection_decorator,
68
67
  )
69
- from mx_bluesky.common.utils.context import device_composite_from_context
70
68
  from mx_bluesky.common.utils.log import LOGGER
71
69
  from mx_bluesky.phase1_zebra.device_setup_plans.setup_zebra import (
72
70
  setup_zebra_for_gridscan,
@@ -74,12 +72,6 @@ from mx_bluesky.phase1_zebra.device_setup_plans.setup_zebra import (
74
72
  )
75
73
 
76
74
 
77
- def create_devices(
78
- context: BlueskyContext,
79
- ) -> GridDetectThenXRayCentreComposite:
80
- return device_composite_from_context(context, GridDetectThenXRayCentreComposite)
81
-
82
-
83
75
  # See https://github.com/DiamondLightSource/blueapi/issues/506 for using device composites
84
76
  def i04_grid_detect_then_xray_centre(
85
77
  parameters: GridCommon,
@@ -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,19 +2,40 @@ 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
12
13
  from dodal.devices.smargon import Smargon
13
- from dodal.devices.thawer import Thawer, ThawerStates
14
+ from dodal.devices.thawer import OnOff, Thawer
14
15
 
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
- zoom_percentage = yield from bps.rd(oav.zoom_controller.percentage)
28
- sample_id = yield from bps.rd(robot.sample_id)
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
- sample_id = int(sample_id)
31
- zoom_level_before_thawing = yield from bps.rd(oav.zoom_controller.level)
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
- yield from bps.mv(oav.zoom_controller.level, "1.0x")
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 _thaw_and_stream_to_redis():
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, switch_forwarder_to_ROI
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
- _thaw_and_stream_to_redis(),
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, ThawerStates.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, ThawerStates.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
  )
@@ -14,4 +14,4 @@ api:
14
14
  - "*"
15
15
  stomp:
16
16
  enabled: true
17
- url: http://i24-control.diamond.ac.uk:61613
17
+ url: tcp://i24-control.diamond.ac.uk:61613
@@ -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, Pilatus
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, Pilatus):
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() or Pilatus().
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 1316
7
- y 610
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-EA-IOC-12:GP15"
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