mx-bluesky 1.4.8__py3-none-any.whl → 1.5.0__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.
- mx_bluesky/_version.py +2 -2
- mx_bluesky/beamlines/aithre_lasershaping/__init__.py +8 -0
- mx_bluesky/beamlines/aithre_lasershaping/beamline_safe.py +36 -0
- mx_bluesky/beamlines/aithre_lasershaping/goniometer_controls.py +43 -0
- mx_bluesky/beamlines/i24/serial/__init__.py +4 -2
- mx_bluesky/beamlines/i24/serial/blueapi_config.yaml +6 -1
- mx_bluesky/beamlines/i24/serial/dcid.py +5 -5
- mx_bluesky/beamlines/i24/serial/extruder/EX-gui-edm/DetStage.edl +2 -2
- mx_bluesky/beamlines/i24/serial/extruder/EX-gui-edm/DiamondExtruder-I24-py3v1.edl +9 -9
- mx_bluesky/beamlines/i24/serial/extruder/i24ssx_Extruder_Collect_py3v2.py +18 -3
- mx_bluesky/beamlines/i24/serial/fixed_target/FT-gui-edm/DetStage.edl +2 -2
- mx_bluesky/beamlines/i24/serial/fixed_target/FT-gui-edm/DiamondChipI24-py3v1.edl +14 -14
- mx_bluesky/beamlines/i24/serial/fixed_target/FT-gui-edm/pumpprobe-py3v1.edl +2 -2
- mx_bluesky/beamlines/i24/serial/fixed_target/i24ssx_Chip_Collect_py3v1.py +55 -4
- mx_bluesky/beamlines/i24/serial/fixed_target/i24ssx_Chip_Manager_py3v1.py +9 -2
- mx_bluesky/beamlines/i24/serial/setup_beamline/setup_beamline.py +0 -8
- mx_bluesky/beamlines/i24/serial/web_gui_plans/general_plans.py +77 -8
- mx_bluesky/common/device_setup_plans/manipulate_sample.py +9 -14
- mx_bluesky/common/device_setup_plans/utils.py +49 -0
- mx_bluesky/common/{plans → experiment_plans}/common_flyscan_xray_centre_plan.py +11 -19
- mx_bluesky/{hyperion/experiment_plans/grid_detect_then_xray_centre_plan.py → common/experiment_plans/common_grid_detect_then_xray_centre_plan.py} +108 -126
- mx_bluesky/common/{plans → experiment_plans}/inner_plans/do_fgs.py +1 -1
- mx_bluesky/common/experiment_plans/oav_grid_detection_plan.py +5 -13
- mx_bluesky/{hyperion → common}/experiment_plans/oav_snapshot_plan.py +8 -2
- mx_bluesky/common/external_interaction/nexus/nexus_utils.py +2 -2
- mx_bluesky/common/parameters/components.py +1 -1
- mx_bluesky/common/parameters/device_composites.py +65 -0
- mx_bluesky/common/utils/__init__.py +0 -0
- mx_bluesky/common/utils/log.py +12 -11
- mx_bluesky/hyperion/__main__.py +6 -11
- mx_bluesky/hyperion/baton_handler.py +8 -3
- mx_bluesky/hyperion/device_setup_plans/smargon.py +2 -7
- mx_bluesky/hyperion/device_setup_plans/utils.py +0 -47
- mx_bluesky/hyperion/experiment_plans/__init__.py +5 -5
- mx_bluesky/hyperion/experiment_plans/experiment_registry.py +6 -7
- mx_bluesky/hyperion/experiment_plans/hyperion_flyscan_xray_centre_plan.py +40 -41
- mx_bluesky/hyperion/experiment_plans/hyperion_grid_detect_then_xray_centre_plan.py +60 -0
- mx_bluesky/hyperion/experiment_plans/load_centre_collect_full_plan.py +40 -10
- mx_bluesky/hyperion/experiment_plans/pin_centre_then_xray_centre_plan.py +26 -15
- mx_bluesky/hyperion/experiment_plans/robot_load_and_change_energy.py +2 -11
- mx_bluesky/hyperion/experiment_plans/robot_load_then_centre_plan.py +8 -6
- mx_bluesky/hyperion/experiment_plans/rotation_scan_plan.py +33 -36
- mx_bluesky/hyperion/external_interaction/agamemnon.py +68 -62
- mx_bluesky/hyperion/external_interaction/callbacks/__main__.py +1 -1
- mx_bluesky/hyperion/external_interaction/callbacks/rotation/ispyb_callback.py +3 -3
- mx_bluesky/hyperion/external_interaction/callbacks/rotation/ispyb_mapping.py +6 -3
- mx_bluesky/hyperion/external_interaction/callbacks/rotation/nexus_callback.py +2 -2
- mx_bluesky/hyperion/external_interaction/config_server.py +4 -1
- mx_bluesky/hyperion/parameters/cli.py +3 -10
- mx_bluesky/hyperion/parameters/constants.py +1 -1
- mx_bluesky/hyperion/parameters/device_composites.py +5 -27
- mx_bluesky/hyperion/parameters/load_centre_collect.py +4 -4
- mx_bluesky/hyperion/parameters/rotation.py +9 -8
- mx_bluesky/hyperion/utils/context.py +5 -2
- mx_bluesky/hyperion/utils/validation.py +11 -18
- {mx_bluesky-1.4.8.dist-info → mx_bluesky-1.5.0.dist-info}/METADATA +5 -5
- {mx_bluesky-1.4.8.dist-info → mx_bluesky-1.5.0.dist-info}/RECORD +65 -62
- {mx_bluesky-1.4.8.dist-info → mx_bluesky-1.5.0.dist-info}/WHEEL +1 -1
- mx_bluesky/common/device_setup_plans/check_beamstop.py +0 -27
- mx_bluesky/common/external_interaction/test_config_server.py +0 -38
- /mx_bluesky/common/{plans → experiment_plans}/__init__.py +0 -0
- /mx_bluesky/common/{plans → experiment_plans}/inner_plans/__init__ .py +0 -0
- /mx_bluesky/common/{plans → experiment_plans}/read_hardware.py +0 -0
- /mx_bluesky/common/{plans → experiment_plans}/write_sample_status.py +0 -0
- {mx_bluesky-1.4.8.dist-info → mx_bluesky-1.5.0.dist-info}/entry_points.txt +0 -0
- {mx_bluesky-1.4.8.dist-info → mx_bluesky-1.5.0.dist-info}/licenses/LICENSE +0 -0
- {mx_bluesky-1.4.8.dist-info → mx_bluesky-1.5.0.dist-info}/top_level.txt +0 -0
mx_bluesky/_version.py
CHANGED
|
@@ -1,13 +1,21 @@
|
|
|
1
|
+
from mx_bluesky.beamlines.aithre_lasershaping.beamline_safe import (
|
|
2
|
+
set_beamline_safe_on_robot,
|
|
3
|
+
)
|
|
1
4
|
from mx_bluesky.beamlines.aithre_lasershaping.check_goniometer_performance import (
|
|
2
5
|
check_omega_performance,
|
|
3
6
|
)
|
|
4
7
|
from mx_bluesky.beamlines.aithre_lasershaping.goniometer_controls import (
|
|
5
8
|
change_goniometer_turn_speed,
|
|
9
|
+
go_to_furthest_maximum,
|
|
10
|
+
jog_sample,
|
|
6
11
|
rotate_goniometer_relative,
|
|
7
12
|
)
|
|
8
13
|
|
|
9
14
|
__all__ = [
|
|
15
|
+
"set_beamline_safe_on_robot",
|
|
10
16
|
"check_omega_performance",
|
|
11
17
|
"change_goniometer_turn_speed",
|
|
18
|
+
"go_to_furthest_maximum",
|
|
12
19
|
"rotate_goniometer_relative",
|
|
20
|
+
"jog_sample",
|
|
13
21
|
]
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import bluesky.plan_stubs as bps
|
|
2
|
+
from bluesky.utils import MsgGenerator
|
|
3
|
+
from dodal.common import inject
|
|
4
|
+
from dodal.devices.aithre_lasershaping.goniometer import Goniometer
|
|
5
|
+
from dodal.devices.aithre_lasershaping.laser_robot import ForceBit, LaserRobot
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
def set_beamline_safe_on_robot(
|
|
9
|
+
robot: LaserRobot = inject("robot"), goniometer: Goniometer = inject("goniometer")
|
|
10
|
+
) -> MsgGenerator:
|
|
11
|
+
"""
|
|
12
|
+
The beamline safe PV is used in the Aithre laser shaping system to indicate whether
|
|
13
|
+
the goniometer is in the correct position for the robot to load a sample. The robot
|
|
14
|
+
is trained to load at the goniometer zero position, so if the translation and
|
|
15
|
+
rotation axes of the goniometer are at zero, then the beamline safe PV bit is forced
|
|
16
|
+
on.
|
|
17
|
+
"""
|
|
18
|
+
pvs = [
|
|
19
|
+
goniometer.x,
|
|
20
|
+
goniometer.y,
|
|
21
|
+
goniometer.z,
|
|
22
|
+
goniometer.sampy,
|
|
23
|
+
goniometer.sampz,
|
|
24
|
+
goniometer.omega,
|
|
25
|
+
]
|
|
26
|
+
|
|
27
|
+
values: list[float] = []
|
|
28
|
+
for pv in pvs:
|
|
29
|
+
values.append((yield from bps.rd(pv)))
|
|
30
|
+
|
|
31
|
+
set_value = (
|
|
32
|
+
ForceBit.ON.value
|
|
33
|
+
if all(round(value, 3) == 0 for value in values)
|
|
34
|
+
else ForceBit.NO.value
|
|
35
|
+
)
|
|
36
|
+
yield from bps.abs_set(robot.set_beamline_safe, set_value, wait=True)
|
|
@@ -1,9 +1,20 @@
|
|
|
1
|
+
from enum import StrEnum
|
|
2
|
+
|
|
1
3
|
import bluesky.plan_stubs as bps
|
|
2
4
|
from bluesky.utils import MsgGenerator
|
|
3
5
|
from dodal.common import inject
|
|
4
6
|
from dodal.devices.aithre_lasershaping.goniometer import Goniometer
|
|
5
7
|
|
|
6
8
|
|
|
9
|
+
class JogDirection(StrEnum):
|
|
10
|
+
UP = "up"
|
|
11
|
+
DOWN = "down"
|
|
12
|
+
LEFT = "left"
|
|
13
|
+
RIGHT = "right"
|
|
14
|
+
ZPLUS = "z_plus"
|
|
15
|
+
ZMINUS = "z_minus"
|
|
16
|
+
|
|
17
|
+
|
|
7
18
|
def rotate_goniometer_relative(
|
|
8
19
|
value: float, goniometer: Goniometer = inject("goniometer")
|
|
9
20
|
) -> MsgGenerator:
|
|
@@ -16,3 +27,35 @@ def change_goniometer_turn_speed(
|
|
|
16
27
|
) -> MsgGenerator:
|
|
17
28
|
"""Set the velocity of the goniometer"""
|
|
18
29
|
yield from bps.mv(goniometer.omega.velocity, velocity)
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
def jog_sample(
|
|
33
|
+
direction: JogDirection,
|
|
34
|
+
increment_size: float,
|
|
35
|
+
goniometer: Goniometer = inject("goniometer"),
|
|
36
|
+
) -> MsgGenerator:
|
|
37
|
+
"""Adjust the goniometer stage positions"""
|
|
38
|
+
direction_map = {
|
|
39
|
+
JogDirection.RIGHT: (goniometer.x, 1),
|
|
40
|
+
JogDirection.LEFT: (goniometer.x, -1),
|
|
41
|
+
JogDirection.ZPLUS: (goniometer.z, 1),
|
|
42
|
+
JogDirection.ZMINUS: (goniometer.z, -1),
|
|
43
|
+
JogDirection.UP: (goniometer.vertical_position, 1),
|
|
44
|
+
JogDirection.DOWN: (goniometer.vertical_position, -1),
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
axis, sign = direction_map[direction]
|
|
48
|
+
yield from bps.mvr(axis, sign * increment_size)
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
def go_to_furthest_maximum(
|
|
52
|
+
goniometer: Goniometer = inject("goniometer"),
|
|
53
|
+
) -> MsgGenerator:
|
|
54
|
+
"""Rotate to positive or negative maximum, whichever is further away"""
|
|
55
|
+
|
|
56
|
+
LIMIT_OF_TRAVEL = 3600
|
|
57
|
+
current_value: float = yield from bps.rd(goniometer.omega.user_readback)
|
|
58
|
+
|
|
59
|
+
yield from bps.mv(
|
|
60
|
+
goniometer.omega, -LIMIT_OF_TRAVEL if current_value > 0 else LIMIT_OF_TRAVEL
|
|
61
|
+
)
|
|
@@ -2,7 +2,8 @@ from mx_bluesky.beamlines.i24.serial.web_gui_plans.general_plans import (
|
|
|
2
2
|
gui_gonio_move_on_click,
|
|
3
3
|
gui_move_backlight,
|
|
4
4
|
gui_move_detector,
|
|
5
|
-
|
|
5
|
+
gui_run_chip_collection,
|
|
6
|
+
gui_set_zoom_level,
|
|
6
7
|
gui_sleep,
|
|
7
8
|
gui_stage_move_on_click,
|
|
8
9
|
)
|
|
@@ -57,6 +58,7 @@ __all__ = [
|
|
|
57
58
|
"gui_gonio_move_on_click",
|
|
58
59
|
"gui_sleep",
|
|
59
60
|
"gui_move_detector",
|
|
60
|
-
"
|
|
61
|
+
"gui_run_chip_collection",
|
|
61
62
|
"gui_move_backlight",
|
|
63
|
+
"gui_set_zoom_level",
|
|
62
64
|
]
|
|
@@ -5,8 +5,13 @@ env:
|
|
|
5
5
|
- kind: planFunctions
|
|
6
6
|
module: mx_bluesky.beamlines.i24.serial
|
|
7
7
|
events:
|
|
8
|
-
broadcast_status_events:
|
|
8
|
+
broadcast_status_events: false
|
|
9
9
|
api:
|
|
10
10
|
port: 25565
|
|
11
|
+
cors:
|
|
12
|
+
allow_credentials: True
|
|
13
|
+
origins:
|
|
14
|
+
- "*"
|
|
11
15
|
stomp:
|
|
16
|
+
enabled: true
|
|
12
17
|
host: i24-control.diamond.ac.uk
|
|
@@ -7,7 +7,7 @@ from functools import lru_cache
|
|
|
7
7
|
|
|
8
8
|
import bluesky.plan_stubs as bps
|
|
9
9
|
import requests
|
|
10
|
-
from
|
|
10
|
+
from bluesky.utils import MsgGenerator
|
|
11
11
|
from dodal.devices.i24.beam_center import DetectorBeamCenter
|
|
12
12
|
from dodal.devices.i24.dcm import DCM
|
|
13
13
|
from dodal.devices.i24.focus_mirrors import FocusMirrorsMode
|
|
@@ -51,7 +51,7 @@ def read_beam_info_from_hardware(
|
|
|
51
51
|
mirrors: FocusMirrorsMode,
|
|
52
52
|
beam_center: DetectorBeamCenter,
|
|
53
53
|
detector_name: DetectorName,
|
|
54
|
-
):
|
|
54
|
+
) -> MsgGenerator[BeamSettings]:
|
|
55
55
|
""" Read the beam information from hardware.
|
|
56
56
|
|
|
57
57
|
Args:
|
|
@@ -361,7 +361,9 @@ class DCID:
|
|
|
361
361
|
SSX_LOGGER.warning("Error completing DCID: %s (%s)", e, resp_str)
|
|
362
362
|
|
|
363
363
|
|
|
364
|
-
def get_pilatus_filename_template_from_device(
|
|
364
|
+
def get_pilatus_filename_template_from_device(
|
|
365
|
+
pilatus_metadata: PilatusMetadata,
|
|
366
|
+
) -> MsgGenerator[str]:
|
|
365
367
|
"""
|
|
366
368
|
Get the template file path by querying the detector PVs, mirror the construction \
|
|
367
369
|
that the PPU does.
|
|
@@ -369,8 +371,6 @@ def get_pilatus_filename_template_from_device():
|
|
|
369
371
|
Returns:
|
|
370
372
|
A template string, with the image numbers replaced with '#'
|
|
371
373
|
"""
|
|
372
|
-
pilatus_metadata: PilatusMetadata = i24.pilatus_metadata()
|
|
373
|
-
|
|
374
374
|
filename_template = yield from bps.rd(pilatus_metadata.filename_template)
|
|
375
375
|
return filename_template
|
|
376
376
|
|
|
@@ -4,7 +4,7 @@ major 4
|
|
|
4
4
|
minor 0
|
|
5
5
|
release 1
|
|
6
6
|
x 1316
|
|
7
|
-
y
|
|
7
|
+
y 610
|
|
8
8
|
w 450
|
|
9
9
|
h 180
|
|
10
10
|
font "arial-medium-r-18.0"
|
|
@@ -113,7 +113,7 @@ font "arial-medium-r-18.0"
|
|
|
113
113
|
buttonLabel "Move Stage"
|
|
114
114
|
numCmds 1
|
|
115
115
|
command {
|
|
116
|
-
0 "blueapi -c CONFIG_LOCATION controller run setup_detector_stage '\{\"expt_type\":\"Serial Jet\"
|
|
116
|
+
0 "blueapi -c CONFIG_LOCATION controller run setup_detector_stage '\{\"expt_type\":\"Serial Jet\"\}'"
|
|
117
117
|
}
|
|
118
118
|
endObjectProperties
|
|
119
119
|
|
|
@@ -4,7 +4,7 @@ major 4
|
|
|
4
4
|
minor 0
|
|
5
5
|
release 1
|
|
6
6
|
x 1006
|
|
7
|
-
y
|
|
7
|
+
y 300
|
|
8
8
|
w 700
|
|
9
9
|
h 900
|
|
10
10
|
font "arial-medium-r-18.0"
|
|
@@ -370,7 +370,7 @@ font "arial-medium-r-24.0"
|
|
|
370
370
|
buttonLabel "Start"
|
|
371
371
|
numCmds 1
|
|
372
372
|
command {
|
|
373
|
-
0 "blueapi -c CONFIG_LOCATION controller run run_extruder_plan
|
|
373
|
+
0 "blueapi -c CONFIG_LOCATION controller run run_extruder_plan"
|
|
374
374
|
}
|
|
375
375
|
endObjectProperties
|
|
376
376
|
|
|
@@ -832,7 +832,7 @@ botShadowColor index 11
|
|
|
832
832
|
font "arial-medium-r-18.0"
|
|
833
833
|
numCmds 1
|
|
834
834
|
command {
|
|
835
|
-
0 "blueapi -c CONFIG_LOCATION controller run initialise_extruder
|
|
835
|
+
0 "blueapi -c CONFIG_LOCATION controller run initialise_extruder"
|
|
836
836
|
}
|
|
837
837
|
endObjectProperties
|
|
838
838
|
|
|
@@ -989,8 +989,8 @@ beginObjectProperties
|
|
|
989
989
|
major 4
|
|
990
990
|
minor 0
|
|
991
991
|
release 0
|
|
992
|
-
x
|
|
993
|
-
y
|
|
992
|
+
x 11
|
|
993
|
+
y 606
|
|
994
994
|
w 680
|
|
995
995
|
h 252
|
|
996
996
|
lineColor index 9
|
|
@@ -1870,7 +1870,7 @@ beginObjectProperties
|
|
|
1870
1870
|
major 4
|
|
1871
1871
|
minor 1
|
|
1872
1872
|
release 1
|
|
1873
|
-
x
|
|
1873
|
+
x 568
|
|
1874
1874
|
y 675
|
|
1875
1875
|
w 72
|
|
1876
1876
|
h 46
|
|
@@ -2179,7 +2179,7 @@ font "arial-medium-r-20.0"
|
|
|
2179
2179
|
buttonLabel "Laser On"
|
|
2180
2180
|
numCmds 1
|
|
2181
2181
|
command {
|
|
2182
|
-
0 "blueapi -c CONFIG_LOCATION controller run laser_check '\{\"mode\":\"laseron\"
|
|
2182
|
+
0 "blueapi -c CONFIG_LOCATION controller run laser_check '\{\"mode\":\"laseron\"\}'"
|
|
2183
2183
|
}
|
|
2184
2184
|
endObjectProperties
|
|
2185
2185
|
|
|
@@ -2201,7 +2201,7 @@ font "arial-medium-r-20.0"
|
|
|
2201
2201
|
buttonLabel "Laser Off"
|
|
2202
2202
|
numCmds 1
|
|
2203
2203
|
command {
|
|
2204
|
-
0 "blueapi -c CONFIG_LOCATION controller run laser_check '\{\"mode\":\"laseroff\"
|
|
2204
|
+
0 "blueapi -c CONFIG_LOCATION controller run laser_check '\{\"mode\":\"laseroff\"\}'"
|
|
2205
2205
|
}
|
|
2206
2206
|
endObjectProperties
|
|
2207
2207
|
|
|
@@ -2223,7 +2223,7 @@ font "arial-medium-r-18.0"
|
|
|
2223
2223
|
buttonLabel "Enter hutch"
|
|
2224
2224
|
numCmds 1
|
|
2225
2225
|
command {
|
|
2226
|
-
0 "blueapi -c CONFIG_LOCATION controller run enter_hutch
|
|
2226
|
+
0 "blueapi -c CONFIG_LOCATION controller run enter_hutch"
|
|
2227
2227
|
}
|
|
2228
2228
|
endObjectProperties
|
|
2229
2229
|
|
|
@@ -24,6 +24,7 @@ from dodal.devices.i24.dcm import DCM
|
|
|
24
24
|
from dodal.devices.i24.dual_backlight import DualBacklight
|
|
25
25
|
from dodal.devices.i24.focus_mirrors import FocusMirrorsMode
|
|
26
26
|
from dodal.devices.i24.i24_detector_motion import DetectorMotion
|
|
27
|
+
from dodal.devices.i24.pilatus_metadata import PilatusMetadata
|
|
27
28
|
from dodal.devices.zebra.zebra import Zebra
|
|
28
29
|
|
|
29
30
|
from mx_bluesky.beamlines.i24.serial.dcid import (
|
|
@@ -37,7 +38,10 @@ from mx_bluesky.beamlines.i24.serial.log import (
|
|
|
37
38
|
log_on_entry,
|
|
38
39
|
)
|
|
39
40
|
from mx_bluesky.beamlines.i24.serial.parameters import ExtruderParameters
|
|
40
|
-
from mx_bluesky.beamlines.i24.serial.parameters.constants import
|
|
41
|
+
from mx_bluesky.beamlines.i24.serial.parameters.constants import (
|
|
42
|
+
BEAM_CENTER_LUT_FILES,
|
|
43
|
+
DetectorName,
|
|
44
|
+
)
|
|
41
45
|
from mx_bluesky.beamlines.i24.serial.setup_beamline import Pilatus, caget, caput, pv
|
|
42
46
|
from mx_bluesky.beamlines.i24.serial.setup_beamline import setup_beamline as sup
|
|
43
47
|
from mx_bluesky.beamlines.i24.serial.setup_beamline.setup_detector import (
|
|
@@ -212,6 +216,7 @@ def main_extruder_plan(
|
|
|
212
216
|
parameters: ExtruderParameters,
|
|
213
217
|
dcid: DCID,
|
|
214
218
|
start_time: datetime,
|
|
219
|
+
pilatus_metadata: PilatusMetadata,
|
|
215
220
|
) -> MsgGenerator:
|
|
216
221
|
beam_center_pixels = sup.compute_beam_center_position_from_lut(
|
|
217
222
|
BEAM_CENTER_LUT_FILES[parameters.detector_name],
|
|
@@ -357,7 +362,9 @@ def main_extruder_plan(
|
|
|
357
362
|
if parameters.detector_name == "eiger":
|
|
358
363
|
filetemplate = f"{parameters.filename}.nxs"
|
|
359
364
|
else:
|
|
360
|
-
filetemplate = yield from get_pilatus_filename_template_from_device(
|
|
365
|
+
filetemplate = yield from get_pilatus_filename_template_from_device(
|
|
366
|
+
pilatus_metadata
|
|
367
|
+
)
|
|
361
368
|
dcid.generate_dcid(
|
|
362
369
|
beam_settings=beam_settings,
|
|
363
370
|
image_dir=parameters.collection_directory.as_posix(),
|
|
@@ -498,6 +505,9 @@ def run_extruder_plan(
|
|
|
498
505
|
dcm: DCM = inject("dcm"),
|
|
499
506
|
mirrors: FocusMirrorsMode = inject("focus_mirrors"),
|
|
500
507
|
attenuator: ReadOnlyAttenuator = inject("attenuator"),
|
|
508
|
+
beam_center_eiger: DetectorBeamCenter = inject("eiger_bc"),
|
|
509
|
+
beam_center_pilatus: DetectorBeamCenter = inject("pilatus_bc"),
|
|
510
|
+
pilatus_metadata: PilatusMetadata = inject("pilatus_meta"),
|
|
501
511
|
) -> MsgGenerator:
|
|
502
512
|
start_time = datetime.now()
|
|
503
513
|
SSX_LOGGER.info(f"Collection start time: {start_time.ctime()}")
|
|
@@ -508,7 +518,11 @@ def run_extruder_plan(
|
|
|
508
518
|
# Create collection directory
|
|
509
519
|
parameters.collection_directory.mkdir(parents=True, exist_ok=True)
|
|
510
520
|
|
|
511
|
-
beam_center_device =
|
|
521
|
+
beam_center_device = (
|
|
522
|
+
beam_center_eiger
|
|
523
|
+
if parameters.detector_name is DetectorName.EIGER
|
|
524
|
+
else beam_center_pilatus
|
|
525
|
+
)
|
|
512
526
|
|
|
513
527
|
# DCID - not generated yet
|
|
514
528
|
dcid = DCID(emit_errors=False, expt_params=parameters)
|
|
@@ -527,6 +541,7 @@ def run_extruder_plan(
|
|
|
527
541
|
parameters=parameters,
|
|
528
542
|
dcid=dcid,
|
|
529
543
|
start_time=start_time,
|
|
544
|
+
pilatus_metadata=pilatus_metadata,
|
|
530
545
|
),
|
|
531
546
|
except_plan=lambda e: (
|
|
532
547
|
yield from collection_aborted_plan(zebra, parameters.detector_name, dcid)
|
|
@@ -4,7 +4,7 @@ major 4
|
|
|
4
4
|
minor 0
|
|
5
5
|
release 1
|
|
6
6
|
x 1205
|
|
7
|
-
y
|
|
7
|
+
y 616
|
|
8
8
|
w 450
|
|
9
9
|
h 180
|
|
10
10
|
font "arial-medium-r-18.0"
|
|
@@ -113,7 +113,7 @@ font "arial-medium-r-18.0"
|
|
|
113
113
|
buttonLabel "Move Stage"
|
|
114
114
|
numCmds 1
|
|
115
115
|
command {
|
|
116
|
-
0 "blueapi -c CONFIG_LOCATION controller run setup_detector_stage '\{\"expt_type\":\"Serial Fixed\"
|
|
116
|
+
0 "blueapi -c CONFIG_LOCATION controller run setup_detector_stage '\{\"expt_type\":\"Serial Fixed\"\}'"
|
|
117
117
|
}
|
|
118
118
|
endObjectProperties
|
|
119
119
|
|
|
@@ -3,8 +3,8 @@ beginScreenProperties
|
|
|
3
3
|
major 4
|
|
4
4
|
minor 0
|
|
5
5
|
release 1
|
|
6
|
-
x
|
|
7
|
-
y
|
|
6
|
+
x 843
|
|
7
|
+
y 206
|
|
8
8
|
w 1030
|
|
9
9
|
h 950
|
|
10
10
|
font "arial-medium-r-18.0"
|
|
@@ -280,7 +280,7 @@ botShadowColor index 14
|
|
|
280
280
|
font "arial-medium-r-18.0"
|
|
281
281
|
numCmds 1
|
|
282
282
|
command {
|
|
283
|
-
0 "blueapi -c CONFIG_LOCATION controller run moveto_preset '\{\"place\":\"load_position\"
|
|
283
|
+
0 "blueapi -c CONFIG_LOCATION controller run moveto_preset '\{\"place\":\"load_position\"\}'"
|
|
284
284
|
}
|
|
285
285
|
endObjectProperties
|
|
286
286
|
|
|
@@ -301,7 +301,7 @@ botShadowColor index 14
|
|
|
301
301
|
font "arial-medium-r-18.0"
|
|
302
302
|
numCmds 1
|
|
303
303
|
command {
|
|
304
|
-
0 "blueapi -c CONFIG_LOCATION controller run moveto_preset '\{\"place\":\"collect_position\"
|
|
304
|
+
0 "blueapi -c CONFIG_LOCATION controller run moveto_preset '\{\"place\":\"collect_position\"\}'"
|
|
305
305
|
}
|
|
306
306
|
endObjectProperties
|
|
307
307
|
|
|
@@ -323,7 +323,7 @@ font "helvetica-bold-r-24.0"
|
|
|
323
323
|
buttonLabel "Start"
|
|
324
324
|
numCmds 1
|
|
325
325
|
command {
|
|
326
|
-
0 "blueapi -c CONFIG_LOCATION controller run run_fixed_target_plan
|
|
326
|
+
0 "blueapi -c CONFIG_LOCATION controller run run_fixed_target_plan"
|
|
327
327
|
}
|
|
328
328
|
endObjectProperties
|
|
329
329
|
|
|
@@ -615,7 +615,7 @@ botShadowColor index 14
|
|
|
615
615
|
font "arial-medium-r-18.0"
|
|
616
616
|
numCmds 1
|
|
617
617
|
command {
|
|
618
|
-
0 "blueapi -c CONFIG_LOCATION controller run cs_maker
|
|
618
|
+
0 "blueapi -c CONFIG_LOCATION controller run cs_maker"
|
|
619
619
|
}
|
|
620
620
|
endObjectProperties
|
|
621
621
|
|
|
@@ -1157,7 +1157,7 @@ botShadowColor index 14
|
|
|
1157
1157
|
font "arial-medium-r-18.0"
|
|
1158
1158
|
numCmds 1
|
|
1159
1159
|
command {
|
|
1160
|
-
0 "blueapi -c CONFIG_LOCATION controller run initialise_stages
|
|
1160
|
+
0 "blueapi -c CONFIG_LOCATION controller run initialise_stages"
|
|
1161
1161
|
}
|
|
1162
1162
|
endObjectProperties
|
|
1163
1163
|
|
|
@@ -1538,7 +1538,7 @@ botShadowColor index 14
|
|
|
1538
1538
|
font "arial-medium-r-18.0"
|
|
1539
1539
|
numCmds 1
|
|
1540
1540
|
command {
|
|
1541
|
-
0 "blueapi -c CONFIG_LOCATION controller run block_check
|
|
1541
|
+
0 "blueapi -c CONFIG_LOCATION controller run block_check"
|
|
1542
1542
|
}
|
|
1543
1543
|
endObjectProperties
|
|
1544
1544
|
|
|
@@ -2912,7 +2912,7 @@ font "helvetica-medium-r-18.0"
|
|
|
2912
2912
|
buttonLabel "Set Fiducial 2"
|
|
2913
2913
|
numCmds 1
|
|
2914
2914
|
command {
|
|
2915
|
-
0 "blueapi -c CONFIG_LOCATION controller run fiducial '\{\"point\":\"2\"
|
|
2915
|
+
0 "blueapi -c CONFIG_LOCATION controller run fiducial '\{\"point\":\"2\"\}'"
|
|
2916
2916
|
}
|
|
2917
2917
|
endObjectProperties
|
|
2918
2918
|
|
|
@@ -2934,7 +2934,7 @@ font "helvetica-medium-r-18.0"
|
|
|
2934
2934
|
buttonLabel "Goto Fiducial 2"
|
|
2935
2935
|
numCmds 1
|
|
2936
2936
|
command {
|
|
2937
|
-
0 "blueapi -c CONFIG_LOCATION controller run moveto '\{\"place\":\"f2\"
|
|
2937
|
+
0 "blueapi -c CONFIG_LOCATION controller run moveto '\{\"place\":\"f2\"\}'"
|
|
2938
2938
|
}
|
|
2939
2939
|
endObjectProperties
|
|
2940
2940
|
|
|
@@ -2978,7 +2978,7 @@ font "helvetica-medium-r-18.0"
|
|
|
2978
2978
|
buttonLabel "Set Fiducial 1"
|
|
2979
2979
|
numCmds 1
|
|
2980
2980
|
command {
|
|
2981
|
-
0 "blueapi -c CONFIG_LOCATION controller run fiducial '\{\"point\":\"1\"
|
|
2981
|
+
0 "blueapi -c CONFIG_LOCATION controller run fiducial '\{\"point\":\"1\"\}'"
|
|
2982
2982
|
}
|
|
2983
2983
|
endObjectProperties
|
|
2984
2984
|
|
|
@@ -3000,7 +3000,7 @@ font "helvetica-medium-r-18.0"
|
|
|
3000
3000
|
buttonLabel "Goto Fiducial 1"
|
|
3001
3001
|
numCmds 1
|
|
3002
3002
|
command {
|
|
3003
|
-
0 "blueapi -c CONFIG_LOCATION controller run moveto '\{\"place\":\"f1\"
|
|
3003
|
+
0 "blueapi -c CONFIG_LOCATION controller run moveto '\{\"place\":\"f1\"\}'"
|
|
3004
3004
|
}
|
|
3005
3005
|
endObjectProperties
|
|
3006
3006
|
|
|
@@ -3731,7 +3731,7 @@ botShadowColor index 14
|
|
|
3731
3731
|
font "arial-medium-r-18.0"
|
|
3732
3732
|
numCmds 1
|
|
3733
3733
|
command {
|
|
3734
|
-
0 "blueapi -c CONFIG_LOCATION controller run moveto '\{\"place\":\"zero\"
|
|
3734
|
+
0 "blueapi -c CONFIG_LOCATION controller run moveto '\{\"place\":\"zero\"\}'"
|
|
3735
3735
|
}
|
|
3736
3736
|
endObjectProperties
|
|
3737
3737
|
|
|
@@ -3773,7 +3773,7 @@ botShadowColor index 14
|
|
|
3773
3773
|
font "arial-medium-r-18.0"
|
|
3774
3774
|
numCmds 1
|
|
3775
3775
|
command {
|
|
3776
|
-
0 "blueapi -c CONFIG_LOCATION controller run moveto_preset '\{\"place\":\"microdrop_position\"
|
|
3776
|
+
0 "blueapi -c CONFIG_LOCATION controller run moveto_preset '\{\"place\":\"microdrop_position\"\}'"
|
|
3777
3777
|
}
|
|
3778
3778
|
endObjectProperties
|
|
3779
3779
|
|
|
@@ -4,7 +4,7 @@ major 4
|
|
|
4
4
|
minor 0
|
|
5
5
|
release 1
|
|
6
6
|
x 830
|
|
7
|
-
y
|
|
7
|
+
y 237
|
|
8
8
|
w 900
|
|
9
9
|
h 700
|
|
10
10
|
font "arial-medium-r-18.0"
|
|
@@ -1585,7 +1585,7 @@ symbol0 {
|
|
|
1585
1585
|
1 "ML"
|
|
1586
1586
|
}
|
|
1587
1587
|
value0 {
|
|
1588
|
-
0 "
|
|
1588
|
+
0 "False"
|
|
1589
1589
|
1 "True"
|
|
1590
1590
|
}
|
|
1591
1591
|
endObjectProperties
|
|
@@ -19,6 +19,7 @@ from dodal.devices.i24.dcm import DCM
|
|
|
19
19
|
from dodal.devices.i24.dual_backlight import DualBacklight
|
|
20
20
|
from dodal.devices.i24.focus_mirrors import FocusMirrorsMode
|
|
21
21
|
from dodal.devices.i24.i24_detector_motion import DetectorMotion
|
|
22
|
+
from dodal.devices.i24.pilatus_metadata import PilatusMetadata
|
|
22
23
|
from dodal.devices.i24.pmac import PMAC
|
|
23
24
|
from dodal.devices.zebra.zebra import Zebra
|
|
24
25
|
|
|
@@ -38,7 +39,10 @@ from mx_bluesky.beamlines.i24.serial.fixed_target.i24ssx_Chip_Manager_py3v1 impo
|
|
|
38
39
|
)
|
|
39
40
|
from mx_bluesky.beamlines.i24.serial.log import SSX_LOGGER, log_on_entry
|
|
40
41
|
from mx_bluesky.beamlines.i24.serial.parameters import FixedTargetParameters
|
|
41
|
-
from mx_bluesky.beamlines.i24.serial.parameters.constants import
|
|
42
|
+
from mx_bluesky.beamlines.i24.serial.parameters.constants import (
|
|
43
|
+
BEAM_CENTER_LUT_FILES,
|
|
44
|
+
DetectorName,
|
|
45
|
+
)
|
|
42
46
|
from mx_bluesky.beamlines.i24.serial.setup_beamline import caget, cagetstring, caput, pv
|
|
43
47
|
from mx_bluesky.beamlines.i24.serial.setup_beamline import setup_beamline as sup
|
|
44
48
|
from mx_bluesky.beamlines.i24.serial.setup_beamline.setup_zebra_plans import (
|
|
@@ -180,10 +184,12 @@ def load_motion_program_data(
|
|
|
180
184
|
# Pump setting chosen
|
|
181
185
|
prefix = 14
|
|
182
186
|
SSX_LOGGER.info(f"Setting program prefix to {prefix}")
|
|
183
|
-
yield from bps.abs_set(pmac.pmac_string, "P1439=0", wait=True)
|
|
184
187
|
if checker_pattern:
|
|
185
188
|
SSX_LOGGER.info("Checker pattern setting enabled.")
|
|
186
189
|
yield from bps.abs_set(pmac.pmac_string, "P1439=1", wait=True)
|
|
190
|
+
else:
|
|
191
|
+
SSX_LOGGER.info("Checker pattern setting disabled.")
|
|
192
|
+
yield from bps.abs_set(pmac.pmac_string, "P1439=0", wait=True)
|
|
187
193
|
if pump_repeat == PumpProbeSetting.Medium1:
|
|
188
194
|
# Medium1 has time delays (Fast shutter opening time in ms)
|
|
189
195
|
yield from bps.abs_set(pmac.pmac_string, "P1441=50", wait=True)
|
|
@@ -270,6 +276,7 @@ def start_i24(
|
|
|
270
276
|
mirrors: FocusMirrorsMode,
|
|
271
277
|
beam_center_device: DetectorBeamCenter,
|
|
272
278
|
dcid: DCID,
|
|
279
|
+
pilatus_metadata: PilatusMetadata,
|
|
273
280
|
):
|
|
274
281
|
"""Set up for I24 fixed target data collection, trigger the detector and open \
|
|
275
282
|
the hutch shutter.
|
|
@@ -328,7 +335,9 @@ def start_i24(
|
|
|
328
335
|
|
|
329
336
|
# DCID process depends on detector PVs being set up already
|
|
330
337
|
SSX_LOGGER.debug("Start DCID process")
|
|
331
|
-
filetemplate = yield from get_pilatus_filename_template_from_device(
|
|
338
|
+
filetemplate = yield from get_pilatus_filename_template_from_device(
|
|
339
|
+
pilatus_metadata
|
|
340
|
+
)
|
|
332
341
|
dcid.generate_dcid(
|
|
333
342
|
beam_settings=beam_settings,
|
|
334
343
|
image_dir=filepath,
|
|
@@ -502,6 +511,7 @@ def main_fixed_target_plan(
|
|
|
502
511
|
beam_center_device: DetectorBeamCenter,
|
|
503
512
|
parameters: FixedTargetParameters,
|
|
504
513
|
dcid: DCID,
|
|
514
|
+
pilatus_metadata: PilatusMetadata,
|
|
505
515
|
) -> MsgGenerator:
|
|
506
516
|
SSX_LOGGER.info("Running a chip collection on I24")
|
|
507
517
|
|
|
@@ -546,6 +556,7 @@ def main_fixed_target_plan(
|
|
|
546
556
|
mirrors,
|
|
547
557
|
beam_center_device,
|
|
548
558
|
dcid,
|
|
559
|
+
pilatus_metadata,
|
|
549
560
|
)
|
|
550
561
|
|
|
551
562
|
SSX_LOGGER.info("Moving to Start")
|
|
@@ -649,6 +660,9 @@ def run_fixed_target_plan(
|
|
|
649
660
|
dcm: DCM = inject("dcm"),
|
|
650
661
|
mirrors: FocusMirrorsMode = inject("focus_mirrors"),
|
|
651
662
|
attenuator: ReadOnlyAttenuator = inject("attenuator"),
|
|
663
|
+
beam_center_eiger: DetectorBeamCenter = inject("eiger_bc"),
|
|
664
|
+
beam_center_pilatus: DetectorBeamCenter = inject("pilatus_bc"),
|
|
665
|
+
pilatus_metadata: PilatusMetadata = inject("pilatus_meta"),
|
|
652
666
|
) -> MsgGenerator:
|
|
653
667
|
# Read the parameters
|
|
654
668
|
parameters: FixedTargetParameters = yield from read_parameters(
|
|
@@ -661,11 +675,47 @@ def run_fixed_target_plan(
|
|
|
661
675
|
if parameters.chip_map:
|
|
662
676
|
yield from upload_chip_map_to_geobrick(pmac, parameters.chip_map)
|
|
663
677
|
|
|
664
|
-
beam_center_device =
|
|
678
|
+
beam_center_device = (
|
|
679
|
+
beam_center_eiger
|
|
680
|
+
if parameters.detector_name is DetectorName.EIGER
|
|
681
|
+
else beam_center_pilatus
|
|
682
|
+
)
|
|
665
683
|
|
|
666
684
|
# DCID instance - do not create yet
|
|
667
685
|
dcid = DCID(emit_errors=False, expt_params=parameters)
|
|
668
686
|
|
|
687
|
+
yield from run_plan_in_wrapper(
|
|
688
|
+
zebra,
|
|
689
|
+
pmac,
|
|
690
|
+
aperture,
|
|
691
|
+
backlight,
|
|
692
|
+
beamstop,
|
|
693
|
+
detector_stage,
|
|
694
|
+
shutter,
|
|
695
|
+
dcm,
|
|
696
|
+
mirrors,
|
|
697
|
+
beam_center_device,
|
|
698
|
+
parameters,
|
|
699
|
+
dcid,
|
|
700
|
+
pilatus_metadata,
|
|
701
|
+
)
|
|
702
|
+
|
|
703
|
+
|
|
704
|
+
def run_plan_in_wrapper(
|
|
705
|
+
zebra: Zebra,
|
|
706
|
+
pmac: PMAC,
|
|
707
|
+
aperture: Aperture,
|
|
708
|
+
backlight: DualBacklight,
|
|
709
|
+
beamstop: Beamstop,
|
|
710
|
+
detector_stage: DetectorMotion,
|
|
711
|
+
shutter: HutchShutter,
|
|
712
|
+
dcm: DCM,
|
|
713
|
+
mirrors: FocusMirrorsMode,
|
|
714
|
+
beam_center_device: DetectorBeamCenter,
|
|
715
|
+
parameters: FixedTargetParameters,
|
|
716
|
+
dcid: DCID,
|
|
717
|
+
pilatus_metadata: PilatusMetadata,
|
|
718
|
+
) -> MsgGenerator:
|
|
669
719
|
yield from bpp.contingency_wrapper(
|
|
670
720
|
main_fixed_target_plan(
|
|
671
721
|
zebra,
|
|
@@ -680,6 +730,7 @@ def run_fixed_target_plan(
|
|
|
680
730
|
beam_center_device,
|
|
681
731
|
parameters,
|
|
682
732
|
dcid,
|
|
733
|
+
pilatus_metadata,
|
|
683
734
|
),
|
|
684
735
|
except_plan=lambda e: (yield from run_aborted_plan(pmac, dcid, e)),
|
|
685
736
|
final_plan=lambda: (
|