Changeset 1391
- Timestamp:
- Jun 20, 2014 1:43:42 PM (9 years ago)
- Location:
- trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/GSASII.py
r1390 r1391 735 735 rd.RefDict['FF'] = [{} for i in range(len(rd.RefDict['RefList']))] 736 736 Id = self.PatternTree.AppendItem(parent=self.root,text=HistName) 737 print rd.RefDict738 737 self.PatternTree.SetItemPyData(Id,[valuesdict,rd.RefDict]) 739 738 Sub = self.PatternTree.AppendItem(Id,text='Instrument Parameters') -
trunk/GSASIIElem.py
r1365 r1391 68 68 atomTypes = General['AtomTypes'] 69 69 BLtable = {} 70 isotopes = General['Isotopes']71 70 isotope = General['Isotope'] 72 71 for El in atomTypes: … … 95 94 BLvals = [] 96 95 for El in BLtables: 97 BLvals.append(BLtables[El][1]['SL'][0]) 96 if 'BW-LS' in El: 97 BLvals.append(BLtables[El][1]['BW-LS'][0]) 98 else: 99 BLvals.append(BLtables[El][1]['SL'][0]) 98 100 else: 99 101 BLvals = {} 100 102 for El in BLtables: 101 BLvals[El] = BLtables[El][1]['SL'][0] 103 if 'BW-LS' in El: 104 BLvals[El] = BLtables[El][1]['BW-LS'][0] 105 else: 106 BLvals[El] = BLtables[El][1]['SL'][0] 102 107 return BLvals 103 108 … … 301 306 return np.sum(fa[:,np.newaxis]*np.exp(t)[:],axis=0)+El['fc'] 302 307 303 def BlenRes (Elist,BLtables,wave):304 FP = np.zeros(len(El ist))305 FPP = np.zeros(len(El ist))306 Emev = 81.80703/wave**2307 for i,El in enumerate(Elist):308 BL = BLtables[El]309 if len(BL) >= 6:308 def BlenResCW(Els,BLtables,wave): 309 FP = np.zeros(len(Els)) 310 FPP = np.zeros(len(Els)) 311 for i,El in enumerate(Els): 312 BL = BLtables[El][1] 313 if 'BW-LS' in BL: 314 Re,Im,E0,gam,A,E1,B,E2 = BL['BW-LS'][1:] 310 315 Emev = 81.80703/wave**2 311 G2 = BL[5]**2 312 T = [Emev-BL[4],0,0] 313 D = [T**2+G2,0,0] 314 fp = T/D 315 fpp = 1.0/D 316 if len(BL) == 8: 317 T = Emev-BL[7] 318 D = T**2+G2 319 fp += BL[6]*T/D 320 fpp += BL[6]/D 321 if len(BL) == 10: 322 T = Emev-BL[9] 323 D = T**2+G2 324 fp += BL[8]*T/D 325 fpp += BL[8]/D 326 FP[i] = (BL[2]*fp) 327 FPP[i] = (-BL[3]*fpp) 316 T0 = Emev-E0 317 T1 = Emev-E1 318 T2 = Emev-E2 319 D0 = T0**2+gam**2 320 D1 = T1**2+gam**2 321 D2 = T2**2+gam**2 322 FP[i] = Re*(T0/D0+A*T1/D1+B*T2/D2) 323 FPP[i] = Im*(1/D0+A/D1+B/D2) 328 324 else: 329 FP[i] = 0.0 330 FPP[i] = 0.0 325 FPP[i] = BL['SL'][1] #for Li, B, etc. 331 326 return FP,FPP 332 327 333 #def BlenRes(BLdata,wave): 334 # FP = [] 335 # FPP = [] 336 # Emev = 81.80703/wave**2 337 # for BL in BLdata: 338 # if len(BL) >= 6: 339 # G2 = BL[5]**2 340 # T = [Emev-BL[4],0,0] 341 # D = [T**2+G2,0,0] 342 # fp = T/D 343 # fpp = 1.0/D 344 # if len(BL) == 8: 345 # T = Emev-BL[7] 346 # D = T**2+G2 347 # fp += BL[6]*T/D 348 # fpp += BL[6]/D 349 # if len(BL) == 10: 350 # T = Emev-BL[9] 351 # D = T**2+G2 352 # fp += BL[8]*T/D 353 # fpp += BL[8]/D 354 # FP.append(BL[2]*fp) 355 # FPP.append(-BL[3]*fpp) 356 # else: 357 # FP.append(0.0) 358 # FPP.append(0.0) 359 # return np.array(FP),np.array(FPP) 328 def BlenResTOF(El,BLtables,wave): 329 # FP = np.zeros(len(wave)) 330 FPP = np.zeros(len(wave)) 331 BL = BLtables[El][1] 332 print BL 333 if 'BW-LS' in BL: 334 Re,Im,E0,gam,A,E1,B,E2 = BL['BW-LS'][1:] 335 Emev = 81.80703/wave**2 336 T0 = Emev-E0 337 T1 = Emev-E1 338 T2 = Emev-E2 339 D0 = T0**2+gam**2 340 D1 = T1**2+gam**2 341 D2 = T2**2+gam**2 342 FP = Re*(T0/D0+A*T1/D1+B*T2/D2) 343 FPP = Im*(1/D0+A/D1+B/D2) 344 else: 345 FPP = np.ones(len(wave))*BL['SL'][1] #for Li, B, etc. 346 return FP,FPP 360 347 361 348 def ComptonFac(El,SQ): -
trunk/GSASIIpwdGUI.py
r1380 r1391 2347 2347 Status = G2frame.dataFrame.CreateStatusBar() 2348 2348 G2frame.Bind(wx.EVT_MENU, OnSelectPhase, id=G2gd.wxID_SELECTPHASE) 2349 G2frame.Bind(wx.EVT_MENU, OnPlotHKL, id=G2gd.wxID_PWDHKLPLOT) #not work yet2349 G2frame.Bind(wx.EVT_MENU, OnPlotHKL, id=G2gd.wxID_PWDHKLPLOT) 2350 2350 G2frame.dataFrame.SelectPhase.Enable(False) 2351 2351 if len(data) > 1: … … 2363 2363 for i in range(len(refs)): rowLabels.append(str(i)) 2364 2364 if HKLF: 2365 colLabels = ['H','K','L','mul','d','Fosq','sig','Fcsq','FoTsq','FcTsq','phase', ]2365 colLabels = ['H','K','L','mul','d','Fosq','sig','Fcsq','FoTsq','FcTsq','phase','Ext',] 2366 2366 else: 2367 2367 colLabels = ['H','K','L','mul','d','pos','sig','gam','Fosq','Fcsq','phase','I100',] -
trunk/GSASIIstrMath.py
r1365 r1391 531 531 532 532 def StructureFactor(refDict,G,hfx,pfx,SGData,calcControls,parmDict): 533 ''' Compute structure factors for all h,k,l for phase 533 ''' Not Used: here only for comparison the StructureFactor2 - faster version 534 Compute structure factors for all h,k,l for phase 534 535 puts the result, F^2, in each ref[8] in refList 535 536 input: … … 557 558 FF = np.zeros(len(Tdata)) 558 559 if 'N' in calcControls[hfx+'histType']: 559 FP,FPP = G2el.BlenRes (Tdata,BLtables,parmDict[hfx+'Lam'])560 FP,FPP = G2el.BlenResCW(Tdata,BLtables,parmDict[hfx+'Lam']) 560 561 else: 561 562 FP = np.array([FFtables[El][hfx+'FP'] for El in Tdata]) … … 632 633 FF = np.zeros(len(Tdata)) 633 634 if 'N' in calcControls[hfx+'histType']: 634 FP,FPP = G2el.BlenRes (Tdata,BLtables,parmDict[hfx+'Lam'])635 FP,FPP = G2el.BlenResCW(Tdata,BLtables,parmDict[hfx+'Lam']) 635 636 else: 636 637 FP = np.array([FFtables[El][hfx+'FP'] for El in Tdata]) … … 704 705 FF = np.zeros(len(Tdata)) 705 706 if 'N' in calcControls[hfx+'histType']: 706 FP,FPP = G2el.BlenRes (Tdata,BLtables,parmDict[hfx+'Lam'])707 FP,FPP = G2el.BlenResCW(Tdata,BLtables,parmDict[hfx+'Lam']) 707 708 else: 708 709 FP = np.array([FFtables[El][hfx+'FP'] for El in Tdata]) … … 788 789 789 790 def SCExtinction(ref,phfx,hfx,pfx,calcControls,parmDict,varyList): 790 ''' Single crystal extinction function; puts correction in ref[1 3] and returns791 ''' Single crystal extinction function; puts correction in ref[11] and returns 791 792 corrections needed for derivatives 792 793 ''' … … 1763 1764 for iref,ref in enumerate(refDict['RefList']): 1764 1765 if ref[6] > 0: 1765 dervCor,dervDict = SCExtinction(ref,phfx,hfx,pfx,calcControls,parmDict,varylist) #puts correction in refl[1 3]1766 dervCor,dervDict = SCExtinction(ref,phfx,hfx,pfx,calcControls,parmDict,varylist) #puts correction in refl[11] 1766 1767 w = 1.0/ref[6] 1767 1768 if w*ref[5] >= calcControls['minF/sig']: … … 1789 1790 for iref,ref in enumerate(refDict['RefList']): 1790 1791 if ref[5] > 0.: 1791 dervCor,dervDict = SCExtinction(ref,phfx,hfx,pfx,calcControls,parmDict,varylist) #puts correction in refl[1 3]1792 dervCor,dervDict = SCExtinction(ref,phfx,hfx,pfx,calcControls,parmDict,varylist) #puts correction in refl[11] 1792 1793 Fo = np.sqrt(ref[5]) 1793 1794 Fc = np.sqrt(ref[7]) … … 1904 1905 for iref,ref in enumerate(refDict['RefList']): 1905 1906 if ref[6] > 0: 1906 dervCor,dervDict = SCExtinction(ref,phfx,hfx,pfx,calcControls,parmDict,varylist) #puts correction in refl[1 3]1907 dervCor,dervDict = SCExtinction(ref,phfx,hfx,pfx,calcControls,parmDict,varylist) #puts correction in refl[11] 1907 1908 w = 1.0/ref[6] 1908 1909 if w*ref[5] >= calcControls['minF/sig']: … … 1931 1932 for iref,ref in enumerate(refDict['RefList']): 1932 1933 if ref[5] > 0.: 1933 dervCor,dervDict = SCExtinction(ref,phfx,hfx,pfx,calcControls,parmDict,varylist) #puts correction in refl[1 3]1934 dervCor,dervDict = SCExtinction(ref,phfx,hfx,pfx,calcControls,parmDict,varylist) #puts correction in refl[11] 1934 1935 Fo = np.sqrt(ref[5]) 1935 1936 Fc = np.sqrt(ref[7]) … … 2059 2060 for i,ref in enumerate(refDict['RefList']): 2060 2061 if ref[6] > 0: 2061 SCExtinction(ref,phfx,hfx,pfx,calcControls,parmDict,varylist) #puts correction in refl[1 3]2062 SCExtinction(ref,phfx,hfx,pfx,calcControls,parmDict,varylist) #puts correction in refl[11] 2062 2063 w = 1.0/ref[6] 2063 2064 ref[7] = parmDict[phfx+'Scale']*ref[9] … … 2077 2078 for i,ref in enumerate(refDict['RefList']): 2078 2079 if ref[5] > 0.: 2079 SCExtinction(ref,phfx,hfx,pfx,calcControls,parmDict,varylist) #puts correction in refl[1 3]2080 SCExtinction(ref,phfx,hfx,pfx,calcControls,parmDict,varylist) #puts correction in refl[11] 2080 2081 ref[7] = parmDict[phfx+'Scale']*ref[9] 2081 2082 ref[7] *= ref[11] #correct Fc^2 for extinction -
trunk/imports/G2sfact.py
r1364 r1391 170 170 else: 171 171 # h,k,l,m,dsp,Fo2,sig,Fc2,Fot2,Fct2,phase,... 172 self.RefDict['RefList'].append([h,k,l,0,0,Fo,sigFo,0,Fo,0,0,0 ])172 self.RefDict['RefList'].append([h,k,l,0,0,Fo,sigFo,0,Fo,0,0,0,wave,tbar]) 173 173 if len(self.Banks): 174 174 self.UpdateParameters(Type='SNT',Wave=None) # histogram type -
trunk/imports/G2sfact_CIF.py
r1168 r1391 68 68 69 69 Fsignames = ('_refln_f_meas_sigma','_refln.f_meas_sigma','_refln.f_meas_sigma_au', 70 '_refln_f_sigma', 70 71 ) 71 72 72 73 F2signames = ('_refln_f_squared_meas_sigma','_refln.f_squared_meas_sigma', 74 '_refln_f_squared_sigma', 73 75 ) 74 76 … … 257 259 except: 258 260 HKL.append('.') 259 #h,k,l,m,dsp,Fo2,sig,Fc2,Fot2,Fct2,phase, ...261 #h,k,l,m,dsp,Fo2,sig,Fc2,Fot2,Fct2,phase,Ext 260 262 ref = HKL+[0,0,0,0,0, 0,0,0,0,0, 0] 261 263 if F2dn: … … 310 312 self.RefDict['RefList'] = np.array(self.RefDict['RefList']) 311 313 self.errors = 'Error during reading of dataset parameters' 312 self.UpdateControls(Type='Fosq',FcalcPresent=FcalcPresent) # set Fobs type & if Fcalc values are loaded313 314 if blk.get('_diffrn_radiation_probe'): 314 315 if blk['_diffrn_radiation_probe'] == 'neutron':
Note: See TracChangeset
for help on using the changeset viewer.