Rethink acquisition dataflow for Gatan EELS and multi-computer setups
As we add EELS acquisition through Gatan DigitalMicrograph, we need to revisit the current acquisition/data workflow.
Current synchronous flow:
- Acquire with hardware
- Generate data key/path
- Save data to disk
- Register that path with Tiled
- Return key to client only after registration completes
This becomes problematic when data is produced on multiple computers, e.g. AutoScript PC + Gatan PC. It pushes us toward either:
- Separate storage: each computer saves locally and has its own Tiled server
- Unified storage: all data is transferred to one computer before save/register
Both introduce transfer or registration latency into the acquisition loop.
Proposal
Decouple acquisition from data availability.
New flow:
- Acquisition is called
- Hardware acquires
- A data reference/key is generated immediately
- Key/reference is returned to the client
- Data save and Tiled registration continue asynchronously
The client is then free to continue the experiment immediately. If the user tries to read before the data is ready, .read() may fail or report unavailable data. To make this robust, we should add a client-side .wait() helper:
ref = microscope.acquire_eels()
data.wait(ref)
spectrum = data.open(ref).read()
Rethink acquisition dataflow for Gatan EELS and multi-computer setups
As we add EELS acquisition through Gatan DigitalMicrograph, we need to revisit the current acquisition/data workflow.
Current synchronous flow:
This becomes problematic when data is produced on multiple computers, e.g. AutoScript PC + Gatan PC. It pushes us toward either:
Both introduce transfer or registration latency into the acquisition loop.
Proposal
Decouple acquisition from data availability.
New flow:
The client is then free to continue the experiment immediately. If the user tries to read before the data is ready,
.read()may fail or report unavailable data. To make this robust, we should add a client-side.wait()helper: