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

Change error to warning when checking EBSD and CrystalMap step sizes for refinement #531

Merged
merged 4 commits into from
May 27, 2022

Conversation

hakonanes
Copy link
Member

Description of the change

Addresses #526 by making an error into a warning.

Progress of the PR

Minimal example of the bug fix or new feature

# Setup
>>> import kikuchipy as kp
>>> from orix import sampling
>>> s = kp.data.nickel_ebsd_large(lazy=True)
>>> s = s.inav[:13, 0]
>>> s.remove_static_background()
>>> s.remove_dynamic_background()
>>> s.compute()
>>> mp = kp.data.nickel_ebsd_master_pattern_small(projection="lambert")
>>> rot = sampling.get_sample_fundamental(3, point_group=mp.phase.point_group)
>>> detector = kp.detectors.EBSDDetector(
>>>     shape=s.axes_manager.signal_shape[::-1],
>>>     pc=[0.421, 0.7794, 0.5049],
>>>     sample_tilt=70,
>>>     convention="edax",
>>> )

# "Mess up" axes manager
>>> s.axes_manager[0].name = ""
>>> s.axes_manager[0].scale = 1

# Index
>>> sim = mp.get_patterns(rotations=rot, detector=detector, energy=20)
>>> xmap = s.dictionary_indexing(sim)

# Refine
>>> xmap_ref = s.refine_orientation(
>>>     xmap=xmap,
>>>     detector=detector,
>>>     master_pattern=mp,
>>>     energy=20,
>>> )
/home/hakon/kode/kikuchipy/kikuchipy/signals/util/_crystal_map.py:40: UserWarning: The signal navigation axes must be named 'x' and/or 'y' in order to compare the signal navigation scale to the CrystalMap step sizes 'dx' and 'dy' (see `EBSD.axes_manager`)
  warnings.warn(
/home/hakon/kode/kikuchipy/kikuchipy/signals/util/_crystal_map.py:49: UserWarning: The `xmap` step size(s) [1.5] are different from the signal's step size(s) [1.0] (see `EBSD.axes_manager`)
  warnings.warn(

The second warning was previously an error.

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>
@hakonanes hakonanes added the bug Something isn't working label May 27, 2022
@hakonanes hakonanes added this to the v0.6.0 milestone May 27, 2022
Signed-off-by: Håkon Wiik Ånes <hwaanes@gmail.com>
@hakonanes hakonanes merged commit 79bd195 into pyxem:develop May 27, 2022
@hakonanes hakonanes deleted the fix-526 branch May 27, 2022 17:15
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.

None yet

1 participant