scan_signal_statistics#
Import: apstools.callbacks.scan_signal_statistics
Collect statistics on the first detector used in 1-D scans.#
Callback: Collect peak (& other) statistics during a scan. |
Module Contents#
- class apstools.callbacks.scan_signal_statistics.SignalStatsCallback[source]#
Import:
apstools.callbacks.scan_signal_statistics.SignalStatsCallbackCallback: Collect peak (& other) statistics during a scan.
Subscribe the
receiver()method. Use with step scan plans such asbp.scan()andbp.rel_scan().Caution
It is recommended to subscribe this callback to specific plans. It should not be run with just any plan (it could easily raise exceptions).
Basic example
1from bluesky import plans as bp 2from bluesky import preprocessors as bpp 3from apstools.callbacks import SignalStatsCallback 4 5signal_stats = SignalStatsCallback() 6 7def my_plan(detectors, mover, rel_start, rel_stop, points, md={}): 8 9 @bpp.subs_decorator(signal_stats.receiver) # collect the data 10 def _inner(): 11 yield from bp.rel_scan(detectors, mover, rel_start, rel_end, points, md) 12 13 yield from _inner() # run the scan 14 signal_stats.report() # print the statistics
Public API
receiver(key, document)Client method used to subscribe to the RunEngine.
report()Print a table with the collected statistics for each signal.
RunEngine document with signals to to watch.
If
True(default), call thereport()method when astopdocument is received.Internal API
clear()Clear the internal memory for the next run.
descriptor(doc)Receives 'descriptor' documents from the RunEngine.
event(doc)Receives 'event' documents from the RunEngine.
start(doc)Receives 'start' documents from the RunEngine.
stop(doc)Receives 'stop' documents from the RunEngine.
Dictionary of statistical array analyses.
_dataArrays of x & y data
_scanningIs a run in progress?
_registersDeprecated: Use 'analysis' instead, will remove in next major release.
- analysis: object = None#
Dictionary of statistical array analyses.
- compute()[source]#
Compute XY statistics from accumulated data.
Can be called mid-run (before the stop document) to populate
self.analysiswith the current statistics. This is used bylineup2()to write the statistics as a bluesky stream before the run closes.(new in release 1.7.10)
- data_stream: str = 'primary'#
RunEngine document with signals to to watch.
- feature: str = None#
Name of the peak feature used for alignment (e.g.
"centroid"). Set by the caller.
- reporting: bool = True#
If
True(default), call thereport()method when astopdocument is received.