mx-bluesky 1.5.3__py3-none-any.whl → 1.5.5__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) hide show
  1. mx_bluesky/_version.py +2 -2
  2. mx_bluesky/beamlines/aithre_lasershaping/__init__.py +2 -0
  3. mx_bluesky/beamlines/aithre_lasershaping/beamline_safe.py +17 -0
  4. mx_bluesky/beamlines/i04/__init__.py +6 -1
  5. mx_bluesky/beamlines/i04/experiment_plans/i04_grid_detect_then_xray_centre_plan.py +0 -8
  6. mx_bluesky/beamlines/i04/redis_to_murko_forwarder.py +2 -3
  7. mx_bluesky/beamlines/i04/thawing_plan.py +174 -60
  8. mx_bluesky/beamlines/i24/serial/blueapi_config.yaml +1 -1
  9. mx_bluesky/beamlines/i24/serial/dcid.py +4 -25
  10. mx_bluesky/beamlines/i24/serial/extruder/EX-gui-edm/DetStage.edl +4 -7
  11. mx_bluesky/beamlines/i24/serial/extruder/EX-gui-edm/DiamondExtruder-I24-py3v1.edl +5 -5
  12. mx_bluesky/beamlines/i24/serial/extruder/i24ssx_Extruder_Collect_py3v2.py +18 -107
  13. mx_bluesky/beamlines/i24/serial/fixed_target/FT-gui-edm/CustomChip_py3v1.edl +11 -11
  14. mx_bluesky/beamlines/i24/serial/fixed_target/FT-gui-edm/DetStage.edl +2 -5
  15. mx_bluesky/beamlines/i24/serial/fixed_target/FT-gui-edm/DiamondChipI24-py3v1.edl +80 -80
  16. mx_bluesky/beamlines/i24/serial/fixed_target/FT-gui-edm/ME14E-GeneralPurpose.edl +120 -120
  17. mx_bluesky/beamlines/i24/serial/fixed_target/FT-gui-edm/MappingLite-oxford_py3v1.edl +143 -143
  18. mx_bluesky/beamlines/i24/serial/fixed_target/FT-gui-edm/PMAC_Command.edl +2 -2
  19. mx_bluesky/beamlines/i24/serial/fixed_target/FT-gui-edm/Shutter_Control.edl +3 -3
  20. mx_bluesky/beamlines/i24/serial/fixed_target/FT-gui-edm/nudgechip.edl +24 -24
  21. mx_bluesky/beamlines/i24/serial/fixed_target/FT-gui-edm/pumpprobe-py3v1.edl +19 -19
  22. mx_bluesky/beamlines/i24/serial/fixed_target/i24ssx_Chip_Collect_py3v1.py +8 -92
  23. mx_bluesky/beamlines/i24/serial/fixed_target/i24ssx_Chip_Manager_py3v1.py +15 -30
  24. mx_bluesky/beamlines/i24/serial/fixed_target/i24ssx_moveonclick.py +10 -10
  25. mx_bluesky/beamlines/i24/serial/parameters/constants.py +0 -2
  26. mx_bluesky/beamlines/i24/serial/parameters/experiment_parameters.py +1 -6
  27. mx_bluesky/beamlines/i24/serial/parameters/fixed_target/cs/cs_maker.json +3 -3
  28. mx_bluesky/beamlines/i24/serial/parameters/utils.py +1 -1
  29. mx_bluesky/beamlines/i24/serial/run_extruder.sh +15 -0
  30. mx_bluesky/beamlines/i24/serial/run_fixed_target.sh +17 -0
  31. mx_bluesky/beamlines/i24/serial/set_visit_directory.sh +1 -1
  32. mx_bluesky/beamlines/i24/serial/setup_beamline/__init__.py +1 -2
  33. mx_bluesky/beamlines/i24/serial/setup_beamline/pv.py +142 -160
  34. mx_bluesky/beamlines/i24/serial/setup_beamline/pv_abstract.py +1 -30
  35. mx_bluesky/beamlines/i24/serial/setup_beamline/setup_beamline.py +0 -94
  36. mx_bluesky/beamlines/i24/serial/setup_beamline/setup_detector.py +4 -10
  37. mx_bluesky/beamlines/i24/serial/setup_beamline/setup_zebra_plans.py +12 -20
  38. mx_bluesky/beamlines/i24/serial/web_gui_plans/general_plans.py +4 -13
  39. mx_bluesky/beamlines/i24/serial/write_nexus.py +34 -9
  40. mx_bluesky/common/device_setup_plans/manipulate_sample.py +2 -2
  41. mx_bluesky/common/experiment_plans/common_grid_detect_then_xray_centre_plan.py +2 -2
  42. mx_bluesky/common/experiment_plans/inner_plans/udc_default_state.py +65 -0
  43. mx_bluesky/common/experiment_plans/oav_snapshot_plan.py +2 -2
  44. mx_bluesky/common/external_interaction/callbacks/common/grid_detection_callback.py +35 -17
  45. mx_bluesky/common/external_interaction/callbacks/common/ispyb_callback_base.py +1 -1
  46. mx_bluesky/common/external_interaction/callbacks/common/plan_reactive_callback.py +2 -2
  47. mx_bluesky/common/external_interaction/callbacks/sample_handling/sample_handling_callback.py +3 -2
  48. mx_bluesky/common/external_interaction/callbacks/xray_centre/ispyb_callback.py +2 -2
  49. mx_bluesky/common/external_interaction/callbacks/xray_centre/nexus_callback.py +2 -2
  50. mx_bluesky/common/parameters/constants.py +1 -0
  51. mx_bluesky/hyperion/baton_handler.py +50 -8
  52. mx_bluesky/hyperion/experiment_plans/load_centre_collect_full_plan.py +5 -1
  53. mx_bluesky/hyperion/experiment_plans/robot_load_and_change_energy.py +6 -2
  54. mx_bluesky/hyperion/external_interaction/alerting/constants.py +2 -7
  55. mx_bluesky/hyperion/external_interaction/callbacks/__main__.py +4 -0
  56. mx_bluesky/hyperion/external_interaction/callbacks/alert_on_container_change.py +54 -0
  57. mx_bluesky/hyperion/external_interaction/callbacks/rotation/ispyb_callback.py +2 -2
  58. {mx_bluesky-1.5.3.dist-info → mx_bluesky-1.5.5.dist-info}/METADATA +2 -2
  59. {mx_bluesky-1.5.3.dist-info → mx_bluesky-1.5.5.dist-info}/RECORD +63 -61
  60. {mx_bluesky-1.5.3.dist-info → mx_bluesky-1.5.5.dist-info}/WHEEL +0 -0
  61. {mx_bluesky-1.5.3.dist-info → mx_bluesky-1.5.5.dist-info}/entry_points.txt +0 -0
  62. {mx_bluesky-1.5.3.dist-info → mx_bluesky-1.5.5.dist-info}/licenses/LICENSE +0 -0
  63. {mx_bluesky-1.5.3.dist-info → mx_bluesky-1.5.5.dist-info}/top_level.txt +0 -0
@@ -4,7 +4,6 @@ This version changed to python3 March2020 by RLO
4
4
  """
5
5
 
6
6
  import json
7
- import re
8
7
  import sys
9
8
  from pathlib import Path
10
9
  from pprint import pformat
@@ -16,7 +15,7 @@ from dodal.common import inject
16
15
  from dodal.devices.attenuator.attenuator import ReadOnlyAttenuator
17
16
  from dodal.devices.i24.beamstop import Beamstop, BeamstopPositions
18
17
  from dodal.devices.i24.dual_backlight import BacklightPositions, DualBacklight
19
- from dodal.devices.i24.pmac import PMAC, EncReset, LaserSettings
18
+ from dodal.devices.i24.pmac import CS_STR, PMAC, EncReset, LaserSettings
20
19
  from dodal.devices.motors import YZStage
21
20
 
22
21
  from mx_bluesky.beamlines.i24.serial.fixed_target.ft_utils import (
@@ -40,7 +39,7 @@ from mx_bluesky.beamlines.i24.serial.parameters.constants import (
40
39
  PARAM_FILE_PATH_FT,
41
40
  PVAR_FILE_PATH,
42
41
  )
43
- from mx_bluesky.beamlines.i24.serial.setup_beamline import Pilatus, caget, caput, pv
42
+ from mx_bluesky.beamlines.i24.serial.setup_beamline import caget, caput, pv
44
43
  from mx_bluesky.beamlines.i24.serial.setup_beamline.setup_detector import (
45
44
  get_detector_type,
46
45
  )
@@ -96,15 +95,13 @@ def initialise_stages(
96
95
  yield from bps.abs_set(pmac.enc_reset, EncReset.ENC7, group=group)
97
96
  yield from bps.abs_set(pmac.enc_reset, EncReset.ENC8, group=group)
98
97
 
99
- caput(pv.pilat_cbftemplate, 0)
100
-
101
98
  yield from bps.sleep(0.1)
102
99
  SSX_LOGGER.info("Clearing General Purpose PVs 1-120")
103
100
  for i in range(4, 120):
104
101
  if i == 100:
105
102
  # Do not clear visit PV
106
103
  continue
107
- pvar = "ME14E-MO-IOC-01:GP" + str(i)
104
+ pvar = "BL24I-MO-IOC-01:GP" + str(i)
108
105
  caput(pvar, 0)
109
106
  sys.stdout.write(".")
110
107
  sys.stdout.flush()
@@ -151,19 +148,6 @@ def read_parameters(
151
148
  chip_map = []
152
149
  pump_repeat = int(caget(PUMP_REPEAT_PV))
153
150
 
154
- # If file name ends in a digit this causes processing/pilatus pain.
155
- # Append an underscore
156
- if isinstance(det_type, Pilatus):
157
- caput(pv.pilat_cbftemplate, 0)
158
- m = re.search(r"\d+$", filename)
159
- if m is not None:
160
- # Note for future reference. Appending underscore causes more hassle and
161
- # high probability of users accidentally overwriting data. Use a dash
162
- filename = filename + "-"
163
- SSX_LOGGER.debug(
164
- f"Requested filename ends in a number. Appended dash: {filename}"
165
- )
166
-
167
151
  transmission = yield from bps.rd(attenuator.actual_transmission)
168
152
 
169
153
  params_dict = {
@@ -457,14 +441,14 @@ def load_stock_map(map_choice: str = "clear") -> MsgGenerator:
457
441
 
458
442
  SSX_LOGGER.info("Clearing GP 10-74") # Actually 11-44
459
443
  for i in range(1, 65):
460
- pvar = "ME14E-MO-IOC-01:GP" + str(i + 10)
444
+ pvar = "BL24I-MO-IOC-01:GP" + str(i + 10)
461
445
  caput(pvar, 0)
462
446
  sys.stdout.write(".")
463
447
  sys.stdout.flush()
464
448
  SSX_LOGGER.info("Map cleared")
465
449
  SSX_LOGGER.info(f"Loading Map Choice {map_choice}")
466
450
  for i in map_dict[map_choice]:
467
- pvar = "ME14E-MO-IOC-01:GP" + str(i + 10)
451
+ pvar = "BL24I-MO-IOC-01:GP" + str(i + 10)
468
452
  caput(pvar, 1)
469
453
  SSX_LOGGER.debug("Load stock map done.")
470
454
  yield from bps.null()
@@ -529,7 +513,7 @@ def load_lite_map() -> MsgGenerator:
529
513
  block_name = entry[0]
530
514
  yesno = entry[1]
531
515
  block_num = block_dict[block_name]
532
- pvar = "ME14E-MO-IOC-01:GP" + str(int(block_num) + 10)
516
+ pvar = "BL24I-MO-IOC-01:GP" + str(int(block_num) + 10)
533
517
  SSX_LOGGER.info(f"Block: {block_name} \tScanned: {yesno} \tPVAR: {pvar}")
534
518
  SSX_LOGGER.debug("Load lite map done")
535
519
  yield from bps.null()
@@ -604,7 +588,6 @@ def laser_control(laser_setting: str, pmac: PMAC = inject("pmac")) -> MsgGenerat
604
588
  SSX_LOGGER.info("Laser 1 /BNC2 shutter is open")
605
589
  # Use M712 = 0 if triggering on falling edge. M712 =1 if on rising edge
606
590
  # Be sure to also change laser1off
607
- # caput(pv.me14e_pmac_str, ' M712=0 M711=1')
608
591
  yield from bps.abs_set(pmac.laser, LaserSettings.LASER_1_ON, wait=True)
609
592
 
610
593
  elif laser_setting == "laser1off":
@@ -845,7 +828,7 @@ def cs_maker(pmac: PMAC = inject("pmac")) -> MsgGenerator:
845
828
  yield from bps.sleep(2.5)
846
829
  SSX_LOGGER.debug(f"Chip_type is {chip_type}")
847
830
  if chip_type == 0:
848
- yield from bps.abs_set(pmac.pmac_string, "!x0.4y0.4", wait=True)
831
+ yield from bps.abs_set(pmac.pmac_string, f"{CS_STR}!x0.4y0.4", wait=True)
849
832
  yield from bps.sleep(2.5)
850
833
  yield from bps.trigger(pmac.home, wait=True)
851
834
  else:
@@ -856,9 +839,9 @@ def cs_maker(pmac: PMAC = inject("pmac")) -> MsgGenerator:
856
839
 
857
840
  def cs_reset(pmac: PMAC = inject("pmac")) -> MsgGenerator:
858
841
  """Used to clear CS when using Custom Chip"""
859
- cs1 = "#1->10000X+0Y+0Z"
860
- cs2 = "#2->+0X-10000Y+0Z"
861
- cs3 = "#3->0X+0Y-10000Z"
842
+ cs1 = "#5->10000X+0Y+0Z"
843
+ cs2 = "#6->+0X-10000Y+0Z"
844
+ cs3 = "#7->0X+0Y-10000Z"
862
845
  strg = "\n".join([cs1, cs2, cs3])
863
846
  print(strg)
864
847
  yield from set_pmac_strings_for_cs(pmac, {"cs1": cs1, "cs2": cs2, "cs3": cs3})
@@ -881,7 +864,7 @@ def set_pmac_strings_for_cs(pmac: PMAC, cs_str: dict):
881
864
 
882
865
  Note. On the PMAC the axes allocations are: #1 - X, #2 - Y, #3 - Z.
883
866
  """
884
- yield from bps.abs_set(pmac.pmac_string, "&2", wait=True)
867
+ yield from bps.abs_set(pmac.pmac_string, CS_STR, wait=True)
885
868
  yield from bps.abs_set(pmac.pmac_string, cs_str["cs1"], wait=True)
886
869
  yield from bps.abs_set(pmac.pmac_string, cs_str["cs2"], wait=True)
887
870
  yield from bps.abs_set(pmac.pmac_string, cs_str["cs3"], wait=True)
@@ -893,7 +876,7 @@ def pumpprobe_calc() -> MsgGenerator:
893
876
  SSX_LOGGER.info("Calculate and show exposure and dwell time for each option.")
894
877
  exptime = float(caget(pv.me14e_exptime))
895
878
  pumpexptime = float(caget(pv.me14e_gp103))
896
- movetime = 0.008
879
+ movetime = 0.014
897
880
  SSX_LOGGER.info(f"X-ray exposure time {exptime}")
898
881
  SSX_LOGGER.info(f"Laser dwell time {pumpexptime}")
899
882
  repeat1 = 2 * 20 * (movetime + (pumpexptime + exptime) / 2)
@@ -941,7 +924,9 @@ def block_check(pmac: PMAC = inject("pmac")) -> MsgGenerator:
941
924
  break
942
925
  block, x, y = entry
943
926
  SSX_LOGGER.debug(f"Block: {block} -> (x={x} y={y})")
944
- yield from bps.abs_set(pmac.pmac_string, f"!x{x}y{y}", wait=True)
927
+ yield from bps.abs_set(
928
+ pmac.pmac_string, f"{CS_STR}!x{x}y{y}", wait=True
929
+ )
945
930
  yield from bps.sleep(0.4)
946
931
  else:
947
932
  SSX_LOGGER.warning("Block Check Aborted due to GP 9 not equalling 0")
@@ -59,8 +59,8 @@ def _move_on_mouse_click_plan(
59
59
  SSX_LOGGER.info(f"Zoom calibrator {zoomcalibrator}")
60
60
  SSX_LOGGER.info(f"Beam centre {beamX} {beamY}")
61
61
  SSX_LOGGER.info(f"Moving X and Y {xmove} {ymove}")
62
- xmovepmacstring = "#1J:" + str(xmove)
63
- ymovepmacstring = "#2J:" + str(ymove)
62
+ xmovepmacstring = "&2#5J:" + str(xmove)
63
+ ymovepmacstring = "&2#6J:" + str(ymove)
64
64
  yield from bps.abs_set(pmac.pmac_string, xmovepmacstring, wait=True)
65
65
  yield from bps.abs_set(pmac.pmac_string, ymovepmacstring, wait=True)
66
66
 
@@ -195,21 +195,21 @@ def start_viewer(oav: OAV, pmac: PMAC, RE: RunEngine, oav1: str = OAV1_CAM):
195
195
  manager.block_check()
196
196
  ) # doesn't work well for blockcheck as image doesn't update
197
197
  if k == 104: # H
198
- RE(bps.abs_set(pmac.pmac_string, "#2J:-10", wait=True))
198
+ RE(bps.abs_set(pmac.pmac_string, "&2#6J:-10", wait=True))
199
199
  if k == 110: # N
200
- RE(bps.abs_set(pmac.pmac_string, "#2J:10", wait=True))
200
+ RE(bps.abs_set(pmac.pmac_string, "&2#6J:10", wait=True))
201
201
  if k == 109: # M
202
- RE(bps.abs_set(pmac.pmac_string, "#1J:-10", wait=True))
202
+ RE(bps.abs_set(pmac.pmac_string, "&2#5J:-10", wait=True))
203
203
  if k == 98: # B
204
- RE(bps.abs_set(pmac.pmac_string, "#1J:10", wait=True))
204
+ RE(bps.abs_set(pmac.pmac_string, "&2#5J:10", wait=True))
205
205
  if k == 105: # I
206
- RE(bps.abs_set(pmac.pmac_string, "#3J:-150", wait=True))
206
+ RE(bps.abs_set(pmac.pmac_string, "&2#7J:-150", wait=True))
207
207
  if k == 111: # O
208
- RE(bps.abs_set(pmac.pmac_string, "#3J:150", wait=True))
208
+ RE(bps.abs_set(pmac.pmac_string, "&2#7J:150", wait=True))
209
209
  if k == 117: # U
210
- RE(bps.abs_set(pmac.pmac_string, "#3J:-1000", wait=True))
210
+ RE(bps.abs_set(pmac.pmac_string, "&2#7J:-1000", wait=True))
211
211
  if k == 112: # P
212
- RE(bps.abs_set(pmac.pmac_string, "#3J:1000", wait=True))
212
+ RE(bps.abs_set(pmac.pmac_string, "&2#7J:1000", wait=True))
213
213
  if k == 0x1B: # esc
214
214
  cv.destroyWindow("OAV1view")
215
215
  print("Pressed escape. Closing window")
@@ -12,7 +12,6 @@ class SSXType(StrEnum):
12
12
 
13
13
  class DetectorName(StrEnum):
14
14
  EIGER = "eiger"
15
- PILATUS = "pilatus"
16
15
 
17
16
 
18
17
  # TODO figue sth out for tests
@@ -20,7 +19,6 @@ LUT_FILES_PATH = Path("/dls_sw/i24/software/daq_configuration/lookup")
20
19
 
21
20
  BEAM_CENTER_LUT_FILES = {
22
21
  DetectorName.EIGER: LUT_FILES_PATH / "DetDistToBeamXYConverterE9M.txt",
23
- DetectorName.PILATUS: LUT_FILES_PATH / "DetDistToBeamXYConverterP6M.txt",
24
22
  }
25
23
 
26
24
 
@@ -5,7 +5,6 @@ from pathlib import Path
5
5
  import numpy as np
6
6
  from dodal.devices.detector.det_dim_constants import (
7
7
  EIGER2_X_9M_SIZE,
8
- PILATUS_6M_SIZE,
9
8
  DetectorSizeConstants,
10
9
  )
11
10
  from pydantic import BaseModel, ConfigDict, computed_field, field_validator
@@ -46,11 +45,7 @@ class SerialExperiment(BaseModel):
46
45
 
47
46
  @property
48
47
  def detector_size_constants(self) -> DetectorSizeConstants:
49
- return (
50
- EIGER2_X_9M_SIZE
51
- if self.detector_name is DetectorName.EIGER
52
- else PILATUS_6M_SIZE
53
- )
48
+ return EIGER2_X_9M_SIZE
54
49
 
55
50
 
56
51
  class LaserExperiment(BaseModel):
@@ -1,8 +1,8 @@
1
1
  {
2
- "scalex": 10004.7,
3
- "scaley": 10004.4,
2
+ "scalex": 10006.4,
3
+ "scaley": 10011.9,
4
4
  "scalez": 10000.0,
5
- "skew": 0.120,
5
+ "skew": 0.025,
6
6
  "Sx_dir": 1,
7
7
  "Sy_dir": 1,
8
8
  "Sz_dir": 1
@@ -7,7 +7,7 @@ from mx_bluesky.beamlines.i24.serial.parameters.experiment_parameters import (
7
7
  )
8
8
  from mx_bluesky.beamlines.i24.serial.setup_beamline import caget, pv
9
9
 
10
- OXFORD_BLOCKS_PVS = [f"ME14E-MO-IOC-01:GP{i}" for i in range(11, 75)]
10
+ OXFORD_BLOCKS_PVS = [f"BL24I-MO-IOC-01:GP{i}" for i in range(11, 75)]
11
11
 
12
12
 
13
13
  class EmptyMapError(Exception):
@@ -9,6 +9,21 @@ case "$2" in
9
9
  ;;
10
10
  esac
11
11
 
12
+ # Get visit from PV and set the instrument session thet will be read by the edms
13
+ # Hack to make the blueapi CLI happy as the client now requires an instrument session
14
+ # on every POST request. For the command line, that means a -i $INSTRUMENT_SESSION
15
+ visit_pv=BL24I-MO-IOC-13:GP1
16
+ visit=$(echo "$(caget -S $visit_pv)" | awk '{print $NF}')
17
+ session=${visit##$visit_pv}
18
+ echo $session
19
+
20
+ if [[ -z "$session" ]]; then
21
+ # if PV is empty print error message and exit
22
+ echo "The visit PV has not been set, please contact beamline staff"
23
+ exit 1
24
+ fi
25
+
26
+ export INSTRUMENT_SESSION=$session
12
27
 
13
28
  # Get edm path from input
14
29
  edm_path=$1
@@ -9,6 +9,23 @@ case "$2" in
9
9
  ;;
10
10
  esac
11
11
 
12
+ # Get visit from PV and set the instrument session thet will be read by the edms
13
+ # Hack to make the blueapi CLI happy as the client now requires an instrument session
14
+ # on every POST request. For the command line, that means a -i $INSTRUMENT_SESSION
15
+ visit_pv=BL24I-MO-IOC-13:GP100
16
+ # visit=$(caget -S $ft_pv)
17
+ visit=$(echo "$(caget -S $visit_pv)" | awk '{print $NF}')
18
+ session=${visit##$visit_pv}
19
+ echo $session
20
+
21
+ if [[ -z "$session" ]]; then
22
+ # if PV is empty print error message and exit
23
+ echo "The visit PV has not been set, please contact beamline staff"
24
+ exit 1
25
+ fi
26
+
27
+ export INSTRUMENT_SESSION=$session
28
+
12
29
  # Get edm path from input
13
30
  edm_path=$1
14
31
 
@@ -36,7 +36,7 @@ if [[ "${visit: -1}" != "/" ]]; then
36
36
  fi
37
37
 
38
38
  ex_pv=BL24I-MO-IOC-13:GP1
39
- ft_pv=ME14E-MO-IOC-01:GP100
39
+ ft_pv=BL24I-MO-IOC-13:GP100
40
40
 
41
41
  shopt -s nocasematch
42
42
 
@@ -1,6 +1,6 @@
1
1
  from . import pv, setup_beamline
2
2
  from .ca import caget, cagetstring, caput
3
- from .pv_abstract import Detector, Eiger, Pilatus
3
+ from .pv_abstract import Detector, Eiger
4
4
 
5
5
  __all__ = [
6
6
  "caget",
@@ -8,7 +8,6 @@ __all__ = [
8
8
  "caput",
9
9
  "Detector",
10
10
  "Eiger",
11
- "Pilatus",
12
11
  "pv",
13
12
  "setup_beamline",
14
13
  ]