dls-dodal 1.66.0__py3-none-any.whl → 1.68.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 (83) hide show
  1. {dls_dodal-1.66.0.dist-info → dls_dodal-1.68.0.dist-info}/METADATA +2 -2
  2. {dls_dodal-1.66.0.dist-info → dls_dodal-1.68.0.dist-info}/RECORD +75 -65
  3. dodal/_version.py +2 -2
  4. dodal/beamlines/b07.py +1 -1
  5. dodal/beamlines/b07_1.py +1 -1
  6. dodal/beamlines/i03.py +92 -208
  7. dodal/beamlines/i04.py +22 -1
  8. dodal/beamlines/i05.py +1 -1
  9. dodal/beamlines/i06.py +1 -1
  10. dodal/beamlines/i09.py +1 -1
  11. dodal/beamlines/i09_1.py +27 -3
  12. dodal/beamlines/i09_2.py +58 -2
  13. dodal/beamlines/i10_optics.py +44 -25
  14. dodal/beamlines/i16.py +23 -0
  15. dodal/beamlines/i17.py +7 -3
  16. dodal/beamlines/i19_1.py +26 -14
  17. dodal/beamlines/i19_2.py +49 -38
  18. dodal/beamlines/i21.py +61 -2
  19. dodal/beamlines/i22.py +16 -1
  20. dodal/beamlines/p60.py +1 -1
  21. dodal/beamlines/training_rig.py +0 -16
  22. dodal/cli.py +26 -12
  23. dodal/common/coordination.py +3 -2
  24. dodal/device_manager.py +604 -0
  25. dodal/devices/cryostream.py +28 -57
  26. dodal/devices/eiger.py +41 -27
  27. dodal/devices/electron_analyser/__init__.py +0 -33
  28. dodal/devices/electron_analyser/base/__init__.py +58 -0
  29. dodal/devices/electron_analyser/base/base_controller.py +73 -0
  30. dodal/devices/electron_analyser/base/base_detector.py +214 -0
  31. dodal/devices/electron_analyser/{abstract → base}/base_driver_io.py +23 -42
  32. dodal/devices/electron_analyser/{abstract → base}/base_region.py +47 -11
  33. dodal/devices/electron_analyser/{util.py → base/base_util.py} +1 -1
  34. dodal/devices/electron_analyser/{energy_sources.py → base/energy_sources.py} +1 -1
  35. dodal/devices/electron_analyser/specs/__init__.py +4 -4
  36. dodal/devices/electron_analyser/specs/specs_detector.py +46 -0
  37. dodal/devices/electron_analyser/specs/{driver_io.py → specs_driver_io.py} +23 -26
  38. dodal/devices/electron_analyser/specs/{region.py → specs_region.py} +4 -3
  39. dodal/devices/electron_analyser/vgscienta/__init__.py +4 -4
  40. dodal/devices/electron_analyser/vgscienta/vgscienta_detector.py +52 -0
  41. dodal/devices/electron_analyser/vgscienta/{driver_io.py → vgscienta_driver_io.py} +25 -31
  42. dodal/devices/electron_analyser/vgscienta/{region.py → vgscienta_region.py} +6 -6
  43. dodal/devices/i04/max_pixel.py +38 -0
  44. dodal/devices/i09_1_shared/__init__.py +8 -1
  45. dodal/devices/i09_1_shared/hard_energy.py +112 -0
  46. dodal/devices/i09_2_shared/__init__.py +0 -0
  47. dodal/devices/i09_2_shared/i09_apple2.py +14 -0
  48. dodal/devices/i10/i10_apple2.py +24 -22
  49. dodal/devices/i17/i17_apple2.py +32 -20
  50. dodal/devices/i19/access_controlled/attenuator_motor_squad.py +61 -0
  51. dodal/devices/i19/access_controlled/blueapi_device.py +9 -1
  52. dodal/devices/i19/access_controlled/shutter.py +2 -4
  53. dodal/devices/i21/__init__.py +3 -1
  54. dodal/devices/insertion_device/__init__.py +58 -0
  55. dodal/devices/{apple2_undulator.py → insertion_device/apple2_undulator.py} +102 -44
  56. dodal/devices/insertion_device/energy_motor_lookup.py +88 -0
  57. dodal/devices/insertion_device/id_enum.py +17 -0
  58. dodal/devices/insertion_device/lookup_table_models.py +317 -0
  59. dodal/devices/motors.py +14 -0
  60. dodal/devices/robot.py +16 -11
  61. dodal/plans/__init__.py +1 -1
  62. dodal/plans/configure_arm_trigger_and_disarm_detector.py +2 -4
  63. dodal/testing/electron_analyser/device_factory.py +4 -4
  64. dodal/testing/fixtures/devices/__init__.py +0 -0
  65. dodal/testing/fixtures/devices/apple2.py +78 -0
  66. dodal/testing/fixtures/run_engine.py +4 -0
  67. dodal/utils.py +6 -3
  68. dodal/devices/electron_analyser/abstract/__init__.py +0 -25
  69. dodal/devices/electron_analyser/abstract/base_detector.py +0 -63
  70. dodal/devices/electron_analyser/abstract/types.py +0 -12
  71. dodal/devices/electron_analyser/detector.py +0 -143
  72. dodal/devices/electron_analyser/specs/detector.py +0 -34
  73. dodal/devices/electron_analyser/types.py +0 -57
  74. dodal/devices/electron_analyser/vgscienta/detector.py +0 -48
  75. dodal/devices/util/lookup_tables_apple2.py +0 -390
  76. {dls_dodal-1.66.0.dist-info → dls_dodal-1.68.0.dist-info}/WHEEL +0 -0
  77. {dls_dodal-1.66.0.dist-info → dls_dodal-1.68.0.dist-info}/entry_points.txt +0 -0
  78. {dls_dodal-1.66.0.dist-info → dls_dodal-1.68.0.dist-info}/licenses/LICENSE +0 -0
  79. {dls_dodal-1.66.0.dist-info → dls_dodal-1.68.0.dist-info}/top_level.txt +0 -0
  80. /dodal/devices/electron_analyser/{enums.py → base/base_enums.py} +0 -0
  81. /dodal/devices/electron_analyser/specs/{enums.py → specs_enums.py} +0 -0
  82. /dodal/devices/electron_analyser/vgscienta/{enums.py → vgscienta_enums.py} +0 -0
  83. /dodal/plans/{scanspec.py → spec_path.py} +0 -0
dodal/beamlines/i09_2.py CHANGED
@@ -1,18 +1,39 @@
1
+ from pathlib import Path
2
+
3
+ from daq_config_server.client import ConfigServer
4
+
1
5
  from dodal.common.beamlines.beamline_utils import (
2
6
  device_factory,
3
7
  )
4
8
  from dodal.common.beamlines.beamline_utils import set_beamline as set_utils_beamline
5
- from dodal.devices.apple2_undulator import (
9
+ from dodal.devices.i09.enums import Grating
10
+ from dodal.devices.i09_2_shared.i09_apple2 import (
11
+ J09_GAP_POLY_DEG_COLUMNS,
12
+ J09_PHASE_POLY_DEG_COLUMNS,
13
+ )
14
+ from dodal.devices.insertion_device import (
6
15
  Apple2,
16
+ Apple2EnforceLHMoveController,
17
+ BeamEnergy,
18
+ InsertionDeviceEnergy,
19
+ InsertionDevicePolarisation,
7
20
  UndulatorGap,
8
21
  UndulatorPhaseAxes,
9
22
  )
10
- from dodal.devices.i09.enums import Grating
23
+ from dodal.devices.insertion_device.energy_motor_lookup import (
24
+ ConfigServerEnergyMotorLookup,
25
+ )
26
+ from dodal.devices.insertion_device.lookup_table_models import LookupTableColumnConfig
11
27
  from dodal.devices.pgm import PlaneGratingMonochromator
12
28
  from dodal.devices.synchrotron import Synchrotron
13
29
  from dodal.log import set_beamline as set_log_beamline
14
30
  from dodal.utils import BeamlinePrefix, get_beamline_name
15
31
 
32
+ J09_CONF_CLIENT = ConfigServer(url="https://daq-config.diamond.ac.uk")
33
+ LOOK_UPTABLE_DIR = "/dls_sw/i09-2/software/gda/workspace_git/gda-diamond.git/configurations/i09-2-shared/lookupTables/"
34
+ GAP_LOOKUP_FILE_NAME = "JIDEnergy2GapCalibrations.csv"
35
+ PHASE_LOOKUP_FILE_NAME = "JIDEnergy2PhaseCalibrations.csv"
36
+
16
37
  BL = get_beamline_name("i09-2")
17
38
  PREFIX = BeamlinePrefix(BL, suffix="J")
18
39
  set_log_beamline(BL)
@@ -55,3 +76,38 @@ def jid() -> Apple2:
55
76
  id_gap=jid_gap(),
56
77
  id_phase=jid_phase(),
57
78
  )
79
+
80
+
81
+ @device_factory()
82
+ def jid_controller() -> Apple2EnforceLHMoveController:
83
+ """J09 insertion device controller."""
84
+ return Apple2EnforceLHMoveController(
85
+ apple2=jid(),
86
+ gap_energy_motor_lut=ConfigServerEnergyMotorLookup(
87
+ lut_config=LookupTableColumnConfig(poly_deg=J09_GAP_POLY_DEG_COLUMNS),
88
+ config_client=J09_CONF_CLIENT,
89
+ path=Path(LOOK_UPTABLE_DIR, GAP_LOOKUP_FILE_NAME),
90
+ ),
91
+ phase_energy_motor_lut=ConfigServerEnergyMotorLookup(
92
+ lut_config=LookupTableColumnConfig(poly_deg=J09_PHASE_POLY_DEG_COLUMNS),
93
+ config_client=J09_CONF_CLIENT,
94
+ path=Path(LOOK_UPTABLE_DIR, PHASE_LOOKUP_FILE_NAME),
95
+ ),
96
+ units="keV",
97
+ )
98
+
99
+
100
+ @device_factory()
101
+ def jid_energy() -> InsertionDeviceEnergy:
102
+ return InsertionDeviceEnergy(id_controller=jid_controller())
103
+
104
+
105
+ @device_factory()
106
+ def jid_polarisation() -> InsertionDevicePolarisation:
107
+ return InsertionDevicePolarisation(id_controller=jid_controller())
108
+
109
+
110
+ @device_factory()
111
+ def energy_jid() -> BeamEnergy:
112
+ """Beam energy."""
113
+ return BeamEnergy(id_energy=jid_energy(), mono=pgm().energy)
@@ -12,14 +12,6 @@ from daq_config_server.client import ConfigServer
12
12
 
13
13
  from dodal.common.beamlines.beamline_utils import device_factory
14
14
  from dodal.common.beamlines.beamline_utils import set_beamline as set_utils_beamline
15
- from dodal.devices.apple2_undulator import (
16
- BeamEnergy,
17
- InsertionDeviceEnergy,
18
- InsertionDevicePolarisation,
19
- UndulatorGap,
20
- UndulatorJawPhase,
21
- UndulatorPhaseAxes,
22
- )
23
15
  from dodal.devices.i10 import (
24
16
  I10SharedDiagnostic,
25
17
  I10SharedSlits,
@@ -34,14 +26,25 @@ from dodal.devices.i10.i10_apple2 import (
34
26
 
35
27
  # Imports taken from i10 while we work out how to deal with split end stations
36
28
  from dodal.devices.i10.i10_setting_data import I10Grating
37
- from dodal.devices.pgm import PlaneGratingMonochromator
38
- from dodal.devices.synchrotron import Synchrotron
39
- from dodal.devices.util.lookup_tables_apple2 import (
29
+ from dodal.devices.insertion_device import (
30
+ BeamEnergy,
31
+ InsertionDeviceEnergy,
32
+ InsertionDevicePolarisation,
33
+ UndulatorGap,
34
+ UndulatorJawPhase,
35
+ UndulatorPhaseAxes,
36
+ )
37
+ from dodal.devices.insertion_device.energy_motor_lookup import (
38
+ ConfigServerEnergyMotorLookup,
39
+ )
40
+ from dodal.devices.insertion_device.lookup_table_models import (
40
41
  DEFAULT_GAP_FILE,
41
42
  DEFAULT_PHASE_FILE,
42
- EnergyMotorLookup,
43
- LookupTableConfig,
43
+ LookupTableColumnConfig,
44
+ Source,
44
45
  )
46
+ from dodal.devices.pgm import PlaneGratingMonochromator
47
+ from dodal.devices.synchrotron import Synchrotron
45
48
  from dodal.log import set_beamline as set_log_beamline
46
49
  from dodal.utils import BeamlinePrefix, get_beamline_name
47
50
 
@@ -50,8 +53,6 @@ set_log_beamline(BL)
50
53
  set_utils_beamline(BL)
51
54
  PREFIX = BeamlinePrefix(BL)
52
55
 
53
- LOOK_UPTABLE_DIR = "/dls_sw/i10/software/blueapi/scratch/i10-config/lookupTables/"
54
-
55
56
 
56
57
  @device_factory()
57
58
  def synchrotron() -> Synchrotron:
@@ -123,13 +124,22 @@ def idd() -> I10Apple2:
123
124
  @device_factory()
124
125
  def idd_controller() -> I10Apple2Controller:
125
126
  """I10 downstream insertion device controller."""
126
- idd_energy_motor_lut = EnergyMotorLookup(
127
+ source = Source(column="Source", value="idd")
128
+ idd_gap_energy_motor_lut = ConfigServerEnergyMotorLookup(
127
129
  config_client=I10_CONF_CLIENT,
128
- lut_config=LookupTableConfig(source=("Source", "idd")),
129
- gap_path=Path(LOOK_UPTABLE_DIR, DEFAULT_GAP_FILE),
130
- phase_path=Path(LOOK_UPTABLE_DIR, DEFAULT_PHASE_FILE),
130
+ lut_config=LookupTableColumnConfig(source=source),
131
+ path=Path(LOOK_UPTABLE_DIR, DEFAULT_GAP_FILE),
132
+ )
133
+ idd_phase_energy_motor_lut = ConfigServerEnergyMotorLookup(
134
+ config_client=I10_CONF_CLIENT,
135
+ lut_config=LookupTableColumnConfig(source=source),
136
+ path=Path(LOOK_UPTABLE_DIR, DEFAULT_PHASE_FILE),
137
+ )
138
+ return I10Apple2Controller(
139
+ apple2=idd(),
140
+ gap_energy_motor_lut=idd_gap_energy_motor_lut,
141
+ phase_energy_motor_lut=idd_phase_energy_motor_lut,
131
142
  )
132
- return I10Apple2Controller(apple2=idd(), energy_motor_lut=idd_energy_motor_lut)
133
143
 
134
144
 
135
145
  @device_factory()
@@ -188,13 +198,22 @@ def idu() -> I10Apple2:
188
198
  @device_factory()
189
199
  def idu_controller() -> I10Apple2Controller:
190
200
  """I10 upstream insertion device controller."""
191
- idu_energy_motor_lut = EnergyMotorLookup(
201
+ source = Source(column="Source", value="idu")
202
+ idu_gap_energy_motor_lut = ConfigServerEnergyMotorLookup(
192
203
  config_client=I10_CONF_CLIENT,
193
- lut_config=LookupTableConfig(source=("Source", "idu")),
194
- gap_path=Path(LOOK_UPTABLE_DIR, DEFAULT_GAP_FILE),
195
- phase_path=Path(LOOK_UPTABLE_DIR, DEFAULT_PHASE_FILE),
204
+ lut_config=LookupTableColumnConfig(source=source),
205
+ path=Path(LOOK_UPTABLE_DIR, DEFAULT_GAP_FILE),
206
+ )
207
+ idu_phase_energy_motor_lut = ConfigServerEnergyMotorLookup(
208
+ config_client=I10_CONF_CLIENT,
209
+ lut_config=LookupTableColumnConfig(source=source),
210
+ path=Path(LOOK_UPTABLE_DIR, DEFAULT_PHASE_FILE),
211
+ )
212
+ return I10Apple2Controller(
213
+ apple2=idd(),
214
+ gap_energy_motor_lut=idu_gap_energy_motor_lut,
215
+ phase_energy_motor_lut=idu_phase_energy_motor_lut,
196
216
  )
197
- return I10Apple2Controller(apple2=idd(), energy_motor_lut=idu_energy_motor_lut)
198
217
 
199
218
 
200
219
  @device_factory()
dodal/beamlines/i16.py ADDED
@@ -0,0 +1,23 @@
1
+ from dodal.common.beamlines.beamline_utils import set_beamline as set_utils_beamline
2
+ from dodal.device_manager import DeviceManager
3
+ from dodal.devices.undulator import UndulatorInMm, UndulatorOrder
4
+ from dodal.log import set_beamline as set_log_beamline
5
+ from dodal.utils import BeamlinePrefix, get_beamline_name
6
+
7
+ BL = get_beamline_name("i16")
8
+ set_log_beamline(BL)
9
+ set_utils_beamline(BL)
10
+ PREFIX = BeamlinePrefix(BL)
11
+
12
+
13
+ devices = DeviceManager()
14
+
15
+
16
+ @devices.factory()
17
+ def id() -> UndulatorInMm:
18
+ return UndulatorInMm(prefix=f"{PREFIX.insertion_prefix}-MO-SERVC-01:")
19
+
20
+
21
+ @devices.factory()
22
+ def harmonic() -> UndulatorOrder:
23
+ return UndulatorOrder()
dodal/beamlines/i17.py CHANGED
@@ -7,7 +7,8 @@ from dodal.common.beamlines.beamline_utils import (
7
7
  device_factory,
8
8
  )
9
9
  from dodal.common.beamlines.beamline_utils import set_beamline as set_utils_beamline
10
- from dodal.devices.apple2_undulator import (
10
+ from dodal.devices.i17.i17_apple2 import I17Apple2Controller
11
+ from dodal.devices.insertion_device import (
11
12
  Apple2,
12
13
  Apple2Controller,
13
14
  BeamEnergy,
@@ -16,7 +17,8 @@ from dodal.devices.apple2_undulator import (
16
17
  UndulatorGap,
17
18
  UndulatorPhaseAxes,
18
19
  )
19
- from dodal.devices.i17.i17_apple2 import I17Apple2Controller
20
+ from dodal.devices.insertion_device.energy_motor_lookup import EnergyMotorLookup
21
+ from dodal.devices.insertion_device.lookup_table_models import LookupTable
20
22
  from dodal.devices.pgm import PlaneGratingMonochromator
21
23
  from dodal.devices.synchrotron import Synchrotron
22
24
  from dodal.log import set_beamline as set_log_beamline
@@ -76,7 +78,9 @@ def id() -> Apple2:
76
78
  def id_controller() -> Apple2Controller:
77
79
  """I17 insertion device controller with dummy energy to motor_converter."""
78
80
  return I17Apple2Controller(
79
- apple2=id(), energy_to_motor_converter=lambda energy, pol: (0.0, 0.0)
81
+ apple2=id(),
82
+ gap_energy_motor_lut=EnergyMotorLookup(lut=LookupTable()),
83
+ phase_energy_motor_lut=EnergyMotorLookup(lut=LookupTable()),
80
84
  )
81
85
 
82
86
 
dodal/beamlines/i19_1.py CHANGED
@@ -4,6 +4,9 @@ from dodal.common.beamlines.beamline_utils import (
4
4
  from dodal.common.beamlines.beamline_utils import (
5
5
  set_beamline as set_utils_beamline,
6
6
  )
7
+ from dodal.devices.i19.access_controlled.attenuator_motor_squad import (
8
+ AttenuatorMotorSquad,
9
+ )
7
10
  from dodal.devices.i19.access_controlled.blueapi_device import HutchState
8
11
  from dodal.devices.i19.access_controlled.shutter import (
9
12
  AccessControlledShutter,
@@ -29,6 +32,8 @@ set_log_beamline(BL)
29
32
  set_utils_beamline(BL)
30
33
 
31
34
 
35
+ I19_1_COMMISSIONING_INSTR_SESSION: str = "cm40638-5"
36
+
32
37
  I19_1_ZEBRA_MAPPING = ZebraMapping(
33
38
  outputs=ZebraTTLOutputs(TTL_PILATUS=1),
34
39
  sources=ZebraSources(),
@@ -40,6 +45,13 @@ ZOOM_PARAMS_FILE = (
40
45
  DISPLAY_CONFIG = "/dls_sw/i19-1/software/daq_configuration/domain/display.configuration"
41
46
 
42
47
 
48
+ @device_factory()
49
+ def attenuator_motor_squad() -> AttenuatorMotorSquad:
50
+ return AttenuatorMotorSquad(
51
+ hutch=HutchState.EH1, instrument_session=I19_1_COMMISSIONING_INSTR_SESSION
52
+ )
53
+
54
+
43
55
  # Needs to wait until enum is fixed on the beamline
44
56
  # See https://github.com/DiamondLightSource/dodal/issues/1150
45
57
  @device_factory()
@@ -58,19 +70,6 @@ def oav() -> OAVBeamCentreFile:
58
70
  )
59
71
 
60
72
 
61
- # NOTE EH1 uses the Zebra 2 box. While a Zebra 1 box exists and is connected
62
- # on the beamline, it is currently not in use
63
- @device_factory()
64
- def zebra() -> Zebra:
65
- """Get the i19-1 zebra device, instantiate it if it hasn't already been.
66
- If this is called when already instantiated in i19-1, it will return the existing object.
67
- """
68
- return Zebra(
69
- mapping=I19_1_ZEBRA_MAPPING,
70
- prefix=f"{PREFIX.beamline_prefix}-EA-ZEBRA-02:",
71
- )
72
-
73
-
74
73
  @device_factory()
75
74
  def shutter() -> AccessControlledShutter:
76
75
  """Get the i19-1 hutch shutter device, instantiate it if it hasn't already been.
@@ -79,7 +78,7 @@ def shutter() -> AccessControlledShutter:
79
78
  return AccessControlledShutter(
80
79
  prefix=f"{PREFIX.beamline_prefix}-PS-SHTR-01:",
81
80
  hutch=HutchState.EH1,
82
- instrument_session="cm40638-4",
81
+ instrument_session=I19_1_COMMISSIONING_INSTR_SESSION,
83
82
  )
84
83
 
85
84
 
@@ -89,3 +88,16 @@ def synchrotron() -> Synchrotron:
89
88
  If this is called when already instantiated in i19-1, it will return the existing object.
90
89
  """
91
90
  return Synchrotron()
91
+
92
+
93
+ # NOTE EH1 uses the Zebra 2 box. While a Zebra 1 box exists and is connected
94
+ # on the beamline, it is currently not in use
95
+ @device_factory()
96
+ def zebra() -> Zebra:
97
+ """Get the i19-1 zebra device, instantiate it if it hasn't already been.
98
+ If this is called when already instantiated in i19-1, it will return the existing object.
99
+ """
100
+ return Zebra(
101
+ mapping=I19_1_ZEBRA_MAPPING,
102
+ prefix=f"{PREFIX.beamline_prefix}-EA-ZEBRA-02:",
103
+ )
dodal/beamlines/i19_2.py CHANGED
@@ -12,6 +12,9 @@ from dodal.common.beamlines.beamline_utils import (
12
12
  set_beamline as set_utils_beamline,
13
13
  )
14
14
  from dodal.common.visit import StaticVisitPathProvider
15
+ from dodal.devices.i19.access_controlled.attenuator_motor_squad import (
16
+ AttenuatorMotorSquad,
17
+ )
15
18
  from dodal.devices.i19.access_controlled.blueapi_device import HutchState
16
19
  from dodal.devices.i19.access_controlled.shutter import AccessControlledShutter
17
20
  from dodal.devices.i19.backlight import BacklightPosition
@@ -43,6 +46,7 @@ set_path_provider(
43
46
  )
44
47
  )
45
48
 
49
+ I19_2_COMMISSIONING_INSTR_SESSION: str = "cm40639-5"
46
50
 
47
51
  I19_2_ZEBRA_MAPPING = ZebraMapping(
48
52
  outputs=ZebraTTLOutputs(),
@@ -51,8 +55,18 @@ I19_2_ZEBRA_MAPPING = ZebraMapping(
51
55
 
52
56
 
53
57
  @device_factory()
54
- def diffractometer() -> FourCircleDiffractometer:
55
- return FourCircleDiffractometer(prefix=PREFIX.beamline_prefix)
58
+ def attenuator_motor_squad() -> AttenuatorMotorSquad:
59
+ return AttenuatorMotorSquad(
60
+ hutch=HutchState.EH2, instrument_session=I19_2_COMMISSIONING_INSTR_SESSION
61
+ )
62
+
63
+
64
+ @device_factory()
65
+ def backlight() -> BacklightPosition:
66
+ """Get the i19-2 backlight device, instantiate it if it hasn't already been.
67
+ If this is called when already instantiated in i19-2, it will return the existing object.
68
+ """
69
+ return BacklightPosition(prefix=f"{PREFIX.beamline_prefix}-EA-IOC-12:")
56
70
 
57
71
 
58
72
  @device_factory()
@@ -64,34 +78,26 @@ def beamstop() -> BeamStop:
64
78
 
65
79
 
66
80
  @device_factory()
67
- def zebra() -> Zebra:
68
- """Get the i19-2 zebra device, instantiate it if it hasn't already been.
69
- If this is called when already instantiated in i19-2, it will return the existing object.
70
- """
71
- return Zebra(
72
- mapping=I19_2_ZEBRA_MAPPING,
73
- prefix=f"{PREFIX.beamline_prefix}-EA-ZEBRA-03:",
74
- )
81
+ def diffractometer() -> FourCircleDiffractometer:
82
+ return FourCircleDiffractometer(prefix=PREFIX.beamline_prefix)
75
83
 
76
84
 
77
85
  @device_factory()
78
- def shutter() -> AccessControlledShutter:
79
- """Get the i19-2 hutch shutter device, instantiate it if it hasn't already been.
80
- If this is called when already instantiated, it will return the existing object.
81
- """
82
- return AccessControlledShutter(
83
- prefix=f"{PREFIX.beamline_prefix}-PS-SHTR-01:",
84
- hutch=HutchState.EH2,
85
- instrument_session="cm40639-4",
86
+ def eiger() -> EigerDetector:
87
+ return EigerDetector(
88
+ prefix=PREFIX.beamline_prefix,
89
+ path_provider=get_path_provider(),
90
+ drv_suffix="-EA-EIGER-01:",
91
+ hdf_suffix="-EA-EIGER-01:OD:",
86
92
  )
87
93
 
88
94
 
89
95
  @device_factory()
90
- def synchrotron() -> Synchrotron:
91
- """Get the i19-2 synchrotron device, instantiate it if it hasn't already been.
92
- If this is called when already instantiated in i19-2, it will return the existing object.
93
- """
94
- return Synchrotron()
96
+ def panda() -> HDFPanda:
97
+ return HDFPanda(
98
+ prefix=f"{PREFIX.beamline_prefix}-EA-PANDA-01:",
99
+ path_provider=get_path_provider(),
100
+ )
95
101
 
96
102
 
97
103
  @device_factory()
@@ -104,26 +110,31 @@ def pinhole_and_collimator() -> PinholeCollimatorControl:
104
110
 
105
111
 
106
112
  @device_factory()
107
- def backlight() -> BacklightPosition:
108
- """Get the i19-2 backlight device, instantiate it if it hasn't already been.
109
- If this is called when already instantiated in i19-2, it will return the existing object.
113
+ def shutter() -> AccessControlledShutter:
114
+ """Get the i19-2 hutch shutter device, instantiate it if it hasn't already been.
115
+ If this is called when already instantiated, it will return the existing object.
110
116
  """
111
- return BacklightPosition(prefix=f"{PREFIX.beamline_prefix}-EA-IOC-12:")
117
+ return AccessControlledShutter(
118
+ prefix=f"{PREFIX.beamline_prefix}-PS-SHTR-01:",
119
+ hutch=HutchState.EH2,
120
+ instrument_session=I19_2_COMMISSIONING_INSTR_SESSION,
121
+ )
112
122
 
113
123
 
114
124
  @device_factory()
115
- def panda() -> HDFPanda:
116
- return HDFPanda(
117
- prefix=f"{PREFIX.beamline_prefix}-EA-PANDA-01:",
118
- path_provider=get_path_provider(),
119
- )
125
+ def synchrotron() -> Synchrotron:
126
+ """Get the i19-2 synchrotron device, instantiate it if it hasn't already been.
127
+ If this is called when already instantiated in i19-2, it will return the existing object.
128
+ """
129
+ return Synchrotron()
120
130
 
121
131
 
122
132
  @device_factory()
123
- def eiger() -> EigerDetector:
124
- return EigerDetector(
125
- prefix=PREFIX.beamline_prefix,
126
- path_provider=get_path_provider(),
127
- drv_suffix="-EA-EIGER-01:",
128
- hdf_suffix="-EA-EIGER-01:OD:",
133
+ def zebra() -> Zebra:
134
+ """Get the i19-2 zebra device, instantiate it if it hasn't already been.
135
+ If this is called when already instantiated in i19-2, it will return the existing object.
136
+ """
137
+ return Zebra(
138
+ mapping=I19_2_ZEBRA_MAPPING,
139
+ prefix=f"{PREFIX.beamline_prefix}-EA-ZEBRA-03:",
129
140
  )
dodal/beamlines/i21.py CHANGED
@@ -1,13 +1,27 @@
1
+ from pathlib import Path
2
+
3
+ from daq_config_server.client import ConfigServer
4
+
1
5
  from dodal.common.beamlines.beamline_utils import (
2
6
  device_factory,
3
7
  )
4
8
  from dodal.common.beamlines.beamline_utils import set_beamline as set_utils_beamline
5
- from dodal.devices.apple2_undulator import (
9
+ from dodal.devices.i21 import (
10
+ Grating,
11
+ )
12
+ from dodal.devices.insertion_device import (
6
13
  Apple2,
14
+ Apple2EnforceLHMoveController,
15
+ BeamEnergy,
16
+ InsertionDeviceEnergy,
17
+ InsertionDevicePolarisation,
7
18
  UndulatorGap,
8
19
  UndulatorPhaseAxes,
9
20
  )
10
- from dodal.devices.i21 import Grating
21
+ from dodal.devices.insertion_device.energy_motor_lookup import (
22
+ ConfigServerEnergyMotorLookup,
23
+ )
24
+ from dodal.devices.insertion_device.lookup_table_models import LookupTableColumnConfig
11
25
  from dodal.devices.pgm import PlaneGratingMonochromator
12
26
  from dodal.devices.synchrotron import Synchrotron
13
27
  from dodal.log import set_beamline as set_log_beamline
@@ -18,6 +32,14 @@ PREFIX = BeamlinePrefix(BL)
18
32
  set_log_beamline(BL)
19
33
  set_utils_beamline(BL)
20
34
 
35
+ I21_PHASE_POLY_DEG_COLUMNS = ["b"]
36
+ I21_GRATING_COLUMNS = "Grating"
37
+
38
+ I21_CONF_CLIENT = ConfigServer(url="https://daq-config.diamond.ac.uk")
39
+ LOOK_UPTABLE_DIR = "/dls_sw/i21/software/gda/workspace_git/gda-diamond.git/configurations/i21-config/lookupTables/"
40
+ GAP_LOOKUP_FILE_NAME = "IDEnergy2GapCalibrations.csv"
41
+ PHASE_LOOKUP_FILE_NAME = "IDEnergy2PhaseCalibrations.csv"
42
+
21
43
 
22
44
  @device_factory()
23
45
  def synchrotron() -> Synchrotron:
@@ -55,3 +77,40 @@ def id() -> Apple2:
55
77
  id_gap=id_gap(),
56
78
  id_phase=id_phase(),
57
79
  )
80
+
81
+
82
+ @device_factory()
83
+ def id_controller() -> Apple2EnforceLHMoveController:
84
+ """i21 insertion device controller."""
85
+ return Apple2EnforceLHMoveController(
86
+ apple2=id(),
87
+ gap_energy_motor_lut=ConfigServerEnergyMotorLookup(
88
+ lut_config=LookupTableColumnConfig(grating=I21_GRATING_COLUMNS),
89
+ config_client=I21_CONF_CLIENT,
90
+ path=Path(LOOK_UPTABLE_DIR, GAP_LOOKUP_FILE_NAME),
91
+ ),
92
+ phase_energy_motor_lut=ConfigServerEnergyMotorLookup(
93
+ lut_config=LookupTableColumnConfig(
94
+ grating=I21_GRATING_COLUMNS, poly_deg=I21_PHASE_POLY_DEG_COLUMNS
95
+ ),
96
+ config_client=I21_CONF_CLIENT,
97
+ path=Path(LOOK_UPTABLE_DIR, GAP_LOOKUP_FILE_NAME),
98
+ ),
99
+ units="eV",
100
+ )
101
+
102
+
103
+ @device_factory()
104
+ def id_energy() -> InsertionDeviceEnergy:
105
+ return InsertionDeviceEnergy(id_controller=id_controller())
106
+
107
+
108
+ @device_factory()
109
+ def id_polarisation() -> InsertionDevicePolarisation:
110
+ return InsertionDevicePolarisation(id_controller=id_controller())
111
+
112
+
113
+ @device_factory()
114
+ def energy_jid() -> BeamEnergy:
115
+ """Beam energy."""
116
+ return BeamEnergy(id_energy=id_energy(), mono=pgm().energy)
dodal/beamlines/i22.py CHANGED
@@ -19,7 +19,7 @@ from dodal.devices.i22.dcm import DCM
19
19
  from dodal.devices.i22.fswitch import FSwitch
20
20
  from dodal.devices.i22.nxsas import NXSasMetadataHolder, NXSasOAV, NXSasPilatus
21
21
  from dodal.devices.linkam3 import Linkam3
22
- from dodal.devices.motors import XYPitchStage
22
+ from dodal.devices.motors import XYPitchStage, XYRollStage, XYStage
23
23
  from dodal.devices.slits import Slits
24
24
  from dodal.devices.synchrotron import Synchrotron
25
25
  from dodal.devices.tetramm import TetrammDetector
@@ -274,3 +274,18 @@ def ppump() -> WatsonMarlow323Pump:
274
274
  @device_factory()
275
275
  def base() -> XYPitchStage:
276
276
  return XYPitchStage(f"{PREFIX.beamline_prefix}-MO-STABL-01:")
277
+
278
+
279
+ @device_factory()
280
+ def bs1() -> XYStage:
281
+ return XYStage(f"{PREFIX.beamline_prefix}-MO-SAXSP-01:BS1:")
282
+
283
+
284
+ @device_factory()
285
+ def bs2() -> XYStage:
286
+ return XYStage(f"{PREFIX.beamline_prefix}-MO-SAXSP-01:BS2:")
287
+
288
+
289
+ @device_factory()
290
+ def bs3() -> XYRollStage:
291
+ return XYRollStage(f"{PREFIX.beamline_prefix}-MO-SAXSP-01:BS3:")
dodal/beamlines/p60.py CHANGED
@@ -2,7 +2,7 @@ from dodal.common.beamlines.beamline_utils import (
2
2
  device_factory,
3
3
  )
4
4
  from dodal.common.beamlines.beamline_utils import set_beamline as set_utils_beamline
5
- from dodal.devices.electron_analyser import DualEnergySource
5
+ from dodal.devices.electron_analyser.base import DualEnergySource
6
6
  from dodal.devices.electron_analyser.vgscienta import VGScientaDetector
7
7
  from dodal.devices.p60 import (
8
8
  LabXraySource,
@@ -1,19 +1,12 @@
1
- from pathlib import Path
2
-
3
1
  from ophyd_async.epics.adaravis import AravisDetector
4
2
  from ophyd_async.fastcs.panda import HDFPanda
5
3
 
6
4
  from dodal.common.beamlines.beamline_utils import (
7
5
  device_factory,
8
6
  get_path_provider,
9
- set_path_provider,
10
7
  )
11
8
  from dodal.common.beamlines.beamline_utils import set_beamline as set_utils_beamline
12
9
  from dodal.common.beamlines.device_helpers import DET_SUFFIX, HDF5_SUFFIX
13
- from dodal.common.visit import (
14
- LocalDirectoryServiceClient,
15
- StaticVisitPathProvider,
16
- )
17
10
  from dodal.devices.motors import XThetaStage
18
11
  from dodal.log import set_beamline as set_log_beamline
19
12
  from dodal.utils import BeamlinePrefix, get_beamline_name
@@ -35,15 +28,6 @@ set_log_beamline(BL)
35
28
  set_utils_beamline(BL)
36
29
 
37
30
 
38
- set_path_provider(
39
- StaticVisitPathProvider(
40
- BL,
41
- Path("/exports/mybeamline/data/2025"),
42
- client=LocalDirectoryServiceClient(),
43
- )
44
- )
45
-
46
-
47
31
  @device_factory()
48
32
  def sample_stage() -> XThetaStage:
49
33
  return XThetaStage(f"{PREFIX.beamline_prefix}-MO-MAP-01:STAGE:")