Commit 63155a2
Implement FastADT experiment (#137)
* Add `ClickDispatcher` architecture and setup one in `VideoStreamFrame`
* Add `VideoStreamService` architecture and setup one in `VideoStreamFrame`
* Rename `VideoStreamEnhancers` to `Overlays`, make `ImageDrawOverlay` editable
* `ClickListener`: make `callback` optional and allow activating via `with` context
* `MediaGrabber`: fix bug: `get_media` cleared `continuousCollectionEvent`
* `calibrate_beamshift.py`: make imports absolute, allow float beamshift
* Instamatic GUI: temporarily print coords of clicked point, revert later
* Move `instamatic.typing` to `typing_` to avoid import conflicts
* `stage`: Add `get_rotation_speed`, improve typing
* Add `instamatic.calibrate_stage_rotation` for greater rotation control
* Add `instamatic.calibrate_stage_rotation` for greater rotation control 2
* Add first ideas for RATS-like generalized data collection frame
* `ImageDrawOverlay`: Don't print `self.operations` on every redraw
* GUI: FIX couldn't initialize with non-steamable camera
* `VideoStream`: Generalize real & fake streams under common base class
* GUI: Allow VideoStreamFrame for non-streamable cameras via the fake
* Allow customizing `NoOverwriteDict`'s `KeyOverwriteError` message
* Add `ClickDispatcher` architecture and setup one in `VideoStreamFrame`
* `ClickListener`: make `callback` optional and allow activating via `with` context
* Add `typing_extensions` as a dependency
* Move potential `typing_extensions` types to `instamatic._typing`
* Feature usefulness of new `instamatic._typing.Self`
* Move potential `typing_extensions` types to `instamatic._typing`
* Feature usefulness of new `instamatic._typing.Self`
* Exclude changes irrelevant to the `click_service` branch
* Add a custom `ClickEvent.__repr__`
* Add a custom `ClickEvent.__repr__`
* Move `instamatic.collections` to `instamatic._collections`
* Move `instamatic.collections` to `instamatic._collections`
* `ClickListener`: call `callback` only after putting event in `self.queue`
* `ClickListener`: call `callback` only after putting event in `self.queue`
* `_VS`: rename type variable to a more conventional `VideoStream_T`
* `_VS`: rename type variable to a more conventional `VideoStream_T`
* `typing_extensions`: uses typing if available so import directly, not via `instamatic._typing`
* `typing_extensions`: uses typing if available so import directly, not via `instamatic._typing`
* Do not pass numpy objects to the microscope.
* `CameraSimu.get_movie`: convert into `Generator`
* `VideoStream.get_movie`: convert into `Generator`
* `VideoStream.get_movie`: Optimize thread release, remove unused event = best fps yet
* `VideoStream.get_movie`: Optimize thread release, remove unused event = best fps yet 2
* `TEMController.get_movie`: convert into `Generator`
* `ctrl.get_image`: fix `header_keys` could hold only 1 key as `str` not `tuple`
* `CalibMovieRate`: first draft of the movie delay calibration
* `TEMController.get_movie`: collect common metadata before the main loop for time precision
* `TEMController`: move ugly explicit `self.cam` check to a method decorator
* `CalibMovieDelays`: simplify and add multi-attempt mechanism
* `CalibMovieDelaysMapping`: add a common class for reading/writing mappings
* `CalibMovieDelaysMapping`: fix I/O, script, bugs, add custom `CalibError`
* FEI Tecnai upper speed limit seem to be around 0.2
* `CameraServal.get_movie`: rewrite as generator, streamline by PIL->tifffile
* `CameraBase.get_movie`: rewrite as generator
* `CameraMerlin.get_movie`: rewrite as generator
* `showcase_movie.py`: Add a temp script to feature get_movie streaming feature
* `CameraServal.get_movie`: Actually replace previous implementation this time
* `CalibMovieDelays`: vastly simplify, do for specific exposure only
* `CalibMovieDelays`: fix documentation, warning criteria
* Register `instamatic.calibrate.calibrate_movie_delays` as script
* Fix bugs, typos
* Adapt `test_get_movie` to the new structure
* Add Daniel Tchoń to `CITATION.cff`
* Implement simple cRED protocol in rats frame using `get_movie`
* Fix `write_tiff` raising when writing to non-existing directory
* Fix `DiffractionRun.middles` off-by-one error
* Wrap generators in `try/finally` to correctly close them when not exhausted
* RATS cRED: find and rotate with closest possible rotation speed
* Reorganize rats frame, lock unusable buttons
* `RatsFrame`: clean code formatting
* `RatsFrame`: make `Run.experiments` a property
* `RatsFrame`: can now extend/collect experiments in parts
* These things don't work on Tecnai (fix better)
* WHen using center, convert numpy types to python
* Disable plotting until its fixed.
* Adapt RATS experiment to updated movie calibration
* Add typing, align `stage.rotating_speed` to `stage.rotation_speed` to match already-used wording
* Fix beamshift deflector so that it passes `int` or `float` instead of `np.int`
* Fix wrong definitions of goniometer speed vs pace
* Fix mismatched axes order for the purpose of crystal tracking
* Generalize image, tracking, diffraction config re/store
* Correctly change config during RATS experiment
* Add docstrings, streamline blanking
* Add `with Beam().blanked()` and `with Beam().unblanked()`
* Apply the new beam `un/blanked` context in various places
* Various RATS frame fixes needed to run cRED on Tecnai
* New console print of carriage return, with debug statements
* Remove ANSI ESCAPE characters after all; this version handles tqdm
* Remove debug statements
* Improve RATS experiment: go to 0 at start, end, also collect image
* Add beam blank button, block can when collecting stills,
* Systematize `setStagePosition` signature, make `None` a sentinel for speed
* Fix TEMController alignments being incorrectly stored and restored
* Add generalized handling for PETS input using a dedicated factory
* Since we need to support python 3.7 and 3.8, move csv file inside py
* Produce just a single PETS file in RATS experiment
* Add generalized handling for PETS input using a dedicated factory
* Since we need to support python 3.7 and 3.8, move csv file inside py
* Fix name of produced pets file to `pets.pts`
* Fix name of produced pets file to `pets.pts`
* Fix creating `pets.pts` if prefix or suffix are not defined
* Fix creating `pets.pts` if prefix or suffix are not defined
* Split PETS affix to blocks pre-adding: rejects only duplicate lines, not all affix
* Split PETS affix to blocks pre-adding: rejects only duplicate lines, not all affix
* Add doc, tests, move csv to resources, bump min Python version to 3.9
* GitHub tests fail for Python 3.13, may be not supported by some libraries yet
* Simplify, accelerate the video provider, now `VideoServiceProcessor`
* Further simplify, make faster, allow `VideoStreamProcessor` to display figures
* Remove `[tool.setuptools.package-data]` from `pyproject.toml`
Co-authored-by: Stef Smeets <stefsmeets@users.noreply.github.com>
* Fix typo in src/instamatic/processing/ImgConversion.py
Co-authored-by: Stef Smeets <stefsmeets@users.noreply.github.com>
* Move `PetsInputWarning` to the top of the `PETS_input_factory.py` file
* Make `PETS_KEYWORDS` uppercase, fix `PetsKeywords.from_file` type hint
* Bump the suggested conda-forge Python version to 3.12
* Improve docstrings in `DeferredImageDraw` & `VideoStreamProcessor`
* `on_frame`: scale 2-fold, clear a bunch of empty lines
* `ExperimentalRats`: fix beam un/blanker
* `ExperimentalRats`: export tracking to its own function
* Merge `fix_pets_input` into `video_services`
* Revert code unrelated to strictly stream processor updates
* Improve `stream.processor.temporary_*`, docstring, add example code
* Fix bug: clicking on VideoStreamFrame.panel.image was 2px off
* Remove debug timing instructions
* Fix clicked point was incorrect if window scrolled or partially visible
* Rename `save_image` -> `save_frame`, new `save_image` job saves edited as PNG, remove unused imports
* Remove discontinued showcase script
* Fix incorrect yield placement in `processor.temporary` context
* Revert "Revert code unrelated to strictly stream processor updates"
This reverts commit a607a77.
* Align with changes suggested in #135 (temporary as common context)
* Fix bug: continuous geometry not interpreted correctly for PETS
* Revert code left for development showcase purposes only
* Simplify, document, rename the RATS frame to FastADT
* Add FastADT experiment test (WIP), clear pytest.mark.parametrize w/ `InstanceAutoTracker`
* Add changes done to movie delay branch after it split off
* Update src/instamatic/experiments/fast_adt/experiment.py
Co-authored-by: Stef Smeets <stefsmeets@users.noreply.github.com>
* Update src/instamatic/experiments/fast_adt/experiment.py
Co-authored-by: Stef Smeets <stefsmeets@users.noreply.github.com>
* Update src/instamatic/experiments/fast_adt/experiment.py
Co-authored-by: Stef Smeets <stefsmeets@users.noreply.github.com>
* Apply selected @stefsmeets suggestions
* Use dict literals here, these are much faster.
Co-authored-by: Stef Smeets <stefsmeets@users.noreply.github.com>
* Adapt FastADT frame to PR 135-137 suggestions
* Remove extremely-cool-yet-unused `SubclassRegistryMeta`
* Remove rather-cool-yet-unused `timer` context
* Document `camera.dead_time`
* Add `fast_adt` to settings modules so that it appears to new users
* Add FastADT documentation
* Bump the lowest supported version of numpy to 1.20
Numpy 1.19 was first numpy version to support python 3.9, so anyone even running on python 3.9 it extremely unlikely to still rely on it. Meanwhile, numpy 1.20 is the first to support very useful numpy.typing: https://numpy.org/devdocs/reference/typing.html
* Increase readability, type hints of FastADT `Run`
* OK, after 2nd thought, let's support Python3.9 users as we can
* Replace custom `RuntimeError` `pass` with docstrings
* Does not hurt; Update src/instamatic/experiments/fast_adt/experiment.py
Co-authored-by: Stef Smeets <stefsmeets@users.noreply.github.com>
* Update src/instamatic/experiments/fast_adt/experiment.py
Co-authored-by: Stef Smeets <stefsmeets@users.noreply.github.com>
* Update src/instamatic/experiments/fast_adt/experiment.py
Co-authored-by: Stef Smeets <stefsmeets@users.noreply.github.com>
* Improve the `config.md` description of `camera.dead_time`
* Update src/instamatic/experiments/fast_adt/experiment.py
Co-authored-by: Stef Smeets <stefsmeets@users.noreply.github.com>
* Let pre-commit fix indentation errors in suggested docstring
* Add a proper docstring for FastADT `Experiment.start_collection`
* Hidden complex bit behind a method to makes things clearer :-)
---------
Co-authored-by: Stef Smeets <stefsmeets@users.noreply.github.com>1 parent 0225245 commit 63155a2
File tree
22 files changed
+907
-70
lines changed- docs
- app_data/instamatic/config/camera
- images
- src/instamatic
- config
- camera
- experiments
- fast_adt
- gui
- tests
- alignments
- config
- calibration
- camera
22 files changed
+907
-70
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
206 | 206 | | |
207 | 207 | | |
208 | 208 | | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
209 | 212 | | |
210 | 213 | | |
211 | 214 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
154 | 154 | | |
155 | 155 | | |
156 | 156 | | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
157 | 196 | | |
158 | 197 | | |
159 | 198 | | |
| |||
Loading
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
| 4 | + | |
3 | 5 | | |
| 6 | + | |
4 | 7 | | |
5 | | - | |
| 8 | + | |
6 | 9 | | |
7 | 10 | | |
8 | 11 | | |
| |||
14 | 17 | | |
15 | 18 | | |
16 | 19 | | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
17 | 27 | | |
18 | 28 | | |
19 | 29 | | |
20 | 30 | | |
21 | 31 | | |
22 | 32 | | |
23 | 33 | | |
24 | | - | |
| 34 | + | |
25 | 35 | | |
26 | 36 | | |
27 | 37 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
| 62 | + | |
62 | 63 | | |
63 | 64 | | |
64 | 65 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
6 | 7 | | |
7 | 8 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
13 | 17 | | |
14 | 18 | | |
15 | 19 | | |
| |||
0 commit comments