Maksim Rakitin (NSLS-II)
and the Bluesky Project Contributors
(NSLS-II, APS, LCLS-II, ALS)
for NOBUGS 2018, October 23, 2018
Brookhaven National Lab, Upton, NY
It starts at data acquisition.
The solution has to start there too.
meta_data_in_37K_fname_005_NaCl_cal.tif
What's the problem?
for an end-to-end data acquisition and analysis solution that leverages data science libraries
Figure Credit: "State of the Stack" by Jake VanderPlas, SciPy Conference 2015
Technical Goals
Layered design of Python libraries that are:
Looking at each component, from the bottom up...
Device Drivers and Underlying Control Layer(s)
You might have a pile of hardware that communicates over one or more of:
Ophyd: a hardware abstraction layer
trigger()
, read()
, and set(...)
.Bluesky: an experiment specification and orchestration engine
DataBroker: rich search and access to saved data
Key Goal of DataBroker: Keep I/O Concerns Separate!
Consume from Interfaces, not File Formats
Minimalist and Extensible
Bluesky emits documents, streamed or in batches
A Gaussian is fit to a stream of measured data using the Python library lmfit (from U. Chicago / APS).
Proof of concept:
In this scan, each step is determined adaptively in response to local slope.
The system is designed to make fast feedback easy to write.
LCLS's Skywalker project builds on this to automatically deliver the photon beam to a number of experimental hutches at LCLS.
A stream of slices is tomographically reconstructed using tomopy (APS).
It took one TomoPy developer and one Bluesky developer less than 20 minutes to write this.
Try it yourself! http://nsls-ii.github.io/cookbook/live_recon.html
Real-time Data Analysis at APS
Data is streamed from APS to Argonne Leadership Compute Facility. Results are immediately visualized at APS.
The Xi-cam 2 GUI / plugin framework from CAMERA
has adopted Bluesky's Event Model
for its internal data structures.
Comparison of experiments and simulations made easier with DataBroker!
Experimental and simulation data at NSLS-II CHX beamline for diffraction and scattering (SRI-2018 proceedings).
Simulations were performed with Sirepo/SRW: https://sirepo.com