Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Detector Pattern Simulation #239

Merged
merged 93 commits into from
Nov 14, 2020
Merged

Detector Pattern Simulation #239

merged 93 commits into from
Nov 14, 2020

Conversation

friedkitteh
Copy link
Collaborator

@friedkitteh friedkitteh commented Oct 26, 2020

Description of the change

Method for sampling patterns from an EBSDDetector()

Closes #229

Progress of the PR

Minimal example of the bug fix or new feature

>>> import kikuchipy as kp
>>> from kikuchipy.detectors import EBSDDetector
>>> from orix import sampling
>>>
>>> mp = kp.load(
    r"My\Awesome\Folder\Master-Pattern.h5",
    projection="lambert",
    hemisphere="both",
)
>>>
>>> detector = EBSDDetector(
    shape=(480, 640),
    px_size=50,
    pc=(0, 0, 15000),
    convention="emsoft4",
    tilt=10,
    sample_tilt=70,
)
>>>
>>> r = sampling.sample_generators.get_sample_fundamental(resolution=2, space_group=225)
>>> patterns = mp.get_patterns(r, detector, 20, dtype_out=np.float32)
>>> patterns
<LazyEBSD, title: , dimensions: (117473|640, 480)>
>>>
>>> patterns.plot()

For reviewers

  • Check that the PR title is short, concise, and will make sense 1 year
    later.
  • Check that new functions are imported in corresponding __init__.py.
  • Check that new features, API changes, and deprecations are mentioned in
    the unreleased section in doc/changelog.rst.

@friedkitteh
Copy link
Collaborator Author

Rest of the suggested changes will be done as soon as #246 closes

Copy link
Member

@hakonanes hakonanes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work!

My plane leaves now, so I will finish this review later this evening or tomorrow.

kikuchipy/signals/ebsd_master_pattern.py Show resolved Hide resolved
kikuchipy/signals/ebsd_master_pattern.py Show resolved Hide resolved
kikuchipy/signals/ebsd_master_pattern.py Outdated Show resolved Hide resolved
kikuchipy/signals/ebsd_master_pattern.py Outdated Show resolved Hide resolved
kikuchipy/signals/ebsd_master_pattern.py Outdated Show resolved Hide resolved
kikuchipy/signals/ebsd_master_pattern.py Outdated Show resolved Hide resolved
Copy link
Member

@hakonanes hakonanes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Contd.

kikuchipy/signals/ebsd_master_pattern.py Outdated Show resolved Hide resolved
kikuchipy/signals/ebsd_master_pattern.py Show resolved Hide resolved
Copy link
Member

@hakonanes hakonanes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again, great stuff.

I think after these changes, we're good to merge!

kikuchipy/signals/ebsd_master_pattern.py Outdated Show resolved Hide resolved
kikuchipy/signals/ebsd_master_pattern.py Show resolved Hide resolved
kikuchipy/signals/ebsd_master_pattern.py Outdated Show resolved Hide resolved
kikuchipy/signals/ebsd_master_pattern.py Outdated Show resolved Hide resolved
kikuchipy/signals/ebsd_master_pattern.py Outdated Show resolved Hide resolved
kikuchipy/signals/tests/test_ebsd_masterpattern.py Outdated Show resolved Hide resolved
@hakonanes hakonanes self-requested a review November 14, 2020 18:26
Copy link
Member

@hakonanes hakonanes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Quick and good changes, only one change remains (I wasn't clear in my comment in the previous review, sorry).

Will merge after that change is made and checks pass.

kikuchipy/signals/ebsd_master_pattern.py Outdated Show resolved Hide resolved
@hakonanes hakonanes merged commit 73f49f9 into pyxem:master Nov 14, 2020
@friedkitteh friedkitteh deleted the MP_mapping branch November 14, 2020 19:25
@hakonanes
Copy link
Member

Thanks a lot for this work, @friedkitteh 🎉 🎉

And for acting on my suggested changes so quickly, making the review process quick and easy 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

LambertProjection.project() can return values outside of the 2D square grid
2 participants