Skip to content

Conversation

Baharis
Copy link
Member

@Baharis Baharis commented Oct 14, 2025

Currently, FastADT experiment supports manual tracking of one crystal. This can be performed by left-clicking at desired beam position on the images collected during a tracking scan. Tracking results are displayed on a 2-axis line plot and can be accepted by left-clicking or rejected by right-clicking.

This PR adds a QOL feature / quality improvement to FastADT. Firsty, the tracking results are now displayed as a colored dot on the tracking images using the VideoStreamProcessor.temporary context. The tracking can be likewise accepted or rejected OR a new tracking can be added using middle mouse button. Every new tracking is then done just like the first one, and the results of previous tracking are displayed using a large colored dot (different color for each tracking):

Screen.Recording.2025-10-20.145950.mp4

With this feature, one tracking scan can be used to define tracking paths for several datasets to be collected one after another. This can be used to get several datasets from crystals laying in close proximity when repeating experiment on several samples or investigating different parts of one crystal.

This PR also includes several minor features, bug-fixes, and code quality improvements:

  • docs/gui/md, gui/fast_adt_frame.py: rename "tracking mode" to "tracking algo" for consistency;
  • calibrate_beamshift.py: fix the type hint for beamshift_to_pixelcoord and pixelcoord_to_beamshift;
  • calibrate_stage_rotation.py: fix CalibStageRotation.plan_rotation failing if rotating towards negative alpha;
  • fast_adt/experiment.py: middle mouse button can be used after tracking to add new one and run multiple experiments;
  • fast_adt/experiment.py: fixed bug where the tracking step was calculate incorrectly if it wasn't divisor of total range;
  • fast_adt/experiment.py: improved type hints, docs, and variable naming to be consistent with the rest of the codebase;
  • fast_adt/experiment.py: new displayed_step context displays tracking on images as colored dots;
  • fast_adt/experiment.py: generalize stills and scanning experiments, add multiple new messages to the user;
  • gui/click_dispatcher.py:MouseButton: now a dataclass with SCROLL_UP and SCROLL_DOWN and xy property;
  • gui/fast_adt_frame.py: Add the second message area that displays experiment status and estimates its runtime;
  • utils/iterating.py: new file for iterating tools with a new sawtooth iterator: sawtool('abc') == 'abccbaabc...;
  • videostream.py: add context VideoStream.unblocked to complement VideoStream.unblocked.

Baharis and others added 30 commits September 26, 2025 13:19
Co-authored-by: Stef Smeets <stefsmeets@users.noreply.github.com>
Co-authored-by: Stef Smeets <stefsmeets@users.noreply.github.com>
@Baharis Baharis requested a review from stefsmeets October 14, 2025 17:23
@Baharis Baharis self-assigned this Oct 14, 2025
@Baharis Baharis marked this pull request as draft October 15, 2025 17:32
@Baharis Baharis marked this pull request as ready for review October 17, 2025 18:28
@Baharis Baharis requested a review from stefsmeets October 20, 2025 13:16
@Baharis
Copy link
Member Author

Baharis commented Oct 20, 2025

Alright, now I believe I addressed most of the things I wanted that take a reasonable time. I have mostly rewritten and generalized the code that runs FastADT experiment. The GUI shows much more information, and thanks to the new videostream processor, the tracking shows on image instead of on a line plot. I fixed multiple bugs, other than one that occurs when the oscillation angle is negative, which I will cover in a separate PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants