Changeset 2051


Ignore:
Timestamp:
Nov 13, 2015 4:36:21 PM (6 years ago)
Author:
toby
Message:

address crash on selecting Q steps (now capitalized): change all CallAfter? to CallLater? for UpdateImageControls? calls

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIimage.py

    r2045 r2051  
    865865    if 'log(q)' in data['binType']:
    866866        lutth = np.log(4.*np.pi*npsind(LUtth/2.)/data['wavelength'])
    867     elif 'q' == data['binType']:
     867    elif 'Q' == data['binType']:
    868868        lutth = 4.*np.pi*npsind(LUtth/2.)/data['wavelength']
    869869    elif '2-theta' in data['binType']:
     
    913913            if 'log(q)' in data['binType']:
    914914                tay = np.log(4.*np.pi*npsind(tay/2.)/data['wavelength'])
    915             elif 'q' == data['binType']:
     915            elif 'Q' == data['binType']:
    916916                tay = 4.*np.pi*npsind(tay/2.)/data['wavelength']
    917917            t0 = time.time()
     
    930930    if 'log(q)' in data['binType']:
    931931        H2 = 2.*npasind(np.exp(H2)*data['wavelength']/(4.*np.pi))
    932     elif 'q' == data['binType']:
     932    elif 'Q' == data['binType']:
    933933        H2 = 2.*npasind(H2*data['wavelength']/(4.*np.pi))
    934934    if Dazm:       
  • trunk/GSASIIimgGUI.py

    r2026 r2051  
    120120    def OnRecalibrate(event):
    121121        G2img.ImageRecalibrate(G2frame,data,masks)
    122         wx.CallAfter(UpdateImageControls,G2frame,data,masks)
     122        wx.CallLater(100,UpdateImageControls,G2frame,data,masks)
    123123       
    124124    def OnClearCalib(event):
     
    343343                data.update(save)
    344344                G2frame.PatternTree.SetItemPyData(G2gd.GetPatternTreeItemId(G2frame,G2frame.Image, 'Image Controls'),copy.deepcopy(data))
    345                 wx.CallAfter(UpdateImageControls,G2frame,data,masks)
     345                wx.CallLater(100,UpdateImageControls,G2frame,data,masks)
    346346                G2plt.PlotExposedImage(G2frame,event=event)
    347347               
     
    362362                data['SampleAbs'][0] = -np.log(data['SampleAbs'][0])  #switch from trans to muT!
    363363                if data['binType'] == 'log(q)': data['binType'] = '2-theta'  #switch default bin type                 
    364             wx.CallAfter(UpdateImageControls,G2frame,data,masks)
     364            wx.CallLater(100,UpdateImageControls,G2frame,data,masks)
    365365   
    366366        def OnNewColorBar(event):
     
    531531        def OnNewBinType(event):
    532532            data['binType'] = binSel.GetValue()
    533             wx.CallAfter(UpdateImageControls,G2frame,data,masks)
     533            wx.CallLater(100,UpdateImageControls,G2frame,data,masks)
    534534       
    535535        def OnIOtth(event):
     
    538538            if Ltth > Utth:
    539539                Ltth,Utth = Utth,Ltth
    540             if 'q' in data['binType']:
     540            if 'Q' in data['binType']:
    541541                data['IOtth'] = [2.*asind(Ltth*wave/(4.*math.pi)),2.*asind(Utth*wave/(4.*math.pi))]
    542542            else:
     
    631631                data['fullIntegrate'] = True
    632632                data['LRazimuth'] = [Lazm,Lazm+360]
    633             wx.CallAfter(UpdateImageControls,G2frame,data,masks)
     633            wx.CallLater(100,UpdateImageControls,G2frame,data,masks)
    634634            G2plt.PlotExposedImage(G2frame,event=event)
    635635           
     
    670670        dataSizer.Add((5,0),0)
    671671        if 'PWDR' in data['type']:
    672             binChoice = ['2-theta','q']
     672            binChoice = ['2-theta','Q']
    673673        elif 'SASD' in data['type']:
    674             binChoice = ['2-theta','q','log(q)']
     674            binChoice = ['2-theta','Q','log(q)']
    675675        dataSizer.Add(wx.StaticText(parent=G2frame.dataDisplay,label=' Bin style: Constant step bins in'),0,WACV)           
    676676        binSel = wx.ComboBox(parent=G2frame.dataDisplay,value=data['binType'],choices=binChoice,
     
    679679        dataSizer.Add(binSel,0,WACV)
    680680        binType = '2-theta'
    681         if 'q' in data['binType']:
    682             binType = 'q'
     681        if 'q' in data['binType'].lower():
     682            binType = 'Q'
    683683        dataSizer.Add(wx.StaticText(parent=G2frame.dataDisplay,label=' Inner/Outer '+binType),0,WACV)           
    684684        IOtth = data['IOtth'][:]
    685         if 'q' in data['binType']:
     685        if 'Q' in data['binType']:
    686686            wave = data['wavelength']
    687687            IOtth = [4.*math.pi*sind(IOtth[0]/2.)/wave,4.*math.pi*sind(IOtth[1]/2.)/wave]
Note: See TracChangeset for help on using the changeset viewer.