In this notebook you will:
Below, we will connect to EPICS IOC(s) controlling simulated hardware in lieu of actual motors, detectors. The IOCs should already be running in the background. Run this command to verify that they are running: it should produce output with RUNNING on each line. In the event of a problem, edit this command to replace status
with restart all
and run again.
!supervisorctl -c supervisor/supervisord.conf status
%run scripts/beamline_configuration.py
sd
Now, at the beginning and end of every run, record the positions of these motors.
sd.baseline = [mtr_spotx, mtr_spoty]
# run a similar scan as other exercises
plt.figure('ph_det vs motor_ph')
RE(scan([ph], motor_ph, -1, 1, 5))
Notice
New stream: 'baseline'
as well as the boxes of readings. How can we access that data later? It doesn't show up in the table!
# Let's show the plot again so you can refer back to it when looking at the tables.
plt.gcf()
db[-1].table()
db[-1].table('primary') # the default
db[-1].table('baseline')
If the table gets too wide, it's handy to know how to take the transpose of a DataFrame
.
db[-1].table('baseline').T
sd.monitors = [I]
RE(scan([ph], motor_ph, -1, 1, 10))
Notice
New stream: 'I_monitor'
and a new figure. But the Best-Effort Callback doesn't show us the numbers from monitor readings. (There's just not enough room.)
h = db[-1]
h.table('I_monitor')
What streams do we have? Another good Header
method to know:
h.stream_names
mtr_slit
to the list of things to be recorded as baseline readings.
%load solutions/add_baseline_device.py
mtr_slit
from the list of things to be recorded as baseline readings.
%load solutions/remove_baseline_device.py
%load solutions/clear_supplemental_monitors.py