bluesky_tiled_plugins.streaming.best_effort#
A best-effort callback that consumes Tiled live streams instead of Bluesky documents.
Module Contents#
Classes#
Peak statistics keyed like |
|
Best-effort visualization of Bluesky runs streamed live from Tiled. |
Functions#
Coarse peak statistics (max, min, com, cen, fwhm) of |
Data#
API#
- bluesky_tiled_plugins.streaming.best_effort.logger#
‘getLogger(…)’
- bluesky_tiled_plugins.streaming.best_effort.peak_stats(x: numpy.ndarray, y: numpy.ndarray) dict[str, Any]#
Coarse peak statistics (max, min, com, cen, fwhm) of
yversusx.
- class bluesky_tiled_plugins.streaming.best_effort.PeakResults#
Peak statistics keyed like
BestEffortCallback.peaks.Each statistic is a dict keyed by field name, reachable both as an attribute (
peaks.cen["det"]) and by subscription (peaks["cen"]["det"]), mirroringbluesky.callbacks.best_effort.PeakResults.- ATTRS#
(‘com’, ‘cen’, ‘max’, ‘min’, ‘fwhm’)
- class bluesky_tiled_plugins.streaming.best_effort.TiledBestEffortStreamer(container: tiled.client.container.Container, *, noplot_streams: collections.abc.Iterable[str] = ('baseline',), replay: bool = False, stop_timeout: float = 2.0, retained_runs: int = 4, max_size: int = 1000000, out: collections.abc.Callable[[str], None] = print)#
Best-effort visualization of Bluesky runs streamed live from Tiled.
Unlike
bluesky.callbacks.best_effort.BestEffortCallback, this is not subscribed to a RunEngine. It subscribes to a Tiled container that aTiledWriterwrites into and reconstructs the heading, live table, live plots, baseline readings, and peak statistics from:the run node creation (
metadata["start"]),each event stream node’s metadata (the descriptor) and its live table data,
the run node metadata update that adds
metadata["stop"].
Tiled invokes callbacks on worker threads, so updates are queued and only rendered when :meth:
process_events(or :meth:run_forever) is called, which must happen on the thread that owns the matplotlib GUI.Parameters
container : tiled.client.container.Container Direct parent of the
BlueskyRunnodes created byTiledWriter. noplot_streams : iterable of str Streams that get neither a live table nor a plot. replay : bool Also show runs whose start time precedes this callback’s connection and that are still retained in Tiled’s streaming cache. stop_timeout : float Seconds to wait after the stop arrives for the remaining stream data before finishing the run. retained_runs : int Stopped runs whose start and descriptors stay cached; seesubscribe_to_hinted_streams. out : callable Receives each line of text output. Defaults toprint.- start() bluesky_tiled_plugins.streaming.best_effort.TiledBestEffortStreamer#
Connect the Tiled websocket subscriptions.