dls-dodal 1.50.0__py3-none-any.whl → 1.51.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.
Files changed (70) hide show
  1. {dls_dodal-1.50.0.dist-info → dls_dodal-1.51.0.dist-info}/METADATA +3 -4
  2. {dls_dodal-1.50.0.dist-info → dls_dodal-1.51.0.dist-info}/RECORD +63 -59
  3. dodal/_version.py +2 -2
  4. dodal/beamlines/adsim.py +5 -3
  5. dodal/beamlines/b01_1.py +41 -5
  6. dodal/beamlines/b07.py +11 -1
  7. dodal/beamlines/b07_1.py +11 -1
  8. dodal/beamlines/b16.py +8 -4
  9. dodal/beamlines/b21.py +148 -0
  10. dodal/beamlines/i03.py +6 -11
  11. dodal/beamlines/i04.py +5 -5
  12. dodal/beamlines/i09.py +22 -1
  13. dodal/beamlines/i09_1.py +9 -1
  14. dodal/beamlines/i09_2.py +24 -0
  15. dodal/beamlines/i10.py +5 -6
  16. dodal/beamlines/i13_1.py +5 -5
  17. dodal/beamlines/i18.py +5 -6
  18. dodal/beamlines/i22.py +7 -1
  19. dodal/beamlines/i24.py +3 -3
  20. dodal/beamlines/p45.py +4 -3
  21. dodal/beamlines/p60.py +18 -1
  22. dodal/beamlines/p99.py +5 -5
  23. dodal/beamlines/training_rig.py +3 -3
  24. dodal/common/beamlines/beamline_utils.py +5 -2
  25. dodal/devices/aithre_lasershaping/goniometer.py +4 -5
  26. dodal/devices/aperture.py +4 -7
  27. dodal/devices/aperturescatterguard.py +2 -2
  28. dodal/devices/b07/__init__.py +3 -0
  29. dodal/devices/b07/grating.py +9 -0
  30. dodal/devices/b07_1/__init__.py +3 -0
  31. dodal/devices/b07_1/grating.py +10 -0
  32. dodal/devices/detector/detector_motion.py +19 -17
  33. dodal/devices/electron_analyser/abstract/base_driver_io.py +24 -25
  34. dodal/devices/electron_analyser/detector.py +3 -13
  35. dodal/devices/electron_analyser/specs/detector.py +9 -3
  36. dodal/devices/electron_analyser/specs/driver_io.py +5 -2
  37. dodal/devices/electron_analyser/vgscienta/detector.py +9 -3
  38. dodal/devices/electron_analyser/vgscienta/driver_io.py +5 -6
  39. dodal/devices/electron_analyser/vgscienta/region.py +0 -1
  40. dodal/devices/fast_grid_scan.py +1 -2
  41. dodal/devices/i04/constants.py +1 -1
  42. dodal/devices/i09/__init__.py +4 -0
  43. dodal/devices/i09/dcm.py +26 -0
  44. dodal/devices/i09/grating.py +7 -0
  45. dodal/devices/i10/mirrors.py +4 -6
  46. dodal/devices/i10/rasor/rasor_motors.py +0 -14
  47. dodal/devices/i19/beamstop.py +3 -7
  48. dodal/devices/i24/aperture.py +4 -6
  49. dodal/devices/i24/beamstop.py +5 -8
  50. dodal/devices/i24/pmac.py +4 -8
  51. dodal/devices/motors.py +92 -35
  52. dodal/devices/p45.py +0 -12
  53. dodal/devices/p60/__init__.py +3 -0
  54. dodal/devices/p60/lab_xray_source.py +21 -0
  55. dodal/devices/pgm.py +1 -1
  56. dodal/devices/robot.py +11 -7
  57. dodal/devices/smargon.py +8 -9
  58. dodal/devices/zocalo/zocalo_results.py +27 -78
  59. dodal/plans/configure_arm_trigger_and_disarm_detector.py +7 -5
  60. dodal/devices/adsim.py +0 -13
  61. dodal/devices/i18/table.py +0 -14
  62. dodal/devices/i18/thor_labs_stage.py +0 -12
  63. dodal/devices/i24/i24_detector_motion.py +0 -12
  64. dodal/devices/scatterguard.py +0 -11
  65. dodal/devices/training_rig/__init__.py +0 -0
  66. dodal/devices/training_rig/sample_stage.py +0 -10
  67. {dls_dodal-1.50.0.dist-info → dls_dodal-1.51.0.dist-info}/WHEEL +0 -0
  68. {dls_dodal-1.50.0.dist-info → dls_dodal-1.51.0.dist-info}/entry_points.txt +0 -0
  69. {dls_dodal-1.50.0.dist-info → dls_dodal-1.51.0.dist-info}/licenses/LICENSE +0 -0
  70. {dls_dodal-1.50.0.dist-info → dls_dodal-1.51.0.dist-info}/top_level.txt +0 -0
dodal/beamlines/i03.py CHANGED
@@ -28,7 +28,7 @@ from dodal.devices.focusing_mirror import FocusingMirrorWithStripes, MirrorVolta
28
28
  from dodal.devices.i03 import Beamstop
29
29
  from dodal.devices.i03.dcm import DCM
30
30
  from dodal.devices.i03.undulator_dcm import UndulatorDCM
31
- from dodal.devices.motors import XYZPositioner
31
+ from dodal.devices.motors import XYZStage
32
32
  from dodal.devices.oav.oav_detector import OAVBeamCentreFile
33
33
  from dodal.devices.oav.oav_parameters import OAVConfigBeamCentre
34
34
  from dodal.devices.oav.pin_image_recognition import PinTipDetection
@@ -368,10 +368,7 @@ def zocalo() -> ZocaloResults:
368
368
  """Get the i03 ZocaloResults device, instantiate it if it hasn't already been.
369
369
  If this is called when already instantiated in i03, it will return the existing object.
370
370
  """
371
- return ZocaloResults(
372
- name="zocalo",
373
- prefix=PREFIX.beamline_prefix,
374
- )
371
+ return ZocaloResults(name="zocalo", prefix=PREFIX.beamline_prefix, use_gpu=True)
375
372
 
376
373
 
377
374
  @device_factory()
@@ -409,11 +406,11 @@ def thawer() -> Thawer:
409
406
 
410
407
 
411
408
  @device_factory()
412
- def lower_gonio() -> XYZPositioner:
409
+ def lower_gonio() -> XYZStage:
413
410
  """Get the i03 lower gonio device, instantiate it if it hasn't already been.
414
411
  If this is called when already instantiated in i03, it will return the existing object.
415
412
  """
416
- return XYZPositioner(
413
+ return XYZStage(
417
414
  f"{PREFIX.beamline_prefix}-MO-GONP-01:",
418
415
  "lower_gonio",
419
416
  )
@@ -451,11 +448,9 @@ def qbpm() -> QBPM:
451
448
  )
452
449
 
453
450
 
454
- @device_factory(
455
- skip=True
456
- ) # Skipping as not yet on the beamline, see https://jira.diamond.ac.uk/browse/I03-894
451
+ @device_factory()
457
452
  def baton() -> Baton:
458
453
  """Get the i03 baton device, instantiate it if it hasn't already been.
459
454
  If this is called when already instantiated in i03, it will return the existing object.
460
455
  """
461
- return Baton(f"{PREFIX.beamline_prefix}:")
456
+ return Baton(f"{PREFIX.beamline_prefix}-CS-BATON-01:")
dodal/beamlines/i04.py CHANGED
@@ -22,7 +22,7 @@ from dodal.devices.i04.constants import RedisConstants
22
22
  from dodal.devices.i04.murko_results import MurkoResultsDevice
23
23
  from dodal.devices.i04.transfocator import Transfocator
24
24
  from dodal.devices.ipin import IPin
25
- from dodal.devices.motors import XYZPositioner
25
+ from dodal.devices.motors import XYZStage
26
26
  from dodal.devices.mx_phase1.beamstop import Beamstop
27
27
  from dodal.devices.oav.oav_detector import OAVBeamCentrePV
28
28
  from dodal.devices.oav.oav_parameters import OAVConfig
@@ -77,22 +77,22 @@ def smargon() -> Smargon:
77
77
 
78
78
 
79
79
  @device_factory()
80
- def gonio_positioner() -> XYZPositioner:
80
+ def gonio_positioner() -> XYZStage:
81
81
  """Get the i04 lower_gonio_stages device, instantiate it if it hasn't already been.
82
82
  If this is called when already instantiated in i04, it will return the existing object.
83
83
  """
84
- return XYZPositioner(
84
+ return XYZStage(
85
85
  f"{PREFIX.beamline_prefix}-MO-GONIO-01:",
86
86
  "lower_gonio_stages",
87
87
  )
88
88
 
89
89
 
90
90
  @device_factory()
91
- def sample_delivery_system() -> XYZPositioner:
91
+ def sample_delivery_system() -> XYZStage:
92
92
  """Get the i04 sample_delivery_system device, instantiate it if it hasn't already been.
93
93
  If this is called when already instantiated in i04, it will return the existing object.
94
94
  """
95
- return XYZPositioner(
95
+ return XYZStage(
96
96
  f"{PREFIX.beamline_prefix}-MO-SDE-01:",
97
97
  "sample_delivery_system",
98
98
  )
dodal/beamlines/i09.py CHANGED
@@ -3,6 +3,8 @@ from dodal.common.beamlines.beamline_utils import (
3
3
  )
4
4
  from dodal.common.beamlines.beamline_utils import set_beamline as set_utils_beamline
5
5
  from dodal.devices.electron_analyser.vgscienta import VGScientaAnalyserDriverIO
6
+ from dodal.devices.i09 import DCM, I09Grating
7
+ from dodal.devices.pgm import PGM
6
8
  from dodal.devices.synchrotron import Synchrotron
7
9
  from dodal.log import set_beamline as set_log_beamline
8
10
  from dodal.utils import BeamlinePrefix, get_beamline_name
@@ -18,6 +20,25 @@ def synchrotron() -> Synchrotron:
18
20
  return Synchrotron()
19
21
 
20
22
 
23
+ @device_factory()
24
+ def pgm() -> PGM:
25
+ return PGM(
26
+ prefix=f"{BeamlinePrefix(BL, suffix='J').beamline_prefix}-MO-PGM-01:",
27
+ grating=I09Grating,
28
+ )
29
+
30
+
31
+ @device_factory()
32
+ def dcm() -> DCM:
33
+ return DCM(prefix=f"{PREFIX.beamline_prefix}-MO-DCM-01:")
34
+
35
+
21
36
  @device_factory()
22
37
  def analyser_driver() -> VGScientaAnalyserDriverIO:
23
- return VGScientaAnalyserDriverIO(prefix=f"{PREFIX.beamline_prefix}-EA-DET-01:CAM:")
38
+ energy_sources = {
39
+ "source1": pgm().energy.user_readback,
40
+ "source2": dcm().energy_in_ev,
41
+ }
42
+ return VGScientaAnalyserDriverIO(
43
+ f"{PREFIX.beamline_prefix}-EA-DET-01:CAM:", energy_sources
44
+ )
dodal/beamlines/i09_1.py CHANGED
@@ -3,6 +3,7 @@ from dodal.common.beamlines.beamline_utils import (
3
3
  )
4
4
  from dodal.common.beamlines.beamline_utils import set_beamline as set_utils_beamline
5
5
  from dodal.devices.electron_analyser.specs import SpecsAnalyserDriverIO
6
+ from dodal.devices.i09.dcm import DCM
6
7
  from dodal.devices.synchrotron import Synchrotron
7
8
  from dodal.log import set_beamline as set_log_beamline
8
9
  from dodal.utils import BeamlinePrefix, get_beamline_name
@@ -18,6 +19,13 @@ def synchrotron() -> Synchrotron:
18
19
  return Synchrotron()
19
20
 
20
21
 
22
+ @device_factory()
23
+ def dcm() -> DCM:
24
+ return DCM(prefix=f"{PREFIX.beamline_prefix}-MO-DCM-01:")
25
+
26
+
21
27
  @device_factory()
22
28
  def analyser_driver() -> SpecsAnalyserDriverIO:
23
- return SpecsAnalyserDriverIO(prefix=f"{PREFIX.beamline_prefix}-EA-DET-02:CAM:")
29
+ return SpecsAnalyserDriverIO(
30
+ f"{PREFIX.beamline_prefix}-EA-DET-02:CAM:", {"source1": dcm().energy_in_ev}
31
+ )
@@ -0,0 +1,24 @@
1
+ from dodal.common.beamlines.beamline_utils import (
2
+ device_factory,
3
+ )
4
+ from dodal.common.beamlines.beamline_utils import set_beamline as set_utils_beamline
5
+ from dodal.devices.i09.grating import I09Grating
6
+ from dodal.devices.pgm import PGM
7
+ from dodal.devices.synchrotron import Synchrotron
8
+ from dodal.log import set_beamline as set_log_beamline
9
+ from dodal.utils import BeamlinePrefix, get_beamline_name
10
+
11
+ BL = get_beamline_name("i09-2")
12
+ PREFIX = BeamlinePrefix(BL, suffix="J")
13
+ set_log_beamline(BL)
14
+ set_utils_beamline(BL)
15
+
16
+
17
+ @device_factory()
18
+ def synchrotron() -> Synchrotron:
19
+ return Synchrotron()
20
+
21
+
22
+ @device_factory()
23
+ def pgm() -> PGM:
24
+ return PGM(prefix=f"{PREFIX.beamline_prefix}-MO-PGM-01:", grating=I09Grating)
dodal/beamlines/i10.py CHANGED
@@ -20,11 +20,10 @@ from dodal.devices.i10.rasor.rasor_motors import (
20
20
  DetSlits,
21
21
  Diffractometer,
22
22
  PaStage,
23
- PinHole,
24
23
  )
25
24
  from dodal.devices.i10.rasor.rasor_scaler_cards import RasorScalerCard1
26
25
  from dodal.devices.i10.slits import I10Slits, I10SlitsDrainCurrent
27
- from dodal.devices.motors import XYZPositioner
26
+ from dodal.devices.motors import XYStage, XYZStage
28
27
  from dodal.devices.pgm import PGM
29
28
  from dodal.log import set_beamline as set_log_beamline
30
29
  from dodal.utils import BeamlinePrefix, get_beamline_name
@@ -130,8 +129,8 @@ def d5a_det() -> I10Diagnostic5ADet:
130
129
 
131
130
 
132
131
  @device_factory()
133
- def pin_hole() -> PinHole:
134
- return PinHole(prefix="ME01D-EA-PINH-01:")
132
+ def pin_hole() -> XYStage:
133
+ return XYStage(prefix="ME01D-EA-PINH-01:")
135
134
 
136
135
 
137
136
  @device_factory()
@@ -150,8 +149,8 @@ def pa_stage() -> PaStage:
150
149
 
151
150
 
152
151
  @device_factory()
153
- def sample_stage() -> XYZPositioner:
154
- return XYZPositioner(prefix="ME01D-MO-CRYO-01:")
152
+ def sample_stage() -> XYZStage:
153
+ return XYZStage(prefix="ME01D-MO-CRYO-01:")
155
154
 
156
155
 
157
156
  @device_factory()
dodal/beamlines/i13_1.py CHANGED
@@ -10,7 +10,7 @@ from dodal.common.beamlines.beamline_utils import (
10
10
  from dodal.common.beamlines.beamline_utils import set_beamline as set_utils_beamline
11
11
  from dodal.common.visit import LocalDirectoryServiceClient, StaticVisitPathProvider
12
12
  from dodal.devices.i13_1.merlin import Merlin
13
- from dodal.devices.motors import XYZPositioner
13
+ from dodal.devices.motors import XYZStage
14
14
  from dodal.log import set_beamline as set_log_beamline
15
15
  from dodal.utils import BeamlinePrefix, get_beamline_name
16
16
 
@@ -29,13 +29,13 @@ set_path_provider(
29
29
 
30
30
 
31
31
  @device_factory()
32
- def sample_xyz_stage() -> XYZPositioner:
33
- return XYZPositioner(prefix=f"{PREFIX}-MO-PI-02:")
32
+ def sample_xyz_stage() -> XYZStage:
33
+ return XYZStage(prefix=f"{PREFIX}-MO-PI-02:")
34
34
 
35
35
 
36
36
  @device_factory()
37
- def sample_xyz_lab_fa_stage() -> XYZPositioner:
38
- return XYZPositioner(prefix=f"{PREFIX}-MO-PI-02:FIXANG:")
37
+ def sample_xyz_lab_fa_stage() -> XYZStage:
38
+ return XYZStage(prefix=f"{PREFIX}-MO-PI-02:FIXANG:")
39
39
 
40
40
 
41
41
  @device_factory()
dodal/beamlines/i18.py CHANGED
@@ -15,8 +15,7 @@ from dodal.common.visit import (
15
15
  from dodal.devices.common_dcm import BaseDCM, PitchAndRollCrystal, RollCrystal
16
16
  from dodal.devices.i18.diode import Diode
17
17
  from dodal.devices.i18.KBMirror import KBMirror
18
- from dodal.devices.i18.table import Table
19
- from dodal.devices.i18.thor_labs_stage import ThorLabsStage
18
+ from dodal.devices.motors import XYStage, XYZThetaStage
20
19
  from dodal.devices.slits import Slits
21
20
  from dodal.devices.synchrotron import Synchrotron
22
21
  from dodal.devices.tetramm import TetrammDetector
@@ -118,10 +117,10 @@ def d7_diode() -> Diode:
118
117
 
119
118
 
120
119
  @device_factory()
121
- def main_table() -> Table:
122
- return Table(f"{PREFIX.beamline_prefix}-MO-TABLE-01:")
120
+ def main_table() -> XYZThetaStage:
121
+ return XYZThetaStage(f"{PREFIX.beamline_prefix}-MO-TABLE-01:")
123
122
 
124
123
 
125
124
  @device_factory()
126
- def thor_labs_stage() -> ThorLabsStage:
127
- return ThorLabsStage(f"{PREFIX.beamline_prefix}-MO-TABLE-02:")
125
+ def thor_labs_stage() -> XYStage:
126
+ return XYStage(f"{PREFIX.beamline_prefix}-MO-TABLE-02:")
dodal/beamlines/i22.py CHANGED
@@ -22,6 +22,7 @@ from dodal.devices.i22.dcm import DCM
22
22
  from dodal.devices.i22.fswitch import FSwitch
23
23
  from dodal.devices.i22.nxsas import NXSasMetadataHolder, NXSasOAV, NXSasPilatus
24
24
  from dodal.devices.linkam3 import Linkam3
25
+ from dodal.devices.motors import XYPitchStage
25
26
  from dodal.devices.slits import Slits
26
27
  from dodal.devices.synchrotron import Synchrotron
27
28
  from dodal.devices.tetramm import TetrammDetector
@@ -136,7 +137,7 @@ def bimorph_hfm() -> BimorphMirror:
136
137
  @device_factory()
137
138
  def bimorph_vfm() -> BimorphMirror:
138
139
  return BimorphMirror(
139
- prefix=f"{PREFIX.beamline_prefix}-OP-KBM-01:G1:", number_of_channels=16
140
+ prefix=f"{PREFIX.beamline_prefix}-OP-KBM-01:G1:", number_of_channels=32
140
141
  )
141
142
 
142
143
 
@@ -264,3 +265,8 @@ def linkam() -> Linkam3:
264
265
  def ppump() -> WatsonMarlow323Pump:
265
266
  """Sample Environment Peristaltic Pump"""
266
267
  return WatsonMarlow323Pump(f"{PREFIX.beamline_prefix}-EA-PUMP-01:")
268
+
269
+
270
+ @device_factory()
271
+ def base_top() -> XYPitchStage:
272
+ return XYPitchStage(f"{PREFIX.beamline_prefix}-MO-STABL-01:")
dodal/beamlines/i24.py CHANGED
@@ -11,10 +11,10 @@ from dodal.devices.i24.beamstop import Beamstop
11
11
  from dodal.devices.i24.dcm import DCM
12
12
  from dodal.devices.i24.dual_backlight import DualBacklight
13
13
  from dodal.devices.i24.focus_mirrors import FocusMirrorsMode
14
- from dodal.devices.i24.i24_detector_motion import DetectorMotion
15
14
  from dodal.devices.i24.pilatus_metadata import PilatusMetadata
16
15
  from dodal.devices.i24.pmac import PMAC
17
16
  from dodal.devices.i24.vgonio import VerticalGoniometer
17
+ from dodal.devices.motors import YZStage
18
18
  from dodal.devices.oav.oav_detector import OAVBeamCentreFile
19
19
  from dodal.devices.oav.oav_parameters import OAVConfigBeamCentre
20
20
  from dodal.devices.zebra.zebra import Zebra
@@ -89,11 +89,11 @@ def backlight() -> DualBacklight:
89
89
 
90
90
 
91
91
  @device_factory()
92
- def detector_motion() -> DetectorMotion:
92
+ def detector_motion() -> YZStage:
93
93
  """Get the i24 detector motion device, instantiate it if it hasn't already been.
94
94
  If this is called when already instantiated in i24, it will return the existing object.
95
95
  """
96
- return DetectorMotion(
96
+ return YZStage(
97
97
  name="detector_motion",
98
98
  prefix=f"{PREFIX.beamline_prefix}-EA-DET-01:",
99
99
  )
dodal/beamlines/p45.py CHANGED
@@ -11,7 +11,8 @@ from dodal.common.beamlines.beamline_utils import (
11
11
  from dodal.common.beamlines.beamline_utils import set_beamline as set_utils_beamline
12
12
  from dodal.common.beamlines.device_helpers import DET_SUFFIX, HDF5_SUFFIX
13
13
  from dodal.common.visit import StaticVisitPathProvider
14
- from dodal.devices.p45 import Choppers, TomoStageWithStretchAndSkew
14
+ from dodal.devices.motors import XYStage
15
+ from dodal.devices.p45 import TomoStageWithStretchAndSkew
15
16
  from dodal.log import set_beamline as set_log_beamline
16
17
  from dodal.utils import BeamlinePrefix, get_beamline_name
17
18
 
@@ -34,8 +35,8 @@ def sample() -> TomoStageWithStretchAndSkew:
34
35
 
35
36
 
36
37
  @device_factory()
37
- def choppers() -> Choppers:
38
- return Choppers(f"{PREFIX.beamline_prefix}-MO-CHOP-01:")
38
+ def choppers() -> XYStage:
39
+ return XYStage(f"{PREFIX.beamline_prefix}-MO-CHOP-01:")
39
40
 
40
41
 
41
42
  # Disconnected
dodal/beamlines/p60.py CHANGED
@@ -3,6 +3,7 @@ from dodal.common.beamlines.beamline_utils import (
3
3
  )
4
4
  from dodal.common.beamlines.beamline_utils import set_beamline as set_utils_beamline
5
5
  from dodal.devices.electron_analyser.vgscienta import VGScientaAnalyserDriverIO
6
+ from dodal.devices.p60 import LabXraySource, LabXraySourceReadable
6
7
  from dodal.log import set_beamline as set_log_beamline
7
8
  from dodal.utils import BeamlinePrefix, get_beamline_name
8
9
 
@@ -12,6 +13,22 @@ set_log_beamline(BL)
12
13
  set_utils_beamline(BL)
13
14
 
14
15
 
16
+ @device_factory()
17
+ def al_kalpha_source() -> LabXraySourceReadable:
18
+ return LabXraySourceReadable(LabXraySource.AL_KALPHA)
19
+
20
+
21
+ @device_factory()
22
+ def mg_kalpha_source() -> LabXraySourceReadable:
23
+ return LabXraySourceReadable(LabXraySource.MG_KALPHA)
24
+
25
+
15
26
  @device_factory()
16
27
  def analyser_driver() -> VGScientaAnalyserDriverIO:
17
- return VGScientaAnalyserDriverIO(prefix=f"{PREFIX.beamline_prefix}-EA-DET-01:CAM:")
28
+ energy_sources = {
29
+ "source1": al_kalpha_source().energy_ev,
30
+ "source2": mg_kalpha_source().energy_ev,
31
+ }
32
+ return VGScientaAnalyserDriverIO(
33
+ f"{PREFIX.beamline_prefix}-EA-DET-01:CAM:", energy_sources
34
+ )
dodal/beamlines/p99.py CHANGED
@@ -15,7 +15,7 @@ from dodal.common.visit import (
15
15
  )
16
16
  from dodal.devices.attenuator.filter import FilterMotor
17
17
  from dodal.devices.attenuator.filter_selections import P99FilterSelections
18
- from dodal.devices.motors import XYZPositioner
18
+ from dodal.devices.motors import XYZStage
19
19
  from dodal.devices.p99.andor2_point import Andor2Point
20
20
  from dodal.devices.p99.sample_stage import SampleAngleStage
21
21
  from dodal.log import set_beamline as set_log_beamline
@@ -38,13 +38,13 @@ def filter() -> FilterMotor:
38
38
 
39
39
 
40
40
  @device_factory()
41
- def sample_stage() -> XYZPositioner:
42
- return XYZPositioner(f"{PREFIX.beamline_prefix}-MO-STAGE-02:")
41
+ def sample_stage() -> XYZStage:
42
+ return XYZStage(f"{PREFIX.beamline_prefix}-MO-STAGE-02:")
43
43
 
44
44
 
45
45
  @device_factory()
46
- def lab_stage() -> XYZPositioner:
47
- return XYZPositioner(f"{PREFIX.beamline_prefix}-MO-STAGE-02:LAB:")
46
+ def lab_stage() -> XYZStage:
47
+ return XYZStage(f"{PREFIX.beamline_prefix}-MO-STAGE-02:LAB:")
48
48
 
49
49
 
50
50
  set_path_provider(
@@ -14,7 +14,7 @@ from dodal.common.visit import (
14
14
  LocalDirectoryServiceClient,
15
15
  StaticVisitPathProvider,
16
16
  )
17
- from dodal.devices.training_rig.sample_stage import TrainingRigSampleStage
17
+ from dodal.devices.motors import XThetaStage
18
18
  from dodal.log import set_beamline as set_log_beamline
19
19
  from dodal.utils import BeamlinePrefix, get_beamline_name
20
20
 
@@ -45,8 +45,8 @@ set_path_provider(
45
45
 
46
46
 
47
47
  @device_factory()
48
- def sample_stage() -> TrainingRigSampleStage:
49
- return TrainingRigSampleStage(f"{PREFIX.beamline_prefix}-MO-MAP-01:STAGE:")
48
+ def sample_stage() -> XThetaStage:
49
+ return XThetaStage(f"{PREFIX.beamline_prefix}-MO-MAP-01:STAGE:")
50
50
 
51
51
 
52
52
  @device_factory()
@@ -33,12 +33,15 @@ def set_beamline(beamline: str):
33
33
 
34
34
  def clear_devices():
35
35
  global ACTIVE_DEVICES
36
- for d in list(ACTIVE_DEVICES):
37
- del ACTIVE_DEVICES[d]
36
+ for name in list(ACTIVE_DEVICES):
37
+ clear_device(name)
38
38
 
39
39
 
40
40
  def clear_device(name: str):
41
41
  global ACTIVE_DEVICES
42
+ device = ACTIVE_DEVICES[name]
43
+ if isinstance(device, OphydV1Device):
44
+ device.destroy()
42
45
  del ACTIVE_DEVICES[name]
43
46
 
44
47
 
@@ -1,11 +1,13 @@
1
1
  import asyncio
2
2
  import math
3
3
 
4
- from ophyd_async.core import StandardReadable, derived_signal_rw
4
+ from ophyd_async.core import derived_signal_rw
5
5
  from ophyd_async.epics.motor import Motor
6
6
 
7
+ from dodal.devices.motors import XYZStage
7
8
 
8
- class Goniometer(StandardReadable):
9
+
10
+ class Goniometer(XYZStage):
9
11
  """The Aithre lab goniometer and the XYZ stage it sits on.
10
12
 
11
13
  `x`, `y` and `z` control the axes of the positioner at the base, while `sampy` and
@@ -18,9 +20,6 @@ class Goniometer(StandardReadable):
18
20
  """
19
21
 
20
22
  def __init__(self, prefix: str, name: str = "") -> None:
21
- self.x = Motor(prefix + "X")
22
- self.y = Motor(prefix + "Y")
23
- self.z = Motor(prefix + "Z")
24
23
  self.sampy = Motor(prefix + "SAMPY")
25
24
  self.sampz = Motor(prefix + "SAMPZ")
26
25
  self.omega = Motor(prefix + "OMEGA")
dodal/devices/aperture.py CHANGED
@@ -1,14 +1,11 @@
1
- from ophyd_async.core import StandardReadable
2
1
  from ophyd_async.epics.core import epics_signal_r
3
- from ophyd_async.epics.motor import Motor
4
2
 
3
+ from dodal.devices.motors import XYZStage
5
4
 
6
- class Aperture(StandardReadable):
5
+
6
+ class Aperture(XYZStage):
7
7
  def __init__(self, prefix: str, name: str = "") -> None:
8
- self.x = Motor(prefix + "X")
9
- self.y = Motor(prefix + "Y")
10
- self.z = Motor(prefix + "Z")
11
8
  self.small = epics_signal_r(float, prefix + "Y:SMALL_CALC")
12
9
  self.medium = epics_signal_r(float, prefix + "Y:MEDIUM_CALC")
13
10
  self.large = epics_signal_r(float, prefix + "Y:LARGE_CALC")
14
- super().__init__(name)
11
+ super().__init__(prefix, name)
@@ -15,7 +15,7 @@ from pydantic import BaseModel, Field
15
15
 
16
16
  from dodal.common.beamlines.beamline_parameters import GDABeamlineParameters
17
17
  from dodal.devices.aperture import Aperture
18
- from dodal.devices.scatterguard import Scatterguard
18
+ from dodal.devices.motors import XYStage
19
19
 
20
20
 
21
21
  class InvalidApertureMove(Exception):
@@ -164,7 +164,7 @@ class ApertureScatterguard(StandardReadable, Preparable):
164
164
  name: str = "",
165
165
  ) -> None:
166
166
  self.aperture = Aperture(prefix + "-MO-MAPT-01:")
167
- self.scatterguard = Scatterguard(prefix + "-MO-SCAT-01:")
167
+ self.scatterguard = XYStage(prefix + "-MO-SCAT-01:")
168
168
  self._loaded_positions = loaded_positions
169
169
  self._tolerances = tolerances
170
170
  with self.add_children_as_readables(StandardReadableFormat.HINTED_SIGNAL):
@@ -0,0 +1,3 @@
1
+ from dodal.devices.b07.grating import B07BGrating
2
+
3
+ __all__ = ["B07BGrating"]
@@ -0,0 +1,9 @@
1
+ from ophyd_async.core import StrictEnum
2
+
3
+
4
+ class B07BGrating(StrictEnum):
5
+ NI_400 = "400 l/mm Ni"
6
+ NI_1000 = "1000 l/mm Ni"
7
+ PT_600 = "BAD 600 l/mm Pt"
8
+ AU_600 = "600 l/mm Au"
9
+ NO_GRATING = "No Grating"
@@ -0,0 +1,3 @@
1
+ from dodal.devices.b07_1.grating import B07CGrating
2
+
3
+ __all__ = ["B07CGrating"]
@@ -0,0 +1,10 @@
1
+ from ophyd_async.core import StrictEnum
2
+
3
+
4
+ class B07CGrating(StrictEnum):
5
+ AU_400 = "400 l/mm Au"
6
+ AU_600 = "600 l/mm Au"
7
+ PT_600 = "600 l/mm Pt"
8
+ AU_1200 = "1200 l/mm Au"
9
+ ML_1200 = "1200 l/mm ML"
10
+ NO_GRATING = "No Grating"
@@ -1,42 +1,44 @@
1
- from ophyd_async.core import Device, StrictEnum
1
+ from ophyd_async.core import StrictEnum
2
2
  from ophyd_async.epics.core import epics_signal_r, epics_signal_rw
3
3
  from ophyd_async.epics.motor import Motor
4
4
 
5
+ from dodal.devices.motors import XYZStage
6
+
5
7
 
6
8
  class ShutterState(StrictEnum):
7
9
  CLOSED = "Closed"
8
10
  OPEN = "Open"
9
11
 
10
12
 
11
- class DetectorMotion(Device):
13
+ class DetectorMotion(XYZStage):
14
+ _device_prefix = "-MO-DET-01:"
15
+ _pmac_prefix = "-MO-PMAC-02:"
16
+
12
17
  def __init__(self, prefix: str, name: str = ""):
13
- device_prefix = "-MO-DET-01:"
14
- pmac_prefix = "-MO-PMAC-02:"
18
+ device_prefix = f"{prefix}{self._device_prefix}"
19
+ pmac_prefix = f"{prefix}{self._pmac_prefix}"
15
20
 
16
- self.upstream_x = Motor(f"{prefix}{device_prefix}UPSTREAMX")
17
- self.downstream_x = Motor(f"{prefix}{device_prefix}DOWNSTREAMX")
18
- self.x = Motor(f"{prefix}{device_prefix}X")
19
- self.y = Motor(f"{prefix}{device_prefix}Y")
20
- self.z = Motor(f"{prefix}{device_prefix}Z")
21
- self.yaw = Motor(f"{prefix}{device_prefix}YAW")
21
+ self.upstream_x = Motor(f"{device_prefix}UPSTREAMX")
22
+ self.downstream_x = Motor(f"{device_prefix}DOWNSTREAMX")
23
+ self.yaw = Motor(f"{device_prefix}YAW")
22
24
 
23
25
  self.shutter = epics_signal_rw(
24
- ShutterState, f"{prefix}{device_prefix}SET_SHUTTER_STATE"
26
+ ShutterState, f"{device_prefix}SET_SHUTTER_STATE"
25
27
  )
26
28
  self.shutter_closed_lim = epics_signal_r(
27
- float, f"{prefix}{device_prefix}CLOSE_LIMIT"
29
+ float, f"{device_prefix}CLOSE_LIMIT"
28
30
  ) # on limit = 1, off = 0
29
31
  self.shutter_open_lim = epics_signal_r(
30
- float, f"{prefix}{device_prefix}OPEN_LIMIT"
32
+ float, f"{device_prefix}OPEN_LIMIT"
31
33
  ) # on limit = 1, off = 0
32
34
  self.z_disabled = epics_signal_r(
33
- float, f"{prefix}{device_prefix}Z:DISABLED"
35
+ float, f"{device_prefix}Z:DISABLED"
34
36
  ) # robot interlock, 0=ok to move, 1=blocked
35
37
  self.crate_power = epics_signal_r(
36
- float, f"{prefix}{pmac_prefix}CRATE2_HEALTHY"
38
+ float, f"{pmac_prefix}CRATE2_HEALTHY"
37
39
  ) # returns 0 if no power
38
40
  self.in_robot_load_safe_position = epics_signal_r(
39
- int, f"{prefix}{pmac_prefix}GPIO_INP_BITS.B2"
41
+ int, f"{pmac_prefix}GPIO_INP_BITS.B2"
40
42
  ) # returns 1 if safe
41
43
 
42
- super().__init__(name)
44
+ super().__init__(device_prefix, name)