@@ -2526,9 +2526,8 @@ def GenRBCoeff(sytsym,RBsym,L):
25262526 cubic = False
25272527 if sytsym in ['23' ,'m3' ,'432' ,'-43m' ,'m3m' ]:
25282528 cubic = True
2529- for iord in range (L + 1 ):
2530- if not iord : continue
2531- for n in range (iord + 1 ):
2529+ for iord in range (1 ,L + 1 ):
2530+ for n in range (- iord ,iord + 1 ):
25322531 rbChk ,sgn = RBChk (sytsym ,iord ,n )
25332532 if rbChk :
25342533 if cubic :
@@ -2553,7 +2552,7 @@ def GenShCoeff(sytsym,L):
25532552 cubic = False
25542553 if sytsym in ['23' ,'m3' ,'432' ,'-43m' ,'m3m' ,'53m' ]:
25552554 cubic = True
2556- for n in range (L + 1 ):
2555+ for n in range (- L , L + 1 ):
25572556 rbChk ,sgn = RBChk (sytsym ,L ,n )
25582557 if rbChk :
25592558 if cubic :
@@ -2901,34 +2900,34 @@ def H2ThPh2(H,Bmat):
29012900 Az = atan2d (Hcart [:,1 ],Hcart [:,0 ])
29022901 return R ,Az ,Pl
29032902
2904- def H2ThPh (H ,Bmat ,Q ):
2905- '''Convert HKL to spherical polar & azimuth angles
2906-
2907- :param array H: array of hkl as [n,3]
2908- :param [3,3] array Bmat: inv crystal to Cartesian transformation
2909- :param array Q: quaternion for rotation of HKL to new polar axis
2910- :returns array Th: HKL azimuth angles
2911- :returns array Ph: HKL polar angles
2912- '''
2913- # A,V = G2mth.Q2AVdeg(Q)
2914- # QR,R = G2mth.make2Quat(V,np.array([0.,0.,1.0]))
2915- # QA = G2mth.AVdeg2Q(A,np.array([0.,0.,1.0]))
2916- # Q2 = G2mth.prodQQ(QR,QA)
2917- Qmat = G2mth .Q2Mat (Q )
2918- CH1 = np .inner (H ,Bmat .T )
2919- CH = np .inner (CH1 ,Qmat .T )
2920- N = nl .norm (CH ,axis = 1 )
2921- CH /= N [:,nxs ]
2922- H3 = np .array ([0 ,0 ,1. ])
2923- DHR = np .inner (CH ,H3 )
2924- Ph = np .where (DHR <= 1.0 ,acosd (DHR ),0.0 ) #polar angle 0<=Ph<=180.; correct
2925- TH = CH * np .array ([1. ,1. ,0. ])[nxs ,:] #projection of CH onto xy plane
2926- N = nl .norm (TH ,axis = 1 )
2927- N = np .where (N > 1.e-5 ,N ,1. )
2928- TH /= N [:,nxs ]
2929- Th = atan2d (TH [:,1 ],TH [:,0 ]) #azimuth angle 0<=Th<360<
2930- Th = np .where (Th < 0. ,Th + 360. ,Th )
2931- return Th ,Ph #azimuth,polar angles
2903+ # def H2ThPh(H,Bmat,Q):
2904+ # '''Convert HKL to spherical polar & azimuth angles - wrong!
2905+
2906+ # :param array H: array of hkl as [n,3]
2907+ # :param [3,3] array Bmat: inv crystal to Cartesian transformation
2908+ # :param array Q: quaternion for rotation of HKL to new polar axis
2909+ # :returns array Th: HKL azimuth angles
2910+ # :returns array Ph: HKL polar angles
2911+ # '''
2912+ # # A,V = G2mth.Q2AVdeg(Q)
2913+ # # QR,R = G2mth.make2Quat(V,np.array([0.,0.,1.0]))
2914+ # # QA = G2mth.AVdeg2Q(A,np.array([0.,0.,1.0]))
2915+ # # Q2 = G2mth.prodQQ(QR,QA)
2916+ # Qmat = G2mth.Q2Mat(Q)
2917+ # CH1 = np.inner(H,Bmat.T)
2918+ # CH = np.inner(CH1,Qmat.T)
2919+ # N = nl.norm(CH,axis=1)
2920+ # CH /= N[:,nxs]
2921+ # H3 = np.array([0,0,1.])
2922+ # DHR = np.inner(CH,H3)
2923+ # Ph = np.where(DHR <= 1.0,acosd(DHR),0.0) #polar angle 0<=Ph<=180.; correct
2924+ # TH = CH*np.array([1.,1.,0.])[nxs,:] #projection of CH onto xy plane
2925+ # N = nl.norm(TH,axis=1)
2926+ # N = np.where(N > 1.e-5,N,1.)
2927+ # TH /= N[:,nxs]
2928+ # Th = atan2d(TH[:,1],TH[:,0]) #azimuth angle 0<=Th<360<
2929+ # Th = np.where(Th<0.,Th+360.,Th)
2930+ # return Th,Ph #azimuth,polar angles
29322931
29332932def SetUVvec (Neigh ):
29342933 ''' Set deformation coordinate choices from neighbors; called in G2phsGUI/UpdateDeformation
0 commit comments