Skip to content

Commit 79804a6

Browse files
Move shared i10 and i10-1 devices to i10_shared (#1534)
* Move shared i10 and i10-1 device to i10_shared * make i10 optics * correct names * add slits to i10_1 * add mirror * test path * Move shared i10 and i10-1 devices to i10_optics * Move shared i10 and i10-1 devices to i10_optics * Merge i10-1.py into i10_1.py and i10.py * Text fixes for i10-1 * Docs corrected * Fix error in merge --------- Co-authored-by: Relm-Arrowny <[email protected]>
1 parent dbcffad commit 79804a6

File tree

7 files changed

+338
-170
lines changed

7 files changed

+338
-170
lines changed

conftest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
]
3838
mock_attributes_table = {
3939
"i03": mock_paths,
40-
"i10": mock_paths,
40+
"i10_optics": mock_paths,
4141
"i04": mock_paths,
4242
"s04": mock_paths,
4343
"i19_1": mock_paths,

src/dodal/beamlines/i10.py

Lines changed: 7 additions & 147 deletions
Original file line numberDiff line numberDiff line change
@@ -6,37 +6,25 @@
66
idd == id1, idu == id2.
77
"""
88

9-
from daq_config_server.client import ConfigServer
10-
119
from dodal.common.beamlines.beamline_utils import device_factory
1210
from dodal.common.beamlines.beamline_utils import set_beamline as set_utils_beamline
13-
from dodal.devices.apple2_undulator import (
14-
BeamEnergy,
15-
InsertionDeviceEnergy,
16-
InsertionDevicePolarisation,
17-
UndulatorGap,
18-
UndulatorJawPhase,
19-
UndulatorPhaseAxes,
20-
)
2111
from dodal.devices.current_amplifiers import CurrentAmpDet
22-
from dodal.devices.i10.diagnostics import I10Diagnostic, I10Diagnostic5ADet
23-
from dodal.devices.i10.i10_apple2 import (
24-
I10Apple2,
25-
I10Apple2Controller,
26-
LinearArbitraryAngle,
12+
from dodal.devices.i10 import (
13+
I10Diagnostic,
14+
I10Diagnostic5ADet,
15+
I10Slits,
16+
I10SlitsDrainCurrent,
17+
PiezoMirror,
2718
)
28-
from dodal.devices.i10.i10_setting_data import I10Grating
29-
from dodal.devices.i10.mirrors import PiezoMirror
19+
from dodal.devices.i10.diagnostics import I10Diagnostic, I10Diagnostic5ADet
3020
from dodal.devices.i10.rasor.rasor_current_amp import RasorFemto, RasorSR570
3121
from dodal.devices.i10.rasor.rasor_motors import (
3222
DetSlits,
3323
Diffractometer,
3424
PaStage,
3525
)
3626
from dodal.devices.i10.rasor.rasor_scaler_cards import RasorScalerCard1
37-
from dodal.devices.i10.slits import I10Slits, I10SlitsDrainCurrent
3827
from dodal.devices.motors import XYStage, XYZStage
39-
from dodal.devices.pgm import PGM
4028
from dodal.devices.temperture_controller import (
4129
Lakeshore340,
4230
)
@@ -48,137 +36,9 @@
4836
set_utils_beamline(BL)
4937
PREFIX = BeamlinePrefix(BL)
5038

51-
I10_CONF_CLIENT = ConfigServer(url="https://daq-config.diamond.ac.uk")
52-
53-
54-
LOOK_UPTABLE_DIR = "/dls_sw/i10/software/gda/workspace_git/gda-diamond.git/configurations/i10-shared/lookupTables/"
55-
56-
57-
@device_factory()
58-
def pgm() -> PGM:
59-
"I10 Plane Grating Monochromator, it can change energy via pgm.energy.set(<energy>)"
60-
return PGM(
61-
prefix=f"{PREFIX.beamline_prefix}-OP-PGM-01:",
62-
grating=I10Grating,
63-
grating_pv="NLINES2",
64-
)
65-
66-
67-
@device_factory()
68-
def idd() -> I10Apple2:
69-
"""i10 downstream insertion device:"""
70-
return I10Apple2(
71-
id_gap=UndulatorGap(prefix=f"{PREFIX.insertion_prefix}-MO-SERVC-01:"),
72-
id_phase=UndulatorPhaseAxes(
73-
prefix=f"{PREFIX.insertion_prefix}-MO-SERVC-01:",
74-
top_outer="RPQ1",
75-
top_inner="RPQ2",
76-
btm_inner="RPQ3",
77-
btm_outer="RPQ4",
78-
),
79-
id_jaw_phase=UndulatorJawPhase(
80-
prefix=f"{PREFIX.insertion_prefix}-MO-SERVC-01:",
81-
move_pv="RPQ1",
82-
),
83-
)
84-
85-
86-
@device_factory()
87-
def idd_controller() -> I10Apple2Controller:
88-
"""I10 downstream insertion device controller."""
89-
return I10Apple2Controller(
90-
apple2=idd(),
91-
lookuptable_dir=LOOK_UPTABLE_DIR,
92-
source=("Source", "idd"),
93-
config_client=I10_CONF_CLIENT,
94-
)
95-
96-
97-
@device_factory()
98-
def idd_energy() -> InsertionDeviceEnergy:
99-
return InsertionDeviceEnergy(id_controller=idd_controller())
100-
101-
102-
@device_factory()
103-
def idd_polarisation() -> InsertionDevicePolarisation:
104-
return InsertionDevicePolarisation(id_controller=idd_controller())
105-
106-
107-
@device_factory()
108-
def idd_laa() -> LinearArbitraryAngle:
109-
return LinearArbitraryAngle(id_controller=idd_controller())
110-
111-
112-
@device_factory()
113-
def energy_dd() -> BeamEnergy:
114-
"""Beam energy from down energy devices."""
115-
return BeamEnergy(id_energy=idd_energy(), mono=pgm().energy)
116-
117-
118-
@device_factory()
119-
def idu() -> I10Apple2:
120-
"""i10 upstream insertion device"""
121-
return I10Apple2(
122-
id_gap=UndulatorGap(prefix=f"{PREFIX.insertion_prefix}-MO-SERVC-21:"),
123-
id_phase=UndulatorPhaseAxes(
124-
prefix=f"{PREFIX.insertion_prefix}-MO-SERVC-21:",
125-
top_outer="RPQ1",
126-
top_inner="RPQ2",
127-
btm_inner="RPQ3",
128-
btm_outer="RPQ4",
129-
),
130-
id_jaw_phase=UndulatorJawPhase(
131-
prefix=f"{PREFIX.insertion_prefix}-MO-SERVC-21:",
132-
move_pv="RPQ1",
133-
),
134-
)
135-
136-
137-
@device_factory()
138-
def idu_controller() -> I10Apple2Controller:
139-
"""I10 upstream insertion device controller."""
140-
return I10Apple2Controller(
141-
apple2=idu(),
142-
lookuptable_dir=LOOK_UPTABLE_DIR,
143-
source=("Source", "idu"),
144-
config_client=I10_CONF_CLIENT,
145-
)
146-
147-
148-
@device_factory()
149-
def idu_energy() -> InsertionDeviceEnergy:
150-
return InsertionDeviceEnergy(id_controller=idu_controller())
151-
152-
153-
@device_factory()
154-
def idu_polarisation() -> InsertionDevicePolarisation:
155-
return InsertionDevicePolarisation(id_controller=idu_controller())
156-
157-
158-
@device_factory()
159-
def idu_laa() -> LinearArbitraryAngle:
160-
return LinearArbitraryAngle(id_controller=idu_controller())
161-
162-
163-
@device_factory()
164-
def energy_ud() -> BeamEnergy:
165-
"""Beam energy from down energy devices."""
166-
return BeamEnergy(id_energy=idu_energy(), mono=pgm().energy)
167-
168-
16939
"""Mirrors"""
17040

17141

172-
@device_factory()
173-
def first_mirror() -> PiezoMirror:
174-
return PiezoMirror(prefix=f"{PREFIX.beamline_prefix}-OP-COL-01:")
175-
176-
177-
@device_factory()
178-
def switching_mirror() -> PiezoMirror:
179-
return PiezoMirror(prefix=f"{PREFIX.beamline_prefix}-OP-SWTCH-01:")
180-
181-
18242
@device_factory()
18343
def focusing_mirror() -> PiezoMirror:
18444
return PiezoMirror(prefix=f"{PREFIX.beamline_prefix}-OP-FOCS-01:")

src/dodal/beamlines/i10_1.py

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,35 @@
1-
from dodal.common.beamlines.beamline_utils import (
2-
device_factory,
3-
)
1+
from dodal.common.beamlines.beamline_utils import device_factory
42
from dodal.common.beamlines.beamline_utils import set_beamline as set_utils_beamline
5-
from dodal.devices.synchrotron import Synchrotron
6-
from dodal.devices.temperture_controller import Lakeshore336
3+
from dodal.devices.i10 import I10JDiagnostic, I10JSlits, PiezoMirror
4+
from dodal.devices.temperture_controller.lakeshore.lakeshore import Lakeshore336
75
from dodal.log import set_beamline as set_log_beamline
86
from dodal.utils import BeamlinePrefix, get_beamline_name
97

108
BL = get_beamline_name("i10-1")
11-
PREFIX = BeamlinePrefix(BL, suffix="J")
129
set_log_beamline(BL)
1310
set_utils_beamline(BL)
14-
15-
16-
@device_factory()
17-
def synchrotron() -> Synchrotron:
18-
return Synchrotron()
11+
PREFIX = BeamlinePrefix("i10", "J")
1912

2013

2114
@device_factory()
2215
def em_temperature_controller() -> Lakeshore336:
2316
return Lakeshore336(
2417
prefix=f"{PREFIX.beamline_prefix}-EA-TCTRL-41:",
2518
)
19+
20+
21+
@device_factory()
22+
def slits() -> I10JSlits:
23+
return I10JSlits(prefix=f"{PREFIX.beamline_prefix}-AL-SLITS-")
24+
25+
26+
@device_factory()
27+
def diagnostic() -> I10JDiagnostic:
28+
return I10JDiagnostic(
29+
prefix=f"{PREFIX.beamline_prefix}-DI-",
30+
)
31+
32+
33+
@device_factory()
34+
def focusing_mirror() -> PiezoMirror:
35+
return PiezoMirror(prefix=f"{PREFIX.beamline_prefix}-OP-FOCA-01:")

0 commit comments

Comments
 (0)