Changeset 4999


Ignore:
Timestamp:
Jul 22, 2021 2:09:36 PM (8 weeks ago)
Author:
vondreele
Message:

change incommensurate magneti str. fctr. equations
avoid search for modulation vector when no peaks were fitted.

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIImath.py

    r4997 r4999  
    17151715    if nWaves[3]:
    17161716        tauM = np.arange(1.,nWaves[3]+1-nx)[:,nxs]*mglTau  #Mwaves x ngl
    1717         MmodA = Am[:,:,:,nxs]*np.sin(twopi*tauM[nxs,:,nxs,:]) #atoms X waves X 3 X ngl
     1717        MmodA = Am[:,:,:,nxs]*np.sin(twopi*tauM[nxs,:,nxs,:]) #atoms X waves X 3 X tau
    17181718        MmodB = Bm[:,:,:,nxs]*np.cos(twopi*tauM[nxs,:,nxs,:]) #ditto
    17191719        Mmod = np.sum(MmodA+MmodB,axis=1)
     
    17441744        Sinv = np.vstack((Sinv,Sinv))
    17451745        SGT = np.vstack((SGT,SGT+np.array([0.,0.,0.,.5])))%1.
    1746     mst = Sinv[:,3,:3]
    17471746    epsinv = Sinv[:,3,3]
     1747    mst = np.inner(Sinv[:,:3,:3],modQ)-epsinv[:,nxs]*modQ   #van Smaalen Eq. 3.3
    17481748    phi = np.inner(XYZ,modQ).T
    17491749    TA = np.sum(mst[nxs,:,:]*(XYZ-SGT[:,:3][nxs,:,:]),axis=-1).T
    1750     phase =  TA[nxs,:,:] + epsinv[nxs,:,nxs]*(glTau[:,nxs,nxs]-SGT[:,3][nxs,:,nxs]+phi[nxs,:,:])
     1750    phase =  TA[nxs,:,:] + epsinv[nxs,:,nxs]*(glTau[:,nxs,nxs]+phi[nxs,:,:])+SGT[:,3][nxs,:,nxs]
    17511751    psin = np.sin(twopi*phase)
    17521752    pcos = np.cos(twopi*phase)
     
    17591759    MmodAI = np.sum(SGMT[nxs,:,nxs,:,:]*MmodAI[:,:,:,nxs,:],axis=-1)
    17601760    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
     1761    return MmodAR,MmodBR,MmodAI,MmodBI    #Ntau,Nops,Natm,Mxyz; cos & sin parts
    17621762       
    17631763def Modulation(H,HP,nWaves,Fmod,Xmod,Umod,glTau,glWt):
  • trunk/GSASIIpwdGUI.py

    r4991 r4999  
    46254625        maxMH.Bind(wx.EVT_COMBOBOX, OnMaxMH)
    46264626        ssSizer.Add(maxMH,0,WACV)
    4627         findMV = wx.Button(G2frame.dataWindow,label="Find mod. vec.?")
    4628         findMV.Bind(wx.EVT_BUTTON,OnFindOneMV)
    4629         ssSizer.Add(findMV,0,WACV)
    4630         findallMV = wx.Button(G2frame.dataWindow,label="Try all?")
    4631         findallMV.Bind(wx.EVT_BUTTON,OnFindMV)
    4632         ssSizer.Add(findallMV,0,WACV)
     4627        if len(peaks[0]):
     4628            findMV = wx.Button(G2frame.dataWindow,label="Find mod. vec.?")
     4629            findMV.Bind(wx.EVT_BUTTON,OnFindOneMV)
     4630            ssSizer.Add(findMV,0,WACV)
     4631            findallMV = wx.Button(G2frame.dataWindow,label="Try all?")
     4632            findallMV.Bind(wx.EVT_BUTTON,OnFindMV)
     4633            ssSizer.Add(findallMV,0,WACV)
    46334634        mainSizer.Add(ssSizer,0)
    46344635
  • trunk/GSASIIstrMath.py

    r4997 r4999  
    15101510        Nops *= 2
    15111511    SSGMT = np.array([ops[0].T for ops in SSGData['SSGOps']])
     1512    GamI = np.array([ops[0][3,3] for ops in SSGData['SSGOps']])
     1513    if SGData['SGInv']:
     1514        GamI = np.hstack((GamI,-GamI))
     1515    GamI = np.hstack([GamI for cen in SGData['SGCen']])
     1516    if SGData['SGGray']:
     1517        GamI = np.hstack((GamI,GamI))
    15121518    SSGT = np.array([ops[1] for ops in SSGData['SSGOps']])
    15131519    SSCen = SSGData['SSGCen']
     
    15331539
    15341540        MmodAR,MmodBR,MmodAI,MmodBI = G2mth.MagMod(glTau,mXYZ,modQ,MSSdata,SGData,SSGData)  #Ntau,Nops,Natm,Mxyz cos,sin parts sum matches drawing
     1541        MmodA = MmodAR+MmodBR
     1542        MmodB = MmodAI+MmodBI
    15351543       
    15361544        if not SGData['SGGray']:    #for fixed Mx,My,Mz
     
    16191627                fbm0 = TMcorr[:,nxs,:,nxs]*GSdata[nxs,:,:,:]*sinm[:,:,:,nxs]
    16201628#  calc mag. structure factors; Nref,Ntau,Nops,Natm,Mxyz                           
    1621             fams = TMcorr[:,nxs,nxs,:,nxs]*np.array([np.where(H[3,i]!=0,(
     1629            fams = TMcorr[:,nxs,nxs,:,nxs]*SGData['MagMom'][nxs,nxs,:,nxs,nxs]*np.array([np.where(H[3,i]!=0,(
    16221630                (MmodAR+H[3,i]*MmodBR)*cosm[i,nxs,:,:,nxs]+   
    1623                 (-MmodAI+H[3,i]*MmodBI)*sinm[i,nxs,:,:,nxs])*SGData['SpnFlp'][nxs,:,nxs,nxs],
     1631                GamI[nxs,:,nxs,nxs]*(-MmodAI+H[3,i]*MmodBI)*sinm[i,nxs,:,:,nxs]),
    16241632                0.) for i in range(mRef)])/2.          #Nref,Ntau,Nops,Natm,Mxyz
    16251633                       
    1626             fbms = TMcorr[:,nxs,nxs,:,nxs]*np.array([np.where(H[3,i]!=0,(
     1634            fbms = TMcorr[:,nxs,nxs,:,nxs]*SGData['MagMom'][nxs,nxs,:,nxs,nxs]*np.array([np.where(H[3,i]!=0,(
    16271635                (MmodAR+H[3,i]*MmodBR)*sinm[i,nxs,:,:,nxs]+   
    1628                 (-MmodAI+H[3,i]*MmodBI)*cosm[i,nxs,:,:,nxs])*SGData['SpnFlp'][nxs,:,nxs,nxs],
     1636                GamI[nxs,:,nxs,nxs]*(MmodAI-H[3,i]*MmodBI)*cosm[i,nxs,:,:,nxs]),
    16291637                0.) for i in range(mRef)])/2.          #Nref,Ntau,Nops,Natm,Mxyz
    16301638           
Note: See TracChangeset for help on using the changeset viewer.