using more precise coefficients also in test

changes in _rotation.py are just cosmetic
This commit is contained in:
Martin Diehl 2022-06-09 23:16:02 +02:00
parent d10516e0b6
commit cdd3b44519
2 changed files with 14 additions and 21 deletions

View File

@ -1581,19 +1581,13 @@ class Rotation:
@staticmethod @staticmethod
def _ho2ax(ho: np.ndarray) -> np.ndarray: def _ho2ax(ho: np.ndarray) -> np.ndarray:
"""Homochoric vector to axisangle pair.""" """Homochoric vector to axisangle pair."""
tfit = np.array([ tfit = np.array([+0.9999999999999968, -0.49999999999986866, -0.025000000000632055,
0.9999999999999968E0, -0.49999999999986866E0, -0.003928571496460683, -0.0008164666077062752, -0.00019411896443261646,
-0.025000000000632055E0, -0.003928571496460683E0, -0.00004985822229871769, -0.000014164962366386031, -1.9000248160936107e-6,
-0.0008164666077062752E0, -0.00019411896443261646E0, -5.72184549898506e-6, +7.772149920658778e-6, -0.00001053483452909705,
-0.00004985822229871769E0, -0.000014164962366386031E0, +9.528014229335313e-6, -5.660288876265125e-6, +1.2844901692764126e-6,
-1.9000248160936107E-6, -5.72184549898506E-6, +1.1255185726258763e-6, -1.3834391419956455e-6, +7.513691751164847e-7,
7.772149920658778E-6, -0.00001053483452909705E0, -2.401996891720091e-7, +4.386887017466388e-8, -3.5917775353564864e-9])
9.528014229335313E-6, -5.660288876265125E-6,
1.2844901692764126E-6, 1.1255185726258763E-6,
-1.3834391419956455E-6, 7.513691751164847E-7,
-2.401996891720091E-7, 4.386887017466388E-8,
-3.5917775353564864E-9,
])
hmag_squared = np.sum(ho**2.,axis=-1,keepdims=True) hmag_squared = np.sum(ho**2.,axis=-1,keepdims=True)
s = np.sum(tfit*hmag_squared**np.arange(len(tfit)),axis=-1,keepdims=True) s = np.sum(tfit*hmag_squared**np.arange(len(tfit)),axis=-1,keepdims=True)
with np.errstate(invalid='ignore'): with np.errstate(invalid='ignore'):

View File

@ -301,14 +301,13 @@ def ro2ho(ro):
#---------- Homochoric vector---------- #---------- Homochoric vector----------
def ho2ax(ho): def ho2ax(ho):
"""Homochoric vector to axis angle pair.""" """Homochoric vector to axis angle pair."""
tfit = np.array([+1.0000000000018852, -0.5000000002194847, tfit = np.array([+0.9999999999999968, -0.49999999999986866, -0.025000000000632055,
-0.024999992127593126, -0.003928701544781374, -0.003928571496460683, -0.0008164666077062752, -0.00019411896443261646,
-0.0008152701535450438, -0.0002009500426119712, -0.00004985822229871769, -0.000014164962366386031, -1.9000248160936107e-6,
-0.00002397986776071756, -0.00008202868926605841, -5.72184549898506e-6, +7.772149920658778e-6, -0.00001053483452909705,
+0.00012448715042090092, -0.0001749114214822577, +9.528014229335313e-6, -5.660288876265125e-6, +1.2844901692764126e-6,
+0.0001703481934140054, -0.00012062065004116828, +1.1255185726258763e-6, -1.3834391419956455e-6, +7.513691751164847e-7,
+0.000059719705868660826, -0.00001980756723965647, -2.401996891720091e-7, +4.386887017466388e-8, -3.5917775353564864e-9])
+0.000003953714684212874, -0.00000036555001439719544])
# normalize h and store the magnitude # normalize h and store the magnitude
hmag_squared = np.sum(ho**2.) hmag_squared = np.sum(ho**2.)
if iszero(hmag_squared): if iszero(hmag_squared):