Skip to content

Commit 2ef4fc1

Browse files
committed
fixes for deformation GUI - now shows conventional names for orbitals
1 parent 6dad5f1 commit 2ef4fc1

File tree

2 files changed

+13
-8
lines changed

2 files changed

+13
-8
lines changed

GSASII/GSASIIphsGUI2.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -314,8 +314,9 @@ def NeSizer(deformation,orbSizer,dId,orb,Indx):
314314
Indx[Tcheck.GetId()] = [dId,iorb,'Ne']
315315
orbSizer.Add(Tcheck)
316316

317-
def Dsizer(deformation,orbSizer,dId,orb,Indx):
318-
orbSizer.Add(wx.StaticText(deformation,label=item+':'))
317+
def Dsizer(deformation,orbSizer,Names,dId,orb,Indx):
318+
name = Names.get(item,'') #Names only go to order = 3
319+
orbSizer.Add(wx.StaticText(deformation,label=item+name+':'))
319320
orbSizer.Add(G2G.ValidatedTxtCtrl(deformation,orb[1][item],0,nDig=(8,5),xmin=-1.,xmax=1.))
320321
Tcheck = wx.CheckBox(deformation,-1,'Refine?')
321322
Tcheck.SetValue(orb[1][item][1])
@@ -506,6 +507,10 @@ def OnAtCol(event):
506507
oriSizer.Add(delHarm,0,WACV)
507508
mainSizer.Add(oriSizer)
508509
G2G.HorizontalLine(mainSizer,deformation)
510+
Names = {'D(1,-1)':'px','D(1,0)':'pz','D(1,1)':'py',
511+
'D(2,-2)':'dxy','D(2,-1)':'dxz','D(2,0)':'dz2','D(2,1)':'dyz','D(2,2)':'dx2-y2',
512+
'D(3,-3)':'fy(3x2-y2)','D(3,-2)':'fz(x2-y2)','D(3,-1':'fyz2','D(3,0)':'fz3',
513+
'D(3,1)':'fxz2','D(3,2)':'fxyz','D(3,3)':'fy(3x2-y2)',}
509514
mainSizer.Add(wx.StaticText(deformation,label=' Deformation parameters:'))
510515
orbSizer = wx.FlexGridSizer(0,9,2,2)
511516
for iorb,orb in enumerate(deformationData[dId]):
@@ -529,7 +534,7 @@ def OnAtCol(event):
529534
for item in orb[1]:
530535
if 'D' in item:
531536
nItem += 1
532-
Dsizer(deformation,orbSizer,dId,orb,Indx)
537+
Dsizer(deformation,orbSizer,Names,dId,orb,Indx)
533538
if nItem in [2,4,6,8,10]:
534539
for i in range(3): orbSizer.Add((5,5),0)
535540
for i in range(3): orbSizer.Add((5,5),0)
@@ -551,7 +556,7 @@ def OnAtCol(event):
551556
if nItems:
552557
nB = 9-nItems
553558
for i in range(nB): orbSizer.Add((5,5),0)
554-
Dsizer(deformation,orbSizer,dId,orb,Indx)
559+
Dsizer(deformation,orbSizer,Names,dId,orb,Indx)
555560
mainSizer.Add(orbSizer)
556561

557562
G2phsG.SetPhaseWindow(deformation,mainSizer)

GSASII/GSASIIplot.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7351,17 +7351,17 @@ def Draw(caller='',Fade=[],NPkey=False):
73517351
#### put deformation texture on sphere here
73527352
if atom[ci] in deformationData:
73537353
defCtrls = deformationData[-atom[ci]]
7354-
defParms = deformationData[atom[ci]]
7355-
SytSym = G2spc.SytSym(atom[cx:cx+3],SGData)[0]
7356-
SGM = np.array(G2spc.GetOpFromCode(atom[cs-1],SGData)[0])
73577354
if defCtrls.get('showDef',False) and defCtrls['Radial'] == 'Slater':
73587355
useAtColor = defCtrls.get('atColor',True)
73597356
atcolor = None
73607357
if useAtColor:
73617358
atcolor = atColor*255
7359+
defParms = deformationData[atom[ci]]
7360+
SytSym = G2spc.SytSym(atom[cx:cx+3],SGData)[0]
7361+
SGM = np.array(G2spc.GetOpFromCode(atom[cs-1],SGData)[0])
73627362
SHC = defParms[0][1]
73637363
SHC = {item.replace('D','C'):SHC[item] for item in SHC if item not in ['Ne','kappa']}
7364-
UVMat = np.inner(SGM.T,defCtrls['UVmat'])
7364+
UVMat = np.inner(defCtrls['UVmat'],SGM)
73657365
Npsi,Ngam = 90,45
73667366
PSI,GAM = np.mgrid[0:Npsi,0:Ngam] #[azm,pol]
73677367
PSI = PSI.flatten()*360./Npsi #azimuth 0-360 ncl

0 commit comments

Comments
 (0)