Follow the tutorial
This directory needs these resources to start & run the queueserver:
file or directory | description |
---|---|
instrument/ |
the Python package with the devices and plans to be used |
starter.py |
loads the instrument (the only .py file in this directory) |
user_group_permissions.yaml |
copied from the bluesky-queueserver example |
Table of Devices and signals:
================== ==================== ==========
device/object pvprefix/pvname connected?
================== ==================== ==========
ad_x_calc bdp:userCalc9 True
ad_y_calc bdp:userCalc10 True
adsimdet bdpad: True
gp_stats bdp: True
image_file_created bdpapi:ImageFileName True
incident_beam bdp:userCalc2 True
incident_beam_calc bdp:userCalc2 True
samplexy True
shutter True
================== ==================== ==========
List of Plans:
close_shutter()
move_coarse_positioner(x, y)
move_fine_positioner(x, y)
open_shutter()
prime_hdf_plugin()
sleep(time)
take_image(atime, aperiod=None, md=None)
Need one terminal and another one to start the graphical user interface.
For now, start the queueserver
before starting the queue-monitor
(GUI). You need to restart the GUI if you change the plans or devices since the GUI is not updating its list when the environment is opened (probably a bug).
Optionally, start another terminal for the tiled server (which needs a separate conda environment with development, non-production, versions of databroker and tiled).
All the commands in this section assume these commands have been run first:
cd ./qserver
conda activate bdp2022
Start the bluesky queueserver: ./qserver.sh start
Start the GUI: queue-monitor &
In the graphical user interface just started:
- Connect with the queueserver process. Wait for log (at bottom)
to show
Returning the list of runs for the running plan ...
- Select Edit and Control Queue from side tab bar.
- Open the environment. Wait for RE Manager Status (at top
right) to show:
RE Environment: OPEN
- Select Plan Editor tab
- Build queue of plans using pop-up menu and complete the form with the plan's arguments. For each new plan, edit and Add to queue.
- Re-arrange order of plans in QUEUE windows as desired.
- loop button will run the queue continuously until the queue is stopped or the button is unpressed.
- Start processing the queue.
It is possible to define a batch of plans from a spreadsheet file. See these two example files:
batch2.xlsx
small_batch.xlsx
work-in-progress (moving to tiled directory)
tiled provides a data server
to view acquired data (from databroker catalogs or local files). Here, we
only provide instructions to access an APS tiled server providing
catalog (bdp2022
) for the BDP data:
In a web browser with access to the APS network, visit URL: http://wow.xray.aps.anl.gov:8010/ui/browse/bdp2022
Data from each measurement is presented by uid
in chronolgocial order. The
most recent is presented at the end of the list. (Yes, the interface is
quite new and not very focused yet on real user activities.)
Click on the uid of interest. Usually, the data to view is found by proceeding
through this chain: uid
-> primary -> data -> adsimdet_image, such as
this example:
http://wow.xray.aps.anl.gov:8010/ui/browse/bdp2022/bdded59a-3d07-441a-af18-35d72adac12b/primary/data/data_vars/adsimdet_image
The tiled server can provide this same image data via a web socket request. See the tiled documentation for details.
This (optional step) is where the user interacts with the queue-server from a command-line.
command | description |
---|---|
qserver environment open |
Load devices & plans, connect databroker, start RE |
qserver environment close |
Stop RE |
qserver allowed devices |
Display the list of allowed devices. |
qserver allowed plans |
Display the list of allowed plans. |
qserver history clear |
Clear the (short-term) history. |
qserver history get |
Show the (short-term) history. |
qserver queue add instruction -2 queue-stop |
Stop the queue two items before the end of the queue (before position -2 .) |
qserver queue add plan ${JSON_STRING} |
Add plan (json string) to the queue. |
qserver queue clear |
Clear the queue. |
qserver queue get |
Show the queue. |
qserver queue start |
Start the queue. |
qserver queue stop |
Stop the queue. |
qserver status | grep re_state |
'idle' when ready to run new jobs |
qserver status | grep worker_environment_state |
'idle' when environment is open |
qserver status |
Status information from the qserver |
cd ./qserver
conda activate queue_server
qserver environment open
qserver status
qserver history clear
qserver queue clear
qserver queue add plan '{"name": "take_image", "args": [.5], "kwargs": {"md": {"task": "demonstrate the qserver", "frame_type": "image"}}}'
qserver queue add plan front '{"name": "open_shutter"}'
qserver queue add plan front '{"name": "move_coarse_positioner", "args": [2.71, 3.14]}'
qserver queue add plan front '{"name": "move_fine_positioner", "args": [.123, -0.456]}'
qserver queue add plan '{"name": "close_shutter"}'
qserver queue add plan '{"name": "take_image", "args": [.5], "kwargs": {"md": {"task": "demonstrate the qserver", "frame_type": "dark"}}}'
qserver status
qserver queue get
qserver queue start
Another example (add jobs while queue is running):
qserver queue clear
qserver queue add plan '{"name": "take_image", "args": [.5], "kwargs": {"md": {"task": "use the qserver"}}}'
qserver queue start
qserver queue add plan '{"name": "move_fine_positioner", "args": [0, 0]}'
qserver queue add plan '{"name": "move_coarse_positioner", "args": [0, 0]}'