Changeset 1229 for trunk/GSASIIphsGUI.py
- Timestamp:
- Feb 25, 2014 9:40:27 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/GSASIIphsGUI.py
r1228 r1229 4829 4829 4830 4830 def OnPawleyEstimate(event): 4831 #Algorithm thanks to James Hester 4831 4832 try: 4832 4833 Refs = data['Pawley ref'] … … 4835 4836 G2frame.ErrorDialog('Pawley estimate','No histograms defined for this phase') 4836 4837 return 4837 HistoNames = Histograms.keys() 4838 Vst = 1.0/data['General']['Cell'][7] #Get volume 4839 HistoNames = filter(lambda a:Histograms[a]['Use']==True,Histograms.keys()) 4838 4840 PatternId = G2gd.GetPatternTreeItemId(G2frame,G2frame.root,HistoNames[0]) 4839 4841 xdata = G2frame.PatternTree.GetItemPyData(PatternId)[1] … … 4843 4845 posCorr = Inst['Zero'][1] 4844 4846 const = 9.e-2/(np.pi*Sample['Gonio. radius']) #shifts in microns 4847 gconst = 2.35482 # sqrt(8 ln 2) 4845 4848 4846 4849 wx.BeginBusyCursor() … … 4855 4858 indx = np.searchsorted(xdata[0],pos) 4856 4859 try: 4857 FWHM = max(0.001,G2pwd.getFWHM(pos,Inst))/2. 4858 dx = xdata[0][indx+1]-xdata[0][indx] 4859 ref[6] = FWHM*(xdata[1][indx]-xdata[4][indx])*cosd(pos/2.)**3/dx 4860 FWHM = max(0.001,G2pwd.getFWHM(pos,Inst))/100.0 4861 # We want to estimate Pawley F^2 as a drop-in replacement for F^2 calculated by the structural 4862 # routines, which use Icorr * F^2 * peak profile, where peak profile has an area of 1. So 4863 # we multiply the observed peak height by sqrt(8 ln 2)/(FWHM*sqrt(pi)) to determine the value of Icorr*F^2 4864 # then divide by Icorr to get F^2. 4865 ref[6] = (xdata[1][indx]-xdata[4][indx])*gconst/(FWHM*np.sqrt(np.pi)) #Area of Gaussian is height * FWHM * sqrt(pi) 4860 4866 Lorenz = 1./(2.*sind(xdata[0][indx]/2.)**2*cosd(xdata[0][indx]/2.)) #Lorentz correction 4861 4867 pola = 1.0 4862 4868 if 'X' in Inst['Type']: 4863 4869 pola,dIdPola = G2pwd.Polarization(Inst['Polariz.'][1],xdata[0][indx],Inst['Azimuth'][1]) 4864 ref[6] /= (Lorenz*pola*ref[3]) 4870 else: 4871 pola = 1.0 4872 # Include histo scale and volume in calculation 4873 ref[6] /= (Sample['Scale'][0] * Vst * Lorenz * pola * ref[3]) 4865 4874 except IndexError: 4866 4875 pass
Note: See TracChangeset
for help on using the changeset viewer.