Skip to content

Commit 830d572

Browse files
committed
Spin RB/defo fixes
1 parent 66a8c2f commit 830d572

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

GSASII/GSASIIstrMath.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -521,7 +521,13 @@ def MakePolar(Orient,QB):
521521
for item in Shell:
522522
if 'C(' in item:
523523
l,m = eval(item.strip('C').strip('c'))
524-
SH = G2lat.KslCalc(item,Th,Ph)
524+
SH = 4.0*np.pi*G2lat.KslCalc(item,Th,Ph)
525+
if l%2: #odd L
526+
SHI = SH
527+
SHR = np.zeros_like(SHI)
528+
else: #even L
529+
SHR = SH
530+
SHI = np.zeros_like(SHR)
525531
SHP = G2lat.KslCalc(item,ThP,PhP)
526532
SHPi = G2lat.KslCalc(item,ThPi,PhPi)
527533
SHPj = G2lat.KslCalc(item,ThPj,PhPj)
@@ -531,7 +537,7 @@ def MakePolar(Orient,QB):
531537
SHMj = G2lat.KslCalc(item,ThMj,PhMj)
532538
SHMk = G2lat.KslCalc(item,ThMk,PhMk)
533539
BS = 1.0
534-
if 'Q' in Atm:
540+
if 'Q' in Atm: #why is this possible?
535541
BS = sp.spherical_jn(l,1.0)/(4.*np.pi) #Slater term here?
536542
else:
537543
BS = sp.spherical_jn(l,QR*R)/(4.*np.pi) #Bessel function
@@ -562,7 +568,6 @@ def MakePolar(Orient,QB):
562568
ffOrb = orbTable['Sl core']
563569
FFcore = G2el.ScatFac(ffOrb,SQR) #core; same for Sl & Be
564570
FFval = np.zeros_like(FFcore)
565-
FFSH = np.zeros_like(FFcore)
566571
FFSHR = np.zeros_like(FFcore)
567572
FFSHI = np.zeros_like(FFcore)
568573
Ne = orbs['Ne1']
@@ -587,8 +592,6 @@ def MakePolar(Orient,QB):
587592
if 'D(' in term: #skip 'Ne' & 'kappa's
588593
name = 'A%s:%d'%(term,iAt)
589594
item = term.replace('D','C')[:-1]
590-
SH = 2.0*twopi*G2lat.KslCalc(item,Th,Ph)**2
591-
#test
592595
L = int(item[2]) #0>L>6 by definition in G2
593596
if L%2: #odd L
594597
SHI = 2.0*twopi*G2lat.KslCalc(item,Th,Ph)*S[L]
@@ -602,9 +605,6 @@ def MakePolar(Orient,QB):
602605
dFFdSR["Akappa'1:%d"%iAt] += -2.0*SQkp*SHR*orbs[term]*dffdkp/kappap #ok
603606
dFFdSI[name] = SHI*ffkp #ok
604607
dFFdSI["Akappa'1:%d"%iAt] += -2.0*SQkp*SHI*orbs[term]*dffdkp/kappap #ok
605-
#end test
606-
FFSH += SH*orbs[term]*ffkp
607-
FF[:,iAt] = FFcore+FFval+FFSH
608608
FFR[:,iAt] = FFcore+FFval+FFSHR
609609
FFI[:,iAt] = np.round(FFSHI,10)
610610
else:

0 commit comments

Comments
 (0)