Changeset 2519


Ignore:
Timestamp:
Nov 9, 2016 2:48:37 PM (5 years ago)
Author:
vondreele
Message:

bug fix in PDF calculations
add option to suppress G(0) ringing in PDF

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIImapvars.py

    r1819 r2519  
    10461046        except KeyError:
    10471047            continue
    1048         parmDict.update(zip(varlist,
    1049                             np.dot(invmultarr,np.array(valuelist)))
    1050                         )
     1048        parmDict.update(zip(varlist,np.dot(invmultarr,np.array(valuelist))))
    10511049
    10521050#======================================================================
  • trunk/GSASIIpwd.py

    r2493 r2519  
    289289    import scipy.fftpack as ft
    290290    Ibeg = np.searchsorted(xydata['Sample'][1][0],limits[0])
    291     Ifin = np.searchsorted(xydata['Sample'][1][0],limits[1])
     291    Ifin = np.searchsorted(xydata['Sample'][1][0],limits[1])+1
    292292    #subtract backgrounds - if any & use PWDR limits
    293293#    GSASIIpath.IPyBreak()
     
    302302            xycontainer += (xydata['Container Bkg.'][1][1][Ibeg:Ifin]+
    303303                data['Container Bkg.']['Add'])*data['Container Bkg.']['Mult']
    304         xydata['IofQ'][1][1] += xycontainer
     304        xydata['IofQ'][1][1] += xycontainer[Ibeg:Ifin]
    305305    #get element data & absorption coeff.
    306306    ElList = data['ElList']
     
    366366    xydata['GofR'] = copy.deepcopy(xydata['FofQ'])
    367367    nR = len(xydata['GofR'][1][1])
    368     xydata['GofR'][1][1] = -dq*np.imag(ft.fft(xydata['FofQ'][1][1],4*nR)[:nR])
    369     xydata['GofR'][1][0] = 0.5*np.pi*np.linspace(0,nR,nR)/qLimits[1]
     368    xydata['GofR'][1][1] = -dq*np.imag(ft.fft(xydata['FofQ'][1][1],8*nR)[:nR])
     369    xydata['GofR'][1][0] = 0.25*np.pi*np.linspace(0,nR,nR)/qLimits[1]
     370    if data.get('noRing',True):
     371        xydata['GofR'][1][1] = np.where(xydata['GofR'][1][0]<0.5,0.,xydata['GofR'][1][1])
    370372    return auxPlot
    371373   
  • trunk/GSASIIpwdGUI.py

    r2514 r2519  
    46474647    if 'BackRatio' not in data:
    46484648        data['BackRatio'] = 0.
     4649    if 'noRing' not in data:
     4650        data['noRing'] = False
    46494651   
    46504652    def FillFileSizer(fileSizer,key):
     
    49064908        SQmin.SetValue('%.1f'%(data['QScaleLim'][0]))
    49074909        auxPlot = ComputePDF(data)
    4908         G2plt.PlotISFG(G2frame,newPlot=True)       
     4910        G2plt.PlotISFG(G2frame,newPlot=True)
     4911       
     4912    def OnNoRing(event):
     4913        data['noRing'] = not data['noRing']
     4914        auxPlot = ComputePDF(data)
     4915        G2plt.PlotISFG(G2frame,newPlot=True)
     4916               
    49094917
    49104918    def GetFileList(fileType):
     
    51675175    sqBox.Add(lorch,0,WACV)
    51685176    sqBox.Add(wx.StaticText(G2frame.dataDisplay,label=' Scaling q-range: '),0,WACV)
    5169     SQmin = wx.TextCtrl(G2frame.dataDisplay,value='%.1f'%(data['QScaleLim'][0]))
     5177    SQmin = wx.TextCtrl(G2frame.dataDisplay,value='%.1f'%(data['QScaleLim'][0]),size=wx.Size(50,20))
    51705178    SQmin.Bind(wx.EVT_TEXT_ENTER,OnSQmin)       
    51715179    SQmin.Bind(wx.EVT_KILL_FOCUS,OnSQmin)   
    51725180    sqBox.Add(SQmin,0)
    51735181    sqBox.Add(wx.StaticText(G2frame.dataDisplay,label=' to '),0,WACV)
    5174     SQmax = wx.TextCtrl(G2frame.dataDisplay,value='%.1f'%(data['QScaleLim'][1]))
     5182    SQmax = wx.TextCtrl(G2frame.dataDisplay,value='%.1f'%(data['QScaleLim'][1]),size=wx.Size(50,20))
    51755183    SQmax.Bind(wx.EVT_TEXT_ENTER,OnSQmax)       
    51765184    SQmax.Bind(wx.EVT_KILL_FOCUS,OnSQmax)
     
    51795187    sqBox.Add(resetQ,0)
    51805188    resetQ.Bind(wx.EVT_CHECKBOX, OnResetQ)
    5181    
     5189    noRing = wx.CheckBox(parent=G2frame.dataDisplay,label='Suppress G(0) ringing?')
     5190    noRing.SetValue(data['noRing'])
     5191    noRing.Bind(wx.EVT_CHECKBOX, OnNoRing)
     5192    sqBox.Add(noRing,0)
    51825193    mainSizer.Add(sqBox,0)
     5194    #Rmax
    51835195
    51845196    mainSizer.Layout()   
Note: See TracChangeset for help on using the changeset viewer.