corrected OR models and set up simple test to check them

This commit is contained in:
Yannick Naunheim 2015-06-29 16:02:56 +00:00
parent 61e3987bfa
commit 5fe65bfcc3
1 changed files with 156 additions and 123 deletions

View File

@ -900,9 +900,16 @@ class Orientation:
def related(self, relationModel, direction, targetSymmetry = None): def related(self, relationModel, direction, targetSymmetry = None):
if relationModel not in ['KS','GT',"GT'",'NW','Bain']: return None if relationModel not in ['KS','GT','GTdash','NW','Pitsch','Bain']: return None
if int(direction) == 0: return None if int(direction) == 0: return None
# KS from S. Morito et al./Journal of Alloys and Compounds 5775 (2013) S587-S592
# GT from Y. He et al./Journal of Applied Crystallography (2006). 39, 72-81
# GT' from Y. He et al./Journal of Applied Crystallography (2006). 39, 72-81
# NW from H. Kitahara et al./Materials Characterization 54 (2005) 378-386
# Pitsch from Y. He et al./Acta Materialia 53 (2005) 1179-1190
# Bain from Y. He et al./Journal of Applied Crystallography (2006). 39, 72-81
variant = int(abs(direction))-1 variant = int(abs(direction))-1
(me,other) = (0,1) if direction > 0 else (1,0) (me,other) = (0,1) if direction > 0 else (1,0)
@ -925,62 +932,62 @@ class Orientation:
[[ -1, 1, 1],[ 0, 1, 1]],\ [[ -1, 1, 1],[ 0, 1, 1]],\
[[ -1, 1, 1],[ 0, 1, 1]],\ [[ -1, 1, 1],[ 0, 1, 1]],\
[[ -1, 1, 1],[ 0, 1, 1]],\ [[ -1, 1, 1],[ 0, 1, 1]],\
[[ 1, 1, 1],[ 0, 1, 1]],\ [[ 1, 1, -1],[ 0, 1, 1]],\
[[ 1, 1, 1],[ 0, 1, 1]],\ [[ 1, 1, -1],[ 0, 1, 1]],\
[[ 1, 1, 1],[ 0, 1, 1]],\ [[ 1, 1, -1],[ 0, 1, 1]],\
[[ 1, 1, 1],[ 0, 1, 1]],\ [[ 1, 1, -1],[ 0, 1, 1]],\
[[ 1, 1, 1],[ 0, 1, 1]],\ [[ 1, 1, -1],[ 0, 1, 1]],\
[[ 1, 1, 1],[ 0, 1, 1]]]), [[ 1, 1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],[ 1, 1, 0]],\
[[-17, 7,-17],[-17, 12, -5]],\ [[ 1, 1, 1],[ 0, 1, 1]],\
[[-17, -7, 17],[-17,-12, 5]],\ [[ 1, 1, 1],[ 1, 0, 1]],\
[[ 17, -7,-17],[ 17,-12, -5]],\ [[ -1, -1, 1],[ -1, -1, 0]],\
[[ 17, 17, 7],[ 17, 5, 12]],\ [[ -1, -1, 1],[ 0, -1, 1]],\
[[-17,-17, 7],[-17, -5, 12]],\ [[ -1, -1, 1],[ -1, 0, 1]],\
[[ 17,-17, -7],[ 17, -5,-12]],\ [[ -1, 1, 1],[ -1, 1, 0]],\
[[-17, 17, -7],[-17, 5,-12]],\ [[ -1, 1, 1],[ 0, 1, 1]],\
[[ -1, 1, 1],[ -1, 0, 1]],\
[[ 1, -1, 1],[ 1, -1, 0]],\
[[ 1, -1, 1],[ 0, -1, 1]],\
[[ 1, -1, 1],[ 1, 0, 1]]]),
'GTdash': \
np.array([[[ 7, 17, 17],[ 12, 5, 17]],\
[[ 17, 7, 17],[ 17, 12, 5]],\
[[ 17, 17, 7],[ 5, 17, 12]],\ [[ 17, 17, 7],[ 5, 17, 12]],\
[[ -7,-17, 17],[-12, -5, 17]],\
[[-17, -7, 17],[-17,-12, 5]],\
[[-17,-17, 7],[ -5,-17, 12]],\ [[-17,-17, 7],[ -5,-17, 12]],\
[[ 7,-17,-17],[ 12, -5,-17]],\
[[ 17, -7,-17],[ 17,-12, -5]],\
[[ 17,-17, -7],[ 5,-17,-12]],\ [[ 17,-17, -7],[ 5,-17,-12]],\
[[ -7, 17,-17],[-12, 5,-17]],\
[[-17, 7,-17],[-17, 12, -5]],\
[[-17, 17, -7],[ -5, 17,-12]],\ [[-17, 17, -7],[ -5, 17,-12]],\
[[ 7, 17, 17],[ 12, 17, 5]],\ [[ 7, 17, 17],[ 12, 17, 5]],\
[[ 7,-17,-17],[ 12,-17, -5]],\
[[ -7,-17, 17],[-12,-17, 5]],\
[[ -7, 17,-17],[-12, 17, -5]],\
[[ 7, 17, 17],[ 12, 5, 17]],\
[[ 7,-17,-17],[ 12, -5,-17]],\
[[ -7,-17, 17],[-12, -5, 17]],\
[[ -7, 17,-17],[-12, 5,-17]],\
[[ 17, 7, 17],[ 5, 12, 17]],\ [[ 17, 7, 17],[ 5, 12, 17]],\
[[-17, 7,-17],[ -5, 12,-17]],\ [[ 17, 17, 7],[ 17, 5, 12]],\
[[ -7,-17, 17],[-12,-17, 5]],\
[[-17, -7, 17],[ -5,-12, 17]],\ [[-17, -7, 17],[ -5,-12, 17]],\
[[ 17, -7,-17],[ 5,-12,-17]]]), [[-17,-17, 7],[-17, -5, 12]],\
[[ 7,-17,-17],[ 12,-17, -5]],\
[[ 17, -7,-17],[ 5, -12,-17]],\
[[ 17,-17, 7],[ 17, -5,-12]],\
[[ -7, 17,-17],[-12, 17, -5]],\
[[-17, 7,-17],[ -5, 12,-17]],\
[[-17, 17, -7],[-17, 5,-12]]]),
'NW': \ 'NW': \
np.array([[[ 1, 1, 1],[ 0, 1, 1]],\ np.array([[[ 1, 1, 1],[ 0, 1, 1]],\
[[ 1, 1, 1],[ 0, 1, 1]],\ [[ 1, 1, 1],[ 0, 1, 1]],\
@ -991,9 +998,22 @@ class Orientation:
[[ 1, -1, 1],[ 0, 1, 1]],\ [[ 1, -1, 1],[ 0, 1, 1]],\
[[ 1, -1, 1],[ 0, 1, 1]],\ [[ 1, -1, 1],[ 0, 1, 1]],\
[[ 1, -1, 1],[ 0, 1, 1]],\ [[ 1, -1, 1],[ 0, 1, 1]],\
[[ 1, 1, -1],[ 0, 1, 1]],\ [[ -1, -1, 1],[ 0, 1, 1]],\
[[ 1, 1, -1],[ 0, 1, 1]],\ [[ -1, -1, 1],[ 0, 1, 1]],\
[[ 1, 1, -1],[ 0, 1, 1]]]), [[ -1, -1, 1],[ 0, 1, 1]]]),
'Pitsch': \
np.array([[[ 0, 1, 0],[ -1, 0, 1]],\
[[ 0, 0, 1],[ 1, -1, 0]],\
[[ 1, 0, 0],[ 0, 1, -1]],\
[[ 1, 0, 0],[ 0, -1, -1]],\
[[ 0, 1, 0],[ -1, 0, -1]],\
[[ 0, 0, 1],[ -1, -1, 0]],\
[[ 0, 1, 0],[ -1, 0, -1]],\
[[ 0, 0, 1],[ -1, -1, 0]],\
[[ 1, 0, 0],[ 0, -1, -1]],\
[[ 1, 0, 0],[ 0, -1, 1]],\
[[ 0, 1, 0],[ 1, 0, -1]],\
[[ 0, 0, 1],[ -1, 1, 0]]]),
'Bain': \ 'Bain': \
np.array([[[ 1, 0, 0],[ 1, 0, 0]],\ np.array([[[ 1, 0, 0],[ 1, 0, 0]],\
[[ 0, 1, 0],[ 0, 1, 0]],\ [[ 0, 1, 0],[ 0, 1, 0]],\
@ -1007,87 +1027,100 @@ class Orientation:
[[ 0, 1, -1],[ -1, 1, -1]],\ [[ 0, 1, -1],[ -1, 1, -1]],\
[[ 1, -1, 0],[ -1, -1, 1]],\ [[ 1, -1, 0],[ -1, -1, 1]],\
[[ 1, -1, 0],[ -1, 1, -1]],\ [[ 1, -1, 0],[ -1, 1, -1]],\
[[ -1, 0, 1],[ -1, -1, 1]],\ [[ 1, 0, -1],[ -1, -1, 1]],\
[[ -1, 0, 1],[ -1, 1, -1]],\ [[ 1, 0, -1],[ -1, 1, -1]],\
[[ 0, 1, -1],[ -1, -1, 1]],\
[[ 0, 1, -1],[ -1, 1, -1]],\
[[ 1, -1, 0],[ -1, -1, 1]],\
[[ 1, -1, 0],[ -1, 1, -1]],\
[[ -1, 0, 1],[ -1, -1, 1]],\
[[ -1, 0, 1],[ -1, 1, -1]],\
[[ 0, 1, -1],[ -1, -1, 1]],\
[[ 0, 1, -1],[ -1, 1, -1]],\
[[ 1, -1, 0],[ -1, -1, 1]],\
[[ 1, -1, 0],[ -1, 1, -1]],\
[[ -1, 0, 1],[ -1, -1, 1]],\
[[ -1, 0, 1],[ -1, 1, -1]],\
[[ 0, 1, -1],[ -1, -1, 1]],\
[[ 0, 1, -1],[ -1, 1, -1]],\
[[ 1, -1, 0],[ -1, -1, 1]],\
[[ 1, -1, 0],[ -1, 1, -1]]]),
'GT': \
np.array([[[ 17, -5,-12],[ 17,-17, -7]],\
[[ 17,-12, -5],[ 17, -7,-17]],\
[[-17, 5,-12],[-17, 17, -7]],\
[[-17, 12, -5],[-17, 7,-17]],\
[[ 17, 5, 12],[ 17, 17, 7]],\
[[ 17, 12, 5],[ 17, 7, 17]],\
[[-17, -5, 12],[-17,-17, 7]],\
[[-17,-12, 5],[-17, -7, 17]],\
[[-12, 17, -5],[ -7, 17,-17]],\
[[ -5, 17,-12],[-17, 17, -7]],\
[[ 12,-17, -5],[ 7,-17,-17]],\
[[ 5,-17,-12],[ 17,-17, -7]],\
[[-12,-17, 5],[ -7,-17, 17]],\
[[ -5,-17, 12],[-17,-17, 7]],\
[[ 12, 17, 5],[ 7, 17, 17]],\
[[ 5, 17, 12],[ 17, 17, 7]],\
[[ -5,-12, 17],[-17, -7, 17]],\
[[-12, -5, 17],[ -7,-17, 17]],\
[[ 5, 12, 17],[ 17, 7, 17]],\
[[ 12, 5, 17],[ 7, 17, 17]],\
[[ -5, 12,-17],[-17, 7,-17]],\
[[-12, 5,-17],[ -7, 17,-17]],\
[[ 5,-12,-17],[ 17, -7,-17]],\
[[ 12, -5,-17],[ 7,-17,-17]]]),
"GT'": \
np.array([[[ -1, 0, 1],[ -1, 1, 1]],\
[[ -1, 0, 1],[ -1, -1, 1]],\
[[ 1, 0, 1],[ 1, -1, 1]],\
[[ 1, 0, 1],[ 1, 1, 1]],\
[[ -1, 1, 0],[ -1, 1, 1]],\
[[ -1, 1, 0],[ -1, 1, -1]],\
[[ 1, 1, 0],[ 1, 1, 1]],\
[[ 1, 1, 0],[ 1, 1, -1]],\
[[ 1, -1, 0],[ 1, -1, 1]],\
[[ 1, -1, 0],[ 1, -1, -1]],\
[[ -1, -1, 0],[ -1, -1, 1]],\ [[ -1, -1, 0],[ -1, -1, 1]],\
[[ -1, -1, 0],[ -1, 1, -1]],\
[[ 0, 1, 1],[ -1, -1, 1]],\
[[ 0, 1, 1],[ -1, 1, -1]],\
[[ 0, -1, 1],[ -1, -1, 1]],\
[[ 0, -1, 1],[ -1, 1, -1]],\
[[ -1, 0, -1],[ -1, -1, 1]],\
[[ -1, 0, -1],[ -1, 1, -1]],\
[[ 1, 1, 0],[ -1, -1, 1]],\
[[ 1, 1, 0],[ -1, 1, -1]],\
[[ -1, 1, 0],[ -1, -1, 1]],\
[[ -1, 1, 0],[ -1, 1, -1]],\
[[ 0, -1, -1],[ -1, -1, 1]],\
[[ 0, -1, -1],[ -1, 1, -1]],\
[[ 1, 0, 1],[ -1, -1, 1]],\
[[ 1, 0, 1],[ -1, 1, -1]]]),
'GT': \
np.array([[[ -5,-12, 17],[-17, -7, 17]],\
[[ 17, -5,-12],[ 17,-17, -7]],\
[[-12, 17, -5],[ -7, 17,-17]],\
[[ 5, 12, 17],[ 17, 7, 17]],\
[[-17, 5,-12],[-17, 17, -7]],\
[[ 12,-17, -5],[ 7,-17,-17]],\
[[ -5, 12,-17],[-17, 7,-17]],\
[[ 17, 5, 12],[ 17, 17, 7]],\
[[-12,-17, 5],[ -7,-17, 17]],\
[[ 5,-12,-17],[ 17, -7,-17]],\
[[-17, -5, 12],[-17,-17, 7]],\
[[ 12, 17, 5],[ 7, 17, 17]],\
[[ -5, 17,-12],[-17, 17, -7]],\
[[-12, -5, 17],[ -7,-17, 17]],\
[[ 17,-12, -5],[ 17, -7,-17]],\
[[ 5,-17,-12],[ 17,-17, -7]],\
[[ 12, 5, 17],[ 7, 17, 17]],\
[[-17, 12, -5],[-17, 7,-17]],\
[[ -5,-17, 12],[-17,-17, 7]],\
[[-12, 5,-17],[ -7, 17,-17]],\
[[ 17, 12, 5],[ 17, 7, 17]],\
[[ 5, 17, 12],[ 17, 17, 7]],\
[[ 12, -5,-17],[ 7,-17,-17]],\
[[-17,-12, 5],[-17, 7, 17]]]),
'GTdash': \
np.array([[[ 0, 1, -1],[ 1, 1, -1]],\
[[ -1, 0, 1],[ -1, 1, 1]],\
[[ 1, -1, 0],[ 1, -1, 1]],\
[[ 0, -1, -1],[ -1, -1, -1]],\
[[ 1, 0, 1],[ 1, -1, 1]],\
[[ 1, -1, 0],[ 1, -1, -1]],\
[[ 0, 1, -1],[ -1, 1, -1]],\
[[ 1, 0, 1],[ 1, 1, 1]],\
[[ -1, -1, 0],[ -1, -1, 1]],\
[[ 0, -1, -1],[ 1, -1, -1]],\
[[ -1, 0, 1],[ -1, -1, 1]],\
[[ -1, -1, 0],[ -1, -1, -1]],\ [[ -1, -1, 0],[ -1, -1, -1]],\
[[ 0, -1, 1],[ 1, -1, 1]],\ [[ 0, -1, 1],[ 1, -1, 1]],\
[[ 1, 0, -1],[ 1, 1, -1]],\
[[ -1, 1, 0],[ -1, 1, 1]],\
[[ 0, 1, 1],[ -1, 1, 1]],\
[[ -1, 0, -1],[ -1, -1, -1]],\
[[ -1, 1, 0],[ -1, 1, -1]],\
[[ 0, -1, 1],[ -1, -1, 1]],\
[[ -1, 0, -1],[ -1, 1, -1]],\
[[ 1, 1, 0],[ 1, 1, 1]],\
[[ 0, 1, 1],[ 1, 1, 1]],\
[[ 1, 0, -1],[ 1, -1, -1]],\
[[ 1, 1, 0],[ 1, 1, -1]]]),
'NW': \
np.array([[[ 2, -1, -1],[ 0, -1, 1]],\
[[ -1, 2, -1],[ 0, -1, 1]],\
[[ -1, -1, 2],[ 0, -1, 1]],\
[[ -2, -1, -1],[ 0, -1, 1]],\
[[ 1, 2, -1],[ 0, -1, 1]],\
[[ 1, -1, 2],[ 0, -1, 1]],\
[[ 2, 1, -1],[ 0, -1, 1]],\
[[ -1, -2, -1],[ 0, -1, 1]],\
[[ -1, 1, 2],[ 0, -1, 1]],\
[[ -1, 2, 1],[ 0, -1, 1]],\
[[ -1, 2, 1],[ 0, -1, 1]],\
[[ -1, -1, -2],[ 0, -1, 1]]]),
'Pitsch': \
np.array([[[ 1, 0, 1],[ 1, -1, 1]],\
[[ 1, 1, 0],[ 1, 1, -1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