documentation polishing
This commit is contained in:
parent
a433f7ef54
commit
6a0760a13c
|
@ -647,7 +647,7 @@ class DADF5():
|
||||||
self.__add_generic_pointwise(_add_eigenvector,{'S':S})
|
self.__add_generic_pointwise(_add_eigenvector,{'S':S})
|
||||||
|
|
||||||
|
|
||||||
def add_IPFcolor(self,q,p):
|
def add_IPFcolor(self,q,l):
|
||||||
"""
|
"""
|
||||||
Add RGB color tuple of inverse pole figure (IPF) color.
|
Add RGB color tuple of inverse pole figure (IPF) color.
|
||||||
|
|
||||||
|
@ -655,26 +655,26 @@ class DADF5():
|
||||||
----------
|
----------
|
||||||
q : str
|
q : str
|
||||||
Label of the dataset containing the crystallographic orientation as quaternions.
|
Label of the dataset containing the crystallographic orientation as quaternions.
|
||||||
p : list of int #ToDo: Direction / int?
|
l : numpy.array of shape (3)
|
||||||
Pole (crystallographic direction or plane).
|
Lab frame direction for inverse pole figure.
|
||||||
|
|
||||||
"""
|
"""
|
||||||
def _add_IPFcolor(q,p):
|
def _add_IPFcolor(q,l):
|
||||||
|
|
||||||
pole = np.array(p)
|
d = np.array(l)
|
||||||
unit_pole = pole/np.linalg.norm(pole)
|
d_unit = pole/np.linalg.norm(d)
|
||||||
m = util.scale_to_coprime(pole)
|
m = util.scale_to_coprime(d)
|
||||||
colors = np.empty((len(q['data']),3),np.uint8)
|
colors = np.empty((len(q['data']),3),np.uint8)
|
||||||
|
|
||||||
lattice = q['meta']['Lattice']
|
lattice = q['meta']['Lattice']
|
||||||
|
|
||||||
for i,q in enumerate(q['data']):
|
for i,q in enumerate(q['data']):
|
||||||
o = Orientation(np.array([q['w'],q['x'],q['y'],q['z']]),lattice).reduced()
|
o = Orientation(np.array([q['w'],q['x'],q['y'],q['z']]),lattice).reduced()
|
||||||
colors[i] = np.uint8(o.IPFcolor(unit_pole)*255)
|
colors[i] = np.uint8(o.IPFcolor(d_unit)*255)
|
||||||
|
|
||||||
return {
|
return {
|
||||||
'data': colors,
|
'data': colors,
|
||||||
'label': 'IPFcolor_{{{} {} {}>'.format(*m),
|
'label': 'IPFcolor_[{} {} {}]'.format(*m),
|
||||||
'meta' : {
|
'meta' : {
|
||||||
'Unit': 'RGB (8bit)',
|
'Unit': 'RGB (8bit)',
|
||||||
'Lattice': lattice,
|
'Lattice': lattice,
|
||||||
|
@ -683,7 +683,7 @@ class DADF5():
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
self.__add_generic_pointwise(_add_IPFcolor,{'q':q},{'p':p})
|
self.__add_generic_pointwise(_add_IPFcolor,{'q':q},{'l':l})
|
||||||
|
|
||||||
|
|
||||||
def add_maximum_shear(self,S):
|
def add_maximum_shear(self,S):
|
||||||
|
@ -815,9 +815,9 @@ class DADF5():
|
||||||
q : str
|
q : str
|
||||||
Label of the dataset containing the crystallographic orientation as quaternions.
|
Label of the dataset containing the crystallographic orientation as quaternions.
|
||||||
p : numpy.array of shape (3)
|
p : numpy.array of shape (3)
|
||||||
Pole in crystal frame.
|
Crystallographic direction or plane.
|
||||||
polar : bool, optional
|
polar : bool, optional
|
||||||
Give pole in polar coordinates. Defaults to false.
|
Give pole in polar coordinates. Defaults to False.
|
||||||
|
|
||||||
"""
|
"""
|
||||||
def _add_pole(q,p,polar):
|
def _add_pole(q,p,polar):
|
||||||
|
|
Loading…
Reference in New Issue