pyxem / kikuchipy

Toolbox for analysis of electron backscatter diffraction (EBSD) patterns
https://kikuchipy.org
GNU General Public License v3.0
81 stars 30 forks source link

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

Closed hakonanes closed 2 years ago

hakonanes commented 2 years ago

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