Skip to content

Adding various strain mapping algorithms - #284

Draft
mitis1 wants to merge 58 commits into
electronmicroscopy:devfrom
mitis1:strain-multi-optimizer-fitting-models
Draft

Adding various strain mapping algorithms#284
mitis1 wants to merge 58 commits into
electronmicroscopy:devfrom
mitis1:strain-multi-optimizer-fitting-models

Conversation

@mitis1

@mitis1 mitis1 commented Aug 29, 2026

Copy link
Copy Markdown
Collaborator

What problem this PR addresses

This PR adds an implementation of the cepstral transform, template matching, and model fitting for strain mapping. The cepstral implementation is based on this paper by Padgett et al and the template matching is based on py4dstem's algorithm. Model fitting is a new method for calculating strain using a rendered diffraction pattern and fitting it to match the original.

The cepstral implementation is mainly in strain_autocorrelation.py file.
Disk detection is in bragg_vectors.py, bragg_vectors_visualization.py, and disk_detection.py.
Model fitting uses model_fitting.py and model_fitting_visualization.py. It also implements a base fitting model that can be used for implementations beyond strain mapping.

The PR also makes a strain class which calculates and saves the strain map using the results of any of the previous algorithms. It is implemented in strain.py and strain_visualizations.py

What should the reviewer(s) do

  • Check the implementation of the various strain mapping algorithms.
  • See if the strain class works for all the listed methods
  • Run the test scripts and verify it works (the dataset is too big to attach so I can send it separately as needed)

model-fitting.ipynb
cepstral_mp.ipynb
cepstral.ipynb
disk-detection.ipynb

Copilot AI and others added 30 commits March 18, 2026 22:22
Create clean fitting_models branch tracking upstream/fitting_models_clean
…odels_clean

Fitting models without all the extra commits, for easier merging into dev in the future.
Miti Shah and others added 28 commits June 2, 2026 13:59
… model fitting, and optimizer batched implementation
@mitis1
mitis1 requested a review from smribet August 29, 2026 21:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants