Skip to content

Commit c2f1c6f

Browse files
committed
fix deformation bug
fix deformation display
1 parent 62ba9f5 commit c2f1c6f

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

GSASII/GSASIIphsGUI2.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -355,11 +355,13 @@ def OnNewHarm(event):
355355
def OnDelHarm(event):
356356
Obj = event.GetEventObject()
357357
dId = Indx[Obj.GetId()]
358+
minL = 1 #always an "Ne"
358359
for harm in data['Deformations'][dId]:
359360
if 'Sl' in harm[0]:
360361
Harm = harm
362+
minL = 2 # & 'kappa'
361363
Hkeys = list(Harm[1].keys())
362-
if len(Hkeys) > 1: #always an "Ne"
364+
if len(Hkeys) > minL:
363365
maxord = max([int(item[2]) for item in Hkeys if 'D' in item])
364366
for item in Hkeys:
365367
if 'D' in item and int(item[2]) == maxord:

GSASII/GSASIIplot.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3523,7 +3523,6 @@ def PlotDeform(G2frame,general,atName,atType,deform,UVmat,radial,neigh):
35233523
Y = 0.5*np.outer(npsind(PHI),npsind(PSI))
35243524
Z = 0.5*np.outer(np.ones(np.size(PHI)),npcosd(PSI))
35253525
XYZ = np.array([X.flatten(),Y.flatten(),Z.flatten()])
3526-
# XYZ = np.inner(UVmat,XYZ.T)
35273526
RAP = G2mth.Cart2Polar(XYZ[0],XYZ[1],XYZ[2])
35283527
P = np.zeros((31,31))
35293528
for shc in SHC:
@@ -7359,9 +7358,9 @@ def Draw(caller='',Fade=[],NPkey=False):
73597358
SGM = np.array(G2spc.GetOpFromCode(atom[cs-1],SGData)[0])
73607359
SHC = defParms[0][1]
73617360
SHC = {item.replace('D','C'):SHC[item] for item in SHC if item not in ['Ne','kappa']}
7362-
SGC = G2lat.CrysM2CartM(Amat,Bmat,SGM)
7363-
UVMat = np.inner(defCtrls['UVmat'],SGC)
7364-
# print(atom[ct-1],atom[cs-1],'\n',UVMat,'\n',SGC)
7361+
SGC = nl.inv(G2lat.CrysM2CartM(Amat,Bmat,SGM))
7362+
UVMat = np.inner(defCtrls['UVmat'],SGC.T)
7363+
# print(nl.det(UVMat),atom[ct-1],atom[cs-1],'\n',UVMat,'\n',SGC)
73657364
Npsi,Ngam = 90,45
73667365
PSI,GAM = np.mgrid[0:Npsi,0:Ngam] #[azm,pol]
73677366
PSI = PSI.flatten()*360./Npsi #azimuth 0-360 incl

0 commit comments

Comments
 (0)