Simple customisation

The first example of a simple customized scan is a series, a repetition of scans.

#!/usr/bin/env python3
"""
ipython3 --matplotlib=qt5 planSeries.py

simple custom plan, a series of plans
"""
from bluesky.plans import scan
import blueskyDESY
from bluesky import RunEngine
from bluesky.callbacks.best_effort import BestEffortCallback
import bluesky.plan_stubs as bps

def execute_serie(detectors, motor, start, stop, np, n_runs):

    for i in range( n_runs):
        yield from scan( detectors, motor, start, stop, np)
    
def main(): 

    bec = BestEffortCallback()
    AMG = blueskyDESY.getActiveMntGrp()
    print( "testMG.main: AMG %s " % repr( AMG))
    mg = blueskyDESY.Experiment( read_attrs = AMG[ 'counters']) 
    eh_mot65 = blueskyDESY.motorTango( name = 'eh_mot65')

    RE = RunEngine()

    #
    # matplotlib and printout
    #
    RE.subscribe( bec)
    RE( execute_serie([mg], eh_mot65, 0, 0.1, 10, n_runs = 3))

    return

if __name__ == "__main__":
    main()