Last active
November 6, 2020 05:00
-
-
Save mrakitin/2a7d46df2ccd9a6aa6f18d462ac5ecfb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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