Simply ‘count’ a detector

Problem

Take five sequential readings of a detector.

Approach

Execute bluesky.plans.count() with a simulated detector (which could be substituted by a real detector from ophyd) and display the reading using bluesky.callbacks.LiveTable().

Example Solution

Out:

+-----------+------------+------------+
|   seq_num |       time |        det |
+-----------+------------+------------+
|         1 | 21:00:43.7 |      1.000 |
|         2 | 21:00:43.7 |      1.000 |
|         3 | 21:00:43.7 |      1.000 |
|         4 | 21:00:43.7 |      1.000 |
|         5 | 21:00:43.7 |      1.000 |
+-----------+------------+------------+
generator count ['0906d3ff'] (scan num: 1)

import bluesky.plans as bp
import bluesky.callbacks as bc
from bluesky import RunEngine
from ophyd.sim import det  # a simulated detector

RE = RunEngine({})

RE(bp.count([det], num=5), bc.LiveTable([det]))

Total running time of the script: ( 0 minutes 0.787 seconds)

Gallery generated by Sphinx-Gallery