Skip to content

Commit 479dae4

Browse files
committed
change spin RB penalty derivative
show limits on spin RB sp. harm. coeff -1 to 1.
1 parent f243fb3 commit 479dae4

3 files changed

Lines changed: 4 additions & 2 deletions

File tree

GSASII/GSASIIphsGUI.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10116,7 +10116,7 @@ def OnDelShell(event):
1011610116
for item in RBObj['SHC'][iSh]:
1011710117
shcSizer.Add(wx.StaticText(RigidBodies,label='%s'%item.strip('+').strip('-')))
1011810118
shcSizer.Add(G2G.ValidatedTxtCtrl(RigidBodies,RBObj['SHC'][iSh][item],0,nDig=(8,5),
10119-
typeHint=float,size=(70,-1),OnLeave=NewSHC))
10119+
typeHint=float,size=(70,-1),OnLeave=NewSHC,xmin=-1.0,xmax=1.0))
1012010120
schref = wx.CheckBox(RigidBodies,label=' refine? ')
1012110121
schref.SetValue(RBObj['SHC'][iSh][item][2])
1012210122
schref.Bind(wx.EVT_CHECKBOX,OnSchRef)

GSASII/GSASIIstrIO.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1597,6 +1597,8 @@ def MakeRBTorsions(rbKey,phaseVary,phaseDict):
15971597
def MakeRBSphHarm(rbKey,phaseVary,phaseDict):
15981598
iAt = str(atomIndx[RB['Ids'][0]][1]) #for spin RBs
15991599
for ish,Shcof in enumerate(RB['SHC']):
1600+
if not len(Shcof):
1601+
continue
16001602
rbid = str(rbids.index(RB['RBId'][ish]))
16011603
if 'Q' not in RB['atType']:
16021604
name = '%sRBSSh;%d;Radius:%s:%s'%(pfx,ish,iAt,rbid)

GSASII/GSASIIstrMath.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1013,7 +1013,7 @@ def penaltyDeriv(pNames,pVal,HistoPhases,calcControls,parmDict,varyList):
10131013
iRb = SRBIds.index(RBObj['RBId'][ish])
10141014
for item in RBObj['SHC'][ish]:
10151015
dNames += ['%d::RBSSh;%d;%s:%d:%d'%(pId,ish,item,AtLookup[iAt],iRb)]
1016-
deriv.append(G2lat.KslCalc(item,PSI,GAM))
1016+
deriv.append(G2lat.KslCalc(item,PSI,GAM)/(4.0*np.pi))
10171017

10181018
elif name == 'General':
10191019
eq,obs,esd = itemRest[name][Id]

0 commit comments

Comments
 (0)