.. note:: :class: sphx-glr-download-link-note Click :ref:`here ` to download the full example code .. rst-class:: sphx-glr-example-title .. _sphx_glr_cookbook_count_with_table.py: Simply 'count' a detector ************************* Problem ------- Take five sequential readings of a detector. Approach -------- Execute :func:`bluesky.plans.count` with a simulated detector (which could be substituted by a real detector from ophyd) and display the reading using :func:`bluesky.callbacks.LiveTable`. Example Solution ---------------- .. rst-class:: sphx-glr-script-out Out: .. code-block:: none +-----------+------------+------------+ | 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) | .. code-block:: default 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])) .. rst-class:: sphx-glr-timing **Total running time of the script:** ( 0 minutes 0.787 seconds) .. _sphx_glr_download_cookbook_count_with_table.py: .. only :: html .. container:: sphx-glr-footer :class: sphx-glr-footer-example .. container:: sphx-glr-download :download:`Download Python source code: count_with_table.py ` .. container:: sphx-glr-download :download:`Download Jupyter notebook: count_with_table.ipynb ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_