Skip to content

Commit ceaff05

Browse files
authored
Update Reflectometry-Config-Training-‐-Exercise-2.md
1 parent 92912db commit ceaff05

File tree

1 file changed

+68
-11
lines changed

1 file changed

+68
-11
lines changed

doc/specific_iocs/reflectometry/config_training/Reflectometry-Config-Training-‐-Exercise-2.md

Lines changed: 68 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,7 @@ Once you have added all these components, you should now be able to set the para
5858
<details>
5959
<summary>Should you have trouble the following is what the code could look like</summary>
6060

61-
```python
62-
from typing import Dict
61+
```pythofrom typing import Dict
6362
6463
from ReflectometryServer.beamline import Beamline
6564
from ReflectometryServer.beamline_constant import BeamlineConstant
@@ -108,7 +107,9 @@ def get_beamline(macros: Dict[str, str]) -> Beamline:
108107
add_constant(BeamlineConstant("S2_Z", S2_Z, "The distance to slits 2"))
109108
110109
# Modes
111-
nr = add_mode("NR")
110+
_nr = add_mode(
111+
"NR"
112+
) # Using underscore to pass pyright as mode has to be created but is not used
112113
113114
##############################
114115
# BEAMLINE MODEL STARTS HERE #
@@ -117,15 +118,36 @@ def get_beamline(macros: Dict[str, str]) -> Beamline:
117118
# Slits 1
118119
add_slit_parameters(1, include_centres=True)
119120
s1_comp = add_component(Component("s1", PositionAndAngle(0.0, S1_Z, NATURAL_ANGLE)))
120-
add_parameter(AxisParameter("S1OFFSET", s1_comp, ChangeAxis.POSITION, nr))
121+
add_parameter(
122+
AxisParameter(
123+
"S1OFFSET",
124+
s1_comp,
125+
ChangeAxis.POSITION,
126+
description="Vertical Position of Slit 1",
127+
)
128+
)
121129
add_driver(IocDriver(s1_comp, ChangeAxis.POSITION, MotorPVWrapper("MOT:MTR0301")))
122130
123131
# Mirror
124132
mirror_comp = add_component(
125133
ReflectingComponent("Mirror", PositionAndAngle(0, SM_Z, NATURAL_ANGLE))
126134
)
127-
add_parameter(AxisParameter("SMANGLE", mirror_comp, ChangeAxis.ANGLE, nr))
128-
add_parameter(AxisParameter("SMOFFSET", mirror_comp, ChangeAxis.POSITION, nr))
135+
add_parameter(
136+
AxisParameter(
137+
"SMANGLE",
138+
mirror_comp,
139+
ChangeAxis.ANGLE,
140+
description="Angle of the Supermirror",
141+
)
142+
)
143+
add_parameter(
144+
AxisParameter(
145+
"SMOFFSET",
146+
mirror_comp,
147+
ChangeAxis.POSITION,
148+
description="Vertical Position of the Supermirror",
149+
)
150+
)
129151
add_driver(IocDriver(mirror_comp, ChangeAxis.ANGLE, MotorPVWrapper("MOT:MTR0207")))
130152
add_driver(
131153
IocDriver(mirror_comp, ChangeAxis.POSITION, MotorPVWrapper("MOT:MTR0206"))
@@ -134,17 +156,52 @@ def get_beamline(macros: Dict[str, str]) -> Beamline:
134156
# Slits 2
135157
add_slit_parameters(2, include_centres=True)
136158
s2_comp = add_component(Component("s2", PositionAndAngle(0.0, S2_Z, NATURAL_ANGLE)))
137-
add_parameter(AxisParameter("S2OFFSET", s2_comp, ChangeAxis.POSITION, nr))
159+
add_parameter(
160+
AxisParameter(
161+
"S2OFFSET",
162+
s2_comp,
163+
ChangeAxis.POSITION,
164+
description="Vertical Position of Slit 2",
165+
)
166+
)
138167
add_driver(IocDriver(s2_comp, ChangeAxis.POSITION, MotorPVWrapper("MOT:MTR0302")))
139168
140169
# SAMPLE
141170
sample_comp = add_component(
142171
TiltingComponent("sample", PositionAndAngle(0, SAMPLE_Z, NATURAL_ANGLE))
143172
)
144-
add_parameter(AxisParameter("SAMPOFFSET", sample_comp, ChangeAxis.POSITION, nr))
145-
add_parameter(AxisParameter("SAMPPHI", sample_comp, ChangeAxis.ANGLE, nr))
146-
add_parameter(AxisParameter("SAMPPSI", sample_comp, ChangeAxis.PSI, nr))
147-
add_parameter(AxisParameter("SAMPTRANS", sample_comp, ChangeAxis.TRANS))
173+
add_parameter(
174+
AxisParameter(
175+
"SAMPOFFSET",
176+
sample_comp,
177+
ChangeAxis.POSITION,
178+
description="Vertical Position of Sample",
179+
)
180+
)
181+
add_parameter(
182+
AxisParameter(
183+
"SAMPPHI",
184+
sample_comp,
185+
ChangeAxis.ANGLE,
186+
description="Phi Angle of Sample (Pitch)",
187+
)
188+
)
189+
add_parameter(
190+
AxisParameter(
191+
"SAMPPSI",
192+
sample_comp,
193+
ChangeAxis.PSI,
194+
description="Psi Angle of Sample (Roll)",
195+
)
196+
)
197+
add_parameter(
198+
AxisParameter(
199+
"SAMPTRANS",
200+
sample_comp,
201+
ChangeAxis.TRANS,
202+
description="Horizontal Position of Sample",
203+
)
204+
)
148205
add_driver(
149206
IocDriver(sample_comp, ChangeAxis.POSITION, MotorPVWrapper("MOT:MTR0307"))
150207
)

0 commit comments

Comments
 (0)