Strain mapping improvements: adding independent optimizers for model fitting and multipeak fitting for cepstral calculation#235
Draft
mitis1 wants to merge 102 commits into
Conversation
Adding bragg disk detection and fixing the strain plotting class.
Collaborator
|
I'm thinking |
Collaborator
|
We want each PR should be meaningful and useful both for future us and this PR reviewers, I hope. |
added 2 commits
June 2, 2026 13:52
…ain-fitting-multi-optimizer
Collaborator
|
@mitis1 Please merge commits from |
Collaborator
|
I saw #195 - if unsure, pls DM, etc. The goal is having this PR containing ideally mostly miti's commits. |
Collaborator
Author
|
I just merged dev into fitting_models_clean, but I have some commits from nanobeam which I am working on removing so it is just additions to fitting_models_clean. |
Collaborator
Collaborator
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.


What problem this PR addressees
This PR updates the fitting-models to allow for strain mapping and independent optimizers for each component. This allows each component to have a different learning rate, which improves model fitting.
It also updates strain_autocorrelation to support multipeak cepstral transform fitting for improved strain mapping. This is controlled by the refine_all_peaks option in choose_lattice_vector() and fit_lattice_vectors().
It adds a StrainFitting class in strain_visualization. This takes the u and v arrays from different strain calculation algorithms and uses them to calculate and plot the strain. The goal is to make the final plots look consistent regardless of which algorithm was used, and the results can be saved using Autoserialize.
What should the reviewer(s) do
See the test notebooks and verify they work. Also see the StrainFitting class and if it is usable for multiple different strain calculation methods.
Test notebook for multi-peak cepstral fitting and strain plotting using StrainFitting:
20260527-pmos-cepstral-strain.ipynb
Test notebook for model fitting and strain plotting using StrainFitting:
20260512-pmos.ipynb