Skip to content

Instantly share code, notes, and snippets.

@mrakitin

mrakitin/bluesky_plan.py

Last active Nov 6, 2020
Embed
What would you like to do?
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
You can’t perform that action at this time.