BCDA-APS / bluesky_training

Bluesky training, including instrument package
https://bcda-aps.github.io/bluesky_training/
Other
11 stars 0 forks source link

DOC: custom per_step method #233

Open prjemian opened 10 months ago

prjemian commented 10 months ago

To demonstrate how to write a custom per_step() method, implement the notion of rocking a sample rotation (axis transverse to the beam) while collecting detector signals at each step of a 1-D scan. The elapsed time for collection would be ended when the rocking axis reaches its destination.

at each step:

  1. move the scanning motor(s)
  2. trigger the signal collection
  3. read the motors & detectors

The rocking happens in the trigger step:

Thanks to @jwkim-anl for the question!

prjemian commented 10 months ago

Here's a starting point for the trigger, showing the rocking motor only:

def rock_trigger(rock_start=0.4, rock_end=0.5):
    yield from bps.mv(m1, rock_start)

    group = "rock_trigger"
    st = yield from bps.abs_set(m1, v, group=group)
    # print(f"{st=}")
    # trigger the detector(s)

    yield from bps.wait(group)

    # stop the detector(s)
    # print(f"{st=}")