Skip to content

Commit eb114af

Browse files
authored
Update Reflectometry-Config-Training-‐-Exercise-3.md
1 parent abc4a5d commit eb114af

File tree

1 file changed

+16
-10
lines changed

1 file changed

+16
-10
lines changed

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

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,22 @@ Next, we will look at modes. Modes are a way to configure the beamline/tracking
88
In the following exercise we will categorize the parameters we have added so far by mode and give them some default values.
99

1010
## Exercise 3
11+
### 1. Create your modes
12+
So far there has always been a mode `_nr`, without a mode the reflectometry server, but as this variable wasn't used there is an underscore to let Pyright know that it could be ignored.
13+
Start by removing that `_`.
14+
Add another mode called `PNR` in the same way that `NR` is added.
15+
Create a list `all_modes` which includes both `nr` and `pnr`.
1116

12-
Make the following changes to your `config.py`:
13-
- In addition to `NR` mode, add another mode called `PNR` to your config using the `add_mode` helper method.
14-
- Add each parameter to the appropriate modes using the `modes` argument e.g. `add_parameter(AxisParameter(...), modes=[nr])`
15-
- Slits should track the beam in every mode
16-
- The Super Mirror should track the beam in `PNR` mode only
17-
- The sample axes should never track the beam automatically. This is because the scientists don't want this component to move implicitly on beam changes, only when they explicitly tell it to
17+
### 2. Add modes to parameters
18+
Give each parameter a `modes` argument follwoing on after the `AxisParameter` argument. Note that `modes` has to be a list, so if you are only applying a single mode don't forget to add square brackets.
19+
The slit offsets should track the beam in `all_modes`.
20+
Both of the supermirror parameters should use `pnr` mode.
21+
The sample axes should never track the beam automatically. This is because the scientists don't want this component to move implicitly on beam changes, only when they explicitly tell it to.
1822

1923
## To Test
20-
1. Once you have made these changes, restart the `REFL_01` IOC.
21-
1. You should now be able to switch between `NR` and `PNR` mode via the front panel OPI.
22-
1. When doing so, you should see a little green "M" appear/disappear next to parameters, indicating whether they are part of the currently selected mode.
23-
1. Try moving `sm_angle`. You should now see `s2_offset` automatically staying aligned to the reflected beam, while `sa_offset` and `sa_phi` are not (as they were prior to this exercise)
24+
1. Don't forget to restart the IOC to pick up the changes to `config.py` you have just made.
25+
2. You'll likely start up in `NR` mode, and if you go to the `Collimation` tab, you should see two green Ms, by each slit offset.
26+
3. Go back to the front panel, and you should be able to switch between the two modes using the buttons next to the status information. If you leave it on `PNR` and go back to collimation then as well as the previous green Ms by the slit offsets there should be ones alongside the supermirror parameters.
27+
4. Assuming nothing has changed after the steps in the previous exercise, everything else should be reading as 0 on the `Collimation` tab, and if you look at the Table of Motors, then the supermirror angle is `22.5`, the slit 2 height at `10`, the sample height at `20`, and the sample phi at `45`.
28+
5. Staying in `PNR` mode, set the `SMANGLE` to `11.25` on the `Collimation` tab.
29+
6. The downstream values on this tab will still change with that value, except the `S2OFFSET` will end up back at 0 as it has moved with the change to the angle. The readback value of `SAMPOFFSET` and `SAMPPHI` will read as `11.716` and `22.5` respectively as these values as this is where these axes are now in relation to the beam. If you look at the Table of Motors, then the supermirror angle is now `11.25`, the slit 2 offset is `4.143`, and the sample height and phi haven't changed and are still at `20` and `45` respectively. So in this mode you can see that the height of slit 2 is moving automatically with changes to the beam.

0 commit comments

Comments
 (0)