Changeset 2561 for trunk/GSASIIpwdGUI.py


Ignore:
Timestamp:
Dec 6, 2016 10:43:26 AM (5 years ago)
Author:
vondreele
Message:

add Rmax to PDF Controls; default = 100.; will not be exact
PDF always generates 5000 points for 0-Rmax; independent of chosen Qmax or image binning.
Trap attempt to calculate PDF without chemical formula - now get error message.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIpwdGUI.py

    r2560 r2561  
    47684768    if 'noRing' not in data:
    47694769        data['noRing'] = False
     4770    if 'Rmax' not in data:
     4771        data['Rmax'] = 100.
    47704772   
    47714773    def FillFileSizer(fileSizer,key):
     
    50165018        wx.CallAfter(OnComputePDF,None)
    50175019       
     5020    def OnRmax(event):
     5021        event.Skip()
     5022        try:
     5023            value = float(rmax.GetValue())
     5024            if value > 200. or value < 10.:
     5025                raise ValueError
     5026        except ValueError:
     5027            value = data['Rmax']
     5028        data['Rmax'] = value
     5029        rmax.SetValue('%.1f'%(value))
     5030        wx.CallAfter(OnComputePDF,None)
     5031       
    50185032    def OnResetQ(event):
    50195033        resetQ.SetValue(False)
     
    51575171    def OnComputePDF(event):
    51585172#        print 'Calculating PDF:'
     5173        if not data['ElList']:
     5174            G2frame.ErrorDialog('PDF error','Chemical formula not defined')
     5175            return
    51595176        auxPlot = ComputePDF(data)
    51605177#        print 'Done calculating PDF:'
     
    51815198                if 'PDF' in Name.split()[0]:
    51825199                    Data = G2frame.PatternTree.GetItemPyData(G2gd.GetPatternTreeItemId(G2frame,id,'PDF Controls'))
     5200                    if not Data['ElList']:
     5201                        G2frame.ErrorDialog('PDF error','Chemical formula not defined for \n'+Name)
     5202                        return
    51835203                    ComputePDF(Data)                   
    51845204                id, cookie = G2frame.PatternTree.GetNextChild(G2frame.root, cookie)
     
    53295349   
    53305350    sqBox = wx.BoxSizer(wx.HORIZONTAL)
     5351    sqBox.Add(wx.StaticText(G2frame.dataDisplay,label=' Scaling q-range: '),0,WACV)
     5352    SQmin = wx.TextCtrl(G2frame.dataDisplay,value='%.1f'%(data['QScaleLim'][0]),size=wx.Size(50,20))
     5353    SQmin.Bind(wx.EVT_KILL_FOCUS,OnSQmin)   
     5354    SQmin.Bind(wx.EVT_TEXT_ENTER,OnSQmin)       
     5355    sqBox.Add(SQmin,0,WACV)
     5356    sqBox.Add(wx.StaticText(G2frame.dataDisplay,label=' to Qmax '),0,WACV)
     5357    SQmax = wx.TextCtrl(G2frame.dataDisplay,value='%.1f'%(data['QScaleLim'][1]),size=wx.Size(50,20))
     5358    SQmax.Bind(wx.EVT_KILL_FOCUS,OnSQmax)
     5359    SQmax.Bind(wx.EVT_TEXT_ENTER,OnSQmax)       
     5360    sqBox.Add(SQmax,0,WACV)
     5361    resetQ = wx.CheckBox(parent=G2frame.dataDisplay,label='Reset?')
     5362    sqBox.Add(resetQ,0,WACV)
     5363    resetQ.Bind(wx.EVT_CHECKBOX, OnResetQ)
     5364    sqBox.Add(wx.StaticText(G2frame.dataDisplay,label=' Rmax: '),0,WACV)
     5365    rmax = wx.TextCtrl(G2frame.dataDisplay,value='%.1f'%(data['Rmax']),size=wx.Size(50,20))
     5366    rmax.Bind(wx.EVT_KILL_FOCUS,OnRmax)
     5367    rmax.Bind(wx.EVT_TEXT_ENTER,OnRmax)       
     5368    sqBox.Add(rmax,0,WACV)
    53315369    lorch = wx.CheckBox(parent=G2frame.dataDisplay,label='Lorch damping?')
    53325370    lorch.SetValue(data['Lorch'])
    53335371    lorch.Bind(wx.EVT_CHECKBOX, OnLorch)
    53345372    sqBox.Add(lorch,0,WACV)
    5335     sqBox.Add(wx.StaticText(G2frame.dataDisplay,label=' Scaling q-range: '),0,WACV)
    5336     SQmin = wx.TextCtrl(G2frame.dataDisplay,value='%.1f'%(data['QScaleLim'][0]),size=wx.Size(50,20))
    5337     SQmin.Bind(wx.EVT_TEXT_ENTER,OnSQmin)       
    5338     SQmin.Bind(wx.EVT_KILL_FOCUS,OnSQmin)   
    5339     sqBox.Add(SQmin,0)
    5340     sqBox.Add(wx.StaticText(G2frame.dataDisplay,label=' to Qmax '),0,WACV)
    5341     SQmax = wx.TextCtrl(G2frame.dataDisplay,value='%.1f'%(data['QScaleLim'][1]),size=wx.Size(50,20))
    5342     SQmax.Bind(wx.EVT_TEXT_ENTER,OnSQmax)       
    5343     SQmax.Bind(wx.EVT_KILL_FOCUS,OnSQmax)
    5344     sqBox.Add(SQmax,0)
    5345     resetQ = wx.CheckBox(parent=G2frame.dataDisplay,label='Reset?')
    5346     sqBox.Add(resetQ,0)
    5347     resetQ.Bind(wx.EVT_CHECKBOX, OnResetQ)
    53485373    noRing = wx.CheckBox(parent=G2frame.dataDisplay,label='Suppress G(0) ringing?')
    53495374    noRing.SetValue(data['noRing'])
Note: See TracChangeset for help on using the changeset viewer.