You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/learn/scans/introduction.md
+29-72Lines changed: 29 additions & 72 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,7 +11,9 @@ related:
11
11
# Scans in BEC
12
12
13
13
!!! Info "Overview"
14
-
Scans are the core of BEC's functionality. They are the tools that move your devices, trigger readouts, and produce the data you analyze. In BEC, all scans follow a shared structure and report themselves in a consistent way, even when their motion logic differs.
14
+
Scans are the core of BEC's functionality. They are the tools that move your devices, trigger readouts, and produce the data you analyze.
15
+
16
+
In BEC, all scans follow the same structure and report themselves in a consistent way, even when their motion logic differs.
15
17
16
18
BEC scans follow one shared model. Whether you run a simple acquisition, a line scan, a grid scan,
17
19
or a continuous scan, BEC handles them in the same overall way.
@@ -39,83 +41,38 @@ For example, a line scan, a grid scan, and a continuous scan may move differentl
39
41
At a high level, a scan in BEC follows this path:
40
42
41
43
1. The scan server publishes the available scan classes together with their serialized signatures, grouped inputs, and GUI metadata.
42
-
2. The client exposes those scans dynamically, so commands such as `scans.line_scan(...)` use the current server-side definition.
43
-
3. When a scan is called, the client validates the user inputs, resolves device-name strings to device objects where needed, and bundles repeated positional inputs for scans such as `line_scan` or `umv` before sending the request to the server.
44
-
4. On the server, the request is queued and receives runtime identifiers.
45
-
5. Once it is the scan's turn to run, the scan server queue hands over the request to a scan worker.
46
-
6. The scan worker runs the scan class's lifecycle hooks and sends device instructions through Redis.
47
-
7. Devices publish readouts and status updates.
48
-
8. The scan bundler groups those readouts into logical scan points.
49
-
9. Clients, history, and the file writer consume the resulting scan data.
50
-
51
-
From the user side, the important part is consistency: every scan goes through the same backend
52
-
steps, reports its progress in the same general way, and produces scan data that can be accessed
53
-
through the same tools afterward.
44
+
1. The client exposes those scans dynamically, so commands such as `scans.line_scan(...)` use the current server-side definition.
45
+
1. When a scan is called, the client sends a request to the server with the scan class's name and the provided arguments.
46
+
1. On the server, the scan is assembled from the scan class and the provided arguments, and then it is put in the scan server queue.
47
+
1. Once it is the scan's turn to run, the scan server queue hands over the request to a scan worker.
48
+
1. The scan worker runs the scan class's lifecycle hooks.
49
+
1. During the scan, the scan class may use scan actions or components to trigger readouts, move devices, or run custom logic at each scan point.
50
+
1. Devices publish readouts and status updates.
51
+
1. The scan bundler groups those readouts into logical scan points.
52
+
1. Clients, history, and the file writer consume the resulting scan data.
53
+
54
+
From the user side, the important part is consistency: every scan goes through the same lifecycle
55
+
steps. **If you have seen one scan, you have seen them all.** You can focus on the differences in motion logic without having to learn a new overall structure for each scan type.
54
56
55
57
## The Shared Scan Shape
56
58
57
-
As mentioned above, all BEC scans follow the same overall shape. They share the same lifecycle steps, and they use the same helpers to report themselves and produce data. This allows users to be always prompted with a familiar structure, even when the motion logic of the scan differs. The shared shape also makes it easier to learn new scans, since you can focus on the differences in motion logic rather than having to learn a new overall structure for each scan. The lifecycle steps are:
58
-
59
-
<!-- The table is in html as the columns would otherwise wrap. There seems to be no internal way to control column width in markdown -->
<td>If an exception is raised during any earlier step, run cleanup logic here.</td>
107
-
</tr>
108
-
</tbody>
109
-
</table>
110
-
111
-
BEC runs these lifecycle steps in the same order every time.
112
-
113
-
This shared shape is why BEC scans feel related rather than like separate one-off tools.
59
+
As mentioned above, all BEC scans follow the same overall shape. They use the same lifecycle and
60
+
the same helpers to report themselves and produce data. That shared structure is why BEC scans feel
61
+
related rather than like separate one-off tools.
62
+
63
+
The details of a scan may change a lot from one scan type to another, but the lifecycle around
64
+
those details stays recognizable. That makes it easier to learn new scans because you can focus on
65
+
the motion logic instead of relearning the full structure each time.
66
+
67
+
The next page, [Scan Lifecycle](lifecycle.md), breaks down those shared lifecycle steps and what
68
+
each hook is responsible for.
114
69
115
70
## Where To Go Next
116
71
117
72
If you want the next layer of detail:
118
73
74
+
- read [Scan Lifecycle](lifecycle.md){ data-preview } to see the shared hook order used by every
75
+
BEC scan.
119
76
- read [Learn by example](../learn/scans/learn-by-example.md){ data-preview } to go through the `acquire` scan example in detail, and see how the shared scan shape applies to a specific scan type.
120
77
121
78
## What to Remember
@@ -124,5 +81,5 @@ If you want the next layer of detail:
124
81
- In BEC, all scans follow the same overall shape.
125
82
- Different scan types use the same backend framework, even when their motion logic differs.
126
83
- Every scan reports itself in a common structured way while it runs.
127
-
- Every scan has to implement the same lifecycle steps, even when some of those steps are empty.
128
-
- The lifecycle steps are called in the same order for every scan.
84
+
- Every scan follows the same lifecycle, even when some hooks do very little.
85
+
- The lifecycle order is fixed, which makes new scan types easier to understand.
0 commit comments