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

Fix scaling of region of interest coordinates in virtual backscatter electron imaging generator #349

Merged
merged 3 commits into from
Apr 29, 2021

Conversation

hakonanes
Copy link
Member

Description of the change

Thanks a lot to @Fred-Ad for opening those issues!

Progress of the PR

Minimal example of the bug fix or new feature

>>> import kikuchipy as kp
>>> import hyperspy.api as hs
>>> s = kp.data.nickel_ebsd_large()
>>> print(s.axes_manager["dx"].scale, s.axes_manager["dy"].scale)
1.0 1.0
>>> s.axes_manager["dx"].scale = 560  # 70 um pixel size, binning of 8
>>> s.axes_manager["dy"].scale = 560
>>> vbse_gen = kp.generators.VirtualBSEGenerator(s)
>>> vbse_gen.plot()  # Grid tile coordinates are displayed correctly
>>> roi = hs.roi.RectangularROI(left=0, top=0, right=10 * 560, bottom=10 * 560)
>>> s.plot_virtual_bse_intensity(roi)  # Doesn't throw TraitError
>>> vbse_rgb = vbse_gen.get_rgb_image(r=(2, 1), g=(2, 2), b=(2, 3))  # Doesn't throw ValueError
>>> vbse_rgb.plot()

For reviewers

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

Signed-off-by: Håkon Wiik Ånes <hwaanes@gmail.com>
Signed-off-by: Håkon Wiik Ånes <hwaanes@gmail.com>
@hakonanes hakonanes added the bug Something isn't working label Apr 29, 2021
@hakonanes hakonanes added this to the v0.4.0 milestone Apr 29, 2021
Signed-off-by: Håkon Wiik Ånes <hwaanes@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

EBSD signal axes not set correctly in the Bruker h5ebsd reader
1 participant