mx-bluesky 1.4.7__py3-none-any.whl → 1.4.9__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 (89) hide show
  1. mx_bluesky/_version.py +2 -2
  2. mx_bluesky/beamlines/aithre_lasershaping/__init__.py +8 -0
  3. mx_bluesky/beamlines/aithre_lasershaping/beamline_safe.py +36 -0
  4. mx_bluesky/beamlines/aithre_lasershaping/goniometer_controls.py +43 -0
  5. mx_bluesky/beamlines/i04/redis_to_murko_forwarder.py +4 -4
  6. mx_bluesky/beamlines/i04/thawing_plan.py +8 -2
  7. mx_bluesky/beamlines/i23/__init__.py +3 -0
  8. mx_bluesky/beamlines/i23/serial.py +71 -0
  9. mx_bluesky/beamlines/i24/serial/__init__.py +2 -0
  10. mx_bluesky/beamlines/i24/serial/blueapi_config.yaml +2 -1
  11. mx_bluesky/beamlines/i24/serial/dcid.py +5 -5
  12. mx_bluesky/beamlines/i24/serial/extruder/EX-gui-edm/DetStage.edl +2 -2
  13. mx_bluesky/beamlines/i24/serial/extruder/EX-gui-edm/DiamondExtruder-I24-py3v1.edl +9 -9
  14. mx_bluesky/beamlines/i24/serial/extruder/i24ssx_Extruder_Collect_py3v2.py +25 -5
  15. mx_bluesky/beamlines/i24/serial/fixed_target/FT-gui-edm/DetStage.edl +2 -2
  16. mx_bluesky/beamlines/i24/serial/fixed_target/FT-gui-edm/DiamondChipI24-py3v1.edl +14 -14
  17. mx_bluesky/beamlines/i24/serial/fixed_target/FT-gui-edm/pumpprobe-py3v1.edl +5 -5
  18. mx_bluesky/beamlines/i24/serial/fixed_target/i24ssx_Chip_Collect_py3v1.py +29 -60
  19. mx_bluesky/beamlines/i24/serial/fixed_target/i24ssx_Chip_Manager_py3v1.py +7 -1
  20. mx_bluesky/beamlines/i24/serial/log.py +9 -10
  21. mx_bluesky/beamlines/i24/serial/parameters/utils.py +36 -7
  22. mx_bluesky/beamlines/i24/serial/setup_beamline/pv.py +0 -1
  23. mx_bluesky/beamlines/i24/serial/setup_beamline/pv_abstract.py +4 -4
  24. mx_bluesky/beamlines/i24/serial/setup_beamline/setup_beamline.py +4 -12
  25. mx_bluesky/beamlines/i24/serial/setup_beamline/setup_detector.py +2 -1
  26. mx_bluesky/beamlines/i24/serial/web_gui_plans/general_plans.py +71 -11
  27. mx_bluesky/beamlines/i24/serial/write_nexus.py +3 -3
  28. mx_bluesky/{hyperion → common}/device_setup_plans/manipulate_sample.py +6 -14
  29. mx_bluesky/{hyperion → common}/device_setup_plans/setup_oav.py +12 -6
  30. mx_bluesky/{hyperion → common}/experiment_plans/change_aperture_then_move_plan.py +4 -5
  31. mx_bluesky/{hyperion → common}/experiment_plans/oav_grid_detection_plan.py +6 -6
  32. mx_bluesky/common/external_interaction/callbacks/common/ispyb_callback_base.py +6 -5
  33. mx_bluesky/common/external_interaction/callbacks/xray_centre/ispyb_callback.py +16 -47
  34. mx_bluesky/common/external_interaction/ispyb/ispyb_store.py +4 -1
  35. mx_bluesky/common/external_interaction/ispyb/ispyb_utils.py +4 -4
  36. mx_bluesky/common/external_interaction/nexus/nexus_utils.py +2 -2
  37. mx_bluesky/common/parameters/components.py +22 -2
  38. mx_bluesky/common/parameters/constants.py +4 -16
  39. mx_bluesky/common/parameters/gridscan.py +36 -32
  40. mx_bluesky/common/plans/common_flyscan_xray_centre_plan.py +316 -0
  41. mx_bluesky/common/plans/inner_plans/__init__ .py +0 -0
  42. mx_bluesky/common/plans/read_hardware.py +3 -3
  43. mx_bluesky/common/utils/log.py +19 -15
  44. mx_bluesky/hyperion/__main__.py +6 -24
  45. mx_bluesky/hyperion/baton_handler.py +8 -3
  46. mx_bluesky/hyperion/device_setup_plans/dcm_pitch_roll_mirror_adjuster.py +4 -4
  47. mx_bluesky/hyperion/device_setup_plans/setup_zebra.py +0 -33
  48. mx_bluesky/hyperion/device_setup_plans/smargon.py +2 -7
  49. mx_bluesky/hyperion/device_setup_plans/utils.py +6 -5
  50. mx_bluesky/hyperion/experiment_plans/__init__.py +1 -7
  51. mx_bluesky/hyperion/experiment_plans/experiment_registry.py +3 -13
  52. mx_bluesky/hyperion/experiment_plans/grid_detect_then_xray_centre_plan.py +80 -87
  53. mx_bluesky/hyperion/experiment_plans/hyperion_flyscan_xray_centre_plan.py +183 -0
  54. mx_bluesky/hyperion/experiment_plans/load_centre_collect_full_plan.py +50 -15
  55. mx_bluesky/hyperion/experiment_plans/oav_snapshot_plan.py +31 -7
  56. mx_bluesky/hyperion/experiment_plans/pin_centre_then_xray_centre_plan.py +4 -4
  57. mx_bluesky/hyperion/experiment_plans/pin_tip_centring_plan.py +1 -1
  58. mx_bluesky/hyperion/experiment_plans/robot_load_and_change_energy.py +13 -14
  59. mx_bluesky/hyperion/experiment_plans/robot_load_then_centre_plan.py +9 -8
  60. mx_bluesky/hyperion/experiment_plans/rotation_scan_plan.py +30 -71
  61. mx_bluesky/hyperion/experiment_plans/set_energy_plan.py +2 -2
  62. mx_bluesky/hyperion/external_interaction/agamemnon.py +78 -80
  63. mx_bluesky/hyperion/external_interaction/callbacks/__main__.py +8 -6
  64. mx_bluesky/hyperion/external_interaction/callbacks/rotation/ispyb_callback.py +3 -3
  65. mx_bluesky/hyperion/external_interaction/callbacks/rotation/ispyb_mapping.py +6 -3
  66. mx_bluesky/hyperion/external_interaction/callbacks/rotation/nexus_callback.py +2 -2
  67. mx_bluesky/hyperion/external_interaction/callbacks/snapshot_callback.py +183 -31
  68. mx_bluesky/hyperion/external_interaction/config_server.py +4 -1
  69. mx_bluesky/hyperion/parameters/cli.py +4 -19
  70. mx_bluesky/hyperion/parameters/constants.py +1 -5
  71. mx_bluesky/hyperion/parameters/device_composites.py +40 -5
  72. mx_bluesky/hyperion/parameters/gridscan.py +9 -58
  73. mx_bluesky/hyperion/parameters/load_centre_collect.py +4 -4
  74. mx_bluesky/hyperion/parameters/rotation.py +9 -12
  75. mx_bluesky/hyperion/utils/context.py +2 -2
  76. mx_bluesky/hyperion/utils/validation.py +15 -19
  77. {mx_bluesky-1.4.7.dist-info → mx_bluesky-1.4.9.dist-info}/METADATA +7 -6
  78. {mx_bluesky-1.4.7.dist-info → mx_bluesky-1.4.9.dist-info}/RECORD +86 -83
  79. {mx_bluesky-1.4.7.dist-info → mx_bluesky-1.4.9.dist-info}/WHEEL +1 -1
  80. mx_bluesky/common/external_interaction/test_config_server.py +0 -38
  81. mx_bluesky/hyperion/device_setup_plans/check_beamstop.py +0 -27
  82. mx_bluesky/hyperion/experiment_plans/flyscan_xray_centre_plan.py +0 -467
  83. /mx_bluesky/beamlines/i24/serial/fixed_target/FT-gui-edm/{short1-laser.png → s1l.png} +0 -0
  84. /mx_bluesky/beamlines/i24/serial/fixed_target/FT-gui-edm/{short2-laser.png → s2l.png} +0 -0
  85. /mx_bluesky/{hyperion → common}/device_setup_plans/position_detector.py +0 -0
  86. /mx_bluesky/common/plans/{do_fgs.py → inner_plans/do_fgs.py} +0 -0
  87. {mx_bluesky-1.4.7.dist-info → mx_bluesky-1.4.9.dist-info}/entry_points.txt +0 -0
  88. {mx_bluesky-1.4.7.dist-info → mx_bluesky-1.4.9.dist-info}/licenses/LICENSE +0 -0
  89. {mx_bluesky-1.4.7.dist-info → mx_bluesky-1.4.9.dist-info}/top_level.txt +0 -0
mx_bluesky/_version.py CHANGED
@@ -17,5 +17,5 @@ __version__: str
17
17
  __version_tuple__: VERSION_TUPLE
18
18
  version_tuple: VERSION_TUPLE
19
19
 
20
- __version__ = version = '1.4.7'
21
- __version_tuple__ = version_tuple = (1, 4, 7)
20
+ __version__ = version = '1.4.9'
21
+ __version_tuple__ = version_tuple = (1, 4, 9)
@@ -1,13 +1,21 @@
1
+ from mx_bluesky.beamlines.aithre_lasershaping.beamline_safe import (
2
+ set_beamline_safe_on_robot,
3
+ )
1
4
  from mx_bluesky.beamlines.aithre_lasershaping.check_goniometer_performance import (
2
5
  check_omega_performance,
3
6
  )
4
7
  from mx_bluesky.beamlines.aithre_lasershaping.goniometer_controls import (
5
8
  change_goniometer_turn_speed,
9
+ go_to_furthest_maximum,
10
+ jog_sample,
6
11
  rotate_goniometer_relative,
7
12
  )
8
13
 
9
14
  __all__ = [
15
+ "set_beamline_safe_on_robot",
10
16
  "check_omega_performance",
11
17
  "change_goniometer_turn_speed",
18
+ "go_to_furthest_maximum",
12
19
  "rotate_goniometer_relative",
20
+ "jog_sample",
13
21
  ]
@@ -0,0 +1,36 @@
1
+ import bluesky.plan_stubs as bps
2
+ from bluesky.utils import MsgGenerator
3
+ from dodal.common import inject
4
+ from dodal.devices.aithre_lasershaping.goniometer import Goniometer
5
+ from dodal.devices.aithre_lasershaping.laser_robot import ForceBit, LaserRobot
6
+
7
+
8
+ def set_beamline_safe_on_robot(
9
+ robot: LaserRobot = inject("robot"), goniometer: Goniometer = inject("goniometer")
10
+ ) -> MsgGenerator:
11
+ """
12
+ The beamline safe PV is used in the Aithre laser shaping system to indicate whether
13
+ the goniometer is in the correct position for the robot to load a sample. The robot
14
+ is trained to load at the goniometer zero position, so if the translation and
15
+ rotation axes of the goniometer are at zero, then the beamline safe PV bit is forced
16
+ on.
17
+ """
18
+ pvs = [
19
+ goniometer.x,
20
+ goniometer.y,
21
+ goniometer.z,
22
+ goniometer.sampy,
23
+ goniometer.sampz,
24
+ goniometer.omega,
25
+ ]
26
+
27
+ values: list[float] = []
28
+ for pv in pvs:
29
+ values.append((yield from bps.rd(pv)))
30
+
31
+ set_value = (
32
+ ForceBit.ON.value
33
+ if all(round(value, 3) == 0 for value in values)
34
+ else ForceBit.NO.value
35
+ )
36
+ yield from bps.abs_set(robot.set_beamline_safe, set_value, wait=True)
@@ -1,9 +1,20 @@
1
+ from enum import StrEnum
2
+
1
3
  import bluesky.plan_stubs as bps
2
4
  from bluesky.utils import MsgGenerator
3
5
  from dodal.common import inject
4
6
  from dodal.devices.aithre_lasershaping.goniometer import Goniometer
5
7
 
6
8
 
9
+ class JogDirection(StrEnum):
10
+ UP = "up"
11
+ DOWN = "down"
12
+ LEFT = "left"
13
+ RIGHT = "right"
14
+ ZPLUS = "z_plus"
15
+ ZMINUS = "z_minus"
16
+
17
+
7
18
  def rotate_goniometer_relative(
8
19
  value: float, goniometer: Goniometer = inject("goniometer")
9
20
  ) -> MsgGenerator:
@@ -16,3 +27,35 @@ def change_goniometer_turn_speed(
16
27
  ) -> MsgGenerator:
17
28
  """Set the velocity of the goniometer"""
18
29
  yield from bps.mv(goniometer.omega.velocity, velocity)
30
+
31
+
32
+ def jog_sample(
33
+ direction: JogDirection,
34
+ increment_size: float,
35
+ goniometer: Goniometer = inject("goniometer"),
36
+ ) -> MsgGenerator:
37
+ """Adjust the goniometer stage positions"""
38
+ direction_map = {
39
+ JogDirection.RIGHT: (goniometer.x, 1),
40
+ JogDirection.LEFT: (goniometer.x, -1),
41
+ JogDirection.ZPLUS: (goniometer.z, 1),
42
+ JogDirection.ZMINUS: (goniometer.z, -1),
43
+ JogDirection.UP: (goniometer.vertical_position, 1),
44
+ JogDirection.DOWN: (goniometer.vertical_position, -1),
45
+ }
46
+
47
+ axis, sign = direction_map[direction]
48
+ yield from bps.mvr(axis, sign * increment_size)
49
+
50
+
51
+ def go_to_furthest_maximum(
52
+ goniometer: Goniometer = inject("goniometer"),
53
+ ) -> MsgGenerator:
54
+ """Rotate to positive or negative maximum, whichever is further away"""
55
+
56
+ LIMIT_OF_TRAVEL = 3600
57
+ current_value: float = yield from bps.rd(goniometer.omega.user_readback)
58
+
59
+ yield from bps.mv(
60
+ goniometer.omega, -LIMIT_OF_TRAVEL if current_value > 0 else LIMIT_OF_TRAVEL
61
+ )
@@ -6,7 +6,7 @@ from typing import TypedDict
6
6
 
7
7
  import numpy as np
8
8
  import zmq
9
- from dodal.beamlines.i04 import MURKO_REDIS_DB, REDIS_HOST, REDIS_PASSWORD
9
+ from dodal.devices.i04.constants import RedisConstants
10
10
  from numpy.typing import NDArray
11
11
  from PIL import Image
12
12
  from redis import StrictRedis
@@ -139,9 +139,9 @@ class RedisListener:
139
139
 
140
140
  def __init__(
141
141
  self,
142
- redis_host=REDIS_HOST,
143
- redis_password=REDIS_PASSWORD,
144
- db=MURKO_REDIS_DB,
142
+ redis_host=RedisConstants.REDIS_HOST,
143
+ redis_password=RedisConstants.REDIS_PASSWORD,
144
+ db=RedisConstants.MURKO_REDIS_DB,
145
145
  redis_channel="murko",
146
146
  ):
147
147
  self.redis_client = StrictRedis(
@@ -4,8 +4,8 @@ import bluesky.plan_stubs as bps
4
4
  import bluesky.preprocessors as bpp
5
5
  from bluesky.preprocessors import run_decorator, subs_decorator
6
6
  from bluesky.utils import MsgGenerator
7
- from dodal.beamlines.i04 import MURKO_REDIS_DB, REDIS_HOST, REDIS_PASSWORD
8
7
  from dodal.common import inject
8
+ from dodal.devices.i04.constants import RedisConstants
9
9
  from dodal.devices.oav.oav_detector import OAV
10
10
  from dodal.devices.oav.oav_to_redis_forwarder import OAVToRedisForwarder, Source
11
11
  from dodal.devices.robot import BartRobot
@@ -42,7 +42,13 @@ def thaw_and_stream_to_redis(
42
42
  beam_centre_i = yield from bps.rd(oav.beam_centre_i)
43
43
  beam_centre_j = yield from bps.rd(oav.beam_centre_j)
44
44
 
45
- @subs_decorator(MurkoCallback(REDIS_HOST, REDIS_PASSWORD, MURKO_REDIS_DB))
45
+ @subs_decorator(
46
+ MurkoCallback(
47
+ RedisConstants.REDIS_HOST,
48
+ RedisConstants.REDIS_PASSWORD,
49
+ RedisConstants.MURKO_REDIS_DB,
50
+ )
51
+ )
46
52
  @run_decorator(
47
53
  md={
48
54
  "microns_per_x_pixel": microns_per_pixel_x,
@@ -0,0 +1,3 @@
1
+ from mx_bluesky.beamlines.i23.serial import serial_collection
2
+
3
+ __all__ = ["serial_collection"]
@@ -0,0 +1,71 @@
1
+ from functools import partial
2
+
3
+ from bluesky import plan_stubs as bps
4
+ from bluesky.plans import rel_grid_scan
5
+ from bluesky.utils import short_uid
6
+ from dodal.beamlines.i23 import I23DetectorPositions
7
+ from dodal.common import inject
8
+ from dodal.devices.motors import SixAxisGonio
9
+ from dodal.devices.positioner import Positioner1D
10
+ from ophyd_async.epics.motor import Motor
11
+
12
+
13
+ def set_axis_to_max_velocity(axis: Motor):
14
+ max_vel = yield from bps.rd(axis.max_velocity)
15
+ yield from bps.mv(axis.velocity, max_vel)
16
+
17
+
18
+ def one_nd_step(
19
+ detectors,
20
+ step,
21
+ pos_cache,
22
+ omega_axis: Motor,
23
+ omega_rotation: float,
24
+ omega_velocity: float,
25
+ ):
26
+ def move():
27
+ yield from bps.checkpoint()
28
+ grp = short_uid("set")
29
+ for motor, pos in step.items():
30
+ yield from bps.abs_set(motor, pos, group=grp)
31
+ yield from set_axis_to_max_velocity(omega_axis)
32
+ yield from bps.abs_set(omega_axis, 0, group=grp)
33
+ yield from bps.wait(group=grp)
34
+
35
+ yield from move()
36
+ yield from bps.mv(omega_axis.velocity, omega_velocity)
37
+ yield from bps.mv(omega_axis, omega_rotation)
38
+
39
+
40
+ def serial_collection(
41
+ x_steps: int,
42
+ y_steps: int,
43
+ x_step_size: float,
44
+ y_step_size: float,
45
+ omega_rotation: float,
46
+ omega_velocity: float,
47
+ detector_motion: Positioner1D = inject("detector_motion"),
48
+ gonio: SixAxisGonio = inject("gonio"),
49
+ ):
50
+ """This plan runs a software controlled serial collection. i.e it moves in a snaked
51
+ grid and does a small rotation collection at each point."""
52
+
53
+ yield from bps.mv(detector_motion.stage_position, I23DetectorPositions.IN)
54
+ yield from rel_grid_scan(
55
+ [],
56
+ gonio.y,
57
+ 0,
58
+ y_step_size * (y_steps - 1),
59
+ y_steps,
60
+ gonio.x,
61
+ 0,
62
+ x_step_size * (x_steps - 1),
63
+ x_steps,
64
+ per_step=partial( # type: ignore
65
+ one_nd_step,
66
+ omega_axis=gonio.omega,
67
+ omega_rotation=omega_rotation,
68
+ omega_velocity=omega_velocity,
69
+ ),
70
+ snake_axes=True,
71
+ )
@@ -1,5 +1,6 @@
1
1
  from mx_bluesky.beamlines.i24.serial.web_gui_plans.general_plans import (
2
2
  gui_gonio_move_on_click,
3
+ gui_move_backlight,
3
4
  gui_move_detector,
4
5
  gui_set_parameters,
5
6
  gui_sleep,
@@ -57,4 +58,5 @@ __all__ = [
57
58
  "gui_sleep",
58
59
  "gui_move_detector",
59
60
  "gui_set_parameters",
61
+ "gui_move_backlight",
60
62
  ]
@@ -5,8 +5,9 @@ env:
5
5
  - kind: planFunctions
6
6
  module: mx_bluesky.beamlines.i24.serial
7
7
  events:
8
- broadcast_status_events: False
8
+ broadcast_status_events: false
9
9
  api:
10
10
  port: 25565
11
11
  stomp:
12
+ enabled: true
12
13
  host: i24-control.diamond.ac.uk
@@ -7,7 +7,7 @@ from functools import lru_cache
7
7
 
8
8
  import bluesky.plan_stubs as bps
9
9
  import requests
10
- from dodal.beamlines import i24
10
+ 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
@@ -51,7 +51,7 @@ def read_beam_info_from_hardware(
51
51
  mirrors: FocusMirrorsMode,
52
52
  beam_center: DetectorBeamCenter,
53
53
  detector_name: DetectorName,
54
- ):
54
+ ) -> MsgGenerator[BeamSettings]:
55
55
  """ Read the beam information from hardware.
56
56
 
57
57
  Args:
@@ -361,7 +361,9 @@ class DCID:
361
361
  SSX_LOGGER.warning("Error completing DCID: %s (%s)", e, resp_str)
362
362
 
363
363
 
364
- def get_pilatus_filename_template_from_device():
364
+ def get_pilatus_filename_template_from_device(
365
+ pilatus_metadata: PilatusMetadata,
366
+ ) -> MsgGenerator[str]:
365
367
  """
366
368
  Get the template file path by querying the detector PVs, mirror the construction \
367
369
  that the PPU does.
@@ -369,8 +371,6 @@ def get_pilatus_filename_template_from_device():
369
371
  Returns:
370
372
  A template string, with the image numbers replaced with '#'
371
373
  """
372
- pilatus_metadata: PilatusMetadata = i24.pilatus_metadata()
373
-
374
374
  filename_template = yield from bps.rd(pilatus_metadata.filename_template)
375
375
  return filename_template
376
376
 
@@ -4,7 +4,7 @@ major 4
4
4
  minor 0
5
5
  release 1
6
6
  x 1316
7
- y 573
7
+ y 610
8
8
  w 450
9
9
  h 180
10
10
  font "arial-medium-r-18.0"
@@ -113,7 +113,7 @@ font "arial-medium-r-18.0"
113
113
  buttonLabel "Move Stage"
114
114
  numCmds 1
115
115
  command {
116
- 0 "blueapi -c CONFIG_LOCATION controller run setup_detector_stage '\{\"expt_type\":\"Serial Jet\",\"detector_stage\":\"detector_motion\"\}'"
116
+ 0 "blueapi -c CONFIG_LOCATION controller run setup_detector_stage '\{\"expt_type\":\"Serial Jet\"\}'"
117
117
  }
118
118
  endObjectProperties
119
119
 
@@ -4,7 +4,7 @@ major 4
4
4
  minor 0
5
5
  release 1
6
6
  x 1006
7
- y 192
7
+ y 300
8
8
  w 700
9
9
  h 900
10
10
  font "arial-medium-r-18.0"
@@ -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 '\{\"zebra\":\"zebra\",\"aperture\":\"aperture\",\"backlight\":\"backlight\",\"beamstop\":\"beamstop\",\"detector_stage\":\"detector_motion\",\"shutter\":\"shutter\",\"dcm\":\"dcm\",\"mirrors\":\"focus_mirrors\",\"attenuator\":\"attenuator\"\}'"
373
+ 0 "blueapi -c CONFIG_LOCATION controller run 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 '\{\"detector_stage\":\"detector_motion\"\}'"
835
+ 0 "blueapi -c CONFIG_LOCATION controller run initialise_extruder"
836
836
  }
837
837
  endObjectProperties
838
838
 
@@ -989,8 +989,8 @@ beginObjectProperties
989
989
  major 4
990
990
  minor 0
991
991
  release 0
992
- x 10
993
- y 611
992
+ x 11
993
+ y 606
994
994
  w 680
995
995
  h 252
996
996
  lineColor index 9
@@ -1870,7 +1870,7 @@ beginObjectProperties
1870
1870
  major 4
1871
1871
  minor 1
1872
1872
  release 1
1873
- x 573
1873
+ x 568
1874
1874
  y 675
1875
1875
  w 72
1876
1876
  h 46
@@ -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\",\"zebra\":\"zebra\",\"detector_stage\":\"detector_motion\"\}'"
2182
+ 0 "blueapi -c CONFIG_LOCATION controller run 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\",\"zebra\":\"zebra\",\"detector_stage\":\"detector_motion\"\}'"
2204
+ 0 "blueapi -c CONFIG_LOCATION controller run 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 '\{\"detector_stage\":\"detector_motion\"\}'"
2226
+ 0 "blueapi -c CONFIG_LOCATION controller run enter_hutch"
2227
2227
  }
2228
2228
  endObjectProperties
2229
2229
 
@@ -24,6 +24,7 @@ from dodal.devices.i24.dcm import DCM
24
24
  from dodal.devices.i24.dual_backlight import DualBacklight
25
25
  from dodal.devices.i24.focus_mirrors import FocusMirrorsMode
26
26
  from dodal.devices.i24.i24_detector_motion import DetectorMotion
27
+ from dodal.devices.i24.pilatus_metadata import PilatusMetadata
27
28
  from dodal.devices.zebra.zebra import Zebra
28
29
 
29
30
  from mx_bluesky.beamlines.i24.serial.dcid import (
@@ -37,7 +38,10 @@ from mx_bluesky.beamlines.i24.serial.log import (
37
38
  log_on_entry,
38
39
  )
39
40
  from mx_bluesky.beamlines.i24.serial.parameters import ExtruderParameters
40
- from mx_bluesky.beamlines.i24.serial.parameters.constants import BEAM_CENTER_LUT_FILES
41
+ from mx_bluesky.beamlines.i24.serial.parameters.constants import (
42
+ BEAM_CENTER_LUT_FILES,
43
+ DetectorName,
44
+ )
41
45
  from mx_bluesky.beamlines.i24.serial.setup_beamline import Pilatus, caget, caput, pv
42
46
  from mx_bluesky.beamlines.i24.serial.setup_beamline import setup_beamline as sup
43
47
  from mx_bluesky.beamlines.i24.serial.setup_beamline.setup_detector import (
@@ -212,6 +216,7 @@ def main_extruder_plan(
212
216
  parameters: ExtruderParameters,
213
217
  dcid: DCID,
214
218
  start_time: datetime,
219
+ pilatus_metadata: PilatusMetadata,
215
220
  ) -> MsgGenerator:
216
221
  beam_center_pixels = sup.compute_beam_center_position_from_lut(
217
222
  BEAM_CENTER_LUT_FILES[parameters.detector_name],
@@ -317,6 +322,7 @@ def main_extruder_plan(
317
322
  parameters.num_images,
318
323
  parameters.exposure_time_s,
319
324
  ],
325
+ dcm,
320
326
  )
321
327
  yield from setup_zebra_for_extruder_with_pump_probe_plan(
322
328
  zebra,
@@ -338,6 +344,7 @@ def main_extruder_plan(
338
344
  parameters.num_images,
339
345
  parameters.exposure_time_s,
340
346
  ],
347
+ dcm,
341
348
  )
342
349
  yield from setup_zebra_for_quickshot_plan(
343
350
  zebra, parameters.exposure_time_s, parameters.num_images, wait=True
@@ -355,7 +362,9 @@ def main_extruder_plan(
355
362
  if parameters.detector_name == "eiger":
356
363
  filetemplate = f"{parameters.filename}.nxs"
357
364
  else:
358
- filetemplate = yield from get_pilatus_filename_template_from_device()
365
+ filetemplate = yield from get_pilatus_filename_template_from_device(
366
+ pilatus_metadata
367
+ )
359
368
  dcid.generate_dcid(
360
369
  beam_settings=beam_settings,
361
370
  image_dir=parameters.collection_directory.as_posix(),
@@ -441,6 +450,7 @@ def tidy_up_at_collection_end_plan(
441
450
  shutter: HutchShutter,
442
451
  parameters: ExtruderParameters,
443
452
  dcid: DCID,
453
+ dcm: DCM,
444
454
  ) -> MsgGenerator:
445
455
  """A plan to tidy up at the end of a collection, successful or aborted.
446
456
 
@@ -455,7 +465,7 @@ def tidy_up_at_collection_end_plan(
455
465
  if parameters.detector_name == "pilatus":
456
466
  yield from sup.pilatus("return-to-normal", None)
457
467
  elif parameters.detector_name == "eiger":
458
- yield from sup.eiger("return-to-normal", None)
468
+ yield from sup.eiger("return-to-normal", None, dcm)
459
469
  SSX_LOGGER.debug(f"{parameters.filename}_{caget(pv.eiger_seqID)}")
460
470
  SSX_LOGGER.debug("End of Run")
461
471
  SSX_LOGGER.info("Close hutch shutter")
@@ -495,6 +505,9 @@ def run_extruder_plan(
495
505
  dcm: DCM = inject("dcm"),
496
506
  mirrors: FocusMirrorsMode = inject("focus_mirrors"),
497
507
  attenuator: ReadOnlyAttenuator = inject("attenuator"),
508
+ beam_center_eiger: DetectorBeamCenter = inject("eiger_bc"),
509
+ beam_center_pilatus: DetectorBeamCenter = inject("pilatus_bc"),
510
+ pilatus_metadata: PilatusMetadata = inject("pilatus_meta"),
498
511
  ) -> MsgGenerator:
499
512
  start_time = datetime.now()
500
513
  SSX_LOGGER.info(f"Collection start time: {start_time.ctime()}")
@@ -505,7 +518,11 @@ def run_extruder_plan(
505
518
  # Create collection directory
506
519
  parameters.collection_directory.mkdir(parents=True, exist_ok=True)
507
520
 
508
- beam_center_device = sup.get_beam_center_device(parameters.detector_name)
521
+ beam_center_device = (
522
+ beam_center_eiger
523
+ if parameters.detector_name is DetectorName.EIGER
524
+ else beam_center_pilatus
525
+ )
509
526
 
510
527
  # DCID - not generated yet
511
528
  dcid = DCID(emit_errors=False, expt_params=parameters)
@@ -524,6 +541,7 @@ def run_extruder_plan(
524
541
  parameters=parameters,
525
542
  dcid=dcid,
526
543
  start_time=start_time,
544
+ pilatus_metadata=pilatus_metadata,
527
545
  ),
528
546
  except_plan=lambda e: (
529
547
  yield from collection_aborted_plan(zebra, parameters.detector_name, dcid)
@@ -534,7 +552,9 @@ def run_extruder_plan(
534
552
  )
535
553
  ),
536
554
  final_plan=lambda: (
537
- yield from tidy_up_at_collection_end_plan(zebra, shutter, parameters, dcid)
555
+ yield from tidy_up_at_collection_end_plan(
556
+ zebra, shutter, parameters, dcid, dcm
557
+ )
538
558
  ),
539
559
  auto_raise=False,
540
560
  )
@@ -4,7 +4,7 @@ major 4
4
4
  minor 0
5
5
  release 1
6
6
  x 1205
7
- y 579
7
+ y 616
8
8
  w 450
9
9
  h 180
10
10
  font "arial-medium-r-18.0"
@@ -113,7 +113,7 @@ font "arial-medium-r-18.0"
113
113
  buttonLabel "Move Stage"
114
114
  numCmds 1
115
115
  command {
116
- 0 "blueapi -c CONFIG_LOCATION controller run setup_detector_stage '\{\"expt_type\":\"Serial Fixed\",\"detector_stage\":\"detector_motion\"\}'"
116
+ 0 "blueapi -c CONFIG_LOCATION controller run setup_detector_stage '\{\"expt_type\":\"Serial Fixed\"\}'"
117
117
  }
118
118
  endObjectProperties
119
119
 
@@ -3,8 +3,8 @@ beginScreenProperties
3
3
  major 4
4
4
  minor 0
5
5
  release 1
6
- x 844
7
- y 238
6
+ x 843
7
+ y 206
8
8
  w 1030
9
9
  h 950
10
10
  font "arial-medium-r-18.0"
@@ -280,7 +280,7 @@ botShadowColor index 14
280
280
  font "arial-medium-r-18.0"
281
281
  numCmds 1
282
282
  command {
283
- 0 "blueapi -c CONFIG_LOCATION controller run moveto_preset '\{\"place\":\"load_position\",\"pmac\":\"pmac\",\"beamstop\":\"beamstop\",\"backlight\":\"backlight\",\"det_stage\":\"detector_motion\"\}'"
283
+ 0 "blueapi -c CONFIG_LOCATION controller run moveto_preset '\{\"place\":\"load_position\"\}'"
284
284
  }
285
285
  endObjectProperties
286
286
 
@@ -301,7 +301,7 @@ botShadowColor index 14
301
301
  font "arial-medium-r-18.0"
302
302
  numCmds 1
303
303
  command {
304
- 0 "blueapi -c CONFIG_LOCATION controller run moveto_preset '\{\"place\":\"collect_position\",\"pmac\":\"pmac\",\"beamstop\":\"beamstop\",\"backlight\":\"backlight\",\"det_stage\":\"detector_motion\"\}'"
304
+ 0 "blueapi -c CONFIG_LOCATION controller run moveto_preset '\{\"place\":\"collect_position\"\}'"
305
305
  }
306
306
  endObjectProperties
307
307
 
@@ -323,7 +323,7 @@ font "helvetica-bold-r-24.0"
323
323
  buttonLabel "Start"
324
324
  numCmds 1
325
325
  command {
326
- 0 "blueapi -c CONFIG_LOCATION controller run run_fixed_target_plan '\{\"zebra\":\"zebra\",\"pmac\":\"pmac\",\"aperture\":\"aperture\",\"backlight\":\"backlight\",\"beamstop\":\"beamstop\",\"detector_stage\":\"detector_motion\",\"shutter\":\"shutter\",\"dcm\":\"dcm\",\"mirrors\":\"focus_mirrors\",\"attenuator\":\"attenuator\"\}'"
326
+ 0 "blueapi -c CONFIG_LOCATION controller run run_fixed_target_plan"
327
327
  }
328
328
  endObjectProperties
329
329
 
@@ -615,7 +615,7 @@ botShadowColor index 14
615
615
  font "arial-medium-r-18.0"
616
616
  numCmds 1
617
617
  command {
618
- 0 "blueapi -c CONFIG_LOCATION controller run cs_maker '\{\"pmac\":\"pmac\"\}'"
618
+ 0 "blueapi -c CONFIG_LOCATION controller run cs_maker"
619
619
  }
620
620
  endObjectProperties
621
621
 
@@ -1157,7 +1157,7 @@ botShadowColor index 14
1157
1157
  font "arial-medium-r-18.0"
1158
1158
  numCmds 1
1159
1159
  command {
1160
- 0 "blueapi -c CONFIG_LOCATION controller run initialise_stages '\{\"pmac\":\"pmac\"\}'"
1160
+ 0 "blueapi -c CONFIG_LOCATION controller run initialise_stages"
1161
1161
  }
1162
1162
  endObjectProperties
1163
1163
 
@@ -1538,7 +1538,7 @@ botShadowColor index 14
1538
1538
  font "arial-medium-r-18.0"
1539
1539
  numCmds 1
1540
1540
  command {
1541
- 0 "blueapi -c CONFIG_LOCATION controller run block_check '\{\"pmac\":\"pmac\"\}'"
1541
+ 0 "blueapi -c CONFIG_LOCATION controller run block_check"
1542
1542
  }
1543
1543
  endObjectProperties
1544
1544
 
@@ -2912,7 +2912,7 @@ font "helvetica-medium-r-18.0"
2912
2912
  buttonLabel "Set Fiducial 2"
2913
2913
  numCmds 1
2914
2914
  command {
2915
- 0 "blueapi -c CONFIG_LOCATION controller run fiducial '\{\"point\":\"2\",\"pmac\":\"pmac\"\}'"
2915
+ 0 "blueapi -c CONFIG_LOCATION controller run fiducial '\{\"point\":\"2\"\}'"
2916
2916
  }
2917
2917
  endObjectProperties
2918
2918
 
@@ -2934,7 +2934,7 @@ font "helvetica-medium-r-18.0"
2934
2934
  buttonLabel "Goto Fiducial 2"
2935
2935
  numCmds 1
2936
2936
  command {
2937
- 0 "blueapi -c CONFIG_LOCATION controller run moveto '\{\"place\":\"f2\",\"pmac\":\"pmac\"\}'"
2937
+ 0 "blueapi -c CONFIG_LOCATION controller run moveto '\{\"place\":\"f2\"\}'"
2938
2938
  }
2939
2939
  endObjectProperties
2940
2940
 
@@ -2978,7 +2978,7 @@ font "helvetica-medium-r-18.0"
2978
2978
  buttonLabel "Set Fiducial 1"
2979
2979
  numCmds 1
2980
2980
  command {
2981
- 0 "blueapi -c CONFIG_LOCATION controller run fiducial '\{\"point\":\"1\",\"pmac\":\"pmac\"\}'"
2981
+ 0 "blueapi -c CONFIG_LOCATION controller run fiducial '\{\"point\":\"1\"\}'"
2982
2982
  }
2983
2983
  endObjectProperties
2984
2984
 
@@ -3000,7 +3000,7 @@ font "helvetica-medium-r-18.0"
3000
3000
  buttonLabel "Goto Fiducial 1"
3001
3001
  numCmds 1
3002
3002
  command {
3003
- 0 "blueapi -c CONFIG_LOCATION controller run moveto '\{\"place\":\"f1\",\"pmac\":\"pmac\"\}'"
3003
+ 0 "blueapi -c CONFIG_LOCATION controller run moveto '\{\"place\":\"f1\"\}'"
3004
3004
  }
3005
3005
  endObjectProperties
3006
3006
 
@@ -3731,7 +3731,7 @@ botShadowColor index 14
3731
3731
  font "arial-medium-r-18.0"
3732
3732
  numCmds 1
3733
3733
  command {
3734
- 0 "blueapi -c CONFIG_LOCATION controller run moveto '\{\"place\":\"zero\",\"pmac\":\"pmac\"\}'"
3734
+ 0 "blueapi -c CONFIG_LOCATION controller run moveto '\{\"place\":\"zero\"\}'"
3735
3735
  }
3736
3736
  endObjectProperties
3737
3737
 
@@ -3773,7 +3773,7 @@ botShadowColor index 14
3773
3773
  font "arial-medium-r-18.0"
3774
3774
  numCmds 1
3775
3775
  command {
3776
- 0 "blueapi -c CONFIG_LOCATION controller run moveto_preset '\{\"place\":\"microdrop_position\",\"pmac\":\"pmac\",\"beamstop\":\"beamstop\",\"backlight\":\"backlight\",\"det_stage\":\"detector_motion\"\}'"
3776
+ 0 "blueapi -c CONFIG_LOCATION controller run moveto_preset '\{\"place\":\"microdrop_position\"\}'"
3777
3777
  }
3778
3778
  endObjectProperties
3779
3779