scan, 3 counter, 1 MCA, pyspMonitor

Figure 11.5 shows the graphics output for a scan using 3 counters and 1 MCA.

#!/usr/bin/env python3
"""
In [5]: blueskyDESY.getActiveMntGrp()
Out[5]: 
{'counters': ['eh_c01', 'eh_c02', 'eh_c03'],
 'mcas': ['eh_mca01'],
 'timers': ['eh_t01'],
 'sampleTime': 0.2}


To be launched like this: ipython3 --matplotlib=qt5 scanMCA.py
"""
from bluesky.plans import scan
import blueskyDESY
from bluesky import RunEngine

def main(): 

    AMG = blueskyDESY.getActiveMntGrp()
    print( "testMG.main: AMG %s " % repr( AMG))
    mg = blueskyDESY.Experiment( read_attrs = AMG[ 'counters'] + AMG[ 'mcas']) 
    eh_mot70 = blueskyDESY.motorTango( name = 'eh_mot70')
    eh_mot71 = blueskyDESY.motorTango( name = 'eh_mot71')
    #
    # create a run engine
    #
    RE = RunEngine()
    #
    # data to pyspMonitor3.py
    #
    RE.subscribe(blueskyDESY.docCallback())
    #
    # metadata, per RE and per plan
    #
    RE.md[ 'user'] = 'p09user' # permanent metadata, lifetime of RE
    uid, = RE(scan([mg], eh_mot70, 0, 0.1, 50, md={ 'sample':'Gold'})) # metadata for this run

    return

if __name__ == "__main__":
    main()

Figure 11.3: scan, 3 counters, 1 MCA, pyspMonitor
Image scan3Counter1MCA