Changeset 942 for trunk/GSASIIElem.py


Ignore:
Timestamp:
Jun 5, 2013 9:26:36 AM (8 years ago)
Author:
vondreele
Message:

mods for MC/SA:
moved scat fac routines from GSASIIstrIO.py & GSASIIstrMath.py to GSASIIElem.py

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIElem.py

    r939 r942  
    5959    return FormFactors
    6060   
     61def GetFFtable(atomTypes):
     62    ''' returns a dictionary of form factor data for atom types found in atomTypes
     63
     64    :param list atomTypes: list of atom types
     65    :return: FFtable, dictionary of form factor data; key is atom type
     66
     67    '''
     68    FFtable = {}
     69    for El in atomTypes:
     70        FFs = GetFormFactorCoeff(El.split('+')[0].split('-')[0])
     71        for item in FFs:
     72            if item['Symbol'] == El.upper():
     73                FFtable[El] = item
     74    return FFtable
     75   
     76def GetBLtable(General):
     77    ''' returns a dictionary of neutron scattering length data for atom types & isotopes found in General
     78
     79    :param dict General: dictionary of phase info.; includes AtomTypes & Isotopes
     80    :return: BLtable, dictionary of scattering length data; key is atom type
     81    '''
     82    atomTypes = General['AtomTypes']
     83    BLtable = {}
     84    isotopes = General['Isotopes']
     85    isotope = General['Isotope']
     86    for El in atomTypes:
     87        BLtable[El] = [isotope[El],isotopes[El][isotope[El]]]
     88    return BLtable
     89       
     90def getFFvalues(FFtables,SQ):
     91    'Needs a doc string'
     92    FFvals = {}
     93    for El in FFtables:
     94        FFvals[El] = ScatFac(FFtables[El],SQ)[0]
     95    return FFvals
     96   
     97def getBLvalues(BLtables):
     98    'Needs a doc string'
     99    BLvals = {}
     100    for El in BLtables:
     101        BLvals[El] = BLtables[El][1][1]
     102    return BLvals
     103       
    61104def GetFFC5(ElSym):
    62105    '''Get 5 term form factor and Compton scattering data
Note: See TracChangeset for help on using the changeset viewer.