Changeset 4016
 Timestamp:
 Jun 6, 2019 12:13:45 AM (3 years ago)
 Location:
 trunk
 Files:

 3 edited
Legend:
 Unmodified
 Added
 Removed

trunk/GSASIImath.py
r4014 r4016 1364 1364 fxn of ngl tau points 1365 1365 ''' 1366 Bm = np.array(MSSdata[:3]).T #atoms x waves x sin pos mods1367 Am = np.array(MSSdata[3:]).T #...cos pos mods1366 Am = np.array(MSSdata[:3]).T #atoms x waves x sin pos mods 1367 Bm = np.array(MSSdata[3:]).T #...cos pos mods 1368 1368 nWaves = Am.shape[1] 1369 1369 tau = np.arange(ngl)/ngl … … 1390 1390 psin = np.sin(twopi*phase) 1391 1391 pcos = np.cos(twopi*phase) 1392 Mmod A = np.sum(Am[nxs,nxs,:,:,:]*pcos[:,:,:,nxs,nxs],axis=3)1393 Mmod B = np.sum(Bm[nxs,nxs,:,:,:]*psin[:,:,:,nxs,nxs],axis=3)1392 MmodB = np.sum(Bm[nxs,nxs,:,:,:]*pcos[:,:,:,nxs,nxs],axis=3) 1393 MmodA = np.sum(Am[nxs,nxs,:,:,:]*psin[:,:,:,nxs,nxs],axis=3) 1394 1394 if SGData['SGGray']: 1395 1395 MmodA = np.sum(SGMT[nxs,:,nxs,:,:]*MmodA[:,:,:,nxs,:],axis=1)*detSM[nxs,:,nxs,nxs] … … 1399 1399 MmodB = np.sum(SGMT[nxs,:,nxs,:,:]*MmodB[:,:,:,nxs,:],axis=1)*SGData['MagMom'][nxs,:,nxs,nxs] 1400 1400 Mmod = MmodA+MmodB 1401 return Mmod,MmodA,MmodB #Ntau,Nops,Natm,,Mxyz; sum, Re & Imparts1401 return Mmod,MmodA,MmodB #Ntau,Nops,Natm,,Mxyz; sum,sin & cos parts 1402 1402 1403 1403 def Modulation(H,HP,nWaves,Fmod,Xmod,Umod,glTau,glWt): 
trunk/GSASIIpwdGUI.py
r3999 r4016 4385 4385 gridDisplay.SetReadOnly(r,c,isReadOnly=True) 4386 4386 mainSizer.Add(gridDisplay,0,WACV) 4387 if magcells :4387 if magcells and len(controls) > 16: 4388 4388 itemList = [phase.get('gid',ip+1) for ip,phase in enumerate(magcells)] 4389 4389 phaseDict = dict(zip(itemList,magcells)) 
trunk/GSASIIstrMath.py
r3906 r4016 1512 1512 Tmag,TmagA,TmagB = G2mth.MagMod(ngl,mXYZ,modQ,MSSdata,SGData,SSGData) #Ntau,Nops,Natm,MxyzTmag matches drawing moments 1513 1513 1514 if not SGData['SGGray']: 1514 if not SGData['SGGray']: #for fixed Mx,My,Mz 1515 1515 Mmod += Gdata.T[:,nxs,:] 1516 1516 GSdata = np.inner(Gdata.T,np.swapaxes(SGMT,1,2)) #apply sym. ops.> Natm,Nops,Nxyz … … 1520 1520 GSdata = SGData['MagMom'][nxs,:,nxs]*GSdata #flip vectors according to spin flip * det(opM) 1521 1521 GSdata = np.swapaxes(GSdata,0,1) #Nop,Natm,Mxyz 1522 Tmag += Gdata.T[nxs,nxs,:,:]1523 1524 TmagC = np.inner(Tmag,uAmat.T) #make cartesian; Ntau,Nops,Natm,,Mxyz1525 Smag = np.sqrt(np.sum(TmagC**2,axis=1))1526 Kmag = TmagC/Smag[:,:,:,nxs]1522 # Tmag += Gdata.T[nxs,nxs,:,:] 1523 # 1524 # TmagC = np.inner(Tmag,uAmat.T) #make cartesian; Ntau,Nops,Natm,,Mxyz 1525 # Smag = np.sqrt(np.sum(TmagC**2,axis=1)) 1526 # Kmag = TmagC/Smag[:,:,:,nxs] 1527 1527 1528 1528 FF = np.zeros(len(Tdata)) … … 1605 1605 fas0 = 0. 1606 1606 fbs0 = 0. 1607 if not SGData['SGGray']: 1607 if not SGData['SGGray']: #correct fixed Mx,My,Mz contribution 1608 1608 fam0 = TMcorr[:,nxs,:,nxs]*GSdata[nxs,:,:,:]*cosm[:,:,:,nxs] #Nref,Nops,Natm,Mxyz 1609 1609 fbm0 = TMcorr[:,nxs,:,nxs]*GSdata[nxs,:,:,:]*sinm[:,:,:,nxs] … … 1616 1616 #for modulated moments > m != 0 reflections 1617 1617 M = np.array(np.abs(H[3]),dtype=np.int)1 1618 fam = TMcorr[:,nxs,nxs,:,nxs]*np.array([np.where(M[i]>=0,(TmagA*cosm[i,nxs,:,:,nxs]np.sign(H[3])[i]*TmagB*sinm[i,nxs,:,:,nxs]),0.) for i in range(mRef)]) 1619 fbm = TMcorr[:,nxs,nxs,:,nxs]*np.array([np.where(M[i]>=0,(TmagA*sinm[i,nxs,:,:,nxs]+np.sign(H[3])[i]*TmagB*cosm[i,nxs,:,:,nxs]),0.) for i in range(mRef)]) 1618 1619 fam = TMcorr[:,nxs,nxs,:,nxs]*np.array([np.where(M[i]>=0,(TmagB*cosm[i,nxs,:,:,nxs] \ 1620 np.sign(H[3,i])*TmagA*sinm[i,nxs,:,:,nxs]),0.) for i in range(mRef)]) 1621 fbm = TMcorr[:,nxs,nxs,:,nxs]*np.array([np.where(M[i]>=0,(TmagB*sinm[i,nxs,:,:,nxs]+ \ 1622 np.sign(H[3,i])*TmagA*cosm[i,nxs,:,:,nxs]),0.) for i in range(mRef)]) 1620 1623 1621 1624 famq = np.sum(np.sum(fam/2.,axis=2),axis=2) #Nref,Mxyz; sum ops & atoms
Note: See TracChangeset
for help on using the changeset viewer.