APS 16BM B & D operations using Bluesky, with BITS structure
conda create -y -n 16bm-bits-b python=3.11 pyepics
conda activate 16bm-bits-b
pip install apsbits16BM-D uses environment 16bm-bits-d.
For each new instrument to be added, create initial configuration. (Modify the
YOUR_INSTRUMENT_NAME below used for 16BM-B. Python packages must now start
with a number, that's why bm comes first.)
export YOUR_INSTRUMENT_NAME=bm16_b
create-bits $YOUR_INSTRUMENT_NAMEInstall all under src/ into the conda environment:
pip install -e .[all]Activate the conda environment:
conda activate 16bm-bits-bTo start the bluesky instrument session in a ipython execute the next command in a terminal:
ipythonStart JupyterLab, a Jupyter notebook server, or a notebook, VSCode.
Either bm16_b or bm16_d:
from bm16_b.startup import *To run some simulated plans that ensure the installation worked as expected please run the next commands inside an ipython session or a jupyter notebook after starting the data acquisition:
from bm16_b.plans.sim_plans import *
RE(sim_print_plan())
RE(sim_count_plan())
RE(sim_rel_scan_plan())The files that can be configured to adhere to your preferences are:
configs/iconfig.yml- configuration for data collectionconfigs/logging.yml- configuration for session logging to console and/or filesqserver/qs-config.yml- contains all configuration of the QS host process. See the documentation for more details of the configuration.
The queueserver has a host process that manages a RunEngine. Client sessions will interact with that host process.
Install screen
sudo apt install screenUse the queueserver host management script to start the QS host process. The
restart option stops the server (if it is running) and then starts it. This is
the usual way to (re)start the QS host process. Using restart, the process
runs in the background.
./src/YOUR_INSTRUMENT_NAME_qserver/qs_host.sh restartTo run the gui client for the queueserver you can use the next command inside the terminal:
queue-monitor &A shell script (./src/YOUR_INSTRUMENT_NAME_qserver/qs_host.sh) starts the QS host process. Below
are all the command options, and what they do.
(BITS_env) $ ./src/YOUR_INSTRUMENT_NAME_qserver/qs_host.sh help
Usage: qs_host.sh {start|stop|restart|status|checkup|console|run} [NAME]
COMMANDS
console attach to process console if process is running in screen
checkup check that process is running, restart if not
restart restart process
run run process in console (not screen)
start start process
status report if process is running
stop stop process
OPTIONAL TERMS
NAME name of process (default: bluesky_queueserver-)Alternatively, run the QS host's startup command directly within the ./qserver/
subdirectory.
cd ./qserver
start-re-manager --config=./qs-config.yml