Changeset 3906 for trunk/GSASIIplot.py


Ignore:
Timestamp:
Apr 16, 2019 9:39:40 PM (3 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/GSASIIplot.py

    r3900 r3906  
    27512751        PlotList = [Pattern,]
    27522752        PId = G2gd.GetGPXtreeItemId(G2frame,G2frame.PatternId, 'Background')
    2753         Pattern[0]['BackFile'] = ['',-1.0]
     2753        Pattern[0]['BackFile'] = ['',-1.0,False]
    27542754        if PId:
    2755             Pattern[0]['BackFile'] =  G2frame.GPXtree.GetItemPyData(PId)[1].get('background PWDR',['',-1.0])
     2755            Pattern[0]['BackFile'] =  G2frame.GPXtree.GetItemPyData(PId)[1].get('background PWDR',['',-1.0,False])
    27562756        Parms,Parms2 = G2frame.GPXtree.GetItemPyData(G2gd.GetGPXtreeItemId(G2frame,
    27572757            G2frame.PatternId, 'Instrument Parameters'))
     
    27862786                Page.plotStyle.update({'Offset':[0.0,0.0],'delOffset':0.02*Ymax,'refOffset':-0.1*Ymax,'refDelt':0.1*Ymax,})
    27872787            PId = G2gd.GetGPXtreeItemId(G2frame,G2frame.PatternId, 'Background')
    2788             Pattern[0]['BackFile'] = ['',-1.0]
     2788            Pattern[0]['BackFile'] = ['',-1.0,False]
    27892789            if PId:
    2790                 Pattern[0]['BackFile'] =  G2frame.GPXtree.GetItemPyData(PId)[1].get('background PWDR',['',-1.0])
     2790                Pattern[0]['BackFile'] =  G2frame.GPXtree.GetItemPyData(PId)[1].get('background PWDR',['',-1.0,False])
    27912791            PlotList.append(Pattern)
    27922792            ParmList.append(G2frame.GPXtree.GetItemPyData(G2gd.GetGPXtreeItemId(G2frame,
     
    28052805    for ip,Pattern in enumerate(PlotList):
    28062806        xye = Pattern[1]
    2807         bxye = G2pdG.GetFileBackground(G2frame,xye,Pattern)
     2807        #bxye = G2pdG.GetFileBackground(G2frame,xye,Pattern)
    28082808        if xye[1] is None: continue
    2809         if Ymax is None: Ymax = max(xye[1]+bxye)
    2810         Ymax = max(Ymax,max(xye[1]+bxye))
     2809        if Ymax is None: Ymax = max(xye[1])
     2810        Ymax = max(Ymax,max(xye[1]))
    28112811    if Ymax is None: return # nothing to plot
    28122812    offsetX = Page.plotStyle['Offset'][1]
     
    28802880        xye = np.array(ma.getdata(Pattern[1])) # strips mask
    28812881        xye0 = Pattern[1][0]  # keeps mask
    2882         bxye = G2pdG.GetFileBackground(G2frame,xye,Pattern)
     2882        #bxye = G2pdG.GetFileBackground(G2frame,xye,Pattern)
    28832883        if PickId:
    28842884            ifpicked = Pattern[2] == G2frame.GPXtree.GetItemText(PatternId)
     
    29532953            if Page.plotStyle['sqrtPlot']:
    29542954                olderr = np.seterr(invalid='ignore') #get around sqrt(-ve) error
    2955                 Y = np.where(xye[1]+bxye>=0.,np.sqrt(xye[1]+bxye),-np.sqrt(-xye[1]-bxye))+bxye+NoffY*Ymax/100.0
     2955                Y = np.where(xye[1]>=0.,np.sqrt(xye[1]),-np.sqrt(-xye[1]))+NoffY*Ymax/100.0
    29562956                np.seterr(invalid=olderr['invalid'])
    29572957            elif 'PWDR' in plottype and G2frame.SinglePlot and not (
    29582958                Page.plotStyle['logPlot'] or Page.plotStyle['sqrtPlot'] or G2frame.Contour):
    2959                 Y = xye[1]*multArray+bxye+NoffY*Ymax/100.0
     2959                Y = xye[1]*multArray+NoffY*Ymax/100.0
    29602960            else:
    2961                 Y = xye[1]+bxye+NoffY*Ymax/100.0
     2961                Y = xye[1]+NoffY*Ymax/100.0
    29622962        elif plottype in ['SASD','REFD']:
    29632963            if plottype == 'SASD':
Note: See TracChangeset for help on using the changeset viewer.