FastADT: Add an option to re-use previous tracking#159
Open
Baharis wants to merge 1 commit intoinstamatic-dev:mainfrom
Open
FastADT: Add an option to re-use previous tracking#159Baharis wants to merge 1 commit intoinstamatic-dev:mainfrom
Baharis wants to merge 1 commit intoinstamatic-dev:mainfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Introduction
Experimental protocol "FastADT" allows selection of an a priori tracking algorithm. The current version of Instamatic implements two: "none" - no tracking will be attempted or "manual" - requires recent beamshift calibration, after which the user clicks on the display to track the crystal. Following a suggestion by @pbklar, this PR implements a third option: "load".
To make this change possible, in the first place the previously tracked paths must be saved. This is now implemented via new FastADT
Runmethods.to_csvandfrom_csv. Since anyRunis an annotated pandas table, the table is saved as an csv, while the metadata is put in the first line in the comment. The resulting file looks like this:One
path_#.csvfile is created for each tracked path, as soon as it is defined, even if an experiment is never performed. Then, whenever a tracking option "load" is selected, the GUI immediately opens a tk-built-in multiple-file-selection dialogue, saves the paths as semicolon-separated string, and passes to the experiment alongside other variables. If the experiment receivesparam["tracking_algo"] == "load", it parses the details string as paths, tries to open every one of them, and runs an experiment for every path, without requesting any new manual process. This way once a tracked path is determined, it can be reused to perform multiple experiments, for example with different exposure or angle range:This was successfully tested on a simulator and emulator. Because
DiffractionRunbeam shifts are determined by interpolating beam shifts ofTrackingRunpoints, this works fine if the alpha range for tracking is different - even tighter than - the alpha range used for diffraction. The GUI by default wants csv files but accepts any others. In case these can not be parsed as valid path tables, the exceptions are gracefully handled at the level of an experiment.What's new
tracking_algo = 'load,tracking_details = 'path1;path2;path3'to re-use previous beamshifts.