Repository navigation
Tomography: restart Kinetix preview once at the end of step scans, not per step - #147
Conversation
Adds restart_preview (default False). The cleanup no longer puts Kinetix detectors back into continuous, internally triggered acquisition unless asked. Assisted-by: copilot:claude-opus-5-5
There was a problem hiding this comment.
🟡 Changes recommended
Adding restart_preview before sample_name breaks existing positional calls, losing sample metadata, unexpectedly enabling preview, and shifting subsequent arguments.
1 open issue
What changed in this PR
This PR makes Kinetix preview restart optional after tomo_flyscan, leaving detectors in their post-scan state by default.
Changes:
- Adds
restart_preview=Falseand gates preview cleanup on this option. - Preserves shutter closure, motor stopping, and velocity restoration.
- Updates default-behavior assertions and adds a test for explicitly restarting preview.
| File | Description |
|---|---|
tests/tomography/test_flyscans.py |
Tests default cleanup behavior and explicit preview restart. |
src/hextools/tomography/flyscans.py |
Adds and documents the preview-restart option and conditional cleanup. |
Review effort: Balanced
|
For tomo_flyscan only it should be set to True be default. Only in tomo_nd it sets to False |
tomo_flyscan and tomo_dark_flat take restart_preview (default True). tomo_nd_step_scan and its wrappers run them with restart_preview=False and restart preview once when the whole scan ends, unless restart_preview=False. Per Jakub and Nghia's review. Assisted-by: copilot:claude-opus-5-5
|
Done in 92ea2c2: |
Jakub Wlodek (jwlodek)
left a comment
There was a problem hiding this comment.
Minor point, otherwise looks good.
|
restart_preview parameter needs to be used in tomo_nd, 1d_2d where we set to False for the loop. But at the end we set it to True. |
enable_preview_mode stops a Phantom recording and turns on its live preview (ADPhantom Preview, deployed afefafc). The Phantom's prepare turns live preview off, since the IOC refuses to download while it runs. The tomography plans call enable_preview_mode for every detector. Per Jakub's review. Assisted-by: copilot:claude-opus-5-5

Restart detector preview once at the end of a tomography scan, not after every step of it.
tomo_flyscanandtomo_dark_flattakerestart_preview: bool = True(besideuse_shutter); run on their own they still return the cameras to preview.tomo_nd_step_scanand its wrappers (tomo_flyscan_loop,tomo_1d_step_scan,tomo_2d_step_scan) run them withrestart_preview=False, and restart preview once when the whole scan ends (also on abort), unlessrestart_preview=False.tomo_dark_flatstill restores each camera's exposure either way.enable_preview_modesupports the Phantom: it stops a recording and turns on live preview (Preview). The Phantom's prepare turns live preview off, since the IOC (ADPhantomafefafc) refuses to download while it runs.Verification
Mock tests only (no sim, TST or beamline):
tests/tomographyandtests/detectors/test_phantom.py: pass; the new or updated tests fail on the code before each change.tests, excludingtests/gui): 562 passed, exit 0.