Add polar transform and pair distribution function analysis#177
Draft
ehrhardtkm wants to merge 10 commits intoelectronmicroscopy:nanobeamfrom
Draft
Add polar transform and pair distribution function analysis#177ehrhardtkm wants to merge 10 commits intoelectronmicroscopy:nanobeamfrom
ehrhardtkm wants to merge 10 commits intoelectronmicroscopy:nanobeamfrom
Conversation
Collaborator
|
I'm happy to review this PR since this would naturally extend along If possible, if you could copy/paste API design here as a comment and attach screenshots (plots, before and after) - these can be helpful as well. API design, as a public facing component, is becoming more important since those are what humans mostly these days. The attached notebook is always good for the reviewers, but PRs contain global URLs so it's a great place to market/demo to the whole group and the world. |
002b5e1 to
fb0e5c7
Compare
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 does this PR do?
Implementation of polar coordinate transforms and computing pair distribution functions (PDFs) for 4DSTEM diffraction data. The PDF relies on a polar transformed data structure, which has been implemented in
Polar4dstem. The code will be updated in the future with other useful tools, like beam stop masking and elliptical corrections.The workflow takes a 4DSTEM dataset through the following steps:
auto_origin_id)grid_samplefor GPU acceleration (dataset4dstem_polar_transform)calculate_Gr)estimate_density,calculate_gr)New files
polar4dstem.py—Polar4dstemdataset class for polar-coordinate 4D-STEM data, plus the origin finding and polar transform functionspolar.py— ContainsPairDistributionFunctionclass. Handles the full PDF pipeline: radial averaging, background fitting, structure factor calculation, windowed sine transform to G(r), iterative density estimation, and conversion to g(r)tests/diffraction/test_polar.py— Tests covering construction, transforms, background fitting, PDF calculation, density estimation, and end-to-end workflowsModified files
dataset4dstem.py— Addedpolar_transform()convenience method onDataset4dstem__init__.pyfiles — Exposed new classes and modulesA companion tutorial notebook (PDFanalysis_simulatedTa.ipynb) demonstrating an example workflow on simulated amorphous Ta data is available.
What should the reviewer(s) do?
Provide feedback on the API design and implementation. Key areas for review:
Polar4dstemclass design and its relationship toDataset4dstemChecklist items:
Reviewer checklist