dls-dodal 1.29.4__py3-none-any.whl → 1.31.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.
- {dls_dodal-1.29.4.dist-info → dls_dodal-1.31.0.dist-info}/METADATA +29 -44
- dls_dodal-1.31.0.dist-info/RECORD +134 -0
- {dls_dodal-1.29.4.dist-info → dls_dodal-1.31.0.dist-info}/WHEEL +1 -1
- dls_dodal-1.31.0.dist-info/entry_points.txt +3 -0
- dodal/__init__.py +1 -4
- dodal/_version.py +2 -2
- dodal/beamline_specific_utils/i03.py +1 -4
- dodal/beamlines/__init__.py +7 -1
- dodal/beamlines/i03.py +34 -29
- dodal/beamlines/i04.py +39 -16
- dodal/beamlines/i13_1.py +66 -0
- dodal/beamlines/i22.py +22 -22
- dodal/beamlines/i24.py +1 -1
- dodal/beamlines/p38.py +21 -21
- dodal/beamlines/p45.py +18 -16
- dodal/beamlines/p99.py +61 -0
- dodal/beamlines/training_rig.py +64 -0
- dodal/cli.py +6 -3
- dodal/common/beamlines/beamline_parameters.py +7 -6
- dodal/common/beamlines/beamline_utils.py +15 -14
- dodal/common/maths.py +1 -3
- dodal/common/types.py +6 -5
- dodal/common/udc_directory_provider.py +39 -21
- dodal/common/visit.py +60 -62
- dodal/devices/CTAB.py +22 -17
- dodal/devices/aperture.py +1 -1
- dodal/devices/aperturescatterguard.py +139 -209
- dodal/devices/areadetector/adaravis.py +8 -6
- dodal/devices/areadetector/adsim.py +2 -3
- dodal/devices/areadetector/adutils.py +20 -12
- dodal/devices/areadetector/plugins/MJPG.py +2 -1
- dodal/devices/backlight.py +12 -1
- dodal/devices/cryostream.py +19 -7
- dodal/devices/dcm.py +1 -1
- dodal/devices/detector/__init__.py +13 -2
- dodal/devices/detector/det_dim_constants.py +2 -2
- dodal/devices/detector/det_dist_to_beam_converter.py +1 -1
- dodal/devices/detector/detector.py +33 -32
- dodal/devices/detector/detector_motion.py +38 -31
- dodal/devices/eiger.py +11 -15
- dodal/devices/eiger_odin.py +9 -10
- dodal/devices/fast_grid_scan.py +18 -27
- dodal/devices/fluorescence_detector_motion.py +13 -4
- dodal/devices/focusing_mirror.py +6 -6
- dodal/devices/hutch_shutter.py +4 -4
- dodal/devices/i22/dcm.py +5 -4
- dodal/devices/i22/fswitch.py +10 -6
- dodal/devices/i22/nxsas.py +55 -43
- dodal/devices/i24/aperture.py +1 -1
- dodal/devices/i24/beamstop.py +1 -1
- dodal/devices/i24/dcm.py +1 -1
- dodal/devices/i24/{I24_detector_motion.py → i24_detector_motion.py} +1 -1
- dodal/devices/i24/pmac.py +67 -12
- dodal/devices/ipin.py +7 -4
- dodal/devices/linkam3.py +12 -6
- dodal/devices/logging_ophyd_device.py +1 -1
- dodal/devices/motors.py +32 -6
- dodal/devices/oav/grid_overlay.py +1 -0
- dodal/devices/oav/microns_for_zoom_levels.json +1 -1
- dodal/devices/oav/oav_detector.py +2 -1
- dodal/devices/oav/oav_parameters.py +18 -10
- dodal/devices/oav/oav_to_redis_forwarder.py +129 -0
- dodal/devices/oav/pin_image_recognition/__init__.py +6 -6
- dodal/devices/oav/pin_image_recognition/utils.py +5 -6
- dodal/devices/oav/utils.py +2 -2
- dodal/devices/p99/__init__.py +0 -0
- dodal/devices/p99/sample_stage.py +43 -0
- dodal/devices/robot.py +31 -20
- dodal/devices/scatterguard.py +1 -1
- dodal/devices/scintillator.py +8 -5
- dodal/devices/slits.py +1 -1
- dodal/devices/smargon.py +4 -4
- dodal/devices/status.py +2 -31
- dodal/devices/tetramm.py +23 -19
- dodal/devices/thawer.py +5 -3
- dodal/devices/training_rig/__init__.py +0 -0
- dodal/devices/training_rig/sample_stage.py +10 -0
- dodal/devices/turbo_slit.py +1 -1
- dodal/devices/undulator.py +1 -1
- dodal/devices/undulator_dcm.py +6 -8
- dodal/devices/util/adjuster_plans.py +3 -3
- dodal/devices/util/epics_util.py +5 -7
- dodal/devices/util/lookup_tables.py +2 -3
- dodal/devices/util/save_panda.py +87 -0
- dodal/devices/util/test_utils.py +17 -0
- dodal/devices/webcam.py +3 -3
- dodal/devices/xbpm_feedback.py +1 -25
- dodal/devices/xspress3/xspress3.py +1 -1
- dodal/devices/zebra.py +15 -10
- dodal/devices/zebra_controlled_shutter.py +26 -11
- dodal/devices/zocalo/zocalo_interaction.py +10 -2
- dodal/devices/zocalo/zocalo_results.py +36 -19
- dodal/log.py +46 -15
- dodal/plans/check_topup.py +65 -10
- dodal/plans/data_session_metadata.py +8 -9
- dodal/plans/motor_util_plans.py +117 -0
- dodal/utils.py +65 -22
- dls_dodal-1.29.4.dist-info/RECORD +0 -125
- dls_dodal-1.29.4.dist-info/entry_points.txt +0 -2
- dodal/devices/beamstop.py +0 -8
- dodal/devices/qbpm1.py +0 -8
- {dls_dodal-1.29.4.dist-info → dls_dodal-1.31.0.dist-info}/LICENSE +0 -0
- {dls_dodal-1.29.4.dist-info → dls_dodal-1.31.0.dist-info}/top_level.txt +0 -0
dodal/beamlines/i13_1.py
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
from pathlib import Path
|
|
2
|
+
|
|
3
|
+
from ophyd_async.epics.adaravis import AravisDetector
|
|
4
|
+
|
|
5
|
+
from dodal.common.beamlines.beamline_utils import (
|
|
6
|
+
device_instantiation,
|
|
7
|
+
get_path_provider,
|
|
8
|
+
set_path_provider,
|
|
9
|
+
)
|
|
10
|
+
from dodal.common.beamlines.beamline_utils import set_beamline as set_utils_beamline
|
|
11
|
+
from dodal.common.visit import StaticVisitPathProvider
|
|
12
|
+
from dodal.devices.motors import XYZPositioner
|
|
13
|
+
from dodal.log import set_beamline as set_log_beamline
|
|
14
|
+
from dodal.utils import get_beamline_name
|
|
15
|
+
|
|
16
|
+
BL = get_beamline_name("i13-1")
|
|
17
|
+
set_log_beamline(BL)
|
|
18
|
+
set_utils_beamline(BL)
|
|
19
|
+
set_path_provider(
|
|
20
|
+
StaticVisitPathProvider(
|
|
21
|
+
BL,
|
|
22
|
+
Path("/data/2024/cm37257-4/"), # latest commissioning visit
|
|
23
|
+
)
|
|
24
|
+
)
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
def sample_xyz_stage(
|
|
28
|
+
wait_for_connection: bool = True, fake_with_ophyd_sim: bool = False
|
|
29
|
+
) -> XYZPositioner:
|
|
30
|
+
return device_instantiation(
|
|
31
|
+
XYZPositioner,
|
|
32
|
+
prefix="BL13J-MO-PI-02:",
|
|
33
|
+
name="sample_xyz_stage",
|
|
34
|
+
wait=wait_for_connection,
|
|
35
|
+
fake=fake_with_ophyd_sim,
|
|
36
|
+
bl_prefix=False,
|
|
37
|
+
)
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
def sample_xyz_lab_fa_stage(
|
|
41
|
+
wait_for_connection: bool = True, fake_with_ophyd_sim: bool = False
|
|
42
|
+
) -> XYZPositioner:
|
|
43
|
+
return device_instantiation(
|
|
44
|
+
XYZPositioner,
|
|
45
|
+
prefix="BL13J-MO-PI-02:FIXANG:",
|
|
46
|
+
name="sample_xyz_lab_fa_stage",
|
|
47
|
+
wait=wait_for_connection,
|
|
48
|
+
fake=fake_with_ophyd_sim,
|
|
49
|
+
bl_prefix=False,
|
|
50
|
+
)
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
def side_camera(
|
|
54
|
+
wait_for_connection: bool = True, fake_with_ophyd_sim: bool = False
|
|
55
|
+
) -> AravisDetector:
|
|
56
|
+
return device_instantiation(
|
|
57
|
+
AravisDetector,
|
|
58
|
+
prefix="BL13J-OP-FLOAT-03:",
|
|
59
|
+
name="side_camera",
|
|
60
|
+
bl_prefix=False,
|
|
61
|
+
drv_suffix="CAM:",
|
|
62
|
+
hdf_suffix="HDF5:",
|
|
63
|
+
path_provider=get_path_provider(),
|
|
64
|
+
wait=wait_for_connection,
|
|
65
|
+
fake=fake_with_ophyd_sim,
|
|
66
|
+
)
|
dodal/beamlines/i22.py
CHANGED
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
from pathlib import Path
|
|
2
2
|
|
|
3
|
-
from ophyd_async.epics.
|
|
4
|
-
from ophyd_async.
|
|
3
|
+
from ophyd_async.epics.adaravis import AravisDetector
|
|
4
|
+
from ophyd_async.epics.adpilatus import PilatusDetector
|
|
5
|
+
from ophyd_async.fastcs.panda import HDFPanda
|
|
5
6
|
|
|
6
7
|
from dodal.common.beamlines.beamline_utils import (
|
|
7
8
|
device_instantiation,
|
|
8
|
-
|
|
9
|
-
|
|
9
|
+
get_path_provider,
|
|
10
|
+
set_path_provider,
|
|
10
11
|
)
|
|
11
12
|
from dodal.common.beamlines.beamline_utils import set_beamline as set_utils_beamline
|
|
12
13
|
from dodal.common.beamlines.device_helpers import numbered_slits
|
|
13
|
-
from dodal.common.visit import
|
|
14
|
+
from dodal.common.visit import RemoteDirectoryServiceClient, StaticVisitPathProvider
|
|
14
15
|
from dodal.devices.focusing_mirror import FocusingMirror
|
|
15
16
|
from dodal.devices.i22.dcm import CrystalMetadata, DoubleCrystalMonochromator
|
|
16
17
|
from dodal.devices.i22.fswitch import FSwitch
|
|
@@ -32,11 +33,11 @@ set_utils_beamline(BL)
|
|
|
32
33
|
# Communication with GDA is also WIP so for now we determine an arbitrary scan number
|
|
33
34
|
# locally and write the commissioning directory. The scan number is not guaranteed to
|
|
34
35
|
# be unique and the data is at risk - this configuration is for testing only.
|
|
35
|
-
|
|
36
|
-
|
|
36
|
+
set_path_provider(
|
|
37
|
+
StaticVisitPathProvider(
|
|
37
38
|
BL,
|
|
38
39
|
Path("/dls/i22/data/2024/cm37271-2/bluesky"),
|
|
39
|
-
client=
|
|
40
|
+
client=RemoteDirectoryServiceClient("http://i22-control:8088/api"),
|
|
40
41
|
)
|
|
41
42
|
)
|
|
42
43
|
|
|
@@ -61,7 +62,7 @@ def saxs(
|
|
|
61
62
|
sensor_thickness=(0.45, "mm"),
|
|
62
63
|
distance=(4711.833684146172, "mm"),
|
|
63
64
|
),
|
|
64
|
-
|
|
65
|
+
path_provider=get_path_provider(),
|
|
65
66
|
)
|
|
66
67
|
|
|
67
68
|
|
|
@@ -97,7 +98,7 @@ def waxs(
|
|
|
97
98
|
sensor_thickness=(0.45, "mm"),
|
|
98
99
|
distance=(175.4199417092314, "mm"),
|
|
99
100
|
),
|
|
100
|
-
|
|
101
|
+
path_provider=get_path_provider(),
|
|
101
102
|
)
|
|
102
103
|
|
|
103
104
|
|
|
@@ -112,7 +113,7 @@ def i0(
|
|
|
112
113
|
wait_for_connection,
|
|
113
114
|
fake_with_ophyd_sim,
|
|
114
115
|
type="Cividec Diamond XBPM",
|
|
115
|
-
|
|
116
|
+
path_provider=get_path_provider(),
|
|
116
117
|
)
|
|
117
118
|
|
|
118
119
|
|
|
@@ -127,7 +128,7 @@ def it(
|
|
|
127
128
|
wait_for_connection,
|
|
128
129
|
fake_with_ophyd_sim,
|
|
129
130
|
type="PIN Diode",
|
|
130
|
-
|
|
131
|
+
path_provider=get_path_provider(),
|
|
131
132
|
)
|
|
132
133
|
|
|
133
134
|
|
|
@@ -234,7 +235,6 @@ def slits_3(
|
|
|
234
235
|
)
|
|
235
236
|
|
|
236
237
|
|
|
237
|
-
@skip_device
|
|
238
238
|
def slits_4(
|
|
239
239
|
wait_for_connection: bool = True,
|
|
240
240
|
fake_with_ophyd_sim: bool = False,
|
|
@@ -296,11 +296,11 @@ def panda1(
|
|
|
296
296
|
"-EA-PANDA-01:",
|
|
297
297
|
wait_for_connection,
|
|
298
298
|
fake_with_ophyd_sim,
|
|
299
|
-
|
|
299
|
+
path_provider=get_path_provider(),
|
|
300
300
|
)
|
|
301
301
|
|
|
302
302
|
|
|
303
|
-
@skip_device
|
|
303
|
+
@skip_device()
|
|
304
304
|
def panda2(
|
|
305
305
|
wait_for_connection: bool = True,
|
|
306
306
|
fake_with_ophyd_sim: bool = False,
|
|
@@ -311,11 +311,11 @@ def panda2(
|
|
|
311
311
|
"-EA-PANDA-02:",
|
|
312
312
|
wait_for_connection,
|
|
313
313
|
fake_with_ophyd_sim,
|
|
314
|
-
|
|
314
|
+
path_provider=get_path_provider(),
|
|
315
315
|
)
|
|
316
316
|
|
|
317
317
|
|
|
318
|
-
@skip_device
|
|
318
|
+
@skip_device()
|
|
319
319
|
def panda3(
|
|
320
320
|
wait_for_connection: bool = True,
|
|
321
321
|
fake_with_ophyd_sim: bool = False,
|
|
@@ -326,11 +326,11 @@ def panda3(
|
|
|
326
326
|
"-EA-PANDA-03:",
|
|
327
327
|
wait_for_connection,
|
|
328
328
|
fake_with_ophyd_sim,
|
|
329
|
-
|
|
329
|
+
path_provider=get_path_provider(),
|
|
330
330
|
)
|
|
331
331
|
|
|
332
332
|
|
|
333
|
-
@skip_device
|
|
333
|
+
@skip_device()
|
|
334
334
|
def panda4(
|
|
335
335
|
wait_for_connection: bool = True,
|
|
336
336
|
fake_with_ophyd_sim: bool = False,
|
|
@@ -341,7 +341,7 @@ def panda4(
|
|
|
341
341
|
"-EA-PANDA-04:",
|
|
342
342
|
wait_for_connection,
|
|
343
343
|
fake_with_ophyd_sim,
|
|
344
|
-
|
|
344
|
+
path_provider=get_path_provider(),
|
|
345
345
|
)
|
|
346
346
|
|
|
347
347
|
|
|
@@ -362,11 +362,11 @@ def oav(
|
|
|
362
362
|
description="AVT Mako G-507B",
|
|
363
363
|
distance=(-1.0, "m"),
|
|
364
364
|
),
|
|
365
|
-
|
|
365
|
+
path_provider=get_path_provider(),
|
|
366
366
|
)
|
|
367
367
|
|
|
368
368
|
|
|
369
|
-
@skip_device
|
|
369
|
+
@skip_device()
|
|
370
370
|
def linkam(
|
|
371
371
|
wait_for_connection: bool = True, fake_with_ophyd_sim: bool = False
|
|
372
372
|
) -> Linkam3:
|
dodal/beamlines/i24.py
CHANGED
|
@@ -7,7 +7,7 @@ from dodal.devices.i24.aperture import Aperture
|
|
|
7
7
|
from dodal.devices.i24.beamstop import Beamstop
|
|
8
8
|
from dodal.devices.i24.dcm import DCM
|
|
9
9
|
from dodal.devices.i24.dual_backlight import DualBacklight
|
|
10
|
-
from dodal.devices.i24.
|
|
10
|
+
from dodal.devices.i24.i24_detector_motion import DetectorMotion
|
|
11
11
|
from dodal.devices.i24.i24_vgonio import VGonio
|
|
12
12
|
from dodal.devices.i24.pmac import PMAC
|
|
13
13
|
from dodal.devices.oav.oav_detector import OAV
|
dodal/beamlines/p38.py
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
from pathlib import Path
|
|
2
2
|
|
|
3
|
-
from ophyd_async.epics.
|
|
4
|
-
from ophyd_async.panda import HDFPanda
|
|
3
|
+
from ophyd_async.epics.adaravis import AravisDetector
|
|
4
|
+
from ophyd_async.fastcs.panda import HDFPanda
|
|
5
5
|
|
|
6
6
|
from dodal.common.beamlines.beamline_utils import (
|
|
7
7
|
device_instantiation,
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
get_path_provider,
|
|
9
|
+
set_path_provider,
|
|
10
10
|
)
|
|
11
11
|
from dodal.common.beamlines.beamline_utils import set_beamline as set_utils_beamline
|
|
12
12
|
from dodal.common.beamlines.device_helpers import numbered_slits
|
|
13
|
-
from dodal.common.visit import LocalDirectoryServiceClient,
|
|
13
|
+
from dodal.common.visit import LocalDirectoryServiceClient, StaticVisitPathProvider
|
|
14
14
|
from dodal.devices.focusing_mirror import FocusingMirror
|
|
15
15
|
from dodal.devices.i22.dcm import CrystalMetadata, DoubleCrystalMonochromator
|
|
16
16
|
from dodal.devices.i22.fswitch import FSwitch
|
|
@@ -30,8 +30,8 @@ set_utils_beamline(BL)
|
|
|
30
30
|
# Communication with GDA is also WIP so for now we determine an arbitrary scan number
|
|
31
31
|
# locally and write the commissioning directory. The scan number is not guaranteed to
|
|
32
32
|
# be unique and the data is at risk - this configuration is for testing only.
|
|
33
|
-
|
|
34
|
-
|
|
33
|
+
set_path_provider(
|
|
34
|
+
StaticVisitPathProvider(
|
|
35
35
|
BL,
|
|
36
36
|
Path("/dls/p38/data/2024/cm37282-2/bluesky"),
|
|
37
37
|
client=LocalDirectoryServiceClient(),
|
|
@@ -50,12 +50,12 @@ def d3(
|
|
|
50
50
|
fake_with_ophyd_sim,
|
|
51
51
|
drv_suffix="DET:",
|
|
52
52
|
hdf_suffix="HDF5:",
|
|
53
|
-
|
|
53
|
+
path_provider=get_path_provider(),
|
|
54
54
|
)
|
|
55
55
|
|
|
56
56
|
|
|
57
57
|
# Disconnected
|
|
58
|
-
@skip_device
|
|
58
|
+
@skip_device()
|
|
59
59
|
def d11(
|
|
60
60
|
wait_for_connection: bool = True, fake_with_ophyd_sim: bool = False
|
|
61
61
|
) -> AravisDetector:
|
|
@@ -67,7 +67,7 @@ def d11(
|
|
|
67
67
|
fake_with_ophyd_sim,
|
|
68
68
|
drv_suffix="DET:",
|
|
69
69
|
hdf_suffix="HDF5:",
|
|
70
|
-
|
|
70
|
+
path_provider=get_path_provider(),
|
|
71
71
|
)
|
|
72
72
|
|
|
73
73
|
|
|
@@ -82,7 +82,7 @@ def d12(
|
|
|
82
82
|
fake_with_ophyd_sim,
|
|
83
83
|
drv_suffix="DET:",
|
|
84
84
|
hdf_suffix="HDF5:",
|
|
85
|
-
|
|
85
|
+
path_provider=get_path_provider(),
|
|
86
86
|
)
|
|
87
87
|
|
|
88
88
|
|
|
@@ -96,7 +96,7 @@ def i0(
|
|
|
96
96
|
"-EA-XBPM-01:",
|
|
97
97
|
wait_for_connection,
|
|
98
98
|
fake_with_ophyd_sim,
|
|
99
|
-
|
|
99
|
+
path_provider=get_path_provider(),
|
|
100
100
|
)
|
|
101
101
|
|
|
102
102
|
|
|
@@ -232,13 +232,13 @@ def dcm(
|
|
|
232
232
|
usage="Bragg",
|
|
233
233
|
type="silicon",
|
|
234
234
|
reflection=(1, 1, 1),
|
|
235
|
-
d_spacing=3.13475,
|
|
235
|
+
d_spacing=(3.13475, "nm"),
|
|
236
236
|
),
|
|
237
237
|
crystal_2_metadata=CrystalMetadata(
|
|
238
238
|
usage="Bragg",
|
|
239
239
|
type="silicon",
|
|
240
240
|
reflection=(1, 1, 1),
|
|
241
|
-
d_spacing=3.13475,
|
|
241
|
+
d_spacing=(3.13475, "nm"),
|
|
242
242
|
),
|
|
243
243
|
)
|
|
244
244
|
|
|
@@ -262,7 +262,7 @@ def undulator(
|
|
|
262
262
|
# Must find which PandA IOC(s) are compatible
|
|
263
263
|
# Must document what PandAs are physically connected to
|
|
264
264
|
# See: https://github.com/bluesky/ophyd-async/issues/284
|
|
265
|
-
@skip_device
|
|
265
|
+
@skip_device()
|
|
266
266
|
def panda1(
|
|
267
267
|
wait_for_connection: bool = True,
|
|
268
268
|
fake_with_ophyd_sim: bool = False,
|
|
@@ -273,11 +273,11 @@ def panda1(
|
|
|
273
273
|
"-EA-PANDA-01:",
|
|
274
274
|
wait_for_connection,
|
|
275
275
|
fake_with_ophyd_sim,
|
|
276
|
-
|
|
276
|
+
path_provider=get_path_provider(),
|
|
277
277
|
)
|
|
278
278
|
|
|
279
279
|
|
|
280
|
-
@skip_device
|
|
280
|
+
@skip_device()
|
|
281
281
|
def panda2(
|
|
282
282
|
wait_for_connection: bool = True,
|
|
283
283
|
fake_with_ophyd_sim: bool = False,
|
|
@@ -288,11 +288,11 @@ def panda2(
|
|
|
288
288
|
"-EA-PANDA-02:",
|
|
289
289
|
wait_for_connection,
|
|
290
290
|
fake_with_ophyd_sim,
|
|
291
|
-
|
|
291
|
+
path_provider=get_path_provider(),
|
|
292
292
|
)
|
|
293
293
|
|
|
294
294
|
|
|
295
|
-
@skip_device
|
|
295
|
+
@skip_device()
|
|
296
296
|
def panda3(
|
|
297
297
|
wait_for_connection: bool = True,
|
|
298
298
|
fake_with_ophyd_sim: bool = False,
|
|
@@ -303,11 +303,11 @@ def panda3(
|
|
|
303
303
|
"-EA-PANDA-03:",
|
|
304
304
|
wait_for_connection,
|
|
305
305
|
fake_with_ophyd_sim,
|
|
306
|
-
|
|
306
|
+
path_provider=get_path_provider(),
|
|
307
307
|
)
|
|
308
308
|
|
|
309
309
|
|
|
310
|
-
@skip_device
|
|
310
|
+
@skip_device()
|
|
311
311
|
def linkam(
|
|
312
312
|
wait_for_connection: bool = True, fake_with_ophyd_sim: bool = False
|
|
313
313
|
) -> Linkam3:
|
dodal/beamlines/p45.py
CHANGED
|
@@ -1,13 +1,15 @@
|
|
|
1
|
-
from
|
|
2
|
-
|
|
1
|
+
from pathlib import Path
|
|
2
|
+
|
|
3
|
+
from ophyd_async.epics.adaravis import AravisDetector
|
|
4
|
+
from ophyd_async.fastcs.panda import HDFPanda
|
|
3
5
|
|
|
4
6
|
from dodal.common.beamlines.beamline_utils import (
|
|
5
7
|
device_instantiation,
|
|
6
|
-
|
|
7
|
-
|
|
8
|
+
get_path_provider,
|
|
9
|
+
set_path_provider,
|
|
8
10
|
)
|
|
9
11
|
from dodal.common.beamlines.beamline_utils import set_beamline as set_utils_beamline
|
|
10
|
-
from dodal.common.visit import
|
|
12
|
+
from dodal.common.visit import StaticVisitPathProvider
|
|
11
13
|
from dodal.devices.p45 import Choppers, TomoStageWithStretchAndSkew
|
|
12
14
|
from dodal.log import set_beamline as set_log_beamline
|
|
13
15
|
from dodal.utils import get_beamline_name, skip_device
|
|
@@ -15,10 +17,10 @@ from dodal.utils import get_beamline_name, skip_device
|
|
|
15
17
|
BL = get_beamline_name("p45")
|
|
16
18
|
set_log_beamline(BL)
|
|
17
19
|
set_utils_beamline(BL)
|
|
18
|
-
|
|
19
|
-
|
|
20
|
+
set_path_provider(
|
|
21
|
+
StaticVisitPathProvider(
|
|
20
22
|
BL,
|
|
21
|
-
"/data/2024/cm37283-2/", # latest commissioning visit
|
|
23
|
+
Path("/data/2024/cm37283-2/"), # latest commissioning visit
|
|
22
24
|
)
|
|
23
25
|
)
|
|
24
26
|
|
|
@@ -48,7 +50,7 @@ def choppers(
|
|
|
48
50
|
|
|
49
51
|
|
|
50
52
|
# Disconnected
|
|
51
|
-
@skip_device
|
|
53
|
+
@skip_device()
|
|
52
54
|
def det(
|
|
53
55
|
wait_for_connection: bool = True, fake_with_ophyd_sim: bool = False
|
|
54
56
|
) -> AravisDetector:
|
|
@@ -60,12 +62,12 @@ def det(
|
|
|
60
62
|
fake_with_ophyd_sim,
|
|
61
63
|
drv_suffix="DET:",
|
|
62
64
|
hdf_suffix="HDF5:",
|
|
63
|
-
|
|
65
|
+
path_provider=get_path_provider(),
|
|
64
66
|
)
|
|
65
67
|
|
|
66
68
|
|
|
67
69
|
# Disconnected
|
|
68
|
-
@skip_device
|
|
70
|
+
@skip_device()
|
|
69
71
|
def diff(
|
|
70
72
|
wait_for_connection: bool = True, fake_with_ophyd_sim: bool = False
|
|
71
73
|
) -> AravisDetector:
|
|
@@ -77,14 +79,14 @@ def diff(
|
|
|
77
79
|
fake_with_ophyd_sim,
|
|
78
80
|
drv_suffix="DET:",
|
|
79
81
|
hdf_suffix="HDF5:",
|
|
80
|
-
|
|
82
|
+
path_provider=get_path_provider(),
|
|
81
83
|
)
|
|
82
84
|
|
|
83
85
|
|
|
84
86
|
# Must find which PandA IOC(s) are compatible
|
|
85
87
|
# Must document what PandAs are physically connected to
|
|
86
88
|
# See: https://github.com/bluesky/ophyd-async/issues/284
|
|
87
|
-
@skip_device
|
|
89
|
+
@skip_device()
|
|
88
90
|
def panda1(
|
|
89
91
|
wait_for_connection: bool = True,
|
|
90
92
|
fake_with_ophyd_sim: bool = False,
|
|
@@ -95,11 +97,11 @@ def panda1(
|
|
|
95
97
|
"-MO-PANDA-01:",
|
|
96
98
|
wait_for_connection,
|
|
97
99
|
fake_with_ophyd_sim,
|
|
98
|
-
|
|
100
|
+
path_provider=get_path_provider(),
|
|
99
101
|
)
|
|
100
102
|
|
|
101
103
|
|
|
102
|
-
@skip_device
|
|
104
|
+
@skip_device()
|
|
103
105
|
def panda2(
|
|
104
106
|
wait_for_connection: bool = True,
|
|
105
107
|
fake_with_ophyd_sim: bool = False,
|
|
@@ -110,5 +112,5 @@ def panda2(
|
|
|
110
112
|
"-MO-PANDA-02:",
|
|
111
113
|
wait_for_connection,
|
|
112
114
|
fake_with_ophyd_sim,
|
|
113
|
-
|
|
115
|
+
path_provider=get_path_provider(),
|
|
114
116
|
)
|
dodal/beamlines/p99.py
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
from dodal.common.beamlines.beamline_utils import device_instantiation, set_beamline
|
|
2
|
+
from dodal.devices.motors import XYZPositioner
|
|
3
|
+
from dodal.devices.p99.sample_stage import FilterMotor, SampleAngleStage
|
|
4
|
+
from dodal.log import set_beamline as set_log_beamline
|
|
5
|
+
from dodal.utils import get_beamline_name
|
|
6
|
+
|
|
7
|
+
BL = get_beamline_name("BL99P")
|
|
8
|
+
set_log_beamline(BL)
|
|
9
|
+
set_beamline(BL)
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
def sample_angle_stage(
|
|
13
|
+
wait_for_connection: bool = True, fake_with_ophyd_sim: bool = False
|
|
14
|
+
) -> SampleAngleStage:
|
|
15
|
+
"""Sample stage for p99"""
|
|
16
|
+
|
|
17
|
+
return device_instantiation(
|
|
18
|
+
SampleAngleStage,
|
|
19
|
+
prefix="-MO-STAGE-01:",
|
|
20
|
+
name="sample_angle_stage",
|
|
21
|
+
wait=wait_for_connection,
|
|
22
|
+
fake=fake_with_ophyd_sim,
|
|
23
|
+
)
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
def sample_stage_filer(
|
|
27
|
+
wait_for_connection: bool = True, fake_with_ophyd_sim: bool = False
|
|
28
|
+
) -> FilterMotor:
|
|
29
|
+
"""Sample stage for p99"""
|
|
30
|
+
|
|
31
|
+
return device_instantiation(
|
|
32
|
+
FilterMotor,
|
|
33
|
+
prefix="-MO-STAGE-02:MP:SELECT",
|
|
34
|
+
name="sample_stage_filer",
|
|
35
|
+
wait=wait_for_connection,
|
|
36
|
+
fake=fake_with_ophyd_sim,
|
|
37
|
+
)
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
def sample_xyz_stage(
|
|
41
|
+
wait_for_connection: bool = True, fake_with_ophyd_sim: bool = False
|
|
42
|
+
) -> XYZPositioner:
|
|
43
|
+
return device_instantiation(
|
|
44
|
+
FilterMotor,
|
|
45
|
+
prefix="-MO-STAGE-02:",
|
|
46
|
+
name="sample_xyz_stage",
|
|
47
|
+
wait=wait_for_connection,
|
|
48
|
+
fake=fake_with_ophyd_sim,
|
|
49
|
+
)
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
def sample_lab_xyz_stage(
|
|
53
|
+
wait_for_connection: bool = True, fake_with_ophyd_sim: bool = False
|
|
54
|
+
) -> XYZPositioner:
|
|
55
|
+
return device_instantiation(
|
|
56
|
+
FilterMotor,
|
|
57
|
+
prefix="-MO-STAGE-02:LAB:",
|
|
58
|
+
name="sample_lab_xyz_stage",
|
|
59
|
+
wait=wait_for_connection,
|
|
60
|
+
fake=fake_with_ophyd_sim,
|
|
61
|
+
)
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
from pathlib import Path
|
|
2
|
+
|
|
3
|
+
from ophyd_async.epics.adaravis import AravisDetector
|
|
4
|
+
|
|
5
|
+
from dodal.common.beamlines.beamline_utils import (
|
|
6
|
+
device_instantiation,
|
|
7
|
+
get_path_provider,
|
|
8
|
+
set_path_provider,
|
|
9
|
+
)
|
|
10
|
+
from dodal.common.beamlines.beamline_utils import set_beamline as set_utils_beamline
|
|
11
|
+
from dodal.common.visit import LocalDirectoryServiceClient, StaticVisitPathProvider
|
|
12
|
+
from dodal.devices.training_rig.sample_stage import TrainingRigSampleStage
|
|
13
|
+
from dodal.log import set_beamline as set_log_beamline
|
|
14
|
+
from dodal.utils import get_beamline_name
|
|
15
|
+
|
|
16
|
+
#
|
|
17
|
+
# HTSS Training Rig
|
|
18
|
+
#
|
|
19
|
+
# A mock-beamline design that is employed at Diamond, consisting of a pair of
|
|
20
|
+
# simple motors, a GigE camera and a PandA.
|
|
21
|
+
# Since there are multiple rigs whose PVs are identical aside from the prefix,
|
|
22
|
+
# this module can be used for any rig. It should fill in the prefix automatically
|
|
23
|
+
# if the ${BEAMLINE} environment variable is correctly set. It currently defaults
|
|
24
|
+
# to p47.
|
|
25
|
+
#
|
|
26
|
+
|
|
27
|
+
BL = get_beamline_name("p47")
|
|
28
|
+
set_log_beamline(BL)
|
|
29
|
+
set_utils_beamline(BL)
|
|
30
|
+
|
|
31
|
+
set_path_provider(
|
|
32
|
+
StaticVisitPathProvider(
|
|
33
|
+
BL,
|
|
34
|
+
Path("/exports/mybeamline/data"),
|
|
35
|
+
client=LocalDirectoryServiceClient(),
|
|
36
|
+
)
|
|
37
|
+
)
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
def sample_stage(
|
|
41
|
+
wait_for_connection: bool = True, fake_with_ophyd_sim: bool = False
|
|
42
|
+
) -> TrainingRigSampleStage:
|
|
43
|
+
return device_instantiation(
|
|
44
|
+
TrainingRigSampleStage,
|
|
45
|
+
"sample_stage",
|
|
46
|
+
"-MO-MAP-01:STAGE:",
|
|
47
|
+
wait_for_connection,
|
|
48
|
+
fake_with_ophyd_sim,
|
|
49
|
+
)
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
def det(
|
|
53
|
+
wait_for_connection: bool = True, fake_with_ophyd_sim: bool = False
|
|
54
|
+
) -> AravisDetector:
|
|
55
|
+
return device_instantiation(
|
|
56
|
+
AravisDetector,
|
|
57
|
+
"det",
|
|
58
|
+
"-EA-DET-01:",
|
|
59
|
+
wait_for_connection,
|
|
60
|
+
fake_with_ophyd_sim,
|
|
61
|
+
drv_suffix="DET:",
|
|
62
|
+
hdf_suffix="HDF5:",
|
|
63
|
+
path_provider=get_path_provider(),
|
|
64
|
+
)
|
dodal/cli.py
CHANGED
|
@@ -58,10 +58,13 @@ def connect(beamline: str, all: bool, sim_backend: bool) -> None:
|
|
|
58
58
|
include_skipped=all,
|
|
59
59
|
fake_with_ophyd_sim=sim_backend,
|
|
60
60
|
)
|
|
61
|
-
sim_statement = "(sim mode)" if sim_backend else ""
|
|
61
|
+
sim_statement = " (sim mode)" if sim_backend else ""
|
|
62
62
|
|
|
63
|
-
print(f"{len(devices)} devices connected
|
|
64
|
-
|
|
63
|
+
print(f"{len(devices)} devices connected{sim_statement}:")
|
|
64
|
+
connected_devices = "\n".join(
|
|
65
|
+
sorted([f"\t{device_name}" for device_name in devices.keys()])
|
|
66
|
+
)
|
|
67
|
+
print(connected_devices)
|
|
65
68
|
|
|
66
69
|
# If exceptions have occurred, this will print details of the relevant PVs
|
|
67
70
|
if len(exceptions) > 0:
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
from typing import Any,
|
|
1
|
+
from typing import Any, cast
|
|
2
2
|
|
|
3
3
|
from dodal.log import LOGGER
|
|
4
4
|
from dodal.utils import get_beamline_name
|
|
@@ -7,7 +7,7 @@ BEAMLINE_PARAMETER_KEYWORDS = ["FB", "FULL", "deadtime"]
|
|
|
7
7
|
|
|
8
8
|
BEAMLINE_PARAMETER_PATHS = {
|
|
9
9
|
"i03": "/dls_sw/i03/software/daq_configuration/domain/beamlineParameters",
|
|
10
|
-
"i04": "/dls_sw/i04/software/gda_versions/
|
|
10
|
+
"i04": "/dls_sw/i04/software/gda_versions/gda_9_34/workspace_git/gda-mx.git/configurations/i04-config/scripts/beamlineParameters",
|
|
11
11
|
"s03": "tests/test_data/test_beamline_parameters.txt",
|
|
12
12
|
}
|
|
13
13
|
|
|
@@ -15,6 +15,9 @@ BEAMLINE_PARAMETER_PATHS = {
|
|
|
15
15
|
class GDABeamlineParameters:
|
|
16
16
|
params: dict[str, Any]
|
|
17
17
|
|
|
18
|
+
def __init__(self, params: dict[str, Any]):
|
|
19
|
+
self.params = params
|
|
20
|
+
|
|
18
21
|
def __repr__(self) -> str:
|
|
19
22
|
return repr(self.params)
|
|
20
23
|
|
|
@@ -23,7 +26,6 @@ class GDABeamlineParameters:
|
|
|
23
26
|
|
|
24
27
|
@classmethod
|
|
25
28
|
def from_lines(cls, file_name: str, config_lines: list[str]):
|
|
26
|
-
ob = cls()
|
|
27
29
|
config_lines_nocomments = [line.split("#", 1)[0] for line in config_lines]
|
|
28
30
|
config_lines_sep_key_and_value = [
|
|
29
31
|
# XXX removes all whitespace instead of just trim
|
|
@@ -31,7 +33,7 @@ class GDABeamlineParameters:
|
|
|
31
33
|
for line in config_lines_nocomments
|
|
32
34
|
]
|
|
33
35
|
config_pairs: list[tuple[str, Any]] = [
|
|
34
|
-
cast(
|
|
36
|
+
cast(tuple[str, Any], param)
|
|
35
37
|
for param in config_lines_sep_key_and_value
|
|
36
38
|
if len(param) == 2
|
|
37
39
|
]
|
|
@@ -46,8 +48,7 @@ class GDABeamlineParameters:
|
|
|
46
48
|
except Exception as e:
|
|
47
49
|
LOGGER.warning(f"Unable to parse {file_name} line {i}: {e}")
|
|
48
50
|
|
|
49
|
-
|
|
50
|
-
return ob
|
|
51
|
+
return cls(params=dict(config_pairs))
|
|
51
52
|
|
|
52
53
|
@classmethod
|
|
53
54
|
def from_file(cls, path: str):
|