Changeset 3712


Ignore:
Timestamp:
Oct 30, 2018 8:50:07 AM (3 years ago)
Author:
vondreele
Message:

add new configuration item: PDF_Rmax maximum radius for G(r) calculations; rarely changed by user
Change PDF GUI Rmax to be for the max r for G(r) plot - no longer r max for calculation
This speeds up optimization
Fix problems with PDF peak table - principally the rowlabels needed to be str not int - crashed wx 4.0 & gave bizarre effects in wx 3.

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIplot.py

    r3681 r3712  
    41044104            del Peaks['Peaks'][lineNo-2]
    41054105        G2frame.itemPicked = None
    4106         G2pdG.UpdatePDFPeaks(G2frame,Peaks,data)
    4107         PlotISFG(G2frame,data,peaks=Peaks,newPlot=False)
     4106        wx.CallAfter(G2pdG.UpdatePDFPeaks,G2frame,Peaks,data)
     4107        wx.CallAfter(PlotISFG,G2frame,data,peaks=Peaks,newPlot=False)
    41084108
    41094109    # PlotISFG continues here
     
    41724172        Plot.set_xlabel(r'r,$\AA$',fontsize=14)
    41734173        Plot.set_ylabel(r'G(r), $\AA^{-2}$',fontsize=14)
     4174        if lim is not None:
     4175            lim[0] = list([lim[0][0],data['Rmax']])
     4176            Plot.set_xlim(lim[0])
    41744177    else:
    41754178        Plot.set_xlabel(r'$Q,\AA^{-1}$',fontsize=14)
     
    42754278                Yb = [0.,-10.*np.pi*numbDen]
    42764279                Plot.plot(Xb,Yb,color='k',dashes=(5,5))
     4280                Plot.set_xlim([0.,PDFdata['Rmax']])
    42774281            elif plotType == 'F(Q)':
    42784282                Plot.axhline(0.,color='k')
  • trunk/GSASIIpwd.py

    r3565 r3712  
    373373    xydata['GofR'] = copy.deepcopy(xydata['FofQ'])
    374374    nR = len(xydata['GofR'][1][1])
    375     mul = int(round(2.*np.pi*nR/(data.get('Rmax',100.)*qLimits[1])))
     375    Rmax = GSASIIpath.GetConfigValue('PDF_Rmax',100.)
     376    mul = int(round(2.*np.pi*nR/(Rmax*qLimits[1])))
     377#    mul = int(round(2.*np.pi*nR/(data.get('Rmax',100.)*qLimits[1])))
    376378    xydata['GofR'][1][0] = 2.*np.pi*np.linspace(0,nR,nR,endpoint=True)/(mul*qLimits[1])
    377379    xydata['GofR'][1][1] = -dq*np.imag(fft.fft(xydata['FofQ'][1][1],mul*nR)[:nR])
  • trunk/GSASIIpwdGUI.py

    r3709 r3712  
    65076507        sqBox.Add(resetQ,0,WACV)
    65086508        resetQ.Bind(wx.EVT_BUTTON, OnResetQ)
    6509         sqBox.Add(wx.StaticText(G2frame.dataWindow,label=' Rmax: '),0,WACV)
     6509        sqBox.Add(wx.StaticText(G2frame.dataWindow,label=' Plot Rmax: '),0,WACV)
    65106510        rmax = G2G.ValidatedTxtCtrl(G2frame.dataWindow,data,'Rmax',nDig=(10,1),min=10.,max=200.,
    65116511            typeHint=float,OnLeave=AfterChangeNoRefresh,size=wx.Size(50,20))
     
    65806580            G2frame.ErrorDialog('Nothing to copy controls to','There must be more than one "PDF" pattern')
    65816581            return
    6582         od = {'label_1':'Only refine flag','value_1':False}
     6582        od = {'label_1':'Only refine flag','value_1':False,'label_2':'Only Lorch flag','value_2':False}
    65836583        dlg = G2G.G2MultiChoiceDialog(G2frame,'Copy PDF controls','Copy controls from '+Source+' to:',TextList,extraOpts=od)
    65846584        try:
     
    65906590                    if od['value_1']:
    65916591                        olddata['Sample Bkg.']['Refine'] = data['Sample Bkg.']['Refine']    #only one flag
     6592                    elif od['value_2']:
     6593                        olddata['Lorch'] = data['Lorch']    #only one flag                       
    65926594                    else:
    65936595                        sample = olddata['Sample']
     
    66896691            G2plt.PlotISFG(G2frame,data,newPlot=True,plotType='G(R)')
    66906692        else:
    6691             G2plt.PlotISFG(G2frame,data,newPlot=False)
     6693            G2plt.PlotISFG(G2frame,data,newPlot=True)
    66926694       
    66936695    def OnComputeAllPDF(event):
     
    68626864            peaks['Background'][2] = refbk.GetValue()
    68636865       
    6864         backBox = wx.wx.BoxSizer(wx.HORIZONTAL)
     6866        backBox = wx.BoxSizer(wx.HORIZONTAL)
    68656867        backBox.Add(wx.StaticText(G2frame.dataWindow,label=' Background slope: '),0,WACV)
    68666868        slope = G2G.ValidatedTxtCtrl(G2frame.dataWindow,peaks['Background'][1],1,nDig=(10,3),
     
    69036905        Types = 3*[wg.GRID_VALUE_FLOAT+':10,3',]+[wg.GRID_VALUE_CHOICE+': ,P,M,S,PM,PS,MS,PMS',]+     \
    69046906            2*[wg.GRID_VALUE_STRING,]+[wg.GRID_VALUE_FLOAT+':10,3',]
    6905         rowLabels = range(len(peaks['Peaks']))
     6907        rowLabels = [str(i) for i in range(len(peaks['Peaks']))]
    69066908        peakTable = G2G.Table(peaks['Peaks'],rowLabels=rowLabels,colLabels=colLabels,types=Types)
    69076909        PDFPeaks = G2G.GSGrid(G2frame.dataWindow)
    6908         PDFPeaks.SetTable(peakTable,False)
    6909         PDFPeaks.SetMargins(0,0)
    6910         PDFPeaks.SetRowLabelSize(40)
     6910        PDFPeaks.SetTable(peakTable,True)
    69116911        PDFPeaks.AutoSizeColumns(False)
    69126912        PDFPeaks.Bind(wg.EVT_GRID_LABEL_LEFT_DCLICK, PeaksRefine)
  • trunk/config_example.py

    r3388 r3712  
    193193line colors in order of obs., calc., back., diff., color5 & color6 separated by spaces; 6 items required.
    194194'''
     195
     196PDF_Rmax = 100.
     197'''Maximum radius for G(r) calculations: range is from 10-200A; default is 100A
     198'''
Note: See TracChangeset for help on using the changeset viewer.