Changeset 4997


Ignore:
Timestamp:
Jul 16, 2021 9:21:10 AM (20 months ago)
Author:
vondreele
Message:

move imports to top of G2ctrlGUi code so debugger can find it
fix FillUnitCell? bug when incommensurate mag.
latest revision of incomm. mag. str. factor stuff

Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIctrlGUI.py

    r4987 r4997  
    143143import glob
    144144import copy
     145import ast
    145146import random as ran
    146147import webbrowser     # could postpone this for quicker startup
     
    162163import GSASIImath as G2mth
    163164import GSASIIstrMain as G2stMn
     165import config_example
    164166if sys.version_info[0] >= 3:
    165167    unicode = str
  • trunk/GSASIImath.py

    r4990 r4997  
    17511751    psin = np.sin(twopi*phase)
    17521752    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
    17581762       
    17591763def Modulation(H,HP,nWaves,Fmod,Xmod,Umod,glTau,glWt):
  • trunk/GSASIIphsGUI.py

    r4992 r4997  
    83678367                        atom[cx:cx+3] = Opp[key]
    83688368                        atom[cs-1] = cell
    8369                         atomData.append(atom[:cuij+9])  #not SS stuff
     8369                        atomData.append(atom[:cuij+7]+atom[-2:])  #not SS stuff
    83708370            data['Drawing']['Atoms'] = atomData
    83718371            GoOn = pgbar.Update(Ind,newmsg='Atoms done=%d'%(Ind))
  • trunk/GSASIIplot.py

    r4992 r4997  
    93409340       
    93419341    def RenderBonds(x,y,z,Bonds,radius,color,slice=20):
     9342        if not len(Bonds):
     9343            return
    93429344        GL.glMaterialfv(GL.GL_FRONT_AND_BACK,GL.GL_DIFFUSE,color)
    93439345        GL.glPushMatrix()
     
    95769578        for i,xyz in enumerate(Atoms):
    95779579            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])
    95799582               
    95809583    def Draw(caller='',Fade=[],NPkey=False):
  • trunk/GSASIIstrMath.py

    r4995 r4997  
    15321532            mXYZ = np.hstack((mXYZ,mXYZ))
    15331533
    1534         MmodA,MmodB = G2mth.MagMod(glTau,mXYZ,modQ,MSSdata,SGData,SSGData)  #Ntau,Nops,Natm,Mxyz cos,sin parts sum matches drawing
     1534        MmodAR,MmodBR,MmodAI,MmodBI = G2mth.MagMod(glTau,mXYZ,modQ,MSSdata,SGData,SSGData)  #Ntau,Nops,Natm,Mxyz cos,sin parts sum matches drawing
    15351535       
    15361536        if not SGData['SGGray']:    #for fixed Mx,My,Mz
     
    16121612            MF = refDict['FF']['MF'][iBeg:iFin].T[Tindx].T   #Nref,Natm
    16131613            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
    16171616
    16181617            if not SGData['SGGray']:     #correct -fixed Mx,My,Mz contribution             
     
    16201619                fbm0 = TMcorr[:,nxs,:,nxs]*GSdata[nxs,:,:,:]*sinm[:,:,:,nxs]
    16211620#  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
    16241625                       
    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           
    16281631            if not SGData['SGGray']:
    16291632                fams += fam0[:,nxs,:,:,:]
     
    16341637            fbsm = np.sum(np.sum(fbms,axis=-2),axis=-2)
    16351638# #put into cartesian space
    1636             facm = np.inner(fasm,uAmat.T)
     1639            facm = np.inner(fasm,uAmat.T)       #.T better than not
    16371640            fbcm = np.inner(fbsm,uAmat.T)
    16381641#form e.F dot product
Note: See TracChangeset for help on using the changeset viewer.