Skip to content

Commit 5765aa3

Browse files
committed
fix symop converter
add 2 axes defn for defo
1 parent f7b1592 commit 5765aa3

File tree

3 files changed

+28
-8
lines changed

3 files changed

+28
-8
lines changed

GSASII/GSASIIphsGUI2.py

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -213,19 +213,36 @@ def OnSSchoice(event):
213213
wx.CallAfter(UpdateDeformation,G2frame,data,dId)
214214

215215
def MakeUVmat(defData,U,V):
216-
MX = U/nl.norm(U)
217-
if 'A' in defData['MUV']:
216+
"Cartesian axes: A: X'=U, Y'=(UxV)xU & Z'=UxV,B: X'=U, Y'=UxV & Z'=Ux(UxV)"
217+
" C: X'=UxV, Y'=Ux(UxV) & Z'=U, D: X'=(UxV)xU, Y=(UxV) & Z'=U"
218+
if 'A' in defData['MUV']: #"X'=U, Y'=(UxV)xU & Z'=UxV"
219+
MX = U/nl.norm(U)
218220
MY = V/nl.norm(V)
219221
MZ = np.cross(MX,MY)
220222
MZ /= nl.norm(MZ)
221223
MY = np.cross(MZ,MX)
222224
MY /= nl.norm(MY)
223-
else:
225+
elif 'B' in defData['MUV']: #"X'=U, Y'=UxV & Z'=Ux(UxV)"
226+
MX = U/nl.norm(U)
224227
MZ = V/nl.norm(V)
225228
MY = np.cross(MZ,MX)
226229
MY /= nl.norm(MY)
227230
MZ = np.cross(MX,MY)
228231
MZ /= nl.norm(MZ)
232+
elif 'C' in defData['MUV']: #"X'=UxV, Y'=Ux(UxV) & Z'=U"
233+
MZ = U/nl.norm(U)
234+
MY = V/nl.norm(V)
235+
MX = np.cross(MZ,MY)
236+
MX /= nl.norm(MX)
237+
MY = np.cross(MZ,MX)
238+
MY /= nl.norm(MY)
239+
elif 'D' in defData['MUV']: #"X'=(UxV)xU, Y=(UxV) & Z'=U"
240+
MZ = U/nl.norm(U)
241+
MX = V/nl.norm(V)
242+
MY = np.cross(MZ,MX)
243+
MY /= nl.norm(MY)
244+
MX = np.cross(MY,MZ)
245+
MX /= nl.norm(MX)
229246
return np.array([MX,MY,MZ]).T
230247

231248
def OnDeformRef(event):
@@ -251,6 +268,7 @@ def OnDelAtm(event):
251268

252269
def OnMatSel(event):
253270
"Cartesian axes: A: X'=U, Y'=(UxV)xU & Z'=UxV,B: X'=U, Y'=UxV & Z'=Ux(UxV)"
271+
" C: X'=UxV, Y'=Ux(UxV) & Z'=U, D: X'=(UxV)xU, Y=(UxV) & Z'=U"
254272
Obj = event.GetEventObject()
255273
dId = Indx[Obj.GetId()]
256274
deformationData[-dId]['MUV'] = Obj.GetValue()
@@ -262,6 +280,7 @@ def OnMatSel(event):
262280

263281
def OnUvec(event):
264282
"Cartesian axes: A: X'=U, Y'=(UxV)xU & Z'=UxV,B: X'=U, Y'=UxV & Z'=Ux(UxV)"
283+
" C: X'=UxV, Y'=Ux(UxV) & Z'=U, D: X'=(UxV)xU, Y=(UxV) & Z'=U"
265284
Obj = event.GetEventObject()
266285
dId = Indx[Obj.GetId()]
267286
if Obj.GetValue() == deformationData[-dId]['V']:
@@ -282,6 +301,7 @@ def OnUvec(event):
282301

283302
def OnVvec(event):
284303
"Cartesian axes: A: X'=U, Y'=(UxV)xU & Z'=UxV,B: X'=U, Y'=UxV & Z'=Ux(UxV)"
304+
" C: X'=UxV, Y'=Ux(UxV) & Z'=U, D: X'=(UxV)xU, Y=(UxV) & Z'=U"
285305
Obj = event.GetEventObject()
286306
dId = Indx[Obj.GetId()]
287307
if Obj.GetValue() == deformationData[-dId]['U']:
@@ -491,7 +511,8 @@ def OnAtCol(event):
491511
mainSizer.Add(wx.StaticText(deformation,
492512
label=" NB: Local site sym always has unique axis || Z' and second axis || X'; choose U && V carefully"))
493513
matSizer = wx.BoxSizer(wx.HORIZONTAL)
494-
Mchoice = ["A: X'=U, Y'=(UxV)xU & Z'=UxV","B: X'=U, Y'=UxV & Z'=Ux(UxV)"]
514+
Mchoice = ["A: X'=U, Y'=(UxV)xU & Z'=UxV","B: X'=U, Y'=UxV & Z'=Ux(UxV)",
515+
"C: X'=UxV, Y'=Ux(UxV) & Z'=U","D: X'=(UxV)xU, Y=(UxV) & Z'=U"]
495516
matSizer.Add(wx.StaticText(deformation,label=' Orbital Cartesian axes:'),0,WACV)
496517
matSel = wx.ComboBox(deformation,choices=Mchoice,value=deformationData[-dId]['MUV'],style=wx.CB_READONLY|wx.CB_DROPDOWN)
497518
matSel.Bind(wx.EVT_COMBOBOX,OnMatSel)

GSASII/GSASIIplot.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7356,7 +7356,6 @@ def Draw(caller='',Fade=[],NPkey=False):
73567356
SHC = {item.replace('D','C'):SHC[item] for item in SHC if item not in ['Ne','kappa']}
73577357
SGC = nl.inv(G2lat.CrysM2CartM(Amat,Bmat,SGM))
73587358
UVMat = np.inner(defCtrls['UVmat'],SGC.T)
7359-
# print(nl.det(UVMat),atom[ct-1],atom[cs-1],'\n',UVMat,'\n',SGC)
73607359
Npsi,Ngam = 60,30
73617360
PSI,GAM = np.mgrid[0:Npsi,0:Ngam] #[azm,pol]
73627361
PSI = PSI.flatten()*360./Npsi #azimuth 0-360 incl

GSASII/GSASIIspc.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1474,9 +1474,9 @@ def GetOpFromCode(Code,SGData):
14741474
Cent = SGCent[cent]
14751475
SGM,SGT = SGOps[opNum]
14761476
if SymOp < 0:
1477-
SGM *= -1
1478-
SGT *= -1
1479-
return SGM,SGT,Cent,Unit
1477+
return -1*SGM,-1*SGT,Cent,Unit
1478+
else:
1479+
return SGM,SGT,Cent,Unit
14801480

14811481
################################################################################
14821482
#### Superspace group codes

0 commit comments

Comments
 (0)