Changeset 3853
- Timestamp:
- Mar 15, 2019 8:37:20 AM (4 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/GSASIImath.py
r3851 r3853 1356 1356 return ngl,nWaves,Fmod,Xmod,Umod,Mmod,glTau,glWt 1357 1357 1358 def MagMod(XYZ,modQ,MSSdata ):1358 def MagMod(XYZ,modQ,MSSdata,SSGData): 1359 1359 Bm = np.array(MSSdata[:3]).T #atoms x waves x sin pos mods 1360 1360 Am = np.array(MSSdata[3:]).T #...cos pos mods 1361 1361 nWaves = Am.shape[1] 1362 1362 MmodA = 0; MmodB = 0 1363 nCen = len(SSGData['SSGCen']) 1364 nEqv = XYZ.shape[1] #full no. of equivalent pos incl centering 1365 mEqv = nEqv//nCen #no. operators not with centering; includes inversion 1363 1366 if nWaves: 1364 1367 modind = np.arange(nWaves)+1. 1365 1368 phase = np.sum(twopi*XYZ[:,:,nxs,:]*modind[nxs,nxs,:,nxs]*modQ[nxs,nxs,nxs,:],axis=-1) 1366 1369 phase = np.swapaxes(phase,0,1) #Nops,Natm,Nwave 1370 if nCen > 0: 1371 phshp = phase.shape 1372 phase = np.reshape(phase,(nCen,mEqv,phshp[1],-1)) 1373 for ic,cen in enumerate(SSGData['SSGCen']): 1374 phase[ic] += twopi*cen[3]/2. 1375 phase = np.reshape(phase,phshp) 1367 1376 MmodA = Am[nxs,:,:,:]*np.cos(phase[:,:,:,nxs])-Bm[nxs,:,:,:]*np.sin(phase[:,:,:,nxs]) 1368 1377 MmodB = Am[nxs,:,:,:]*np.sin(phase[:,:,:,nxs])+Bm[nxs,:,:,:]*np.cos(phase[:,:,:,nxs]) -
trunk/GSASIIstrMath.py
r3851 r3853 1518 1518 1519 1519 mXYZ = np.array([[xyz[0] for xyz in list(G2spc.GenAtom(xyz,SGData,All=True,Move=True))] for xyz in (Xdata+dXdata).T])%1. #Natn,Nop,xyz 1520 MmodA,MmodB = G2mth.MagMod(mXYZ,modQ,MSSdata ) #Re cos/Im sin,Nops,Natm,Nwaves,Mxyz1521 MmodA = np.inner(MmodA,uAmat.T) #*(SGData['MagMom']/SGData['SpnFlp'])[:,nxs,nxs,nxs] #make cartesian * apply det(ops)1522 MmodB = np.inner(MmodB,uAmat.T) #*(SGData['MagMom']/SGData['SpnFlp'])[:,nxs,nxs,nxs]1520 MmodA,MmodB = G2mth.MagMod(mXYZ,modQ,MSSdata,SSGData) #Re cos/Im sin,Nops,Natm,Nwaves,Mxyz 1521 MmodA = np.inner(MmodA,uAmat.T)*(SGData['MagMom']/SGData['SpnFlp'])[:,nxs,nxs,nxs] #make cartesian * apply det(ops) 1522 MmodB = np.inner(MmodB,uAmat.T)*(SGData['MagMom']/SGData['SpnFlp'])[:,nxs,nxs,nxs] 1523 1523 1524 1524 FF = np.zeros(len(Tdata))
Note: See TracChangeset
for help on using the changeset viewer.