Changeset 2478 for trunk/GSASIIElem.py


Ignore:
Timestamp:
Sep 23, 2016 1:43:24 PM (5 years ago)
Author:
vondreele
Message:

work up to magnetic structure factor calcs.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIElem.py

    r2473 r2478  
    6060    return FFtable
    6161   
    62 def GetMFtable(atomTypes):
     62def GetMFtable(atomTypes,Landeg):
    6363    ''' returns a dictionary of magnetic form factor data for atom types found in atomTypes
    6464
    6565    :param list atomTypes: list of atom types
     66    :param list Landeg: Lande g factors for atomTypes
    6667    :return: FFtable, dictionary of form factor data; key is atom type
    6768
    6869    '''
    69     FFtable = {}
    70     for El in atomTypes:
    71         FFs = GetMagFormFacCoeff(getElSym(El))
    72         for item in FFs:
     70    MFtable = {}
     71    for El,gfac in zip(atomTypes,Landeg):
     72        MFs = GetMagFormFacCoeff(getElSym(El))
     73        for item in MFs:
    7374            if item['Symbol'] == El.upper():
    74                 FFtable[El] = item
    75     return FFtable
     75                item['gfac'] = gfac
     76                MFtable[El] = item
     77    return MFtable
    7678   
    7779def GetBLtable(General):
     
    122124    return BLvals
    123125       
     126def getMFvalues(MFtables,SQ,ifList=False):
     127    'Needs a doc string'
     128    if ifList:
     129        MFvals = []
     130        for El in MFtables:
     131            MFvals.append(MagScatFac(MFtables[El],SQ)[0])
     132    else:
     133        MFvals = {}
     134        for El in MFtables:
     135            MFvals[El] = MagScatFac(MFtables[El],SQ)[0]
     136    return MFvals
     137   
    124138def GetFFC5(ElSym):
    125139    '''Get 5 term form factor and Compton scattering data
     
    327341    return np.sum(fa[:,np.newaxis]*np.exp(t)[:],axis=0)+El['fc']
    328342       
    329 def MagScatFac(El, SQ,gfac):
     343def MagScatFac(El, SQ):
    330344    """compute value of form factor
    331345
     
    343357    MMF = np.sum(mfa[:,np.newaxis]*np.exp(mt)[:],axis=0)+El['mfc']
    344358    NMF = np.sum(nfa[:,np.newaxis]*np.exp(nt)[:],axis=0)+El['nfc']
    345     return MMF+(2.0/gfac-1.0)*NMF
     359    return MMF+(2.0/El['gfac']-1.0)*NMF
    346360       
    347361def BlenResCW(Els,BLtables,wave):
Note: See TracChangeset for help on using the changeset viewer.