@@ -43,7 +43,8 @@ class Orientation(Rotation,Crystal):
43
43
- cubic
44
44
45
45
and enables symmetry-related operations such as
46
- "equivalent", "reduced", "disorientation", "IPF_color", or "to_SST".
46
+ :func:`equivalent`, :func:`reduced` :func:`disorientation`,
47
+ :func:`IPF_color`, or :func:`to_SST`.
47
48
48
49
The Bravais lattice is given in the Pearson notation:
49
50
@@ -74,8 +75,9 @@ class Orientation(Rotation,Crystal):
74
75
75
76
and inherits the corresponding crystal family.
76
77
Specifying a Bravais lattice, compared to just the crystal family,
77
- extends the functionality of Orientation objects to include operations such as
78
- "Schmid", "related", or "to_frame" that require a lattice type and its parameters.
78
+ extends the functionality of Orientation objects to include operations
79
+ such as :func:`Schmid`, :func:`related`, or :func:`to_frame` that
80
+ require a lattice type and its parameters.
79
81
80
82
Examples
81
83
--------
@@ -1177,7 +1179,7 @@ def disorientation(self: MyType,
1177
1179
>>> b = damask.Orientation.from_Euler_angles(phi=[104,11,87],degrees=True,family='hexagonal')
1178
1180
>>> a.disorientation(b)
1179
1181
Crystal family: hexagonal
1180
- Quaternion [0.976 0.189 0.018 0.103]
1182
+ array((0.976478 , 0.18880082, 0.01784483, 0.10259889))
1181
1183
1182
1184
Plot a sample from the Mackenzie distribution.
1183
1185
@@ -1188,8 +1190,8 @@ def disorientation(self: MyType,
1188
1190
>>> b = damask.Orientation.from_random(shape=N,family='cubic')
1189
1191
>>> n,omega = a.disorientation(b).as_axis_angle(degrees=True,pair=True)
1190
1192
>>> plt.hist(omega,25)
1191
- [ ...]
1192
- >>> plt.show()
1193
+ ( ...)
1194
+ >>> plt.show(block=False )
1193
1195
"""
1194
1196
# For extension to cases with differing symmetry see
1195
1197
# https://doi.org/10.1107/S0021889808016373 and https://doi.org/10.1107/S0108767391006864
@@ -1495,10 +1497,10 @@ def IPF_color(self,
1495
1497
>>> coord = damask.util.project_equal_area(o.to_SST(lab))
1496
1498
>>> color = o.IPF_color(lab)
1497
1499
>>> plt.scatter(coord[:,0],coord[:,1],color=color,s=.06)
1498
- [...]
1500
+ <matplotlib.collections.PathCollection object at ...>
1499
1501
>>> plt.axis('scaled')
1500
- [ ...]
1501
- >>> plt.show()
1502
+ ( ...)
1503
+ >>> plt.show(block=False )
1502
1504
"""
1503
1505
if np .array (vector ).shape [- 1 ] != 3 :
1504
1506
raise ValueError ('input is not a field of three-dimensional vectors' )
@@ -1565,11 +1567,11 @@ def to_lattice(self, *,
1565
1567
>>> import numpy as np
1566
1568
>>> import damask
1567
1569
>>> cubic = damask.Orientation.from_axis_angle(n_omega=[1,0,0,90],degrees=True,lattice='cI')
1568
- >>> cubic.to_lattice(direction=[1, 0, 0])
1570
+ >>> np.round( cubic.to_lattice(direction=[1, 0, 0]),3 )
1569
1571
array([1., 0., 0.])
1570
- >>> cubic.to_lattice(direction=[0, 1, 0])
1571
- array([0., 0., -1.])
1572
- >>> cubic.to_lattice(direction=[0, 0, 1])
1572
+ >>> np.round( cubic.to_lattice(direction=[0, 1, 0]),3 )
1573
+ array([ 0., 0., -1.])
1574
+ >>> np.round( cubic.to_lattice(direction=[0, 0, 1]),3 )
1573
1575
array([-0., 1., 0.])
1574
1576
>>> tetragonal = damask.Orientation(lattice='tI',c=0.5)
1575
1577
>>> damask.util.scale_to_coprime(tetragonal.to_lattice(direction=[1,1,1]))
@@ -1656,9 +1658,9 @@ def Schmid(self, *,
1656
1658
>>> import damask
1657
1659
>>> O = damask.Orientation.from_Euler_angles(phi=[0,45,0],degrees=True,lattice='cF')
1658
1660
>>> O.Schmid(N_slip=[12])[0]
1659
- array([[ 0.000 , 0.000 , 0.000 ],
1660
- [ 0.577, -0.000 , 0.816 ],
1661
- [ 0.000, 0.000, 0.000 ]])
1661
+ array([[ 0. , 0. , 0. ],
1662
+ [ 0.408, 0.408 , 0.408 ],
1663
+ [-0.408, -0.408, -0.408 ]])
1662
1664
"""
1663
1665
if len (self .shape ) == 0 :
1664
1666
return self @ super ().Schmid (N_slip = N_slip , N_twin = N_twin )
@@ -1700,10 +1702,9 @@ def related(self: MyType,
1700
1702
Bravais lattice: cI
1701
1703
a=1 m, b=1 m, c=1 m
1702
1704
α=90°, β=90°, γ=90°
1703
- Quaternions of shape (3,)
1704
- [[ 6.53281482e-01 2.70598050e-01 6.53281482e-01 2.70598050e-01]
1705
- [ 2.70598050e-01 -2.70598050e-01 -6.53281482e-01 -6.53281482e-01]
1706
- [ 9.23879533e-01 -5.55111512e-17 -2.77555756e-17 -3.82683432e-01]]
1705
+ array([( 6.53281482e-01, 2.70598050e-01, 6.53281482e-01, 2.70598050e-01),
1706
+ ( 2.70598050e-01, -2.70598050e-01, -6.53281482e-01, -6.53281482e-01),
1707
+ ( 9.23879533e-01, -5.55111512e-17, -2.77555756e-17, -3.82683432e-01)])
1707
1708
"""
1708
1709
lattice ,o = self .relation_operations (model ,target )
1709
1710
target = Crystal (lattice = lattice ) if target is None else target
0 commit comments