mx-bluesky 1.5.10__py3-none-any.whl → 1.5.11__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 (76) hide show
  1. mx_bluesky/_version.py +2 -2
  2. mx_bluesky/beamlines/aithre_lasershaping/goniometer_controls.py +2 -2
  3. mx_bluesky/beamlines/i02_1/parameters/gridscan.py +1 -1
  4. mx_bluesky/beamlines/i04/experiment_plans/i04_grid_detect_then_xray_centre_plan.py +7 -7
  5. mx_bluesky/beamlines/i04/thawing_plan.py +9 -9
  6. mx_bluesky/beamlines/i24/jungfrau_commissioning/experiment_plans/do_darks.py +55 -10
  7. mx_bluesky/beamlines/i24/jungfrau_commissioning/plan_stubs/do_external_acquisition.py +1 -1
  8. mx_bluesky/beamlines/i24/jungfrau_commissioning/plan_stubs/plan_utils.py +1 -1
  9. mx_bluesky/beamlines/i24/serial/__init__.py +7 -5
  10. mx_bluesky/beamlines/i24/serial/dcid.py +3 -3
  11. mx_bluesky/beamlines/i24/serial/extruder/{i24ssx_Extruder_Collect_py3v2.py → i24ssx_extruder_collect_py3v2.py} +65 -35
  12. mx_bluesky/beamlines/i24/serial/fixed_target/{i24ssx_Chip_Collect_py3v1.py → i24ssx_chip_collect_py3v1.py} +5 -5
  13. mx_bluesky/beamlines/i24/serial/fixed_target/{i24ssx_Chip_Manager_py3v1.py → i24ssx_chip_manager_py3v1.py} +46 -46
  14. mx_bluesky/beamlines/i24/serial/fixed_target/{i24ssx_Chip_StartUp_py3v1.py → i24ssx_chip_startup_py3v1.py} +3 -3
  15. mx_bluesky/beamlines/i24/serial/fixed_target/i24ssx_moveonclick.py +33 -33
  16. mx_bluesky/beamlines/i24/serial/log.py +11 -11
  17. mx_bluesky/beamlines/i24/serial/parameters/fixed_target/cs/cs_maker.json +3 -3
  18. mx_bluesky/beamlines/i24/serial/setup_beamline/ca.py +0 -12
  19. mx_bluesky/beamlines/i24/serial/setup_beamline/pv.py +13 -32
  20. mx_bluesky/beamlines/i24/serial/setup_beamline/pv_abstract.py +5 -5
  21. mx_bluesky/beamlines/i24/serial/setup_beamline/setup_beamline.py +22 -249
  22. mx_bluesky/beamlines/i24/serial/setup_beamline/setup_detector.py +2 -2
  23. mx_bluesky/beamlines/i24/serial/setup_beamline/setup_zebra_plans.py +4 -4
  24. mx_bluesky/beamlines/i24/serial/web_gui_plans/general_plans.py +102 -15
  25. mx_bluesky/beamlines/i24/serial/write_nexus.py +4 -4
  26. mx_bluesky/common/experiment_plans/common_flyscan_xray_centre_plan.py +6 -6
  27. mx_bluesky/common/experiment_plans/common_grid_detect_then_xray_centre_plan.py +2 -2
  28. mx_bluesky/common/experiment_plans/inner_plans/do_fgs.py +1 -1
  29. mx_bluesky/common/experiment_plans/inner_plans/read_hardware.py +2 -2
  30. mx_bluesky/common/experiment_plans/inner_plans/udc_default_state.py +22 -1
  31. mx_bluesky/common/experiment_plans/inner_plans/write_sample_status.py +2 -2
  32. mx_bluesky/common/experiment_plans/oav_snapshot_plan.py +1 -1
  33. mx_bluesky/common/external_interaction/callbacks/common/ispyb_callback_base.py +3 -3
  34. mx_bluesky/common/external_interaction/callbacks/common/plan_reactive_callback.py +1 -1
  35. mx_bluesky/common/external_interaction/callbacks/common/zocalo_callback.py +2 -2
  36. mx_bluesky/common/external_interaction/callbacks/sample_handling/sample_handling_callback.py +3 -3
  37. mx_bluesky/common/external_interaction/callbacks/xray_centre/ispyb_callback.py +7 -5
  38. mx_bluesky/common/external_interaction/callbacks/xray_centre/nexus_callback.py +2 -2
  39. mx_bluesky/common/external_interaction/config_server.py +2 -2
  40. mx_bluesky/common/external_interaction/ispyb/exp_eye_store.py +4 -2
  41. mx_bluesky/common/external_interaction/ispyb/ispyb_store.py +0 -1
  42. mx_bluesky/common/external_interaction/nexus/nexus_utils.py +2 -2
  43. mx_bluesky/common/external_interaction/nexus/write_nexus.py +3 -3
  44. mx_bluesky/common/parameters/constants.py +1 -1
  45. mx_bluesky/common/parameters/gridscan.py +2 -2
  46. mx_bluesky/common/utils/exceptions.py +9 -7
  47. mx_bluesky/common/utils/log.py +4 -4
  48. mx_bluesky/common/utils/tracing.py +5 -5
  49. mx_bluesky/common/utils/utils.py +8 -8
  50. mx_bluesky/hyperion/__main__.py +5 -5
  51. mx_bluesky/hyperion/baton_handler.py +15 -8
  52. mx_bluesky/hyperion/device_setup_plans/smargon.py +5 -5
  53. mx_bluesky/hyperion/device_setup_plans/utils.py +1 -1
  54. mx_bluesky/hyperion/experiment_plans/experiment_registry.py +1 -1
  55. mx_bluesky/hyperion/experiment_plans/hyperion_flyscan_xray_centre_plan.py +15 -13
  56. mx_bluesky/hyperion/experiment_plans/load_centre_collect_full_plan.py +2 -2
  57. mx_bluesky/hyperion/experiment_plans/optimise_attenuation_plan.py +9 -9
  58. mx_bluesky/hyperion/experiment_plans/pin_centre_then_xray_centre_plan.py +2 -2
  59. mx_bluesky/hyperion/experiment_plans/pin_tip_centring_plan.py +3 -3
  60. mx_bluesky/hyperion/experiment_plans/rotation_scan_plan.py +2 -2
  61. mx_bluesky/hyperion/external_interaction/agamemnon.py +2 -2
  62. mx_bluesky/hyperion/external_interaction/callbacks/__main__.py +2 -2
  63. mx_bluesky/hyperion/external_interaction/callbacks/rotation/ispyb_callback.py +1 -1
  64. mx_bluesky/hyperion/external_interaction/callbacks/rotation/nexus_callback.py +2 -2
  65. mx_bluesky/hyperion/external_interaction/config_server.py +2 -2
  66. mx_bluesky/hyperion/parameters/constants.py +2 -2
  67. mx_bluesky/hyperion/parameters/gridscan.py +4 -4
  68. mx_bluesky/hyperion/plan_runner.py +6 -6
  69. mx_bluesky/hyperion/runner.py +10 -8
  70. mx_bluesky/jupyter_example.ipynb +3 -3
  71. {mx_bluesky-1.5.10.dist-info → mx_bluesky-1.5.11.dist-info}/METADATA +6 -5
  72. {mx_bluesky-1.5.10.dist-info → mx_bluesky-1.5.11.dist-info}/RECORD +76 -76
  73. {mx_bluesky-1.5.10.dist-info → mx_bluesky-1.5.11.dist-info}/WHEEL +0 -0
  74. {mx_bluesky-1.5.10.dist-info → mx_bluesky-1.5.11.dist-info}/entry_points.txt +0 -0
  75. {mx_bluesky-1.5.10.dist-info → mx_bluesky-1.5.11.dist-info}/licenses/LICENSE +0 -0
  76. {mx_bluesky-1.5.10.dist-info → mx_bluesky-1.5.11.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.10'
32
- __version_tuple__ = version_tuple = (1, 5, 10)
31
+ __version__ = version = '1.5.11'
32
+ __version_tuple__ = version_tuple = (1, 5, 11)
33
33
 
34
34
  __commit_id__ = commit_id = None
@@ -53,9 +53,9 @@ def go_to_furthest_maximum(
53
53
  ) -> MsgGenerator:
54
54
  """Rotate to positive or negative maximum, whichever is further away"""
55
55
 
56
- LIMIT_OF_TRAVEL = 3600
56
+ limit_of_travel = 3600
57
57
  current_value: float = yield from bps.rd(goniometer.omega.user_readback)
58
58
 
59
59
  yield from bps.mv(
60
- goniometer.omega, -LIMIT_OF_TRAVEL if current_value > 0 else LIMIT_OF_TRAVEL
60
+ goniometer.omega, -limit_of_travel if current_value > 0 else limit_of_travel
61
61
  )
@@ -20,7 +20,7 @@ class SpecifiedTwoDGridScan(
20
20
  return self.grid_1_spec
21
21
 
22
22
  @property
23
- def FGS_params(self) -> ZebraGridScanParamsTwoD:
23
+ def fast_gridscan_params(self) -> ZebraGridScanParamsTwoD:
24
24
  return ZebraGridScanParamsTwoD(
25
25
  x_steps=self.x_steps,
26
26
  y_steps=self.y_steps,
@@ -40,13 +40,13 @@ from mx_bluesky.common.device_setup_plans.setup_zebra_and_shutter import (
40
40
  )
41
41
  from mx_bluesky.common.experiment_plans.common_flyscan_xray_centre_plan import (
42
42
  BeamlineSpecificFGSFeatures,
43
- construct_beamline_specific_FGS_features,
43
+ construct_beamline_specific_fast_gridscan_features,
44
44
  )
45
45
  from mx_bluesky.common.experiment_plans.common_grid_detect_then_xray_centre_plan import (
46
46
  grid_detect_then_xray_centre,
47
47
  )
48
48
  from mx_bluesky.common.experiment_plans.oav_snapshot_plan import (
49
- setup_beamline_for_OAV,
49
+ setup_beamline_for_oav,
50
50
  )
51
51
  from mx_bluesky.common.external_interaction.callbacks.common.zocalo_callback import (
52
52
  ZocaloCallback,
@@ -200,7 +200,7 @@ def get_ready_for_oav_and_close_shutter(
200
200
  yield from bps.wait(PlanGroupCheckpointConstants.GRID_READY_FOR_DC)
201
201
  group = "get_ready_for_oav_and_close_shutter"
202
202
  LOGGER.info("Non-udc tidy: Setting up beamline for OAV")
203
- yield from setup_beamline_for_OAV(
203
+ yield from setup_beamline_for_oav(
204
204
  smargon, backlight, aperture_scatterguard, group=group
205
205
  )
206
206
  LOGGER.info("Non-udc tidy: Closing detector shutter")
@@ -243,14 +243,14 @@ def construct_i04_specific_features(
243
243
  xrc_composite.smargon.x,
244
244
  xrc_composite.smargon.y,
245
245
  xrc_composite.smargon.z,
246
- xrc_composite.dcm.energy_in_kev,
246
+ xrc_composite.dcm.energy_in_keV,
247
247
  ]
248
248
 
249
249
  signals_to_read_during_collection = [
250
250
  xrc_composite.aperture_scatterguard,
251
251
  xrc_composite.attenuator.actual_transmission,
252
252
  xrc_composite.flux.flux_reading,
253
- xrc_composite.dcm.energy_in_kev,
253
+ xrc_composite.dcm.energy_in_keV,
254
254
  xrc_composite.eiger.bit_depth,
255
255
  ]
256
256
 
@@ -264,10 +264,10 @@ def construct_i04_specific_features(
264
264
  set_flyscan_params_plan = partial(
265
265
  set_fast_grid_scan_params,
266
266
  xrc_composite.zebra_fast_grid_scan,
267
- xrc_parameters.FGS_params,
267
+ xrc_parameters.fast_gridscan_params,
268
268
  )
269
269
  fgs_motors = xrc_composite.zebra_fast_grid_scan
270
- return construct_beamline_specific_FGS_features(
270
+ return construct_beamline_specific_fast_gridscan_features(
271
271
  partial(
272
272
  setup_zebra_for_gridscan,
273
273
  ),
@@ -62,7 +62,7 @@ def thaw_and_stream_to_redis(
62
62
  defaults are always correct
63
63
  """
64
64
 
65
- def switch_forwarder_to_ROI() -> MsgGenerator:
65
+ def switch_forwarder_to_roi() -> MsgGenerator:
66
66
  yield from bps.complete(oav_to_redis_forwarder, wait=True)
67
67
  yield from bps.mv(oav_to_redis_forwarder.selected_source, Source.ROI.value)
68
68
  yield from bps.kickoff(oav_to_redis_forwarder, wait=True)
@@ -75,7 +75,7 @@ def thaw_and_stream_to_redis(
75
75
  smargon,
76
76
  oav,
77
77
  oav_to_redis_forwarder,
78
- switch_forwarder_to_ROI,
78
+ switch_forwarder_to_roi,
79
79
  )
80
80
 
81
81
 
@@ -110,14 +110,14 @@ def thaw_and_murko_centre(
110
110
  defaults are always correct
111
111
  """
112
112
 
113
- MURKO_RESULTS_GROUP = "get_results"
113
+ murko_results_group = "get_results"
114
114
 
115
- def centre_then_switch_forwarder_to_ROI() -> MsgGenerator:
115
+ def centre_then_switch_forwarder_to_roi() -> MsgGenerator:
116
116
  yield from bps.complete(oav_to_redis_forwarder, wait=True)
117
117
 
118
118
  yield from bps.mv(oav_to_redis_forwarder.selected_source, Source.ROI.value)
119
119
 
120
- yield from bps.wait(MURKO_RESULTS_GROUP)
120
+ yield from bps.wait(murko_results_group)
121
121
  x_predict = yield from bps.rd(murko_results.x_mm)
122
122
  y_predict = yield from bps.rd(murko_results.y_mm)
123
123
  z_predict = yield from bps.rd(murko_results.z_mm)
@@ -132,7 +132,7 @@ def thaw_and_murko_centre(
132
132
  yield from bps.mv(murko_results.sample_id, str(sample_id))
133
133
 
134
134
  yield from bps.stage(murko_results, wait=True)
135
- yield from bps.trigger(murko_results, group=MURKO_RESULTS_GROUP)
135
+ yield from bps.trigger(murko_results, group=murko_results_group)
136
136
 
137
137
  yield from bpp.contingency_wrapper(
138
138
  _thaw_and_stream_to_redis(
@@ -143,7 +143,7 @@ def thaw_and_murko_centre(
143
143
  smargon,
144
144
  oav,
145
145
  oav_to_redis_forwarder,
146
- centre_then_switch_forwarder_to_ROI,
146
+ centre_then_switch_forwarder_to_roi,
147
147
  ),
148
148
  final_plan=partial(bps.unstage, murko_results, wait=True),
149
149
  )
@@ -168,7 +168,7 @@ def _thaw(
168
168
  plan_between_rotations (MsgGenerator, optional): A plan to run between rotations
169
169
  of the smargon. Defaults to no plan.
170
170
  """
171
- inital_velocity = yield from bps.rd(smargon.omega.velocity)
171
+ initial_velocity = yield from bps.rd(smargon.omega.velocity)
172
172
  new_velocity = abs(rotation / time_to_thaw) * 2.0
173
173
 
174
174
  def do_thaw():
@@ -180,7 +180,7 @@ def _thaw(
180
180
  yield from bps.rel_set(smargon.omega, -rotation, wait=True)
181
181
 
182
182
  def cleanup():
183
- yield from bps.abs_set(smargon.omega.velocity, inital_velocity, wait=True)
183
+ yield from bps.abs_set(smargon.omega.velocity, initial_velocity, wait=True)
184
184
  yield from bps.abs_set(thawer.control, OnOff.OFF, wait=True)
185
185
 
186
186
  # Always cleanup even if there is a failure
@@ -3,10 +3,10 @@ from bluesky import plan_stubs as bps
3
3
  from bluesky.utils import MsgGenerator
4
4
  from dodal.common import inject
5
5
  from dodal.devices.i24.commissioning_jungfrau import CommissioningJungfrau
6
- from ophyd_async.core import WatchableAsyncStatus
7
6
  from ophyd_async.fastcs.jungfrau import (
8
7
  AcquisitionType,
9
8
  GainMode,
9
+ create_jungfrau_internal_triggering_info,
10
10
  create_jungfrau_pedestal_triggering_info,
11
11
  )
12
12
  from pydantic import PositiveInt
@@ -18,6 +18,7 @@ from mx_bluesky.beamlines.i24.jungfrau_commissioning.plan_stubs.plan_utils impor
18
18
  from mx_bluesky.common.utils.log import LOGGER
19
19
 
20
20
  PEDESTAL_DARKS_RUN = "PEDESTAL DARKS RUN"
21
+ STANDARD_DARKS_RUN = "STANDARD DARKS RUN"
21
22
 
22
23
 
23
24
  def do_pedestal_darks(
@@ -26,7 +27,7 @@ def do_pedestal_darks(
26
27
  pedestal_loops: PositiveInt = 200,
27
28
  jungfrau: CommissioningJungfrau = inject("jungfrau"),
28
29
  path_of_output_file: str | None = None,
29
- ) -> MsgGenerator[WatchableAsyncStatus]:
30
+ ) -> MsgGenerator:
30
31
  """Acquire darks in pedestal mode, using dynamic gain mode. This calibrates the offsets
31
32
  for the jungfrau, and must be performed before acquiring real data in dynamic gain mode.
32
33
 
@@ -38,6 +39,9 @@ def do_pedestal_darks(
38
39
  4. Do the first three steps a second time, except use ForceSwitchG2 instead of ForceSwitchG1
39
40
  during step 2.
40
41
 
42
+ A pedestal scan should be acquired when detector configuration and environmental conditions change, but due to small
43
+ in instabilities in beamline conditions, it is recommended to run a pedestal scan on roughly an hourly basis.
44
+
41
45
  Args:
42
46
  exp_time_s: Length of detector exposure for each frame.
43
47
  pedestal_frames: Number of frames acquired per pedestal loop.
@@ -66,13 +70,54 @@ def do_pedestal_darks(
66
70
  jungfrau.drv.gain_mode,
67
71
  GainMode.DYNAMIC,
68
72
  )
69
- return (
70
- yield from fly_jungfrau(
71
- jungfrau,
72
- trigger_info,
73
- wait=True,
74
- log_on_percentage_prefix="Jungfrau pedestal dynamic gain mode darks triggers recieved",
75
- )
73
+ yield from fly_jungfrau(
74
+ jungfrau,
75
+ trigger_info,
76
+ wait=True,
77
+ log_on_percentage_prefix="Jungfrau pedestal dynamic gain mode darks triggers received",
78
+ )
79
+
80
+ yield from _do_decorated_plan()
81
+
82
+
83
+ def do_non_pedestal_darks(
84
+ gain_mode: GainMode,
85
+ exp_time_s: float = 0.001,
86
+ total_triggers: PositiveInt = 1000,
87
+ jungfrau: CommissioningJungfrau = inject("jungfrau"),
88
+ path_of_output_file: str | None = None,
89
+ ) -> MsgGenerator:
90
+ """Internally take a set of images at a given gain mode.
91
+
92
+ Non-pedestal darks are useful for detector panel cross-checks and for calculating masks.
93
+
94
+ Args:
95
+ gain_mode: Which gain mode to put the Jungfrau into before starting the acquisition.
96
+ exp_time_s: Length of detector exposure for each trigger.
97
+ total_triggers: Total triggers for the dark scan.
98
+ jungfrau: Jungfrau device
99
+ path_of_output_file: Absolute path of the detector file output, including file name. If None, then use the PathProvider
100
+ set during Jungfrau device instantiation
101
+ """
102
+
103
+ @bpp.set_run_key_decorator(STANDARD_DARKS_RUN)
104
+ @bpp.run_decorator(md={"subplan_name": STANDARD_DARKS_RUN})
105
+ @bpp.stage_decorator([jungfrau])
106
+ def _do_decorated_plan():
107
+ if path_of_output_file:
108
+ override_file_path(jungfrau, path_of_output_file)
109
+
110
+ trigger_info = create_jungfrau_internal_triggering_info(
111
+ total_triggers, exp_time_s
112
+ )
113
+
114
+ yield from bps.mv(jungfrau.drv.gain_mode, gain_mode)
115
+
116
+ yield from fly_jungfrau(
117
+ jungfrau,
118
+ trigger_info,
119
+ wait=True,
120
+ log_on_percentage_prefix=f"Jungfrau {gain_mode} gain mode darks triggers received",
76
121
  )
77
122
 
78
- return (yield from _do_decorated_plan())
123
+ yield from _do_decorated_plan()
@@ -30,7 +30,7 @@ def do_external_acquisition(
30
30
 
31
31
  Args:
32
32
  exp_time_s: Length of detector exposure for each frame.
33
- total_triggers: Number of external triggers recieved before acquisition is marked as complete.
33
+ total_triggers: Number of external triggers received before acquisition is marked as complete.
34
34
  jungfrau: Jungfrau device
35
35
  output_file_name: Absolute path of the detector file output, including file name. If None, then use the PathProvider
36
36
  set during jungfrau device instantiation
@@ -21,7 +21,7 @@ def fly_jungfrau(
21
21
  jungfrau: CommissioningJungfrau,
22
22
  trigger_info: TriggerInfo,
23
23
  wait: bool = False,
24
- log_on_percentage_prefix="Jungfrau data collection triggers recieved",
24
+ log_on_percentage_prefix="Jungfrau data collection triggers received",
25
25
  ) -> MsgGenerator[WatchableAsyncStatus]:
26
26
  """Stage, prepare, and kickoff Jungfrau with a configured TriggerInfo. Optionally wait
27
27
  for completion.
@@ -3,19 +3,20 @@ from mx_bluesky.beamlines.i24.serial.web_gui_plans.general_plans import (
3
3
  gui_move_backlight,
4
4
  gui_move_detector,
5
5
  gui_run_chip_collection,
6
+ gui_run_extruder_collection,
7
+ gui_set_fiducial_0,
6
8
  gui_set_zoom_level,
7
- gui_sleep,
8
9
  gui_stage_move_on_click,
9
10
  )
10
11
 
11
- from .extruder.i24ssx_Extruder_Collect_py3v2 import (
12
+ from .extruder.i24ssx_extruder_collect_py3v2 import (
12
13
  enter_hutch,
13
14
  initialise_extruder,
14
15
  laser_check,
15
16
  run_extruder_plan,
16
17
  )
17
- from .fixed_target.i24ssx_Chip_Collect_py3v1 import run_fixed_target_plan
18
- from .fixed_target.i24ssx_Chip_Manager_py3v1 import (
18
+ from .fixed_target.i24ssx_chip_collect_py3v1 import run_fixed_target_plan
19
+ from .fixed_target.i24ssx_chip_manager_py3v1 import (
19
20
  block_check,
20
21
  cs_maker,
21
22
  cs_reset,
@@ -56,9 +57,10 @@ __all__ = [
56
57
  # GUI plans
57
58
  "gui_stage_move_on_click",
58
59
  "gui_gonio_move_on_click",
59
- "gui_sleep",
60
60
  "gui_move_detector",
61
61
  "gui_run_chip_collection",
62
62
  "gui_move_backlight",
63
63
  "gui_set_zoom_level",
64
+ "gui_set_fiducial_0",
65
+ "gui_run_extruder_collection",
64
66
  ]
@@ -95,7 +95,7 @@ class DCID:
95
95
 
96
96
  Attributes:
97
97
  error:
98
- If an error has occured. This will be set, even if emit_errors = True
98
+ If an error has occurred. This will be set, even if emit_errors = True
99
99
  """
100
100
 
101
101
  def __init__(
@@ -157,7 +157,7 @@ class DCID:
157
157
  xbeam, ybeam = beam_settings.beam_center_in_mm
158
158
 
159
159
  if isinstance(self.detector, Eiger):
160
- startImageNumber = 1
160
+ start_image_number = 1
161
161
  else:
162
162
  raise ValueError("Unknown detector:", self.detector)
163
163
 
@@ -201,7 +201,7 @@ class DCID:
201
201
  "imageDirectory": image_dir,
202
202
  "numberOfImages": num_images,
203
203
  "resolution": resolution,
204
- "startImageNumber": startImageNumber,
204
+ "startImageNumber": start_image_number,
205
205
  "startTime": start_time.isoformat(),
206
206
  "transmission": transmission,
207
207
  "visit": self.parameters.visit.name,
@@ -46,7 +46,7 @@ from mx_bluesky.beamlines.i24.serial.setup_beamline import (
46
46
  )
47
47
  from mx_bluesky.beamlines.i24.serial.setup_beamline import setup_beamline as sup
48
48
  from mx_bluesky.beamlines.i24.serial.setup_beamline.setup_detector import (
49
- UnknownDetectorType,
49
+ UnknownDetectorTypeError,
50
50
  get_detector_type,
51
51
  )
52
52
  from mx_bluesky.beamlines.i24.serial.setup_beamline.setup_zebra_plans import (
@@ -113,17 +113,17 @@ def laser_check(
113
113
  """
114
114
  SSX_LOGGER.debug(f"Laser check: {mode}")
115
115
 
116
- LASER_TTL = zebra.mapping.outputs.TTL_PILATUS # Update with dodal changes
116
+ laser_ttl = zebra.mapping.outputs.TTL_PILATUS # Update with dodal changes
117
117
 
118
118
  if mode == "laseron":
119
119
  yield from bps.abs_set(
120
- zebra.output.out_pvs[LASER_TTL], zebra.mapping.sources.SOFT_IN3
120
+ zebra.output.out_pvs[laser_ttl], zebra.mapping.sources.SOFT_IN3
121
121
  )
122
122
  yield from set_shutter_mode(zebra, "auto")
123
123
 
124
124
  if mode == "laseroff":
125
125
  yield from bps.abs_set(
126
- zebra.output.out_pvs[LASER_TTL], zebra.mapping.sources.DISCONNECT
126
+ zebra.output.out_pvs[laser_ttl], zebra.mapping.sources.DISCONNECT
127
127
  )
128
128
  yield from set_shutter_mode(zebra, "manual")
129
129
 
@@ -230,7 +230,7 @@ def main_extruder_plan(
230
230
 
231
231
  SSX_LOGGER.debug(f"Creating the directory for the collection in {filepath}.")
232
232
 
233
- caput(pv.eiger_seqID, int(caget(pv.eiger_seqID)) + 1)
233
+ caput(pv.eiger_seq_id, int(caget(pv.eiger_seq_id)) + 1)
234
234
  SSX_LOGGER.info(f"Eiger quickshot setup: filepath {filepath}")
235
235
  SSX_LOGGER.info(f"Eiger quickshot setup: filepath {parameters.filename}")
236
236
  SSX_LOGGER.info(
@@ -282,7 +282,7 @@ def main_extruder_plan(
282
282
  else:
283
283
  err = f"Unknown Detector Type, det_type = {parameters.detector_name}"
284
284
  SSX_LOGGER.error(err)
285
- raise UnknownDetectorType(err)
285
+ raise UnknownDetectorTypeError(err)
286
286
 
287
287
  beam_settings = yield from read_beam_info_from_hardware(
288
288
  dcm, mirrors, beam_center_device, parameters.detector_name
@@ -291,7 +291,7 @@ def main_extruder_plan(
291
291
  # Do DCID creation BEFORE arming the detector
292
292
  filetemplate = f"{parameters.filename}.nxs"
293
293
  if parameters.detector_name == "eiger":
294
- complete_filename = cagetstring(pv.eiger_ODfilenameRBV)
294
+ complete_filename = cagetstring(pv.eiger_od_filename_rbv)
295
295
  filetemplate = f"{complete_filename}.nxs"
296
296
  dcid.generate_dcid(
297
297
  beam_settings=beam_settings,
@@ -387,7 +387,7 @@ def tidy_up_at_collection_end_plan(
387
387
  # Clean Up
388
388
  if parameters.detector_name == "eiger":
389
389
  yield from sup.eiger("return-to-normal", None, dcm)
390
- SSX_LOGGER.debug(f"{parameters.filename}_{caget(pv.eiger_seqID)}")
390
+ SSX_LOGGER.debug(f"{parameters.filename}_{caget(pv.eiger_seq_id)}")
391
391
  SSX_LOGGER.debug("End of Run")
392
392
  SSX_LOGGER.info("Close hutch shutter")
393
393
  yield from bps.abs_set(shutter, ShutterDemand.CLOSE, wait=True)
@@ -402,7 +402,7 @@ def collection_complete_plan(
402
402
  if detector_name == "eiger":
403
403
  SSX_LOGGER.info("Eiger Acquire STOP")
404
404
  caput(pv.eiger_acquire, 0)
405
- caput(pv.eiger_ODcapture, "Done")
405
+ caput(pv.eiger_od_capture, "Done")
406
406
 
407
407
  yield from bps.sleep(0.5)
408
408
 
@@ -413,32 +413,20 @@ def collection_complete_plan(
413
413
  yield from bps.null()
414
414
 
415
415
 
416
- def run_extruder_plan(
417
- zebra: Zebra = inject("zebra"),
418
- aperture: Aperture = inject("aperture"),
419
- backlight: DualBacklight = inject("backlight"),
420
- beamstop: Beamstop = inject("beamstop"),
421
- detector_stage: YZStage = inject("detector_motion"),
422
- shutter: HutchShutter = inject("shutter"),
423
- dcm: DCM = inject("dcm"),
424
- mirrors: FocusMirrorsMode = inject("focus_mirrors"),
425
- attenuator: ReadOnlyAttenuator = inject("attenuator"),
426
- beam_center_eiger: DetectorBeamCenter = inject("eiger_bc"),
416
+ def run_plan_in_wrapper(
417
+ zebra: Zebra,
418
+ aperture: Aperture,
419
+ backlight: DualBacklight,
420
+ beamstop: Beamstop,
421
+ detector_stage: YZStage,
422
+ shutter: HutchShutter,
423
+ dcm: DCM,
424
+ mirrors: FocusMirrorsMode,
425
+ beam_center_eiger: DetectorBeamCenter,
426
+ parameters: ExtruderParameters,
427
+ dcid: DCID,
428
+ start_time: datetime,
427
429
  ) -> MsgGenerator:
428
- start_time = datetime.now()
429
- SSX_LOGGER.info(f"Collection start time: {start_time.ctime()}")
430
-
431
- parameters: ExtruderParameters = yield from read_parameters(
432
- detector_stage, attenuator
433
- )
434
- # Create collection directory
435
- parameters.collection_directory.mkdir(parents=True, exist_ok=True)
436
-
437
- beam_center_device = beam_center_eiger
438
-
439
- # DCID - not generated yet
440
- dcid = DCID(emit_errors=False, expt_params=parameters)
441
-
442
430
  yield from bpp.contingency_wrapper(
443
431
  main_extruder_plan(
444
432
  zebra=zebra,
@@ -449,7 +437,7 @@ def run_extruder_plan(
449
437
  shutter=shutter,
450
438
  dcm=dcm,
451
439
  mirrors=mirrors,
452
- beam_center_device=beam_center_device,
440
+ beam_center_device=beam_center_eiger,
453
441
  parameters=parameters,
454
442
  dcid=dcid,
455
443
  start_time=start_time,
@@ -469,3 +457,45 @@ def run_extruder_plan(
469
457
  ),
470
458
  auto_raise=False,
471
459
  )
460
+
461
+
462
+ def run_extruder_plan(
463
+ zebra: Zebra = inject("zebra"),
464
+ aperture: Aperture = inject("aperture"),
465
+ backlight: DualBacklight = inject("backlight"),
466
+ beamstop: Beamstop = inject("beamstop"),
467
+ detector_stage: YZStage = inject("detector_motion"),
468
+ shutter: HutchShutter = inject("shutter"),
469
+ dcm: DCM = inject("dcm"),
470
+ mirrors: FocusMirrorsMode = inject("focus_mirrors"),
471
+ attenuator: ReadOnlyAttenuator = inject("attenuator"),
472
+ beam_center_eiger: DetectorBeamCenter = inject("eiger_bc"),
473
+ ) -> MsgGenerator:
474
+ start_time = datetime.now()
475
+ SSX_LOGGER.info(f"Collection start time: {start_time.ctime()}")
476
+
477
+ parameters: ExtruderParameters = yield from read_parameters(
478
+ detector_stage, attenuator
479
+ )
480
+ # Create collection directory
481
+ parameters.collection_directory.mkdir(parents=True, exist_ok=True)
482
+
483
+ beam_center_device = beam_center_eiger
484
+
485
+ # DCID - not generated yet
486
+ dcid = DCID(emit_errors=False, expt_params=parameters)
487
+
488
+ yield from run_plan_in_wrapper(
489
+ zebra,
490
+ aperture,
491
+ backlight,
492
+ beamstop,
493
+ detector_stage,
494
+ shutter,
495
+ dcm,
496
+ mirrors,
497
+ beam_center_device,
498
+ parameters,
499
+ dcid,
500
+ start_time,
501
+ )
@@ -31,7 +31,7 @@ from mx_bluesky.beamlines.i24.serial.fixed_target.ft_utils import (
31
31
  MappingType,
32
32
  PumpProbeSetting,
33
33
  )
34
- from mx_bluesky.beamlines.i24.serial.fixed_target.i24ssx_Chip_Manager_py3v1 import (
34
+ from mx_bluesky.beamlines.i24.serial.fixed_target.i24ssx_chip_manager_py3v1 import (
35
35
  read_parameters,
36
36
  upload_chip_map_to_geobrick,
37
37
  )
@@ -335,7 +335,7 @@ def start_i24(
335
335
 
336
336
  # DCID process depends on detector PVs being set up already
337
337
  SSX_LOGGER.debug("Start DCID process")
338
- complete_filename = cagetstring(pv.eiger_ODfilenameRBV)
338
+ complete_filename = cagetstring(pv.eiger_od_filename_rbv)
339
339
  filetemplate = f"{complete_filename}.nxs"
340
340
  dcid.generate_dcid(
341
341
  beam_settings=beam_settings,
@@ -401,7 +401,7 @@ def finish_i24(
401
401
  SSX_LOGGER.debug("Finish I24 Eiger")
402
402
  yield from reset_zebra_when_collection_done_plan(zebra)
403
403
  yield from sup.eiger("return-to-normal", None, dcm)
404
- complete_filename = cagetstring(pv.eiger_ODfilenameRBV) # type: ignore
404
+ complete_filename = cagetstring(pv.eiger_od_filename_rbv) # type: ignore
405
405
  else:
406
406
  raise ValueError(f"{parameters.detector_name} unrecognised")
407
407
 
@@ -538,7 +538,7 @@ def collection_complete_plan(
538
538
  SSX_LOGGER.debug(f"Collection end time {end_time}")
539
539
  dcid.collection_complete(end_time, aborted=False)
540
540
 
541
- # NOTE no files to copy anymore but shoud write userlog here
541
+ # NOTE no files to copy anymore but should write userlog here
542
542
  yield from bps.null()
543
543
 
544
544
 
@@ -562,7 +562,7 @@ def tidy_up_after_collection_plan(
562
562
  if parameters.detector_name == "eiger":
563
563
  SSX_LOGGER.debug("Eiger Acquire STOP")
564
564
  caput(pv.eiger_acquire, 0)
565
- caput(pv.eiger_ODcapture, "Done")
565
+ caput(pv.eiger_od_capture, "Done")
566
566
  yield from bps.sleep(0.5)
567
567
 
568
568
  yield from finish_i24(zebra, pmac, shutter, dcm, parameters)