Changeset 2473 for trunk/GSASIIElem.py
 Timestamp:
 Sep 20, 2016 1:58:10 PM (5 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

trunk/GSASIIElem.py
r1589 r2473 55 55 for El in atomTypes: 56 56 FFs = GetFormFactorCoeff(getElSym(El)) 57 for item in FFs: 58 if item['Symbol'] == El.upper(): 59 FFtable[El] = item 60 return FFtable 61 62 def GetMFtable(atomTypes): 63 ''' returns a dictionary of magnetic form factor data for atom types found in atomTypes 64 65 :param list atomTypes: list of atom types 66 :return: FFtable, dictionary of form factor data; key is atom type 67 68 ''' 69 FFtable = {} 70 for El in atomTypes: 71 FFs = GetMagFormFacCoeff(getElSym(El)) 57 72 for item in FFs: 58 73 if item['Symbol'] == El.upper(): … … 266 281 267 282 def GetMagFormFacCoeff(El): 268 """Read magnetic form factor data from at omdata.asc file283 """Read magnetic form factor data from atmdata.py 269 284 270 285 :param El: 2 character element symbol … … 283 298 284 299 """ 300 Els = El.capitalize().strip() 285 301 MagFormFactors = [] 286 mags = [ky for ky in atmdata.MagFF.keys() if El == getElSym(ky)]302 mags = [ky for ky in atmdata.MagFF.keys() if Els == getElSym(ky)] 287 303 for mag in mags: 288 304 magData = {} 289 305 data = atmdata.MagFF[mag] 290 magData['Symbol'] = mag 291 magData['Z'] = atmdata.XrayFF[getElSym(mag s)]['Z']306 magData['Symbol'] = mag.upper() 307 magData['Z'] = atmdata.XrayFF[getElSym(mag)]['Z'] 292 308 magData['mfa'] = [data['M'][i] for i in [0,2,4,6]] 293 mag data['mfb'] = [data['M'][i] for i in [1,3,5,7]]294 mag data['mfc'] = data['M'][8]309 magData['mfb'] = [data['M'][i] for i in [1,3,5,7]] 310 magData['mfc'] = data['M'][8] 295 311 magData['nfa'] = [data['N'][i] for i in [0,2,4,6]] 296 magdata['nfb'] = [data['N'][i] for i in [1,3,5,7]] 297 magdata['nfc'] = data['N'][8] 298 magdata['gfac'] = data['N'][9] 299 MagFormFactors.append(magdata) 312 magData['nfb'] = [data['N'][i] for i in [1,3,5,7]] 313 magData['nfc'] = data['N'][8] 314 MagFormFactors.append(magData) 300 315 return MagFormFactors 301 316 … … 311 326 t = fb[:,np.newaxis]*SQ 312 327 return np.sum(fa[:,np.newaxis]*np.exp(t)[:],axis=0)+El['fc'] 328 329 def MagScatFac(El, SQ,gfac): 330 """compute value of form factor 331 332 :param El: element dictionary defined in GetFormFactorCoeff 333 :param SQ: (sintheta/lambda)**2 334 :param gfac: Lande g factor (normally = 2.0) 335 :return: real part of form factor 336 """ 337 mfa = np.array(El['mfa']) 338 mfb = np.array(El['mfb']) 339 nfa = np.array(El['nfa']) 340 nfb = np.array(El['nfb']) 341 mt = mfb[:,np.newaxis]*SQ 342 nt = nfb[:,np.newaxis]*SQ 343 MMF = np.sum(mfa[:,np.newaxis]*np.exp(mt)[:],axis=0)+El['mfc'] 344 NMF = np.sum(nfa[:,np.newaxis]*np.exp(nt)[:],axis=0)+El['nfc'] 345 return MMF+(2.0/gfac1.0)*NMF 313 346 314 347 def BlenResCW(Els,BLtables,wave):
Note: See TracChangeset
for help on using the changeset viewer.