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
@@ -96,185 +96,6 @@ def set_detector_beam_center_plan(
96
96
  yield from bps.wait(group=group)
97
97
 
98
98
 
99
- def modechange(action):
100
- """Mode Change"""
101
- # Pin Hand Mount
102
- if action == "Pin_hand_mount":
103
- caput(pv.bl_mp_select, "Out")
104
- caput(pv.aptr1_mp_select, "Manual Mounting")
105
- caput(pv.bs_mp_select, "Robot")
106
- caput(pv.vgon_omega, 0)
107
- caput(pv.vgon_kappa, 0)
108
- caput(pv.vgon_phi, 0)
109
- caput(pv.vgon_pinxs, 0)
110
- caput(pv.vgon_pinzs, 0)
111
- caput(pv.fluo_trans, "OUT")
112
- caput(pv.cstrm_p1701, 0)
113
- caput(pv.cstrm_mp_select, "Out")
114
- SSX_LOGGER.debug("Pin Hand Mount Done")
115
-
116
- # Pin Room Tempreature Hand Mount
117
- elif action == "Pin_rt_hand_mount":
118
- caput(pv.cstrm_p1701, 0)
119
- caput(pv.cstrm_mp_select, "Away")
120
- caput(pv.bl_mp_select, "Out")
121
- caput(pv.aptr1_mp_select, "Manual Mounting")
122
- caput(pv.bs_mp_select, "Robot")
123
- caput(pv.vgon_omega, 0)
124
- caput(pv.vgon_kappa, 0)
125
- caput(pv.vgon_phi, 0)
126
- caput(pv.vgon_pinxs, 0)
127
- caput(pv.vgon_pinzs, 0)
128
- caput(pv.fluo_trans, "OUT")
129
- SSX_LOGGER.debug("RT Pin Hand Mount Done")
130
-
131
- # Pin Data Collection
132
- elif action == "Pin_data_collection":
133
- caput(pv.cstrm_p1701, 0)
134
- caput(pv.cstrm_mp_select, "In")
135
- caput(pv.aptr1_mp_select, "In")
136
- caput(pv.vgon_omega, 0)
137
- caput(pv.vgon_kappa, 0)
138
- caput(pv.vgon_phi, 0)
139
- caput(pv.vgon_pinxs, 0)
140
- # caput(pv.vgon_pinyh, 0)
141
- caput(pv.vgon_pinzs, 0)
142
- caput(pv.fluo_trans, "OUT")
143
- caput(pv.bs_roty, 0)
144
- yield from bps.sleep(0.5)
145
- caput(pv.bs_mp_select, "Data Collection")
146
- yield from bps.sleep(2.3)
147
- caput(pv.bl_mp_select, "In")
148
- SSX_LOGGER.debug("Pin Data Collection Done")
149
-
150
- # Pin Room Tempreature Data Collection
151
- elif action == "Pin_rt_data_collection":
152
- SSX_LOGGER.debug("RT Mode")
153
- caput(pv.cstrm_p1701, 0)
154
- caput(pv.cstrm_mp_select, "Away")
155
- caput(pv.aptr1_mp_select, "In")
156
- caput(pv.vgon_omega, 0)
157
- caput(pv.vgon_kappa, 0)
158
- caput(pv.vgon_phi, 0)
159
- caput(pv.vgon_pinxs, 0)
160
- caput(pv.vgon_pinyh, 0)
161
- caput(pv.vgon_pinzs, 0)
162
- caput(pv.fluo_trans, "OUT")
163
- yield from bps.sleep(0.1)
164
- caput(pv.bs_roty, 0)
165
- yield from bps.sleep(2.6)
166
- caput(pv.bl_mp_select, "In")
167
- caput(pv.bs_mp_select, "Data Collection")
168
- SSX_LOGGER.debug("RT Data Collection Done")
169
-
170
- # Tray Hand Mount
171
- elif action == "Tray_hand_mount":
172
- caput(pv.ttab_x, 2.0)
173
- caput(pv.hgon_trayys, 0.0)
174
- caput(pv.hgon_omega, 0.0)
175
- caput(pv.fluo_trans, "OUT")
176
- caput(pv.bl_mp_select, "Out")
177
- yield from bps.sleep(1)
178
- caput(pv.aptr1_mp_select, "Manual Mounting")
179
- caput(pv.bs_mp_select, "Tray Mount")
180
- while float(caget(pv.ttab_x + ".RBV")) > 3:
181
- yield from bps.sleep(1)
182
- SSX_LOGGER.debug("Tray Hand Mount Done")
183
-
184
- # Tray Robot Load. This action needs to be reviewed and revised
185
- elif action == "Tray_robot_load":
186
- # Middle of black circle
187
- caput(pv.ttab_x, 79.2)
188
- caput(pv.hgon_trayys, -7.00)
189
- caput(pv.hgon_trayzs, -1.10)
190
- caput(pv.hgon_omega, 0.0)
191
- caput(pv.fluo_trans, "OUT")
192
- caput(pv.aptr1_mp_select, "In")
193
- caput(pv.bl_mp_select, "Out")
194
- yield from bps.sleep(1)
195
- caput(pv.bs_roty, 0)
196
- yield from bps.sleep(1)
197
- caput(pv.bs_mp_select, "Robot")
198
- yield from bps.sleep(1)
199
- caput(pv.bs_mp_select, "Data Collection Far")
200
- yield from bps.sleep(1)
201
- caput(pv.bs_roty, 0)
202
- yield from bps.sleep(4)
203
- caput(pv.bl_mp_select, "In")
204
- SSX_LOGGER.debug("Tray Robot Mount Done")
205
-
206
- # Tray Data Collection
207
- elif action == "Tray_data_collection":
208
- SSX_LOGGER.debug("This should be E11 on the test tray (CrystalQuickX)")
209
- caput(pv.ttab_x, 37.4)
210
- caput(pv.hgon_trayys, -8.0)
211
- caput(pv.hgon_trayzs, -2.1)
212
- caput(pv.aptr1_mp_select, "In")
213
- caput(pv.fluo_trans, "OUT")
214
- caput(pv.bl_mp_select, "Out")
215
- yield from bps.sleep(1)
216
- caput(pv.bs_roty, 0)
217
- yield from bps.sleep(1)
218
- caput(pv.bs_mp_select, "Robot")
219
- yield from bps.sleep(1)
220
- caput(pv.bs_mp_select, "Data Collection")
221
- yield from bps.sleep(1)
222
- caput(pv.bs_roty, 0)
223
- yield from bps.sleep(4)
224
- caput(pv.bl_mp_select, "In")
225
- SSX_LOGGER.debug("Tray Data Collection Done")
226
-
227
- # Pin Switch to Tray
228
- elif action == "Pin_switch2tray":
229
- caput(pv.cstrm_p1701, 0)
230
- caput(pv.cstrm_mp_select, "Away")
231
- caput(pv.aptr1_mp_select, "Manual Mounting")
232
- caput(pv.bl_mp_select, "Out")
233
- caput(pv.hgon_omega, 0.0)
234
- caput(pv.ttab_x, 0)
235
- caput(pv.hgon_trayys, 0.0)
236
- caput(pv.hgon_trayzs, 0.0)
237
- caput(pv.ptab_y, -90)
238
- caput(pv.fluo_trans, "OUT")
239
- caput(pv.vgon_omega, 0)
240
- caput(pv.vgon_kappa, 0)
241
- caput(pv.vgon_phi, 0)
242
- caput(pv.vgon_pinxs, 0)
243
- caput(pv.vgon_pinyh, 0)
244
- caput(pv.vgon_pinzs, 0)
245
- while float(caget(pv.ttab_x + ".RBV")) > 1:
246
- SSX_LOGGER.debug(f"moving ttab_x {caget(pv.ttab_x)}")
247
- yield from bps.sleep(0.1)
248
- while caget(pv.fluo_out_limit) == "OFF":
249
- SSX_LOGGER.debug("waiting on fluorescence detector")
250
- yield from bps.sleep(0.1)
251
- while caget(pv.bl_mp_select) != "Out":
252
- SSX_LOGGER.debug("waiting on back light to move to out")
253
- yield from bps.sleep(0.1)
254
- caput(pv.bs_mp_select, "Robot")
255
- caput(pv.bs_roty, 0)
256
- while float(caget(pv.ptab_y + ".RBV")) > -89.0:
257
- yield from bps.sleep(1)
258
- SSX_LOGGER.debug("Switch To Tray Done")
259
-
260
- # Tray Switch to Pin
261
- elif action == "Tray_switch2pin":
262
- caput(pv.ttab_x, 0.0)
263
- # Supposed to absorb pin laser
264
- caput(pv.hgon_trayys, 0.0)
265
- caput(pv.hgon_trayzs, 0.0)
266
- while float(caget(pv.ttab_x + ".RBV")) > 1.0:
267
- yield from bps.sleep(1)
268
- caput(pv.ptab_y, 0)
269
- while float(caget(pv.ptab_y + ".RBV")) < -1.0:
270
- yield from bps.sleep(1)
271
- yield from modechange("Pin_data_collection")
272
- SSX_LOGGER.debug("Switch To Pin Done")
273
- else:
274
- SSX_LOGGER.debug(f"Unknown action: {action}")
275
- return 1
276
-
277
-
278
99
  def eiger(action, args_list, dcm: DCM):
279
100
  SSX_LOGGER.debug("***** Entering Eiger")
280
101
  SSX_LOGGER.info(f"Setup eiger - {action}")
@@ -292,7 +113,7 @@ def eiger(action, args_list, dcm: DCM):
292
113
  caput(pv.eiger_monitor, "No")
293
114
  # caput(pv.eiger_datasource, 'None')
294
115
  caput(pv.eiger_statuspoll, "1 second")
295
- caput(pv.eiger_ROImode, "Disabled")
116
+ caput(pv.eiger_roi_mode, "Disabled")
296
117
  caput(pv.eiger_ff, "Enabled")
297
118
  caput(pv.eiger_compresstype, "bslz4")
298
119
  caput(pv.eiger_countmode, "Retrigger")
@@ -304,10 +125,10 @@ def eiger(action, args_list, dcm: DCM):
304
125
  # Sends a single trigger to start data collection
305
126
  SSX_LOGGER.debug("Eiger quickshot")
306
127
  [filepath, filename, num_imgs, exptime] = args_list
307
- filename = filename + "_" + str(caget(pv.eiger_seqID))
308
- caput(pv.eiger_ODfilepath, filepath)
128
+ filename = filename + "_" + str(caget(pv.eiger_seq_id))
129
+ caput(pv.eiger_od_filepath, filepath)
309
130
  yield from bps.sleep(0.1)
310
- caput(pv.eiger_ODfilename, filename)
131
+ caput(pv.eiger_od_filename, filename)
311
132
  yield from bps.sleep(0.1)
312
133
  acqtime = float(exptime) - 0.0000001
313
134
  caput(pv.eiger_acquiretime, str(acqtime))
@@ -325,17 +146,17 @@ def eiger(action, args_list, dcm: DCM):
325
146
  yield from bps.sleep(1.0)
326
147
  # ODIN setup
327
148
  SSX_LOGGER.info("Setting up Odin")
328
- caput(pv.eiger_ODfilename, filename)
329
- caput(pv.eiger_ODfilepath, filepath)
330
- caput(pv.eiger_ODnumcapture, str(num_imgs))
331
- caput(pv.eiger_ODfilepath, filepath)
149
+ caput(pv.eiger_od_filename, filename)
150
+ caput(pv.eiger_od_filepath, filepath)
151
+ caput(pv.eiger_od_num_capture, str(num_imgs))
152
+ caput(pv.eiger_od_filepath, filepath)
332
153
  eigerbdrbv = "UInt" + str(caget(pv.eiger_bitdepthrbv))
333
- caput(pv.eiger_ODdatatype, eigerbdrbv)
334
- caput(pv.eiger_ODcompress, "BSL24")
154
+ caput(pv.eiger_od_datatype, eigerbdrbv)
155
+ caput(pv.eiger_od_compress, "BSL24")
335
156
  yield from bps.sleep(1.0)
336
157
  # All done. Now get Odin to wait for data and start Eiger
337
158
  SSX_LOGGER.info("Done: Odin waiting for data")
338
- caput(pv.eiger_ODcapture, "Capture")
159
+ caput(pv.eiger_od_capture, "Capture")
339
160
  # If detector fails to arm first time can try twice with a sleep inbetween
340
161
  SSX_LOGGER.info("Arming Eiger")
341
162
  caput(pv.eiger_acquire, "1")
@@ -346,10 +167,10 @@ def eiger(action, args_list, dcm: DCM):
346
167
  # Send a trigger for every image. Records while TTL is high
347
168
  SSX_LOGGER.info("Eiger triggered")
348
169
  [filepath, filename, num_imgs, exptime] = args_list
349
- filename = filename + "_" + str(caget(pv.eiger_seqID))
350
- caput(pv.eiger_ODfilepath, filepath)
170
+ filename = filename + "_" + str(caget(pv.eiger_seq_id))
171
+ caput(pv.eiger_od_filepath, filepath)
351
172
  yield from bps.sleep(0.1)
352
- caput(pv.eiger_ODfilename, filename)
173
+ caput(pv.eiger_od_filename, filename)
353
174
  yield from bps.sleep(0.1)
354
175
  acqtime = float(exptime) - 0.0000001
355
176
  caput(pv.eiger_acquiretime, str(acqtime))
@@ -367,17 +188,17 @@ def eiger(action, args_list, dcm: DCM):
367
188
  yield from bps.sleep(1.0)
368
189
  # ODIN setup #
369
190
  SSX_LOGGER.info("Setting up Odin")
370
- caput(pv.eiger_ODfilename, filename)
371
- caput(pv.eiger_ODfilepath, filepath)
372
- caput(pv.eiger_ODnumcapture, str(num_imgs))
373
- caput(pv.eiger_ODfilepath, filepath)
191
+ caput(pv.eiger_od_filename, filename)
192
+ caput(pv.eiger_od_filepath, filepath)
193
+ caput(pv.eiger_od_num_capture, str(num_imgs))
194
+ caput(pv.eiger_od_filepath, filepath)
374
195
  eigerbdrbv = "UInt" + str(caget(pv.eiger_bitdepthrbv))
375
- caput(pv.eiger_ODdatatype, eigerbdrbv)
376
- caput(pv.eiger_ODcompress, "BSL24")
196
+ caput(pv.eiger_od_datatype, eigerbdrbv)
197
+ caput(pv.eiger_od_compress, "BSL24")
377
198
  yield from bps.sleep(1.0)
378
199
  # All done. Now get Odin to wait for data and start Eiger
379
200
  SSX_LOGGER.info("Done: Odin waiting for data")
380
- caput(pv.eiger_ODcapture, "Capture")
201
+ caput(pv.eiger_od_capture, "Capture")
381
202
  # If detector fails to arm first time can try twice with a sleep inbetween
382
203
  SSX_LOGGER.info("Arming Eiger")
383
204
  caput(pv.eiger_acquire, "1")
@@ -387,55 +208,7 @@ def eiger(action, args_list, dcm: DCM):
387
208
  # Put it all back to GDA acceptable defaults
388
209
  elif action == "return-to-normal":
389
210
  caput(pv.eiger_manualtrigger, "No")
390
- # caput(pv.eiger_seqID, int(caget(pv.eiger_seqID))+1)
211
+ # caput(pv.eiger_seq_id, int(caget(pv.eiger_seq_id))+1)
391
212
  SSX_LOGGER.debug("***** leaving Eiger")
392
213
  yield from bps.sleep(0.1)
393
214
  return 0
394
-
395
-
396
- def xspress3(action, args_list):
397
- SSX_LOGGER.debug("***** Entering xspress3")
398
- SSX_LOGGER.info(f"xspress3 - {action}")
399
- if args_list:
400
- for arg in args_list:
401
- SSX_LOGGER.debug(f"Argument: {arg}")
402
-
403
- if action == "stop-and-start":
404
- [exp_time, lo, hi] = args_list
405
- caput(pv.xsp3_triggermode, "Internal")
406
- caput(pv.xsp3_numimages, 1)
407
- caput(pv.xsp3_acquiretime, exp_time)
408
- caput(pv.xsp3_c1_mca_roi1_llm, lo)
409
- caput(pv.xsp3_c1_mca_roi1_hlm, hi)
410
- yield from bps.sleep(0.2)
411
- caput(pv.xsp3_c1_mca_roi1_llm, lo)
412
- caput(pv.xsp3_c1_mca_roi1_hlm, hi)
413
- yield from bps.sleep(0.2)
414
- caput(pv.xsp3_erase, 0)
415
-
416
- elif action == "on-the-fly":
417
- [num_frms, lo, hi] = args_list
418
- caput(pv.xsp3_triggermode, "TTL Veto Only")
419
- caput(pv.xsp3_numimages, num_frms)
420
- caput(pv.xsp3_c1_mca_roi1_llm, lo)
421
- caput(pv.xsp3_c1_mca_roi1_hlm, hi)
422
- yield from bps.sleep(0.2)
423
- caput(pv.xsp3_c1_mca_roi1_llm, lo)
424
- caput(pv.xsp3_c1_mca_roi1_hlm, hi)
425
- yield from bps.sleep(0.2)
426
- caput(pv.xsp3_erase, 0)
427
-
428
- elif action == "return-to-normal":
429
- caput(pv.xsp3_triggermode, "TTL Veto Only")
430
- caput(pv.xsp3_numimages, 1)
431
- caput(pv.xsp3_acquiretime, 1)
432
- caput(pv.xsp3_c1_mca_roi1_llm, 0)
433
- caput(pv.xsp3_c1_mca_roi1_hlm, 0)
434
- caput(pv.xsp3_erase, 0)
435
-
436
- else:
437
- SSX_LOGGER.error("Unknown action for xspress3 method:", action)
438
-
439
- yield from bps.sleep(0.1)
440
- SSX_LOGGER.debug("***** leaving xspress3")
441
- return 1
@@ -32,7 +32,7 @@ class DetRequest(IntEnum):
32
32
  return self.name
33
33
 
34
34
 
35
- class UnknownDetectorType(Exception):
35
+ class UnknownDetectorTypeError(Exception):
36
36
  pass
37
37
 
38
38
 
@@ -45,7 +45,7 @@ def get_detector_type(detector_stage: YZStage) -> Generator[Msg, None, Detector]
45
45
  return Eiger()
46
46
  else:
47
47
  SSX_LOGGER.error("Detector not found.")
48
- raise UnknownDetectorType("Detector not found.")
48
+ raise UnknownDetectorTypeError("Detector not found.")
49
49
 
50
50
 
51
51
  def _move_detector_stage(detector_stage: YZStage, target: float) -> MsgGenerator:
@@ -209,13 +209,13 @@ def setup_zebra_for_extruder_with_pump_probe_plan(
209
209
  yield from set_logic_gates_for_porto_triggering(zebra)
210
210
 
211
211
  # Set TTL out depending on detector type
212
- DET_TTL = TTL_EIGER
213
- LASER_TTL = TTL_LASER # may change with additional detectors
212
+ det_ttl = TTL_EIGER
213
+ laser_ttl = TTL_LASER # may change with additional detectors
214
214
  yield from bps.abs_set(
215
- zebra.output.out_pvs[DET_TTL], zebra.mapping.sources.AND4, group=group
215
+ zebra.output.out_pvs[det_ttl], zebra.mapping.sources.AND4, group=group
216
216
  )
217
217
  yield from bps.abs_set(
218
- zebra.output.out_pvs[LASER_TTL], zebra.mapping.sources.AND3, group=group
218
+ zebra.output.out_pvs[laser_ttl], zebra.mapping.sources.AND3, group=group
219
219
  )
220
220
 
221
221
  yield from bps.abs_set(
@@ -1,4 +1,5 @@
1
1
  # from collections.abc import Sequence
2
+ from datetime import datetime
2
3
  from typing import Literal
3
4
 
4
5
  import bluesky.plan_stubs as bps
@@ -6,6 +7,7 @@ import bluesky.preprocessors as bpp
6
7
  from bluesky.utils import MsgGenerator
7
8
  from dodal.beamlines import i24
8
9
  from dodal.common import inject
10
+ from dodal.devices.attenuator.attenuator import EnumFilterAttenuator
9
11
  from dodal.devices.hutch_shutter import HutchShutter
10
12
  from dodal.devices.i24.aperture import Aperture
11
13
  from dodal.devices.i24.beam_center import DetectorBeamCenter
@@ -19,15 +21,18 @@ from dodal.devices.oav.oav_detector import OAVBeamCentreFile
19
21
  from dodal.devices.zebra.zebra import Zebra
20
22
 
21
23
  from mx_bluesky.beamlines.i24.serial.dcid import DCID
24
+ from mx_bluesky.beamlines.i24.serial.extruder.i24ssx_extruder_collect_py3v2 import (
25
+ run_plan_in_wrapper as run_ex_collection_plan,
26
+ )
22
27
  from mx_bluesky.beamlines.i24.serial.fixed_target.ft_utils import (
23
28
  ChipType,
24
29
  MappingType,
25
30
  PumpProbeSetting,
26
31
  )
27
- from mx_bluesky.beamlines.i24.serial.fixed_target.i24ssx_Chip_Collect_py3v1 import (
28
- run_plan_in_wrapper,
32
+ from mx_bluesky.beamlines.i24.serial.fixed_target.i24ssx_chip_collect_py3v1 import (
33
+ run_plan_in_wrapper as run_ft_collection_plan,
29
34
  )
30
- from mx_bluesky.beamlines.i24.serial.fixed_target.i24ssx_Chip_Manager_py3v1 import (
35
+ from mx_bluesky.beamlines.i24.serial.fixed_target.i24ssx_chip_manager_py3v1 import (
31
36
  upload_chip_map_to_geobrick,
32
37
  )
33
38
  from mx_bluesky.beamlines.i24.serial.fixed_target.i24ssx_moveonclick import (
@@ -41,13 +46,15 @@ from mx_bluesky.beamlines.i24.serial.parameters import (
41
46
  FixedTargetParameters,
42
47
  get_chip_format,
43
48
  )
49
+ from mx_bluesky.beamlines.i24.serial.parameters.experiment_parameters import (
50
+ ExtruderParameters,
51
+ )
44
52
  from mx_bluesky.beamlines.i24.serial.parameters.utils import EmptyMapError
45
53
  from mx_bluesky.beamlines.i24.serial.setup_beamline import pv
46
54
  from mx_bluesky.beamlines.i24.serial.setup_beamline.ca import caput
47
55
  from mx_bluesky.beamlines.i24.serial.setup_beamline.pv_abstract import Eiger
48
56
  from mx_bluesky.beamlines.i24.serial.setup_beamline.setup_detector import (
49
57
  _move_detector_stage,
50
- get_detector_type,
51
58
  )
52
59
 
53
60
 
@@ -92,13 +99,6 @@ def gui_gonio_move_on_click(position_px: tuple[int, int]) -> MsgGenerator:
92
99
  yield from bps.mv(gonio.x, x_um / 1000, gonio.yh, y_um / 1000) # type: ignore
93
100
 
94
101
 
95
- # See https://github.com/DiamondLightSource/mx-bluesky/issues/853
96
- @bpp.run_decorator()
97
- def gui_sleep(sec: int) -> MsgGenerator:
98
- for _ in range(sec):
99
- yield from bps.sleep(1)
100
-
101
-
102
102
  @bpp.run_decorator()
103
103
  def gui_move_detector(
104
104
  det: Literal["eiger"],
@@ -111,6 +111,12 @@ def gui_move_detector(
111
111
  caput(pv.me14e_gp101, det)
112
112
 
113
113
 
114
+ @bpp.run_decorator()
115
+ def gui_set_fiducial_0(pmac: PMAC = inject("PMAC")) -> MsgGenerator:
116
+ SSX_LOGGER.debug("Set fiducial 0 to home string")
117
+ yield from bps.trigger(pmac.home, wait=True)
118
+
119
+
114
120
  @bpp.run_decorator()
115
121
  def gui_run_chip_collection(
116
122
  sub_dir: str,
@@ -137,8 +143,9 @@ def gui_run_chip_collection(
137
143
  dcm: DCM = inject("dcm"),
138
144
  mirrors: FocusMirrorsMode = inject("focus_mirrors"),
139
145
  beam_center_eiger: DetectorBeamCenter = inject("eiger_bc"),
146
+ attenuator: EnumFilterAttenuator = inject("attenuator"),
140
147
  ) -> MsgGenerator:
141
- """Set the parameter model for the data collection.
148
+ """Set the parameter model and run the data collection.
142
149
 
143
150
  Args:
144
151
  sub_dir (str): subdirectory of the visit to write data in.
@@ -166,7 +173,9 @@ def gui_run_chip_collection(
166
173
  """
167
174
  # NOTE still a work in progress, adding to it as the ui grows
168
175
  # See progression of https://github.com/DiamondLightSource/mx-daq-ui/issues/3
169
- det_type = yield from get_detector_type(detector_stage)
176
+ # get_detector_type temporarily disabled as pilatus went away, and for now only eiger in use
177
+ # for this.
178
+ # det_type = yield from get_detector_type(detector_stage)
170
179
  _format = chip_format if ChipType[chip_type] is ChipType.Custom else None
171
180
  chip_params = get_chip_format(ChipType[chip_type], _format)
172
181
  if ChipType[chip_type] in [ChipType.Oxford, ChipType.OxfordInner]:
@@ -179,13 +188,16 @@ def gui_run_chip_collection(
179
188
  mapping = MappingType.NoMap
180
189
  chip_map = []
181
190
 
191
+ # NOTE. For now setting attenuation here in place of the edms doing a caput
192
+ yield from bps.abs_set(attenuator, transmission, wait=True)
193
+
182
194
  params = {
183
195
  "visit": _read_visit_directory_from_file().as_posix(), # noqa
184
196
  "directory": sub_dir,
185
197
  "filename": chip_name,
186
198
  "exposure_time_s": exp_time,
187
199
  "detector_distance_mm": det_dist,
188
- "detector_name": str(det_type),
200
+ "detector_name": "eiger",
189
201
  "num_exposures": n_shots,
190
202
  "transmission": transmission,
191
203
  "chip": chip_params,
@@ -213,7 +225,7 @@ def gui_run_chip_collection(
213
225
  dcid = DCID(emit_errors=False, expt_params=parameters) # noqa
214
226
  SSX_LOGGER.info("DCID created")
215
227
 
216
- yield from run_plan_in_wrapper(
228
+ yield from run_ft_collection_plan(
217
229
  zebra,
218
230
  pmac,
219
231
  aperture,
@@ -227,3 +239,78 @@ def gui_run_chip_collection(
227
239
  parameters,
228
240
  dcid,
229
241
  )
242
+
243
+
244
+ @bpp.run_decorator()
245
+ def gui_run_extruder_collection(
246
+ sub_dir: str,
247
+ file_name: str,
248
+ exp_time: float,
249
+ det_dist: float,
250
+ transmission: float,
251
+ num_images: int,
252
+ pump_probe: bool,
253
+ laser_dwell: float,
254
+ laser_delay: float,
255
+ zebra: Zebra = inject("zebra"),
256
+ aperture: Aperture = inject("aperture"),
257
+ backlight: DualBacklight = inject("backlight"),
258
+ beamstop: Beamstop = inject("beamstop"),
259
+ detector_stage: YZStage = inject("detector_motion"),
260
+ shutter: HutchShutter = inject("shutter"),
261
+ dcm: DCM = inject("dcm"),
262
+ mirrors: FocusMirrorsMode = inject("focus_mirrors"),
263
+ attenuator: EnumFilterAttenuator = inject("attenuator"),
264
+ beam_center_eiger: DetectorBeamCenter = inject("eiger_bc"),
265
+ ):
266
+ """Set parameter model for extruder and run the data collection.
267
+ Args:
268
+ sub_dir (str): subdirectory of the visit to write data in.
269
+ file_name (str): filename to be used for the collection.
270
+ exp_time (float): exposure time of each image, in s.
271
+ det_dist (float): sample-detector distance, in mm.
272
+ transmission (float): requested beam intensity transmission, expressed as
273
+ a fraction, e.g. 0.3.
274
+ num_images (int): number of images be collected.
275
+ pump_probe (bool): pump probe setting.
276
+ laser_dwell (float): laser exposure time for pump probe collections, in s.
277
+ laser_delay (float): delay between laser exposure and collection, in s.
278
+ """
279
+ # NOTE. For now setting attenuation here in place of the edms doing a caput
280
+ yield from bps.abs_set(attenuator, transmission, wait=True)
281
+ start_time = datetime.now()
282
+ SSX_LOGGER.info(f"Collection start time: {start_time.ctime()}")
283
+
284
+ params = {
285
+ "visit": _read_visit_directory_from_file().as_posix(), # noqa
286
+ "directory": sub_dir,
287
+ "filename": file_name,
288
+ "exposure_time_s": exp_time,
289
+ "detector_distance_mm": det_dist,
290
+ "detector_name": "eiger",
291
+ "transmission": transmission,
292
+ "num_images": num_images,
293
+ "pump_status": pump_probe,
294
+ "laser_dwell_s": laser_dwell,
295
+ "laser_delay_s": laser_delay,
296
+ }
297
+ parameters = ExtruderParameters(**params)
298
+ # Create collection directory
299
+ parameters.collection_directory.mkdir(parents=True, exist_ok=True)
300
+ # DCID - not generated yet
301
+ dcid = DCID(emit_errors=False, expt_params=parameters)
302
+
303
+ yield from run_ex_collection_plan(
304
+ zebra,
305
+ aperture,
306
+ backlight,
307
+ beamstop,
308
+ detector_stage,
309
+ shutter,
310
+ dcm,
311
+ mirrors,
312
+ beam_center_eiger,
313
+ parameters,
314
+ dcid,
315
+ start_time,
316
+ )
@@ -37,7 +37,7 @@ def call_nexgen(
37
37
  Raises:
38
38
  ValueError: For a wrong experiment type passed (either unknown or not matched \
39
39
  to parameter model).
40
- HTTPError: For a problem with reponse from server
40
+ HTTPError: For a problem with response from server
41
41
 
42
42
  """
43
43
  current_chip_map = None
@@ -55,7 +55,7 @@ def call_nexgen(
55
55
  total_numb_imgs = parameters.num_images
56
56
  pump_status = parameters.pump_status
57
57
 
58
- filename_prefix = cagetstring(Eiger.pv.filenameRBV)
58
+ filename_prefix = cagetstring(Eiger.PV.filename_rbv)
59
59
  meta_h5 = parameters.visit / parameters.directory / f"{filename_prefix}_meta.h5"
60
60
  t0 = time.time()
61
61
  max_wait = 60 # seconds
@@ -71,7 +71,7 @@ def call_nexgen(
71
71
  SSX_LOGGER.warning(f"Giving up waiting for {meta_h5} after {max_wait} seconds")
72
72
  return
73
73
 
74
- bit_depth = int(caget(Eiger.pv.bit_depth))
74
+ bit_depth = int(caget(Eiger.PV.bit_depth))
75
75
  SSX_LOGGER.debug(
76
76
  f"Call to nexgen server with the following chip definition: \n{chip_prog_dict}"
77
77
  )
@@ -109,7 +109,7 @@ def submit_to_server(
109
109
  Raises:
110
110
  ValueError: For a wrong experiment type passed (either unknown or not matched \
111
111
  to parameter model).
112
- HTTPError: For a problem with reponse from server
112
+ HTTPError: For a problem with response from server
113
113
 
114
114
  """
115
115
  access_token = pathlib.Path("/scratch/ssx_nexgen.key").read_text().strip()
@@ -37,8 +37,8 @@ from mx_bluesky.common.parameters.constants import (
37
37
  from mx_bluesky.common.parameters.device_composites import FlyScanEssentialDevices
38
38
  from mx_bluesky.common.parameters.gridscan import SpecifiedThreeDGridScan
39
39
  from mx_bluesky.common.utils.exceptions import (
40
- CrystalNotFoundException,
41
- SampleException,
40
+ CrystalNotFoundError,
41
+ SampleError,
42
42
  )
43
43
  from mx_bluesky.common.utils.log import LOGGER
44
44
  from mx_bluesky.common.utils.tracing import TRACER
@@ -77,7 +77,7 @@ def generic_tidy(xrc_composite: FlyScanEssentialDevices, wait=True) -> MsgGenera
77
77
  yield from bps.wait(group)
78
78
 
79
79
 
80
- def construct_beamline_specific_FGS_features(
80
+ def construct_beamline_specific_fast_gridscan_features(
81
81
  setup_trigger_plan: Callable[..., MsgGenerator],
82
82
  tidy_plan: Callable[..., MsgGenerator],
83
83
  set_flyscan_params_plan: Callable[..., MsgGenerator],
@@ -235,7 +235,7 @@ def _fetch_xrc_results_from_zocalo(
235
235
  flyscan_results = [_generate_dummy_xrc_result(parameters)]
236
236
  else:
237
237
  LOGGER.warning("No X-ray centre received")
238
- raise CrystalNotFoundException()
238
+ raise CrystalNotFoundError()
239
239
  yield from _fire_xray_centre_result_event(flyscan_results)
240
240
 
241
241
 
@@ -276,7 +276,7 @@ def run_gridscan(
276
276
  yield from beamline_specific.set_flyscan_params_plan()
277
277
  except FailedStatus as e:
278
278
  if isinstance(e.__cause__, GridScanInvalidError):
279
- raise SampleException(
279
+ raise SampleError(
280
280
  "Scan invalid - gridscan not valid for detected pin position"
281
281
  ) from e
282
282
 
@@ -301,7 +301,7 @@ def run_gridscan(
301
301
  def _xrc_result_in_boxes_to_result_in_mm(
302
302
  xrc_result: XrcResult, parameters: SpecifiedThreeDGridScan
303
303
  ) -> XRayCentreResult:
304
- fgs_params = parameters.FGS_params
304
+ fgs_params = parameters.fast_gridscan_params
305
305
  xray_centre = fgs_params.grid_position_to_motor_position(
306
306
  np.array(xrc_result["centre_of_mass"])
307
307
  )
@@ -29,7 +29,7 @@ from mx_bluesky.common.experiment_plans.oav_grid_detection_plan import (
29
29
  grid_detection_plan,
30
30
  )
31
31
  from mx_bluesky.common.experiment_plans.oav_snapshot_plan import (
32
- setup_beamline_for_OAV,
32
+ setup_beamline_for_oav,
33
33
  )
34
34
  from mx_bluesky.common.external_interaction.callbacks.common.grid_detection_callback import (
35
35
  GridDetectionCallback,
@@ -123,7 +123,7 @@ def detect_grid_and_do_gridscan(
123
123
 
124
124
  grid_params_callback = GridDetectionCallback()
125
125
 
126
- yield from setup_beamline_for_OAV(
126
+ yield from setup_beamline_for_oav(
127
127
  composite.smargon,
128
128
  composite.backlight,
129
129
  composite.aperture_scatterguard,
@@ -46,7 +46,7 @@ def _wait_for_zocalo_to_stage_then_do_fgs(
46
46
  LOGGER.info("Waiting for Zocalo device queue to have been cleared...")
47
47
  yield from bps.wait(ZOCALO_STAGE_GROUP)
48
48
 
49
- # Triggers Zocalo if RE is subscribed to ZocaloCallback
49
+ # Triggers Zocalo if run_engine is subscribed to ZocaloCallback
50
50
  yield from read_hardware_for_zocalo(detector)
51
51
  LOGGER.info("Wait for all moves with no assigned group")
52
52
  yield from bps.wait()