mx-bluesky 1.5.2__py3-none-any.whl → 1.5.4__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 (64) hide show
  1. mx_bluesky/_version.py +16 -3
  2. mx_bluesky/beamlines/aithre_lasershaping/__init__.py +2 -0
  3. mx_bluesky/beamlines/aithre_lasershaping/beamline_safe.py +17 -0
  4. mx_bluesky/beamlines/i04/__init__.py +7 -3
  5. mx_bluesky/beamlines/i04/experiment_plans/i04_grid_detect_then_xray_centre_plan.py +3 -8
  6. mx_bluesky/beamlines/i04/thawing_plan.py +3 -3
  7. mx_bluesky/beamlines/i24/serial/blueapi_config.yaml +2 -2
  8. mx_bluesky/beamlines/i24/serial/fixed_target/FT-gui-edm/CustomChip_py3v1.edl +10 -10
  9. mx_bluesky/beamlines/i24/serial/fixed_target/FT-gui-edm/DetStage.edl +1 -1
  10. mx_bluesky/beamlines/i24/serial/fixed_target/FT-gui-edm/DiamondChipI24-py3v1.edl +68 -68
  11. mx_bluesky/beamlines/i24/serial/fixed_target/FT-gui-edm/ME14E-GeneralPurpose.edl +120 -120
  12. mx_bluesky/beamlines/i24/serial/fixed_target/FT-gui-edm/MappingLite-oxford_py3v1.edl +135 -135
  13. mx_bluesky/beamlines/i24/serial/fixed_target/FT-gui-edm/PMAC_Command.edl +2 -2
  14. mx_bluesky/beamlines/i24/serial/fixed_target/FT-gui-edm/Shutter_Control.edl +3 -3
  15. mx_bluesky/beamlines/i24/serial/fixed_target/FT-gui-edm/nudgechip.edl +24 -24
  16. mx_bluesky/beamlines/i24/serial/fixed_target/FT-gui-edm/pumpprobe-py3v1.edl +12 -12
  17. mx_bluesky/beamlines/i24/serial/fixed_target/i24ssx_Chip_Manager_py3v1.py +13 -12
  18. mx_bluesky/beamlines/i24/serial/fixed_target/i24ssx_moveonclick.py +10 -10
  19. mx_bluesky/beamlines/i24/serial/parameters/utils.py +1 -1
  20. mx_bluesky/beamlines/i24/serial/set_visit_directory.sh +1 -1
  21. mx_bluesky/beamlines/i24/serial/setup_beamline/pv.py +142 -135
  22. mx_bluesky/common/device_setup_plans/manipulate_sample.py +2 -2
  23. mx_bluesky/common/experiment_plans/common_grid_detect_then_xray_centre_plan.py +2 -2
  24. mx_bluesky/common/experiment_plans/inner_plans/udc_default_state.py +65 -0
  25. mx_bluesky/common/experiment_plans/oav_grid_detection_plan.py +12 -2
  26. mx_bluesky/common/experiment_plans/oav_snapshot_plan.py +2 -2
  27. mx_bluesky/common/external_interaction/alerting/__init__.py +13 -0
  28. mx_bluesky/common/external_interaction/alerting/_service.py +82 -0
  29. mx_bluesky/common/external_interaction/alerting/log_based_service.py +57 -0
  30. mx_bluesky/common/external_interaction/callbacks/common/grid_detection_callback.py +35 -17
  31. mx_bluesky/common/external_interaction/callbacks/sample_handling/sample_handling_callback.py +31 -6
  32. mx_bluesky/common/external_interaction/config_server.py +151 -54
  33. mx_bluesky/common/parameters/constants.py +27 -8
  34. mx_bluesky/common/parameters/gridscan.py +1 -1
  35. mx_bluesky/hyperion/__main__.py +50 -178
  36. mx_bluesky/hyperion/baton_handler.py +130 -69
  37. mx_bluesky/hyperion/device_setup_plans/dcm_pitch_roll_mirror_adjuster.py +29 -24
  38. mx_bluesky/hyperion/experiment_plans/hyperion_flyscan_xray_centre_plan.py +4 -1
  39. mx_bluesky/hyperion/experiment_plans/load_centre_collect_full_plan.py +17 -5
  40. mx_bluesky/hyperion/experiment_plans/pin_tip_centring_plan.py +1 -1
  41. mx_bluesky/hyperion/experiment_plans/robot_load_and_change_energy.py +6 -2
  42. mx_bluesky/hyperion/experiment_plans/rotation_scan_plan.py +2 -3
  43. mx_bluesky/hyperion/external_interaction/agamemnon.py +128 -73
  44. mx_bluesky/hyperion/external_interaction/alerting/__init__.py +0 -0
  45. mx_bluesky/hyperion/external_interaction/alerting/constants.py +12 -0
  46. mx_bluesky/hyperion/external_interaction/callbacks/__main__.py +9 -0
  47. mx_bluesky/hyperion/external_interaction/callbacks/alert_on_container_change.py +54 -0
  48. mx_bluesky/hyperion/external_interaction/callbacks/rotation/nexus_callback.py +2 -2
  49. mx_bluesky/hyperion/external_interaction/config_server.py +12 -31
  50. mx_bluesky/hyperion/parameters/cli.py +15 -3
  51. mx_bluesky/hyperion/parameters/components.py +7 -5
  52. mx_bluesky/hyperion/parameters/constants.py +20 -4
  53. mx_bluesky/hyperion/parameters/gridscan.py +22 -14
  54. mx_bluesky/hyperion/parameters/load_centre_collect.py +1 -14
  55. mx_bluesky/hyperion/parameters/robot_load.py +1 -4
  56. mx_bluesky/hyperion/parameters/rotation.py +1 -2
  57. mx_bluesky/hyperion/plan_runner.py +78 -0
  58. mx_bluesky/hyperion/runner.py +189 -0
  59. {mx_bluesky-1.5.2.dist-info → mx_bluesky-1.5.4.dist-info}/METADATA +4 -3
  60. {mx_bluesky-1.5.2.dist-info → mx_bluesky-1.5.4.dist-info}/RECORD +64 -55
  61. {mx_bluesky-1.5.2.dist-info → mx_bluesky-1.5.4.dist-info}/entry_points.txt +0 -2
  62. {mx_bluesky-1.5.2.dist-info → mx_bluesky-1.5.4.dist-info}/WHEEL +0 -0
  63. {mx_bluesky-1.5.2.dist-info → mx_bluesky-1.5.4.dist-info}/licenses/LICENSE +0 -0
  64. {mx_bluesky-1.5.2.dist-info → mx_bluesky-1.5.4.dist-info}/top_level.txt +0 -0
@@ -246,17 +246,21 @@ det_z = "BL24I-EA-DET-01:Z"
246
246
  # Fast grid diagnostics
247
247
  pmc_gridstatus = "BL24I-MO-STEP-10:signal:P2401"
248
248
  pmc_gridcounter = "BL24I-MO-STEP-10:signal:P2402"
249
+
249
250
  # PMAC Strings
250
251
  step08_pmac_str = "BL24I-MO-IOC-08:ASYN8.AOUT"
251
252
  step09_pmac_str = "BL24I-MO-IOC-09:ASYN9.AOUT"
252
253
  step10_pmac_str = "BL24I-MO-IOC-10:ASYN10.AOUT"
253
254
  step11_pmac_str = "BL24I-MO-IOC-11:ASYN11.AOUT"
254
255
  step12_pmac_str = "BL24I-MO-IOC-12:ASYN12.AOUT"
256
+ step13_pmac_str = "BL24I-MO-IOC-13:PMAC:console"
255
257
  step08_pmac_response = "BL24I-MO-IOC-08:ASYN8.AINP"
256
258
  step09_pmac_response = "BL24I-MO-IOC-09:ASYN9.AINP"
257
259
  step10_pmac_response = "BL24I-MO-IOC-10:ASYN10.AINP"
258
260
  step11_pmac_response = "BL24I-MO-IOC-11:ASYN11.AINP"
259
261
  step12_pmac_response = "BL24I-MO-IOC-12:ASYN12.AINP"
262
+ step13_pmac_response = "BL24I-MO-IOC-13:PMAC:console_RBV"
263
+
260
264
  # General Purpose PV. Now use STEP13
261
265
  ioc13_gp1 = "BL24I-MO-IOC-13:GP1"
262
266
  ioc13_gp2 = "BL24I-MO-IOC-13:GP2"
@@ -273,138 +277,141 @@ ioc13_gp12 = "BL24I-MO-IOC-13:GP12"
273
277
  ioc13_gp13 = "BL24I-MO-IOC-13:GP13"
274
278
  ioc13_gp14 = "BL24I-MO-IOC-13:GP14"
275
279
  ioc13_gp15 = "BL24I-MO-IOC-13:GP15"
276
- # ME14E
277
- me14e_pmac_str = "ME14E-MO-CHIP-01:PMAC_STRING"
278
- me14e_stage_x = "ME14E-MO-CHIP-01:X"
279
- me14e_stage_y = "ME14E-MO-CHIP-01:Y"
280
- me14e_stage_z = "ME14E-MO-CHIP-01:Z"
281
- me14e_filter = "ME14E-MO-CHIP-01:FILTER"
282
- me14e_filepath = "ME14E-MO-CHIP-01:filePath"
283
- me14e_chip_name = "ME14E-MO-CHIP-01:chipName"
284
- me14e_chipcapacity = "ME14E-MO-CHIP-01:chipCapacity"
285
- me14e_blockcapacity = "ME14E-MO-CHIP-01:blockCapacity"
286
- me14e_exptime = "ME14E-MO-CHIP-01:expTime"
287
- me14e_dcdetdist = "ME14E-MO-CHIP-01:detDistance"
288
- me14e_scanstatus = "BL24I-MO-STEP-14:signal:P2401"
289
- me14e_counter = "BL24I-MO-STEP-14:signal:P2402"
290
- # ME14E General Purpose PV
291
- me14e_gp1 = "ME14E-MO-IOC-01:GP1"
292
- me14e_gp2 = "ME14E-MO-IOC-01:GP2"
293
- me14e_gp3 = "ME14E-MO-IOC-01:GP3"
294
- me14e_gp4 = "ME14E-MO-IOC-01:GP4"
295
- me14e_gp5 = "ME14E-MO-IOC-01:GP5"
296
- me14e_gp6 = "ME14E-MO-IOC-01:GP6"
297
- me14e_gp7 = "ME14E-MO-IOC-01:GP7"
298
- me14e_gp8 = "ME14E-MO-IOC-01:GP8"
299
- me14e_gp9 = "ME14E-MO-IOC-01:GP9"
300
- me14e_gp10 = "ME14E-MO-IOC-01:GP10"
301
- me14e_gp11 = "ME14E-MO-IOC-01:GP11"
302
- me14e_gp12 = "ME14E-MO-IOC-01:GP12"
303
- me14e_gp13 = "ME14E-MO-IOC-01:GP13"
304
- me14e_gp14 = "ME14E-MO-IOC-01:GP14"
305
- me14e_gp15 = "ME14E-MO-IOC-01:GP15"
306
- me14e_gp16 = "ME14E-MO-IOC-01:GP16"
307
- me14e_gp17 = "ME14E-MO-IOC-01:GP17"
308
- me14e_gp18 = "ME14E-MO-IOC-01:GP18"
309
- me14e_gp19 = "ME14E-MO-IOC-01:GP19"
310
- me14e_gp20 = "ME14E-MO-IOC-01:GP20"
311
- me14e_gp21 = "ME14E-MO-IOC-01:GP21"
312
- me14e_gp22 = "ME14E-MO-IOC-01:GP22"
313
- me14e_gp23 = "ME14E-MO-IOC-01:GP23"
314
- me14e_gp24 = "ME14E-MO-IOC-01:GP24"
315
- me14e_gp25 = "ME14E-MO-IOC-01:GP25"
316
- me14e_gp26 = "ME14E-MO-IOC-01:GP26"
317
- me14e_gp27 = "ME14E-MO-IOC-01:GP27"
318
- me14e_gp28 = "ME14E-MO-IOC-01:GP28"
319
- me14e_gp29 = "ME14E-MO-IOC-01:GP29"
320
- me14e_gp30 = "ME14E-MO-IOC-01:GP30"
321
- me14e_gp31 = "ME14E-MO-IOC-01:GP31"
322
- me14e_gp32 = "ME14E-MO-IOC-01:GP32"
323
- me14e_gp33 = "ME14E-MO-IOC-01:GP33"
324
- me14e_gp34 = "ME14E-MO-IOC-01:GP34"
325
- me14e_gp35 = "ME14E-MO-IOC-01:GP35"
326
- me14e_gp36 = "ME14E-MO-IOC-01:GP36"
327
- me14e_gp37 = "ME14E-MO-IOC-01:GP37"
328
- me14e_gp38 = "ME14E-MO-IOC-01:GP38"
329
- me14e_gp39 = "ME14E-MO-IOC-01:GP39"
330
- me14e_gp40 = "ME14E-MO-IOC-01:GP40"
331
- me14e_gp41 = "ME14E-MO-IOC-01:GP41"
332
- me14e_gp42 = "ME14E-MO-IOC-01:GP42"
333
- me14e_gp43 = "ME14E-MO-IOC-01:GP43"
334
- me14e_gp44 = "ME14E-MO-IOC-01:GP44"
335
- me14e_gp45 = "ME14E-MO-IOC-01:GP45"
336
- me14e_gp46 = "ME14E-MO-IOC-01:GP46"
337
- me14e_gp47 = "ME14E-MO-IOC-01:GP47"
338
- me14e_gp48 = "ME14E-MO-IOC-01:GP48"
339
- me14e_gp49 = "ME14E-MO-IOC-01:GP49"
340
- me14e_gp50 = "ME14E-MO-IOC-01:GP50"
341
- me14e_gp51 = "ME14E-MO-IOC-01:GP51"
342
- me14e_gp52 = "ME14E-MO-IOC-01:GP52"
343
- me14e_gp53 = "ME14E-MO-IOC-01:GP53"
344
- me14e_gp54 = "ME14E-MO-IOC-01:GP54"
345
- me14e_gp55 = "ME14E-MO-IOC-01:GP55"
346
- me14e_gp56 = "ME14E-MO-IOC-01:GP56"
347
- me14e_gp57 = "ME14E-MO-IOC-01:GP57"
348
- me14e_gp58 = "ME14E-MO-IOC-01:GP58"
349
- me14e_gp59 = "ME14E-MO-IOC-01:GP59"
350
- me14e_gp60 = "ME14E-MO-IOC-01:GP60"
351
- me14e_gp61 = "ME14E-MO-IOC-01:GP61"
352
- me14e_gp62 = "ME14E-MO-IOC-01:GP62"
353
- me14e_gp63 = "ME14E-MO-IOC-01:GP63"
354
- me14e_gp64 = "ME14E-MO-IOC-01:GP64"
355
- me14e_gp65 = "ME14E-MO-IOC-01:GP65"
356
- me14e_gp66 = "ME14E-MO-IOC-01:GP66"
357
- me14e_gp67 = "ME14E-MO-IOC-01:GP67"
358
- me14e_gp68 = "ME14E-MO-IOC-01:GP68"
359
- me14e_gp69 = "ME14E-MO-IOC-01:GP69"
360
- me14e_gp70 = "ME14E-MO-IOC-01:GP70"
361
- me14e_gp71 = "ME14E-MO-IOC-01:GP71"
362
- me14e_gp72 = "ME14E-MO-IOC-01:GP72"
363
- me14e_gp73 = "ME14E-MO-IOC-01:GP73"
364
- me14e_gp74 = "ME14E-MO-IOC-01:GP74"
365
- me14e_gp75 = "ME14E-MO-IOC-01:GP75"
366
- me14e_gp76 = "ME14E-MO-IOC-01:GP76"
367
- me14e_gp77 = "ME14E-MO-IOC-01:GP77"
368
- me14e_gp78 = "ME14E-MO-IOC-01:GP78"
369
- me14e_gp79 = "ME14E-MO-IOC-01:GP79"
370
- me14e_gp80 = "ME14E-MO-IOC-01:GP80"
371
- me14e_gp81 = "ME14E-MO-IOC-01:GP81"
372
- me14e_gp82 = "ME14E-MO-IOC-01:GP82"
373
- me14e_gp83 = "ME14E-MO-IOC-01:GP83"
374
- me14e_gp84 = "ME14E-MO-IOC-01:GP84"
375
- me14e_gp85 = "ME14E-MO-IOC-01:GP85"
376
- me14e_gp86 = "ME14E-MO-IOC-01:GP86"
377
- me14e_gp87 = "ME14E-MO-IOC-01:GP87"
378
- me14e_gp88 = "ME14E-MO-IOC-01:GP88"
379
- me14e_gp89 = "ME14E-MO-IOC-01:GP89"
380
- me14e_gp90 = "ME14E-MO-IOC-01:GP90"
381
- me14e_gp91 = "ME14E-MO-IOC-01:GP91"
382
- me14e_gp92 = "ME14E-MO-IOC-01:GP92"
383
- me14e_gp93 = "ME14E-MO-IOC-01:GP93"
384
- me14e_gp94 = "ME14E-MO-IOC-01:GP94"
385
- me14e_gp95 = "ME14E-MO-IOC-01:GP95"
386
- me14e_gp96 = "ME14E-MO-IOC-01:GP96"
387
- me14e_gp97 = "ME14E-MO-IOC-01:GP97"
388
- me14e_gp98 = "ME14E-MO-IOC-01:GP98"
389
- me14e_gp99 = "ME14E-MO-IOC-01:GP99"
390
- me14e_gp100 = "ME14E-MO-IOC-01:GP100"
391
- me14e_gp101 = "ME14E-MO-IOC-01:GP101" # Detector in use
392
- me14e_gp102 = "ME14E-MO-IOC-01:GP102"
393
- me14e_gp103 = "ME14E-MO-IOC-01:GP103"
394
- me14e_gp104 = "ME14E-MO-IOC-01:GP104"
395
- me14e_gp105 = "ME14E-MO-IOC-01:GP105"
396
- me14e_gp106 = "ME14E-MO-IOC-01:GP106"
397
- me14e_gp107 = "ME14E-MO-IOC-01:GP107"
398
- me14e_gp108 = "ME14E-MO-IOC-01:GP108"
399
- me14e_gp109 = "ME14E-MO-IOC-01:GP109"
400
- me14e_gp110 = "ME14E-MO-IOC-01:GP110"
401
- me14e_gp111 = "ME14E-MO-IOC-01:GP111"
402
- me14e_gp112 = "ME14E-MO-IOC-01:GP112"
403
- me14e_gp113 = "ME14E-MO-IOC-01:GP113"
404
- me14e_gp114 = "ME14E-MO-IOC-01:GP114"
405
- me14e_gp115 = "ME14E-MO-IOC-01:GP115"
406
- me14e_gp116 = "ME14E-MO-IOC-01:GP116"
407
- me14e_gp117 = "ME14E-MO-IOC-01:GP117"
408
- me14e_gp118 = "ME14E-MO-IOC-01:GP118"
409
- me14e_gp119 = "ME14E-MO-IOC-01:GP119"
410
- me14e_gp120 = "ME14E-MO-IOC-01:GP120"
280
+
281
+ # BL24I beamline-specific labelled PVs
282
+ me14e_filter = "BL24I-EA-CHIP-01:FILTER" # to check
283
+ me14e_filepath = "BL24I-MO-CHIP-01:filePath"
284
+ me14e_chip_name = "BL24I-MO-CHIP-01:chipName"
285
+ me14e_chipcapacity = "BL24I-MO-CHIP-01:chipCapacity"
286
+ me14e_blockcapacity = "BL24I-MO-CHIP-01:blockCapacity"
287
+ me14e_exptime = "BL24I-MO-CHIP-01:expTime"
288
+ me14e_dcdetdist = "BL24I-MO-CHIP-01:detDistance"
289
+
290
+ # STEP-13 chip motion
291
+ ioc13_filepath = "BL24I-MO-CHIP-01:filePath"
292
+ ioc13_chip_name = "BL24I-MO-CHIP-01:chipName"
293
+ ioc13_chipcapacity = "BL24I-MO-CHIP-01:chipCapacity"
294
+ ioc13_blockcapacity = "BL24I-MO-CHIP-01:blockCapacity"
295
+ ioc13_exptime = "BL24I-MO-CHIP-01:expTime"
296
+ ioc13_dcdetdist = "BL24I-MO-CHIP-01:detDistance"
297
+
298
+ me14e_gp1 = "BL24I-MO-IOC-13:GP1"
299
+ me14e_gp2 = "BL24I-MO-IOC-13:GP2"
300
+ me14e_gp3 = "BL24I-MO-IOC-13:GP3"
301
+ me14e_gp4 = "BL24I-MO-IOC-13:GP4"
302
+ me14e_gp5 = "BL24I-MO-IOC-13:GP5"
303
+ me14e_gp6 = "BL24I-MO-IOC-13:GP6"
304
+ me14e_gp7 = "BL24I-MO-IOC-13:GP7"
305
+ me14e_gp8 = "BL24I-MO-IOC-13:GP8"
306
+ me14e_gp9 = "BL24I-MO-IOC-13:GP9"
307
+ me14e_gp10 = "BL24I-MO-IOC-13:GP10"
308
+ me14e_gp11 = "BL24I-MO-IOC-13:GP11"
309
+ me14e_gp12 = "BL24I-MO-IOC-13:GP12"
310
+ me14e_gp13 = "BL24I-MO-IOC-13:GP13"
311
+ me14e_gp14 = "BL24I-MO-IOC-13:GP14"
312
+ me14e_gp15 = "BL24I-MO-IOC-13:GP15"
313
+ me14e_gp16 = "BL24I-MO-IOC-13:GP16"
314
+ me14e_gp17 = "BL24I-MO-IOC-13:GP17"
315
+ me14e_gp18 = "BL24I-MO-IOC-13:GP18"
316
+ me14e_gp19 = "BL24I-MO-IOC-13:GP19"
317
+ me14e_gp20 = "BL24I-MO-IOC-13:GP20"
318
+ me14e_gp21 = "BL24I-MO-IOC-13:GP21"
319
+ me14e_gp22 = "BL24I-MO-IOC-13:GP22"
320
+ me14e_gp23 = "BL24I-MO-IOC-13:GP23"
321
+ me14e_gp24 = "BL24I-MO-IOC-13:GP24"
322
+ me14e_gp25 = "BL24I-MO-IOC-13:GP25"
323
+ me14e_gp26 = "BL24I-MO-IOC-13:GP26"
324
+ me14e_gp27 = "BL24I-MO-IOC-13:GP27"
325
+ me14e_gp28 = "BL24I-MO-IOC-13:GP28"
326
+ me14e_gp29 = "BL24I-MO-IOC-13:GP29"
327
+ me14e_gp30 = "BL24I-MO-IOC-13:GP30"
328
+ me14e_gp31 = "BL24I-MO-IOC-13:GP31"
329
+ me14e_gp32 = "BL24I-MO-IOC-13:GP32"
330
+ me14e_gp33 = "BL24I-MO-IOC-13:GP33"
331
+ me14e_gp34 = "BL24I-MO-IOC-13:GP34"
332
+ me14e_gp35 = "BL24I-MO-IOC-13:GP35"
333
+ me14e_gp36 = "BL24I-MO-IOC-13:GP36"
334
+ me14e_gp37 = "BL24I-MO-IOC-13:GP37"
335
+ me14e_gp38 = "BL24I-MO-IOC-13:GP38"
336
+ me14e_gp39 = "BL24I-MO-IOC-13:GP39"
337
+ me14e_gp40 = "BL24I-MO-IOC-13:GP40"
338
+ me14e_gp41 = "BL24I-MO-IOC-13:GP41"
339
+ me14e_gp42 = "BL24I-MO-IOC-13:GP42"
340
+ me14e_gp43 = "BL24I-MO-IOC-13:GP43"
341
+ me14e_gp44 = "BL24I-MO-IOC-13:GP44"
342
+ me14e_gp45 = "BL24I-MO-IOC-13:GP45"
343
+ me14e_gp46 = "BL24I-MO-IOC-13:GP46"
344
+ me14e_gp47 = "BL24I-MO-IOC-13:GP47"
345
+ me14e_gp48 = "BL24I-MO-IOC-13:GP48"
346
+ me14e_gp49 = "BL24I-MO-IOC-13:GP49"
347
+ me14e_gp50 = "BL24I-MO-IOC-13:GP50"
348
+ me14e_gp51 = "BL24I-MO-IOC-13:GP51"
349
+ me14e_gp52 = "BL24I-MO-IOC-13:GP52"
350
+ me14e_gp53 = "BL24I-MO-IOC-13:GP53"
351
+ me14e_gp54 = "BL24I-MO-IOC-13:GP54"
352
+ me14e_gp55 = "BL24I-MO-IOC-13:GP55"
353
+ me14e_gp56 = "BL24I-MO-IOC-13:GP56"
354
+ me14e_gp57 = "BL24I-MO-IOC-13:GP57"
355
+ me14e_gp58 = "BL24I-MO-IOC-13:GP58"
356
+ me14e_gp59 = "BL24I-MO-IOC-13:GP59"
357
+ me14e_gp60 = "BL24I-MO-IOC-13:GP60"
358
+ me14e_gp61 = "BL24I-MO-IOC-13:GP61"
359
+ me14e_gp62 = "BL24I-MO-IOC-13:GP62"
360
+ me14e_gp63 = "BL24I-MO-IOC-13:GP63"
361
+ me14e_gp64 = "BL24I-MO-IOC-13:GP64"
362
+ me14e_gp65 = "BL24I-MO-IOC-13:GP65"
363
+ me14e_gp66 = "BL24I-MO-IOC-13:GP66"
364
+ me14e_gp67 = "BL24I-MO-IOC-13:GP67"
365
+ me14e_gp68 = "BL24I-MO-IOC-13:GP68"
366
+ me14e_gp69 = "BL24I-MO-IOC-13:GP69"
367
+ me14e_gp70 = "BL24I-MO-IOC-13:GP70"
368
+ me14e_gp71 = "BL24I-MO-IOC-13:GP71"
369
+ me14e_gp72 = "BL24I-MO-IOC-13:GP72"
370
+ me14e_gp73 = "BL24I-MO-IOC-13:GP73"
371
+ me14e_gp74 = "BL24I-MO-IOC-13:GP74"
372
+ me14e_gp75 = "BL24I-MO-IOC-13:GP75"
373
+ me14e_gp76 = "BL24I-MO-IOC-13:GP76"
374
+ me14e_gp77 = "BL24I-MO-IOC-13:GP77"
375
+ me14e_gp78 = "BL24I-MO-IOC-13:GP78"
376
+ me14e_gp79 = "BL24I-MO-IOC-13:GP79"
377
+ me14e_gp80 = "BL24I-MO-IOC-13:GP80"
378
+ me14e_gp81 = "BL24I-MO-IOC-13:GP81"
379
+ me14e_gp82 = "BL24I-MO-IOC-13:GP82"
380
+ me14e_gp83 = "BL24I-MO-IOC-13:GP83"
381
+ me14e_gp84 = "BL24I-MO-IOC-13:GP84"
382
+ me14e_gp85 = "BL24I-MO-IOC-13:GP85"
383
+ me14e_gp86 = "BL24I-MO-IOC-13:GP86"
384
+ me14e_gp87 = "BL24I-MO-IOC-13:GP87"
385
+ me14e_gp88 = "BL24I-MO-IOC-13:GP88"
386
+ me14e_gp89 = "BL24I-MO-IOC-13:GP89"
387
+ me14e_gp90 = "BL24I-MO-IOC-13:GP90"
388
+ me14e_gp91 = "BL24I-MO-IOC-13:GP91"
389
+ me14e_gp92 = "BL24I-MO-IOC-13:GP92"
390
+ me14e_gp93 = "BL24I-MO-IOC-13:GP93"
391
+ me14e_gp94 = "BL24I-MO-IOC-13:GP94"
392
+ me14e_gp95 = "BL24I-MO-IOC-13:GP95"
393
+ me14e_gp96 = "BL24I-MO-IOC-13:GP96"
394
+ me14e_gp97 = "BL24I-MO-IOC-13:GP97"
395
+ me14e_gp98 = "BL24I-MO-IOC-13:GP98"
396
+ me14e_gp99 = "BL24I-MO-IOC-13:GP99"
397
+ me14e_gp100 = "BL24I-MO-IOC-13:GP100"
398
+ me14e_gp101 = "BL24I-MO-IOC-13:GP101" # Detector in use
399
+ me14e_gp102 = "BL24I-MO-IOC-13:GP102"
400
+ me14e_gp103 = "BL24I-MO-IOC-13:GP103"
401
+ me14e_gp104 = "BL24I-MO-IOC-13:GP104"
402
+ me14e_gp105 = "BL24I-MO-IOC-13:GP105"
403
+ me14e_gp106 = "BL24I-MO-IOC-13:GP106"
404
+ me14e_gp107 = "BL24I-MO-IOC-13:GP107"
405
+ me14e_gp108 = "BL24I-MO-IOC-13:GP108"
406
+ me14e_gp109 = "BL24I-MO-IOC-13:GP109"
407
+ me14e_gp110 = "BL24I-MO-IOC-13:GP110"
408
+ me14e_gp111 = "BL24I-MO-IOC-13:GP111"
409
+ me14e_gp112 = "BL24I-MO-IOC-13:GP112"
410
+ me14e_gp113 = "BL24I-MO-IOC-13:GP113"
411
+ me14e_gp114 = "BL24I-MO-IOC-13:GP114"
412
+ me14e_gp115 = "BL24I-MO-IOC-13:GP115"
413
+ me14e_gp116 = "BL24I-MO-IOC-13:GP116"
414
+ me14e_gp117 = "BL24I-MO-IOC-13:GP117"
415
+ me14e_gp118 = "BL24I-MO-IOC-13:GP118"
416
+ me14e_gp119 = "BL24I-MO-IOC-13:GP119"
417
+ me14e_gp120 = "BL24I-MO-IOC-13:GP120"
@@ -5,7 +5,7 @@ from dodal.devices.aperturescatterguard import (
5
5
  ApertureScatterguard,
6
6
  ApertureValue,
7
7
  )
8
- from dodal.devices.backlight import Backlight, BacklightPosition
8
+ from dodal.devices.backlight import Backlight, InOut
9
9
  from dodal.devices.detector.detector_motion import DetectorMotion
10
10
  from dodal.devices.smargon import CombinedMove, Smargon
11
11
 
@@ -22,7 +22,7 @@ def setup_sample_environment(
22
22
  group="setup_senv",
23
23
  ):
24
24
  """Move the aperture into required position, move out the backlight."""
25
- yield from bps.abs_set(backlight, BacklightPosition.OUT, group=group)
25
+ yield from bps.abs_set(backlight, InOut.OUT, group=group)
26
26
 
27
27
  aperture_value = (
28
28
  None
@@ -7,7 +7,7 @@ from bluesky import plan_stubs as bps
7
7
  from bluesky import preprocessors as bpp
8
8
  from bluesky.preprocessors import subs_decorator
9
9
  from bluesky.utils import MsgGenerator
10
- from dodal.devices.backlight import BacklightPosition
10
+ from dodal.devices.backlight import InOut
11
11
  from dodal.devices.eiger import EigerDetector
12
12
  from dodal.devices.oav.oav_parameters import OAVParameters
13
13
 
@@ -168,7 +168,7 @@ def detect_grid_and_do_gridscan(
168
168
 
169
169
  yield from bps.abs_set(
170
170
  composite.backlight,
171
- BacklightPosition.OUT,
171
+ InOut.OUT,
172
172
  group=PlanGroupCheckpointConstants.GRID_READY_FOR_DC,
173
173
  )
174
174
 
@@ -0,0 +1,65 @@
1
+ import bluesky.plan_stubs as bps
2
+ import pydantic
3
+ from dodal.devices.aperturescatterguard import ApertureScatterguard, ApertureValue
4
+ from dodal.devices.collimation_table import CollimationTable
5
+ from dodal.devices.cryostream import CryoStream
6
+ from dodal.devices.cryostream import InOut as CryoInOut
7
+ from dodal.devices.fluorescence_detector_motion import (
8
+ FluorescenceDetector,
9
+ )
10
+ from dodal.devices.fluorescence_detector_motion import InOut as FlouInOut
11
+ from dodal.devices.mx_phase1.beamstop import Beamstop, BeamstopPositions
12
+ from dodal.devices.scintillator import InOut as ScinInOut
13
+ from dodal.devices.scintillator import Scintillator
14
+
15
+
16
+ @pydantic.dataclasses.dataclass(config={"arbitrary_types_allowed": True})
17
+ class UDCDefaultDevices:
18
+ cryostream: CryoStream
19
+ fluorescence_det_motion: FluorescenceDetector
20
+ beamstop: Beamstop
21
+ scintillator: Scintillator
22
+ aperture_scatterguard: ApertureScatterguard
23
+ collimation_table: CollimationTable
24
+
25
+
26
+ def move_to_udc_default_state(devices: UDCDefaultDevices):
27
+ """Moves beamline to known positions prior to UDC start"""
28
+
29
+ cryostream_temp = yield from bps.rd(devices.cryostream.temperature_k)
30
+ cryostream_pressure = yield from bps.rd(devices.cryostream.back_pressure_bar)
31
+ if cryostream_temp > devices.cryostream.MAX_TEMP_K:
32
+ raise ValueError("Cryostream temperature is too high, not starting UDC")
33
+ if cryostream_pressure > devices.cryostream.MAX_PRESSURE_BAR:
34
+ raise ValueError("Cryostream back pressure is too high, not starting UDC")
35
+
36
+ yield from bps.abs_set(devices.scintillator.selected_pos, ScinInOut.OUT, wait=True)
37
+
38
+ yield from bps.abs_set(
39
+ devices.fluorescence_det_motion.pos, FlouInOut.OUT, group="udc_default"
40
+ )
41
+
42
+ yield from bps.abs_set(devices.collimation_table.inboard_y, 0, group="udc_default")
43
+ yield from bps.abs_set(devices.collimation_table.outboard_y, 0, group="udc_default")
44
+ yield from bps.abs_set(devices.collimation_table.upstream_y, 0, group="udc_default")
45
+ yield from bps.abs_set(devices.collimation_table.upstream_x, 0, group="udc_default")
46
+ yield from bps.abs_set(
47
+ devices.collimation_table.downstream_x, 0, group="udc_default"
48
+ )
49
+
50
+ yield from bps.abs_set(
51
+ devices.beamstop.selected_pos,
52
+ BeamstopPositions.DATA_COLLECTION,
53
+ group="udc_default",
54
+ )
55
+
56
+ yield from bps.abs_set(
57
+ devices.aperture_scatterguard.selected_aperture,
58
+ ApertureValue.SMALL,
59
+ group="udc_default",
60
+ )
61
+
62
+ yield from bps.abs_set(devices.cryostream.course, CryoInOut.IN, group="udc_default")
63
+ yield from bps.abs_set(devices.cryostream.fine, CryoInOut.IN, group="udc_default")
64
+
65
+ yield from bps.wait("udc_default")
@@ -6,6 +6,7 @@ from typing import TYPE_CHECKING
6
6
  import bluesky.plan_stubs as bps
7
7
  import numpy as np
8
8
  from blueapi.core import BlueskyContext
9
+ from bluesky.utils import MsgGenerator
9
10
  from dodal.devices.oav.oav_detector import OAV
10
11
  from dodal.devices.oav.pin_image_recognition import PinTipDetection
11
12
  from dodal.devices.oav.pin_image_recognition.utils import NONE_VALUE
@@ -49,6 +50,16 @@ def get_min_and_max_y_of_pin(
49
50
  return min_y, max_y
50
51
 
51
52
 
53
+ def optimum_grid_detect_angles(smargon: Smargon) -> MsgGenerator[list[float]]:
54
+ """We need to match the 0 and -90 that the fast grid scan performs but the order in
55
+ which we do the grid detection does not matter so we do the closest angle first."""
56
+ current_omega = yield from bps.rd(smargon.omega)
57
+ if current_omega < -45:
58
+ return [-90, 0]
59
+ else:
60
+ return [0, -90]
61
+
62
+
52
63
  def grid_detection_plan(
53
64
  composite: OavGridDetectionComposite,
54
65
  parameters: OAVParameters,
@@ -90,8 +101,7 @@ def grid_detection_plan(
90
101
 
91
102
  grid_width_pixels = int(grid_width_microns / microns_per_pixel_x)
92
103
 
93
- # The FGS uses -90 so we need to match it
94
- for angle in [0, -90]:
104
+ for angle in (yield from optimum_grid_detect_angles(smargon)):
95
105
  yield from bps.mv(smargon.omega, angle)
96
106
  # need to wait for the OAV image to update
97
107
  # See #673 for improvements
@@ -4,7 +4,7 @@ from typing import Protocol
4
4
  from bluesky import plan_stubs as bps
5
5
  from bluesky.utils import MsgGenerator
6
6
  from dodal.devices.aperturescatterguard import ApertureScatterguard, ApertureValue
7
- from dodal.devices.backlight import Backlight, BacklightPosition
7
+ from dodal.devices.backlight import Backlight, InOut
8
8
  from dodal.devices.oav.oav_detector import OAV
9
9
  from dodal.devices.oav.oav_parameters import OAVParameters
10
10
  from dodal.devices.smargon import Smargon
@@ -36,7 +36,7 @@ def setup_beamline_for_OAV(
36
36
  ):
37
37
  max_vel = yield from bps.rd(smargon.omega.max_velocity)
38
38
  yield from bps.abs_set(smargon.omega.velocity, max_vel, group=group)
39
- yield from bps.abs_set(backlight, BacklightPosition.IN, group=group)
39
+ yield from bps.abs_set(backlight, InOut.IN, group=group)
40
40
  yield from bps.abs_set(
41
41
  aperture_scatterguard.selected_aperture, ApertureValue.OUT_OF_BEAM, group=group
42
42
  )
@@ -0,0 +1,13 @@
1
+ from mx_bluesky.common.external_interaction.alerting._service import (
2
+ AlertService,
3
+ Metadata,
4
+ get_alerting_service,
5
+ set_alerting_service,
6
+ )
7
+
8
+ __all__ = [
9
+ "AlertService",
10
+ "Metadata",
11
+ "get_alerting_service",
12
+ "set_alerting_service",
13
+ ]
@@ -0,0 +1,82 @@
1
+ from datetime import UTC, datetime, timedelta
2
+ from enum import StrEnum
3
+ from typing import Protocol
4
+ from urllib.parse import quote, urlencode
5
+
6
+
7
+ class Metadata(StrEnum):
8
+ """Metadata fields that can be specified by the caller when raising an alert."""
9
+
10
+ CONTAINER = "container"
11
+ SAMPLE_ID = "sample_id"
12
+ VISIT = "visit"
13
+
14
+
15
+ class ExtraMetadata(StrEnum):
16
+ """Additional metadata fields that are automatically appended by
17
+ the AlertService implementations."""
18
+
19
+ ALERT_CONTENT = "alert_content"
20
+ ALERT_SUMMARY = "alert_summary"
21
+ BEAMLINE = "beamline"
22
+ GRAYLOG_URL = "graylog_url"
23
+ ISPYB_URL = "ispyb_url"
24
+ PROPOSAL = "proposal"
25
+
26
+
27
+ class AlertService(Protocol):
28
+ """
29
+ Implemented by any backend that provides the ability to dispatch alerts to some
30
+ service that is capable of disseminating them via any of a variety of media such
31
+ as email, SMS, instant messaging, etc etc.
32
+ """
33
+
34
+ def raise_alert(self, summary: str, content: str, metadata: dict[Metadata, str]):
35
+ """
36
+ Raise an alert that will be forwarded to beamline support staff, which might
37
+ for example be used as the basis for an incident in an incident reporting system.
38
+ Args:
39
+ summary: One line summary of the alert, that might for instance be used
40
+ in an email subject line.
41
+ content: Plain text content detailing the nature of the incident.
42
+ metadata: A dict of strings that can be included as metadata in the alert for
43
+ those backends that support it. The summary and content will be included
44
+ by default.
45
+ """
46
+ pass
47
+
48
+
49
+ _alert_service: AlertService
50
+
51
+
52
+ def get_alerting_service() -> AlertService:
53
+ """Get the alert service for this instance."""
54
+ return _alert_service
55
+
56
+
57
+ def set_alerting_service(service: AlertService):
58
+ """Set the alert service for this instance, call when the beamline is initialised."""
59
+ global _alert_service
60
+ _alert_service = service
61
+
62
+
63
+ def ispyb_url(sample_id: str):
64
+ return f"https://ispyb.diamond.ac.uk/samples/sid/{quote(sample_id)}"
65
+
66
+
67
+ def graylog_url(stream_id: str):
68
+ now = datetime.now(UTC)
69
+ from_utc = now - timedelta(minutes=5)
70
+ from_timestamp = from_utc.isoformat()
71
+ # Add 1 second for graylog timing jitter
72
+ to_utc = now + timedelta(seconds=1)
73
+ to_timestamp = to_utc.isoformat()
74
+ query_string = urlencode(
75
+ {
76
+ "streams": stream_id,
77
+ "rangetype": "absolute",
78
+ "from": from_timestamp,
79
+ "to": to_timestamp,
80
+ }
81
+ )
82
+ return "https://graylog.diamond.ac.uk/search?" + query_string
@@ -0,0 +1,57 @@
1
+ import logging
2
+ from typing import cast
3
+
4
+ from dodal.log import LOGGER
5
+ from dodal.utils import get_beamline_name
6
+
7
+ from mx_bluesky.common.external_interaction.alerting import Metadata
8
+ from mx_bluesky.common.external_interaction.alerting._service import (
9
+ ExtraMetadata,
10
+ graylog_url,
11
+ ispyb_url,
12
+ )
13
+ from mx_bluesky.common.external_interaction.callbacks.common.ispyb_mapping import (
14
+ get_proposal_and_session_from_visit_string,
15
+ )
16
+
17
+
18
+ class LoggingAlertService:
19
+ """
20
+ Implement an alert service that raises alerts by generating a specially formatted
21
+ log message, that may be intercepted by a logging service such as graylog and
22
+ used to dispatch the alert.
23
+ """
24
+
25
+ def __init__(self, graylog_stream_id: str, level=logging.WARNING):
26
+ """
27
+ Create a new instance of the service
28
+ Args:
29
+ level: The python logging level at which to generate the message
30
+ """
31
+ super().__init__()
32
+ self._level = level
33
+ self._graylog_stream_id = graylog_stream_id
34
+
35
+ def _append_extra_metadata(self, metadata: dict[Metadata, str]) -> dict[str, str]:
36
+ with_extras = cast(dict, metadata.copy())
37
+ with_extras[ExtraMetadata.GRAYLOG_URL] = graylog_url(self._graylog_stream_id)
38
+ with_extras[ExtraMetadata.BEAMLINE] = get_beamline_name("")
39
+ if sample_id := metadata.get(Metadata.SAMPLE_ID, None):
40
+ with_extras[ExtraMetadata.ISPYB_URL] = ispyb_url(sample_id)
41
+ if visit := metadata.get(Metadata.VISIT, None):
42
+ proposal, _ = get_proposal_and_session_from_visit_string(visit)
43
+ with_extras[ExtraMetadata.PROPOSAL] = proposal
44
+ return with_extras
45
+
46
+ def raise_alert(self, summary: str, content: str, metadata: dict[Metadata, str]):
47
+ message = f"***ALERT*** summary={summary} content={content}"
48
+ with_extras = self._append_extra_metadata(metadata)
49
+ LOGGER.log(
50
+ self._level,
51
+ message,
52
+ extra={
53
+ ExtraMetadata.ALERT_SUMMARY: summary,
54
+ ExtraMetadata.ALERT_CONTENT: content,
55
+ }
56
+ | with_extras,
57
+ )