Changeset 3224


Ignore:
Timestamp:
Jan 14, 2018 3:58:51 PM (4 years ago)
Author:
vondreele
Message:

fix phase offset in modulations
mark places to fix mag structure factor calc & derivs.
fix mag phase import from GSAS EXP files

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIspc.py

    r3221 r3224  
    21152115   
    21162116def getTauT(tau,sop,ssop,XYZ,wave=np.zeros(3)):
    2117     phase = 4.*np.pi*np.sum(XYZ*wave)
     2117    phase = np.sum(XYZ*wave)
    21182118    ssopinv = nl.inv(ssop[0])
    21192119    mst = ssopinv[3][:3]
  • trunk/GSASIIstrMath.py

    r3219 r3224  
    684684    if not Xdata.size:          #no atoms in phase!
    685685        return
    686     if parmDict[pfx+'isMag']:
     686    if parmDict[pfx+'isMag']:       #TODO: fix the math - mag moments now along crystal axes
    687687        Mag = np.sqrt(np.sum(Gdata**2,axis=0))      #magnitude of moments for uniq atoms
    688688        Gdata = np.where(Mag>0.,Gdata/Mag,0.)       #normalze mag. moments
     
    692692            Gdata = np.hstack((Gdata,-Gdata))       #inversion if any
    693693        Gdata = np.hstack([Gdata for icen in range(Ncen)])        #dup over cell centering
    694 #        GSASIIpath.IPyBreak()
    695694        Gdata = SGData['MagMom'][nxs,:,nxs]*Gdata   #flip vectors according to spin flip * det(opM)
    696695        Gdata = np.inner(Amat,Gdata.T)              #convert back to cart. space MXYZ, Natoms, NOps*Inv*Ncen
     
    761760        Tindx = np.array([refDict['FF']['El'].index(El) for El in Tdata])
    762761        FF = np.repeat(refDict['FF']['FF'][iBeg:iFin].T[Tindx].T,len(SGT)*len(TwinLaw),axis=0)
    763         if 'N' in calcControls[hfx+'histType'] and parmDict[pfx+'isMag']:
     762        if 'N' in calcControls[hfx+'histType'] and parmDict[pfx+'isMag']:       #TODO: math here??
    764763            MF = refDict['FF']['MF'][iBeg:iFin].T[Tindx].T   #Nref,Natm
    765764            TMcorr = 0.539*(np.reshape(Tiso,Tuij.shape)*Tuij)[:,0,:]*Fdata*Mdata*MF/(2*Nops)     #Nref,Natm
     
    990989    :returns: dict dFdvDict: dictionary of derivatives
    991990    '''
     991    #TODO: fix mag math - moments parallel to crystal axes
    992992    ast = np.sqrt(np.diag(G))
    993993    Mast = twopisq*np.multiply.outer(ast,ast)
  • trunk/imports/G2phase.py

    r3221 r3224  
    239239            Ptype = 'nuclear'
    240240        elif NPhas[result] in ['2','3']:
    241             Ptype = 'nuclear'
    242 #            Ptype = 'magnetic'
    243 #            MagDmin = 1.0
     241            Ptype = 'magnetic'
     242            MagDmin = 1.0
    244243        elif NPhas[result] == '4':
    245244            Ptype = 'macromolecular'
     
    266265                SpnFlp = np.where(SpnFlp==0,1,SpnFlp)
    267266                if SGData['SpGrp'][0] in ['A','B','C','I','R','F']:
    268                     SpnFlp += [1,1,1,1]
     267                    SpnFlp = list(SpnFlp)+[1,1,1,1]
    269268            elif 'MXDSTR' in key:
    270269                MagDmin = float(EXPphase[key][:10])               
     
    317316                        mag = np.sqrt(np.sum(mom**2))
    318317                        mom = np.inner(Bmat,mom)*mag
    319                         print (mom,mag)
    320318                        Atoms[-1] = Atom[:7]+list(mom)+Atom[7:]
    321319        elif Ptype == 'macromolecular':
Note: See TracChangeset for help on using the changeset viewer.