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 EBSD orientation refinement on Windows #495

Merged
merged 8 commits into from
Jan 10, 2022

Conversation

hakonanes
Copy link
Member

@hakonanes hakonanes commented Jan 9, 2022

Description of the change

Fixes #494.

Progress of the PR

Minimal example of the bug fix or new feature

The following example is included as a test to catch this bug

from orix.crystal_map import create_coordinate_arrays, CrystalMap, Phase, PhaseList
from orix.quaternion import Rotation
import kikuchipy as kp
s = kp.data.nickel_ebsd_small()
s.remove_static_background()
s.remove_dynamic_background()
energy = 20
mp = kp.data.nickel_ebsd_master_pattern_small(energy=energy, projection="lambert")
detector = kp.detectors.EBSDDetector(
    shape=s.axes_manager.signal_shape[::-1],
    sample_tilt=70,
    pc=(0.421, 0.7794, 0.5049),
    convention="tsl",
)
# Crystal map from DI
coords, _ = create_coordinate_arrays((3, 3), step_sizes=(1.5, 1.5))
xmap = CrystalMap(
    rotations=Rotation((
        (0.9542, -0.0183, -0.2806, 0.1018),
        (0.9542, 0.0608, -0.2295, -0.1818),
        (0.9542, 0.0608, -0.2295, -0.1818),
        (0.9542, -0.0183, -0.2806, 0.1018),
        (0.9542, 0.0608, -0.2295, -0.1818),
        (0.9542, 0.0608, -0.2295, -0.1818),
        (0.9542, -0.0183, -0.2806, 0.1018),
        (0.9542, 0.0608, -0.2295, -0.1818),
        (0.9542, 0.0608, -0.2295, -0.1818),
    )),
    x=coords["x"],
    y=coords["y"],
    prop=dict(scores=np.array((
        0.4364652, 0.3772456, 0.4140171,
        0.4537009, 0.37445727, 0.43675864,
        0.42391658, 0.38740265, 0.41931134
    ))),
    phase_list=PhaseList(Phase("ni", 225, "m-3m"))
)
xmap_refined = s.inav.refine_orientation(
    xmap=xmap, detector=detector, master_pattern=mp, energy=energy,
)
print(np.all(xmap_refined.scores > xmap.scores))
# True

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 CHANGELOG.rst.
  • New contributors are added to .all-contributorsrc and the table is regenerated.

Signed-off-by: Håkon Wiik Ånes <hwaanes@gmail.com>
Signed-off-by: Håkon Wiik Ånes <hwaanes@gmail.com>
Signed-off-by: Håkon Wiik Ånes <hwaanes@gmail.com>
Signed-off-by: Håkon Wiik Ånes <hwaanes@gmail.com>
Signed-off-by: Håkon Wiik Ånes <hwaanes@gmail.com>
Signed-off-by: Håkon Wiik Ånes <hwaanes@gmail.com>
Signed-off-by: Håkon Wiik Ånes <hwaanes@gmail.com>
@hakonanes hakonanes added bug Something isn't working 📋 tests labels Jan 9, 2022
@hakonanes hakonanes added this to the 0.5.7 milestone Jan 9, 2022
Signed-off-by: Håkon Wiik Ånes <hwaanes@gmail.com>
@hakonanes
Copy link
Member Author

After checks pass, I'll merge and release 0.5.7.

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.

1 participant