Skip to content

Commit 43e9881

Browse files
committed
address test bug w/out of range arccos value; commented out traceback on HessianLSQ fail
1 parent 8b332f1 commit 43e9881

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

GSASII/GSASIIlattice.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2663,7 +2663,7 @@ def CrsAng(H,cell,SGData):
26632663
DR = np.inner(H3,np.inner(G,H3))
26642664
DHR = np.inner(H,np.inner(G,H3))
26652665
DHR /= np.sqrt(DR*DH)
2666-
phi = np.where(DHR <= 1.0,acosd(DHR),0.0)
2666+
phi = acosd(max(-1,min(DHR,1.)))
26672667
if Laue == '-1':
26682668
BA = H.T[1]*a/(b-H.T[0]*cosd(ga))
26692669
BB = H.T[0]*sind(ga)**2

GSASII/GSASIImath.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,9 @@ def HessianLSQ(func,x0,Hess,args=(),ftol=1.49012e-8,xtol=1.e-6, maxcyc=0,lamda=-
297297
M2 = func(x0+XvecAll,*args)
298298
except Exception as Msg:
299299
if not hasattr(Msg,'msg'): Msg.msg = str(Msg)
300+
#import traceback
301+
#Msg.msg += '\n'
302+
#Msg.msg += traceback.format_exc()
300303
G2fil.G2Print(Msg.msg,mode='warn')
301304
loops += 1
302305
d = np.abs(np.diag(nl.qr(Amatlam)[1]))

0 commit comments

Comments
 (0)