Changeset 3070 for trunk/GSASIIplot.py


Ignore:
Timestamp:
Sep 13, 2017 8:53:49 AM (4 years ago)
Author:
vondreele
Message:

implement use of background pattern for PWDR data.
Used for plot & peak fitting; not Rietveld refinement
fix background parm copy issue - needed deepcopy

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIplot.py

    r3066 r3070  
    19711971        Pattern.append(G2frame.GPXtree.GetItemText(PatternId))
    19721972        PlotList = [Pattern,]
     1973        Pattern[0]['BackFile'] =  G2frame.GPXtree.GetItemPyData(G2gd.GetGPXtreeItemId(G2frame,G2frame.PatternId, 'Background'))[1].get('background PWDR',['',-1.0])
    19731974        Parms,Parms2 = G2frame.GPXtree.GetItemPyData(G2gd.GetGPXtreeItemId(G2frame,
    19741975            G2frame.PatternId, 'Instrument Parameters'))
     
    19941995                Ymax = max(Pattern[1][1])
    19951996                Pattern[0].update({'Offset':[0.0,0.0],'delOffset':0.02*Ymax,'refOffset':-0.1*Ymax,'refDelt':0.1*Ymax,})
     1997            Pattern[0]['BackFile'] =  G2frame.GPXtree.GetItemPyData(G2gd.GetGPXtreeItemId(G2frame,G2frame.PatternId, 'Background'))[1].get('background PWDR',['',-1.0])
    19961998            PlotList.append(Pattern)
    19971999            ParmList.append(G2frame.GPXtree.GetItemPyData(G2gd.GetGPXtreeItemId(G2frame,
     
    20032005    for Pattern in PlotList:
    20042006        xye = Pattern[1]
     2007        bxye = G2pdG.GetFileBackground(G2frame,xye,Pattern)
    20052008        if xye[1] is None: continue
    2006         if Ymax is None: Ymax = max(xye[1])
    2007         Ymax = max(Ymax,max(xye[1]))
     2009        if Ymax is None: Ymax = max(xye[1]+bxye)
     2010        Ymax = max(Ymax,max(xye[1]+bxye))
    20082011    if Ymax is None: return # nothing to plot
    20092012    offsetX = Pattern[0]['Offset'][1]
     
    20622065        LimitId = 0
    20632066        if Pattern[1] is None: continue # skip over uncomputed simulations
    2064         xye = ma.array(ma.getdata(Pattern[1]))
     2067#        xye = ma.array(ma.getdata(Pattern[1]))
     2068        xye = np.array(ma.getdata(Pattern[1]))
     2069        bxye = G2pdG.GetFileBackground(G2frame,xye,Pattern)
    20652070        if PickId:
    20662071            ifpicked = Pattern[2] == G2frame.GPXtree.GetItemText(PatternId)
     
    20812086            if G2frame.plotStyle['sqrtPlot']:
    20822087                olderr = np.seterr(invalid='ignore') #get around sqrt(-ve) error
    2083                 Y = np.where(xye[1]>=0.,np.sqrt(xye[1]),-np.sqrt(-xye[1]))
     2088                Y = np.where(xye[1]+bxye>=0.,np.sqrt(xye[1]+bxye),-np.sqrt(-xye[1]-bxye))
    20842089                np.seterr(invalid=olderr['invalid'])
    20852090            else:
    2086                 Y = xye[1]+offsetY*N*Ymax/100.0
     2091                Y = xye[1]+bxye+offsetY*N*Ymax/100.0
    20872092        elif plottype in ['SASD','REFD']:
    20882093            if plottype == 'SASD':
Note: See TracChangeset for help on using the changeset viewer.