diff --git a/python/tests/resources/Orientation/Bain-001.png b/python/tests/resources/Orientation/Bain-001.png new file mode 100644 index 000000000..c46dc3b32 Binary files /dev/null and b/python/tests/resources/Orientation/Bain-001.png differ diff --git a/python/tests/resources/Orientation/Bain-011.png b/python/tests/resources/Orientation/Bain-011.png new file mode 100644 index 000000000..479121d7e Binary files /dev/null and b/python/tests/resources/Orientation/Bain-011.png differ diff --git a/python/tests/resources/Orientation/Bain-111.png b/python/tests/resources/Orientation/Bain-111.png new file mode 100644 index 000000000..34b003e5b Binary files /dev/null and b/python/tests/resources/Orientation/Bain-111.png differ diff --git a/python/tests/resources/Orientation/GT-001.png b/python/tests/resources/Orientation/GT-001.png new file mode 100644 index 000000000..56eb5a9ad Binary files /dev/null and b/python/tests/resources/Orientation/GT-001.png differ diff --git a/python/tests/resources/Orientation/GT-011.png b/python/tests/resources/Orientation/GT-011.png new file mode 100644 index 000000000..1f439380f Binary files /dev/null and b/python/tests/resources/Orientation/GT-011.png differ diff --git a/python/tests/resources/Orientation/GT-111.png b/python/tests/resources/Orientation/GT-111.png new file mode 100644 index 000000000..9abb5c2f0 Binary files /dev/null and b/python/tests/resources/Orientation/GT-111.png differ diff --git a/python/tests/resources/Orientation/GT_prime-001.png b/python/tests/resources/Orientation/GT_prime-001.png new file mode 100644 index 000000000..c600e7e2c Binary files /dev/null and b/python/tests/resources/Orientation/GT_prime-001.png differ diff --git a/python/tests/resources/Orientation/GT_prime-011.png b/python/tests/resources/Orientation/GT_prime-011.png new file mode 100644 index 000000000..a23745946 Binary files /dev/null and b/python/tests/resources/Orientation/GT_prime-011.png differ diff --git a/python/tests/resources/Orientation/GT_prime-111.png b/python/tests/resources/Orientation/GT_prime-111.png new file mode 100644 index 000000000..1e6ae2326 Binary files /dev/null and b/python/tests/resources/Orientation/GT_prime-111.png differ diff --git a/python/tests/resources/Orientation/KS-001.png b/python/tests/resources/Orientation/KS-001.png new file mode 100644 index 000000000..e51ada4ab Binary files /dev/null and b/python/tests/resources/Orientation/KS-001.png differ diff --git a/python/tests/resources/Orientation/KS-011.png b/python/tests/resources/Orientation/KS-011.png new file mode 100644 index 000000000..504be6174 Binary files /dev/null and b/python/tests/resources/Orientation/KS-011.png differ diff --git a/python/tests/resources/Orientation/KS-111.png b/python/tests/resources/Orientation/KS-111.png new file mode 100644 index 000000000..744fa564d Binary files /dev/null and b/python/tests/resources/Orientation/KS-111.png differ diff --git a/python/tests/resources/Orientation/NW-001.png b/python/tests/resources/Orientation/NW-001.png new file mode 100644 index 000000000..c79052e25 Binary files /dev/null and b/python/tests/resources/Orientation/NW-001.png differ diff --git a/python/tests/resources/Orientation/NW-011.png b/python/tests/resources/Orientation/NW-011.png new file mode 100644 index 000000000..1b4f8cd87 Binary files /dev/null and b/python/tests/resources/Orientation/NW-011.png differ diff --git a/python/tests/resources/Orientation/NW-111.png b/python/tests/resources/Orientation/NW-111.png new file mode 100644 index 000000000..fa16fcfda Binary files /dev/null and b/python/tests/resources/Orientation/NW-111.png differ diff --git a/python/tests/resources/Orientation/Pitsch-001.png b/python/tests/resources/Orientation/Pitsch-001.png new file mode 100644 index 000000000..134d35cd7 Binary files /dev/null and b/python/tests/resources/Orientation/Pitsch-001.png differ diff --git a/python/tests/resources/Orientation/Pitsch-011.png b/python/tests/resources/Orientation/Pitsch-011.png new file mode 100644 index 000000000..4cdbfc96b Binary files /dev/null and b/python/tests/resources/Orientation/Pitsch-011.png differ diff --git a/python/tests/resources/Orientation/Pitsch-111.png b/python/tests/resources/Orientation/Pitsch-111.png new file mode 100644 index 000000000..2aa2779da Binary files /dev/null and b/python/tests/resources/Orientation/Pitsch-111.png differ diff --git a/python/tests/resources/Result/2phase_irregularGrid_tensionX_2phase_irregularGrid.material.hdf5 b/python/tests/resources/Result/2phase_irregularGrid_tensionX_2phase_irregularGrid.material.hdf5 new file mode 100644 index 000000000..8370f9d6a Binary files /dev/null and b/python/tests/resources/Result/2phase_irregularGrid_tensionX_2phase_irregularGrid.material.hdf5 differ diff --git a/python/tests/resources/Result/2phase_irregularGrid_tensionX_increment_0.dream3d b/python/tests/resources/Result/2phase_irregularGrid_tensionX_increment_0.dream3d new file mode 100644 index 000000000..933856445 Binary files /dev/null and b/python/tests/resources/Result/2phase_irregularGrid_tensionX_increment_0.dream3d differ diff --git a/python/tests/resources/Result/2phase_irregularGrid_tensionX_increment_40.dream3d b/python/tests/resources/Result/2phase_irregularGrid_tensionX_increment_40.dream3d new file mode 100644 index 000000000..42ec5da7f Binary files /dev/null and b/python/tests/resources/Result/2phase_irregularGrid_tensionX_increment_40.dream3d differ diff --git a/python/tests/test_Orientation.py b/python/tests/test_Orientation.py index 2b802f12d..d1fd02294 100644 --- a/python/tests/test_Orientation.py +++ b/python/tests/test_Orientation.py @@ -1,6 +1,8 @@ import pytest import numpy as np from itertools import permutations +from matplotlib import pyplot as plt +from PIL import Image from damask import Rotation from damask import Orientation @@ -520,3 +522,25 @@ class TestOrientation: def test_mul_invalid(self): with pytest.raises(TypeError): Orientation.from_random(lattice='cF')*np.ones(3) + + @pytest.mark.parametrize('OR',['KS','NW','GT','GT_prime','Bain','Pitsch']) + @pytest.mark.parametrize('pole',[[0,0,1],[0,1,1],[1,1,1]]) + def test_OR_plot(self,update,res_path,tmp_path,OR,pole): + # https://doi.org/10.3390/cryst13040663 for comparison + O = Orientation(lattice='cF') + poles = O.related(OR).to_pole(uvw=pole,with_symmetry=True).reshape(-1,3) + points = util.project_equal_area(poles,'z') + + fig, ax = plt.subplots() + c = plt.Circle((0,0),1, color='k',fill=False) + ax.add_patch(c) + ax.scatter(points[:,0],points[:,1]) + ax.set_aspect('equal', 'box') + fname=f'{OR}-{"".join(map(str,pole))}.png' + plt.axis('off') + plt.savefig(tmp_path/fname) + if update: plt.savefig(res_path/fname) + current = np.array(Image.open(tmp_path/fname)) + reference = np.array(Image.open(res_path/fname)) + assert np.allclose(current,reference) +