Inspect or rehearse a plan without touching hardware (“simulation mode”)¶
Problem¶
Check a plan for mistakes before running it on real hardware.
Approach¶
- Display the steps of a plan and read through them to verify that they match our intention.
- Execute the plan on “simulated hardware,” Python objects that stand in for real motors and detectors but do not actually communicate with any hardware.
Example Solutions¶
The bluesky.examples
module includes simulated motors and detectors.
# Import simulated motors and a detector.
from bluesky.examples import motor, motor1, motor2, det
# This may already be imported in the configuration.
from bluesky.plan_tools import print_summary
from bluesky.plans import count, scan, outer_product_scan
Inspect plans¶
Use print_summary
which translates the plan into a human-readable list
of steps.
In [1]: print_summary(count([det]))
=================================== Open Run ===================================
Read ['det']
================================== Close Run ===================================
In [2]: print_summary(scan([det], motor, 1, 3, 3))