Skip to content

Instantly share code, notes, and snippets.

@mrakitin
Last active November 6, 2020 05:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mrakitin/2a7d46df2ccd9a6aa6f18d462ac5ecfb to your computer and use it in GitHub Desktop.
Save mrakitin/2a7d46df2ccd9a6aa6f18d462ac5ecfb to your computer and use it in GitHub Desktop.
import bluesky.plan_stubs as bps
import bluesky.plans as bp
from bluesky.callbacks.best_effort import BestEffortCallback
from bluesky.run_engine import RunEngine
from bluesky.utils import install_kicker
from databroker import Broker
from ophyd.sim import det, motor
import matplotlib.pyplot as plt
plt.ion()
RE = RunEngine()
db = Broker.named('temp')
bec = BestEffortCallback()
RE.subscribe(db.insert)
RE.subscribe(bec)
install_kicker()
# Run next:
RE(bp.scan([det], motor, -10, 10, 5))
hdr = db[-1]
hdr.start
tbl = hdr.table()
tbl.plot(x='motor', y='det')
docs = hdr.documents()
for name, doc in docs:
print(name)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment