Changeset 3906 for trunk/GSASIIpwdGUI.py


Ignore:
Timestamp:
Apr 16, 2019 9:39:40 PM (4 years ago)
Author:
toby
Message:

implement fixed backgound file in Riteveld Fit; show Rietveld & peak fits with bkg file added to calc bkg, not subtracted

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIpwdGUI.py

    r3886 r3906  
    286286    bxye = np.zeros(len(xye[1]))
    287287    if 'BackFile' in Pattern[0]:
    288         backfile,mult = Pattern[0]['BackFile']
     288        backfile,mult = Pattern[0]['BackFile'][:2]
    289289        if backfile:
    290290            bId = G2gd.GetGPXtreeItemId(G2frame,G2frame.root,backfile)
     
    15651565        def OnBackPWDR(event):
    15661566            data[1]['background PWDR'][0] = back.GetValue()
     1567            if  data[1]['background PWDR'][0]:
     1568                curHist = G2frame.GPXtree.GetItemPyData(G2frame.PatternId)
     1569                Id = G2gd.GetGPXtreeItemId(G2frame,G2frame.root,data[1]['background PWDR'][0])
     1570                if not Id:
     1571                    G2G.G2MessageBox(G2frame,'Histogram not found -- how did this happen?','Missing histogram')
     1572                    back.SetValue('')
     1573                    data[1]['background PWDR'][0] = back.GetValue()
     1574                    return
     1575                bkgHist = G2frame.GPXtree.GetItemPyData(Id)
     1576                if len(bkgHist[1][0]) != len(curHist[1][0]):
     1577                    G2G.G2MessageBox(G2frame,'Histogram have different lengths','Mismatched histograms')
     1578                    back.SetValue('')
     1579                    data[1]['background PWDR'][0] = back.GetValue()
     1580                    return
    15671581            G2plt.PlotPatterns(G2frame,plotType='PWDR')
    15681582       
     
    15701584        fileSizer.Add(wx.StaticText(G2frame.dataWindow,-1,' Fixed background file:'),0,WACV)
    15711585        if 'background PWDR' not in data[1]:
    1572             data[1]['background PWDR'] = ['',-1.]
     1586            data[1]['background PWDR'] = ['',-1.,False]
    15731587        backSizer = wx.BoxSizer(wx.HORIZONTAL)
    15741588        Choices = ['',]+G2gd.GetGPXtreeDataNames(G2frame,['PWDR',])
Note: See TracChangeset for help on using the changeset viewer.