Changeset 4997
- Timestamp:
- Jul 16, 2021 9:21:10 AM (20 months ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/GSASIIctrlGUI.py
r4987 r4997 143 143 import glob 144 144 import copy 145 import ast 145 146 import random as ran 146 147 import webbrowser # could postpone this for quicker startup … … 162 163 import GSASIImath as G2mth 163 164 import GSASIIstrMain as G2stMn 165 import config_example 164 166 if sys.version_info[0] >= 3: 165 167 unicode = str -
trunk/GSASIImath.py
r4990 r4997 1751 1751 psin = np.sin(twopi*phase) 1752 1752 pcos = np.cos(twopi*phase) 1753 MmodA = Am[nxs,nxs,:,:]*pcos[:,:,:,nxs] #cos term 1754 MmodB = Bm[nxs,nxs,:,:]*psin[:,:,:,nxs] #sin term 1755 MmodA = np.sum(SGMT[nxs,:,nxs,:,:]*MmodA[:,:,:,nxs,:],axis=-1)*SGData['SpnFlp'][nxs,:,nxs,nxs] 1756 MmodB = np.sum(SGMT[nxs,:,nxs,:,:]*MmodB[:,:,:,nxs,:],axis=-1)*SGData['SpnFlp'][nxs,:,nxs,nxs] 1757 return MmodA,MmodB #Ntau,Nops,Natm,Mxyz; cos & sin parts; sum matches drawn atom moments 1753 MmodAR = Am[nxs,nxs,:,:]*pcos[:,:,:,nxs] #cos term 1754 MmodBR = Bm[nxs,nxs,:,:]*psin[:,:,:,nxs] #sin term 1755 MmodAR = np.sum(SGMT[nxs,:,nxs,:,:]*MmodAR[:,:,:,nxs,:],axis=-1) 1756 MmodBR = np.sum(SGMT[nxs,:,nxs,:,:]*MmodBR[:,:,:,nxs,:],axis=-1) 1757 MmodAI = Am[nxs,nxs,:,:]*psin[:,:,:,nxs] #cos term 1758 MmodBI = Bm[nxs,nxs,:,:]*pcos[:,:,:,nxs] #sin term 1759 MmodAI = np.sum(SGMT[nxs,:,nxs,:,:]*MmodAI[:,:,:,nxs,:],axis=-1) 1760 MmodBI = np.sum(SGMT[nxs,:,nxs,:,:]*MmodBI[:,:,:,nxs,:],axis=-1) 1761 return MmodAR,MmodBR,MmodAI,MmodBI #Ntau,Nops,Natm,Mxyz; cos & sin parts; sum matches drawn atom moments 1758 1762 1759 1763 def Modulation(H,HP,nWaves,Fmod,Xmod,Umod,glTau,glWt): -
trunk/GSASIIphsGUI.py
r4992 r4997 8367 8367 atom[cx:cx+3] = Opp[key] 8368 8368 atom[cs-1] = cell 8369 atomData.append(atom[:cuij+ 9]) #not SS stuff8369 atomData.append(atom[:cuij+7]+atom[-2:]) #not SS stuff 8370 8370 data['Drawing']['Atoms'] = atomData 8371 8371 GoOn = pgbar.Update(Ind,newmsg='Atoms done=%d'%(Ind)) -
trunk/GSASIIplot.py
r4992 r4997 9340 9340 9341 9341 def RenderBonds(x,y,z,Bonds,radius,color,slice=20): 9342 if not len(Bonds): 9343 return 9342 9344 GL.glMaterialfv(GL.GL_FRONT_AND_BACK,GL.GL_DIFFUSE,color) 9343 9345 GL.glPushMatrix() … … 9576 9578 for i,xyz in enumerate(Atoms): 9577 9579 ax,ay,az = xyz 9578 RenderBonds(ax,ay,az,bondData[i],bondR,Color[i]) 9580 if len(bondData[i]): 9581 RenderBonds(ax,ay,az,bondData[i],bondR,Color[i]) 9579 9582 9580 9583 def Draw(caller='',Fade=[],NPkey=False): -
trunk/GSASIIstrMath.py
r4995 r4997 1532 1532 mXYZ = np.hstack((mXYZ,mXYZ)) 1533 1533 1534 MmodA ,MmodB= G2mth.MagMod(glTau,mXYZ,modQ,MSSdata,SGData,SSGData) #Ntau,Nops,Natm,Mxyz cos,sin parts sum matches drawing1534 MmodAR,MmodBR,MmodAI,MmodBI = G2mth.MagMod(glTau,mXYZ,modQ,MSSdata,SGData,SSGData) #Ntau,Nops,Natm,Mxyz cos,sin parts sum matches drawing 1535 1535 1536 1536 if not SGData['SGGray']: #for fixed Mx,My,Mz … … 1612 1612 MF = refDict['FF']['MF'][iBeg:iFin].T[Tindx].T #Nref,Natm 1613 1613 TMcorr = 0.539*(np.reshape(Tiso,Tuij.shape)*Tuij)[:,0,:]*Mdata*Fdata*MF/(2*Nops) #Nref,Natm 1614 HM = np.inner(Bmat,HP.T) #put into cartesian space X||H,Z||H*L; 1615 Hlen = np.sqrt(np.sum(HM**2,axis=0)) 1616 eM = (HM/Hlen).T # normalize HP Nref,hkl=Unit vectors || Q 1614 HM = np.inner(Bmat,HP.T) #put into cartesian space X||H,Z||H*L; 1615 eM = (HM*refl.T[5]).T # normalize HP by d* Nref,hkl=Unit vectors || Q 1617 1616 1618 1617 if not SGData['SGGray']: #correct -fixed Mx,My,Mz contribution … … 1620 1619 fbm0 = TMcorr[:,nxs,:,nxs]*GSdata[nxs,:,:,:]*sinm[:,:,:,nxs] 1621 1620 # calc mag. structure factors; Nref,Ntau,Nops,Natm,Mxyz 1622 fams = TMcorr[:,nxs,nxs,:,nxs]*np.array([np.where(H[3,i]!=0,(MmodA*cosm[i,nxs,:,:,nxs]+ 1623 H[3,i]*MmodB*sinm[i,nxs,:,:,nxs]),0.) for i in range(mRef)])/2. #Nref,Ntau,Nops,Natm,Mxyz 1621 fams = TMcorr[:,nxs,nxs,:,nxs]*np.array([np.where(H[3,i]!=0,( 1622 (MmodAR+H[3,i]*MmodBR)*cosm[i,nxs,:,:,nxs]+ 1623 (-MmodAI+H[3,i]*MmodBI)*sinm[i,nxs,:,:,nxs])*SGData['SpnFlp'][nxs,:,nxs,nxs], 1624 0.) for i in range(mRef)])/2. #Nref,Ntau,Nops,Natm,Mxyz 1624 1625 1625 fbms = TMcorr[:,nxs,nxs,:,nxs]*np.array([np.where(H[3,i]!=0,(MmodA*sinm[i,nxs,:,:,nxs]+ 1626 H[3,i]*MmodB*cosm[i,nxs,:,:,nxs]),0.) for i in range(mRef)])/2. #Nref,Ntau,Nops,Natm,Mxyz 1627 1626 fbms = TMcorr[:,nxs,nxs,:,nxs]*np.array([np.where(H[3,i]!=0,( 1627 (MmodAR+H[3,i]*MmodBR)*sinm[i,nxs,:,:,nxs]+ 1628 (-MmodAI+H[3,i]*MmodBI)*cosm[i,nxs,:,:,nxs])*SGData['SpnFlp'][nxs,:,nxs,nxs], 1629 0.) for i in range(mRef)])/2. #Nref,Ntau,Nops,Natm,Mxyz 1630 1628 1631 if not SGData['SGGray']: 1629 1632 fams += fam0[:,nxs,:,:,:] … … 1634 1637 fbsm = np.sum(np.sum(fbms,axis=-2),axis=-2) 1635 1638 # #put into cartesian space 1636 facm = np.inner(fasm,uAmat.T) 1639 facm = np.inner(fasm,uAmat.T) #.T better than not 1637 1640 fbcm = np.inner(fbsm,uAmat.T) 1638 1641 #form e.F dot product
Note: See TracChangeset
for help on using the changeset viewer.