Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
5986b8d
Allow server cameras to be streamable by removing precaution checks
Baharis Sep 26, 2025
1267ac4
Unify interface, naming between get_microscope/camera(_class)
Baharis Sep 26, 2025
65a2707
Remove unused _init_attr_dict/get_attrs from microscope client/server
Baharis Sep 26, 2025
e64c51f
Do not force server-side attributes to be callable, use them first: t…
Baharis Sep 26, 2025
81b099c
EAFP: Allow camera to call functions whether they are registered or not
Baharis Sep 26, 2025
69210a1
EAFP: Allow camera to call unregistered functions - fixes server cameras
Baharis Sep 26, 2025
2322ece
Remove unnecessary print debug statement
Baharis Sep 26, 2025
1f5ecd2
Add **streamable** description to `config.md` documentation
Baharis Sep 26, 2025
463b798
Encapsulate FastADT paths in separate prop/method
Baharis Sep 30, 2025
115deda
Add new TrackingArtist to be used with plotting multi-runs
Baharis Sep 30, 2025
5cafbc9
Working multi-tracking FastADT frame! Still needs polish
Baharis Oct 1, 2025
eeb9e36
Change `ClickEvent` to dataclass, implement `ClickEvent.xy`
Baharis Oct 3, 2025
cbf757e
Optimize clicking logic in FastADT experiment
Baharis Oct 3, 2025
18cdde9
Merge branch 'main' into FastADT-track-multi
Baharis Oct 3, 2025
5e379b5
Streamline the `calibrate_beamshift_live` function
Baharis Oct 3, 2025
70eddda
Streamline `CalibBeamShift.plot`
Baharis Oct 3, 2025
49f1cf5
Improvements to `CalibBeamShift` readability (WIP)
Baharis Oct 3, 2025
1d6f91d
Add option to calibrate beamshift with vsp
Baharis Oct 6, 2025
4c16ca9
Fix errors, add beam center
Baharis Oct 6, 2025
ea64c4a
Switch calibration output format from pickle to yaml
Baharis Oct 6, 2025
1fe61dd
Allow delay during calibrate beamshift
Baharis Oct 6, 2025
416c070
Add necessary reflections to fix plotting
Baharis Oct 6, 2025
9eb51fe
Final tweaks
Baharis Oct 6, 2025
97274cf
Make the yaml produced by CalibBeamShift human-readable
Baharis Oct 6, 2025
9e0a017
Update src/instamatic/calibrate/calibrate_beamshift.py
Baharis Oct 7, 2025
8e3ddd0
Update src/instamatic/calibrate/calibrate_beamshift.py
Baharis Oct 7, 2025
ea4ec42
Minor post-review type-hint improvements + ruff
Baharis Oct 7, 2025
1837277
Merge remote-tracking branch 'origin/better_calibrate_beamshift' into…
Baharis Oct 7, 2025
4de403c
Merge branch 'main' into FastADT-track-multi
Baharis Oct 14, 2025
ce1d934
Add `instamatic.utils.iterating` with `sawtooth` iterating function
Baharis Oct 14, 2025
23ae996
Make the `click_dispatcher:ClickEvent.xy` a property
Baharis Oct 14, 2025
d2bfb1c
Rephrase `VideoStreamProcessor.temporary` using `blocked` context
Baharis Oct 14, 2025
bf73eb4
Fix the bug where canceling FastADT did not remove its elements
Baharis Oct 14, 2025
b220e74
Fix the bug where colors of crystal tracking repeated after 10
Baharis Oct 14, 2025
6af6c1c
Remove debug message
Baharis Oct 15, 2025
4c4f449
Attempt to generalize collecting, revert as needed
Baharis Oct 15, 2025
7611b6c
Fix: rotation speed for negative target pace is negative, rounds to 0
Baharis Oct 17, 2025
ca85cf0
Rename tracking "mode" to "algo"; if continuous, track w/ movie
Baharis Oct 17, 2025
f056fbf
Generalize FastADT run collection (+fix resulting bugs)
Baharis Oct 17, 2025
61ff039
Revert change: use stills for continuous tracking
Baharis Oct 17, 2025
9fe149f
Minor fixes and code quality improvements
Baharis Oct 17, 2025
e4e5dff
Clean, remove unused code
Baharis Oct 17, 2025
869adba
Fix tracking failing for beam not in the center at alignment
Baharis Oct 17, 2025
b8f8644
Fix Run.__str__, clean up code, method, call order
Baharis Oct 17, 2025
15ccdfe
Log all behavior in two separate message windows.
Baharis Oct 17, 2025
4d9d0e8
Fix ignore msg1,2 variables in headless FastADT experiment
Baharis Oct 17, 2025
8ac955a
Update in tests `tracking_mode` -> `tracking_algo`
Baharis Oct 17, 2025
8dfbf9e
Add estimated time required dialog in FastADT message 2
Baharis Oct 20, 2025
b280c35
Display which experiment is being collected in multi-expt
Baharis Oct 20, 2025
9422a93
Display which experiment is being collected in multi-expt
Baharis Oct 20, 2025
fa8fb2d
Trace variables only after everything was defined to avoid Exceptions
Baharis Oct 21, 2025
f9cf3b9
Merge branch 'main' into FastADT-track-multi
Baharis Oct 21, 2025
a463647
Fix: leaving input empty even temporarily caused exception
Baharis Oct 22, 2025
e91234c
Merge branch 'main' into FastADT-track-multi
Baharis Oct 23, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/gui.md
Original file line number Diff line number Diff line change
Expand Up @@ -181,8 +181,8 @@ For optimum performance, the FastADT frame uses three separate TEM setting which
**Diffraction exposure (s)**
: The time taken to collect each diffraction image in seconds. In the `continuous` mode it will additionally dictate the rotation speed.

**Tracking mode**
: Dictates whether `none` or `manual` tracking is to be performed at the start of the experiment.
**Tracking algorithm**
: Dictates whether `none` or `manual` tracking algorithm is to be performed at the start of the experiment to determine pathing.

**Tracking step (deg)**
: The target spacing between angles at which subsequent tracking images are collected within the tracking series in degrees.
Expand Down
4 changes: 2 additions & 2 deletions src/instamatic/calibrate/calibrate_beamshift.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,12 @@ class CalibBeamShift:
def __repr__(self):
return f'CalibBeamShift(transform=\n{self.transform},\n reference_shift=\n{self.reference_shift},\n reference_pixel=\n{self.reference_pixel})'

def beamshift_to_pixelcoord(self, beamshift: Sequence[float, float]) -> Vector2:
def beamshift_to_pixelcoord(self, beamshift: Sequence[float]) -> Vector2:
"""Converts from beamshift x,y to pixel coordinates."""
r_i = np.linalg.inv(self.transform)
return np.dot(self.reference_shift - np.array(beamshift), r_i) + self.reference_pixel

def pixelcoord_to_beamshift(self, pixelcoord: Sequence[float, float]) -> Vector2:
def pixelcoord_to_beamshift(self, pixelcoord: Sequence[float]) -> Vector2:
"""Converts from pixel coordinates to beamshift x,y."""
pc = np.array(pixelcoord)
return self.reference_shift - np.dot(pc - self.reference_pixel, self.transform)
Expand Down
2 changes: 1 addition & 1 deletion src/instamatic/calibrate/calibrate_stage_rotation.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ def speed_time_to_span(self, speed: float, time: float) -> float:

def plan_rotation(self, target_pace: float) -> RotationPlan:
"""Given target pace in sec / deg, find nearest pace, speed, delay."""
target_speed = self.alpha_pace / target_pace # exact speed setting needed
target_speed = abs(self.alpha_pace / target_pace) # exact speed setting needed
nearest_speed = self.speed_options.nearest(target_speed) # nearest setting
nearest_pace = self.alpha_pace / nearest_speed # nearest in sec/deg
total_delay = self.alpha_windup / nearest_speed + self.delay
Expand Down
15 changes: 15 additions & 0 deletions src/instamatic/camera/videostream.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,10 @@ def unblock(self):
def blocked(self):
yield

@contextmanager
def unblocked(self):
yield


class LiveVideoStream(VideoStream):
"""Handle the continuous stream of incoming data from the ImageGrabber."""
Expand Down Expand Up @@ -237,6 +241,17 @@ def blocked(self):
if not was_set_before:
self.grabber.continuousCollectionEvent.clear()

@contextmanager
def unblocked(self):
"""Clear `continuousCollectionEvent` in the statement scope only."""
was_set_before = self.grabber.continuousCollectionEvent.is_set()
try:
self.grabber.continuousCollectionEvent.clear()
yield
finally:
if was_set_before:
self.grabber.continuousCollectionEvent.set()

def show_stream(self):
from instamatic.gui import videostream_frame

Expand Down
Loading