favor numpy intrinsic over list-comprehension
This commit is contained in:
parent
826611411f
commit
91cb0f37c8
|
@ -1567,7 +1567,7 @@ class Rotation:
|
||||||
+0.000059719705868660826, -0.00001980756723965647,
|
+0.000059719705868660826, -0.00001980756723965647,
|
||||||
+0.000003953714684212874, -0.00000036555001439719544])
|
+0.000003953714684212874, -0.00000036555001439719544])
|
||||||
hmag_squared = np.sum(ho**2.,axis=-1,keepdims=True)
|
hmag_squared = np.sum(ho**2.,axis=-1,keepdims=True)
|
||||||
s = np.sum(np.array([t*hmag_squared**i for i,t in enumerate(tfit)]),0)
|
s = np.sum(tfit*hmag_squared**np.arange(len(tfit)),axis=-1,keepdims=True)
|
||||||
with np.errstate(invalid='ignore'):
|
with np.errstate(invalid='ignore'):
|
||||||
ax = np.where(np.broadcast_to(np.abs(hmag_squared)<1.e-8,ho.shape[:-1]+(4,)),
|
ax = np.where(np.broadcast_to(np.abs(hmag_squared)<1.e-8,ho.shape[:-1]+(4,)),
|
||||||
[ 0.0, 0.0, 1.0, 0.0 ],
|
[ 0.0, 0.0, 1.0, 0.0 ],
|
||||||
|
|
Loading…
Reference in New Issue