Skip to content

Latest commit

 

History

21 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

17-BM-B Powder Diffraction Instrument

Bluesky BITS instrument for the 17-BM powder diffraction beamline.

Session startup

You can start a bluesky session in any directory using IPython console session or Jupyter notebook. From IPython:

bash
source /APSshare/miniconda/x86_64/bin/activate
conda activate 17bm-bits
ipython -i -c "from bm17.startup import *"

See below for other startups.

IPython console Start

To start the bluesky instrument session in a ipython execute the next command in a terminal:

ipython

Jupyter Notebook Start

Start JupyterLab, a Jupyter notebook server, or a notebook, VSCode.

Starting the BITS Package

from bm17.startup import *

Run Sim Plan Demos

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:

sim_print_plan() - demonstrates a simple plan stub (no data acquired)

from bm17.plans.sim_plans import sim_print_plan
RE(sim_print_plan())

sim_count_plan() - demonstrates data acquisition with a counter

from bm17.plans.sim_plans import sim_count_plan
RE(sim_count_plan())

sim_rel_scan_plan() - demonstrates data acquisition with a counter & motor

from bm17.plans.sim_plans import sim_rel_scan_plan
RE(sim_rel_scan_plan())

Configuration files

The files that can be configured to adhere to your preferences are:

  • configs/iconfig.yml - configuration for data collection
  • configs/extra_logging.yml - configuration for session logging to console and/or files
  • src/bm17/qserver/qs-config.yml - contains all configuration of the QS host process. See the documentation for more details of the configuration.

queueserver

The queueserver has a host process that manages a RunEngine. Client sessions will interact with that host process.

Run a queueserver host process

Install screen

sudo apt install screen

Use 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.

./scripts/bm17_qs_host.sh restart

Run a queueserver client GUI

To run the gui client for the queueserver you can use the next command inside the terminal:

queue-monitor &

Shell script explained

A shell script (./scripts/bm17_qs_host.sh) starts the QS host process. Below are all the command options, and what they do.

(17bm-bits) $ ./scripts/bm17_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 ./src/bm17/qserver/ subdirectory.

cd ./src/bm17/qserver
start-re-manager --config=./qs-config.yml

(Re)Installation

These steps describe the installation procedure.

Start a fresh BITS environment with Conda

export ENV_NAME=17bm-bits
conda create -y -n $ENV_NAME python=3.12
conda activate $ENV_NAME
pip install apsbits

Start a fresh BITS environment with pixi

Build the environment (also installs apsbits and this package, editable):

pixi install

Creating a New Instrument

bits-create bm17
pip install -e .

About

Bluesky BITS instrument for the 17-BM powder diffraction beamline

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

Generated from BCDA-APS/BITS-Starter