Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DOC: custom per_step method #233

Open
prjemian opened this issue Aug 21, 2023 · 1 comment
Open

DOC: custom per_step method #233

prjemian opened this issue Aug 21, 2023 · 1 comment
Labels
documentation Improvements or additions to documentation
Milestone

Comments

@prjemian
Copy link
Contributor

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:

  • move the rocking motor to its start position
  • prepare the detector(s) to collect signals
  • start moving the rocking motor to its final position
  • start the detector(s) to collect
  • wait for the rocking motor to finish
  • stop the detector(s)

Thanks to @jwkim-anl for the question!

@prjemian prjemian added the documentation Improvements or additions to documentation label Aug 21, 2023
@prjemian prjemian added this to the v1.0.2 milestone Aug 21, 2023
@prjemian
Copy link
Contributor Author

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=}")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

1 participant