-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathscan_with_delay.py
More file actions
71 lines (60 loc) · 2.18 KB
/
Copy pathscan_with_delay.py
File metadata and controls
71 lines (60 loc) · 2.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
from bluesky.plans import scan
from bluesky.plan_stubs import move_per_step, sleep, trigger_and_read
from sophys.common.plans.annotated_default_plans import (
DETECTORS_TYPE,
PER_STEP_TYPE,
MD_TYPE,
)
def scan_with_delay(
detectors: DETECTORS_TYPE,
/,
*args,
num: int = None,
delay: float = 0.2,
per_step: PER_STEP_TYPE = None,
md: MD_TYPE = None,
):
"""
Scan over one multi-motor trajectory.
Parameters
----------
detectors : list or tuple
list of 'readable' objects
*args :
For one dimension, ``motor, start, stop``.
In general:
.. code-block:: python
motor1, start1, stop1,
motor2, start2, stop2,
...,
motorN, startN, stopN
-.-motor,start,stop;the n-th motor to move from slowest to fastest,the starting point in the motor's trajectory relative to the current position,the ending point in the motor's trajectory relative to the current position;__MOVABLE__,typing.Any,typing.Any-.-
num : integer
number of points
delay : integer
Delay between the triggers of the scan.
per_step : callable, optional
hook for customizing action of inner loop (messages per step).
See docstring of :func:`bluesky.plan_stubs.one_nd_step` (the default)
with and sleep plan after it.
md : dict, optional
metadata
See Also
--------
:func:`bluesky.plans.rel_grid_scan`
:func:`bluesky.plans.inner_product_scan`
:func:`bluesky.plans.scan_nd`
"""
def one_nd_step_with_delay(detectors, step, pos_cache):
"This is a copy of bluesky.plan_stubs.one_nd_step with a sleep added."
motors = step.keys()
yield from move_per_step(step, pos_cache)
yield from sleep(delay)
yield from trigger_and_read(list(detectors) + list(motors))
def per_step_with_delay(detectors, step, pos_cache):
yield from per_step(detectors, step, pos_cache)
yield from sleep(delay)
per_step_scan = one_nd_step_with_delay
if per_step is not None:
per_step_scan = per_step_with_delay
yield from scan(detectors, *args, num=num, per_step=per_step_scan, md=md)