Changeset 5636 for trunk/GSASIIplot.py


Ignore:
Timestamp:
Jul 27, 2023 6:21:18 PM (4 months ago)
Author:
toby
Message:

add autobackground feature; scale fixed bkg points by mag factors

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIplot.py

    r5629 r5636  
    40674067        G2frame.MagLines = magMarkers
    40684068    if PickId and G2frame.GPXtree.GetItemText(PickId) == 'Background':
     4069        mag2th = [0]+[x for x,m in data[0].get('Magnification',[])][1:]
     4070        magmult = [m for x,m in data[0].get('Magnification',[])]
    40694071        # plot fixed background points
    40704072        backDict = G2frame.GPXtree.GetItemPyData(G2gd.GetGPXtreeItemId(G2frame,G2frame.PatternId, 'Background'))[1]
     
    40744076            Parms = None
    40754077        for x,y in backDict.get('FixedPoints',[]):
     4078            if magmult:
     4079                mult = magmult[np.searchsorted(mag2th, x, side = 'right')-1]
     4080            else:
     4081                mult = 1.
    40764082            # "normal" intensity modes only!
    40774083            if G2frame.SubBack or G2frame.Weight or G2frame.Contour or not G2frame.SinglePlot:
     
    40914097                else:
    40924098                    break
    4093             Plot.plot(x,y,'rD',clip_on=Clip_on,picker=True,pickradius=10.)
     4099            Plot.plot(x,y*mult,'rD',clip_on=Clip_on,picker=True,pickradius=10.)
    40944100
    40954101    # plot the partials. TODO: get partials to show up in publication plot
Note: See TracChangeset for help on using the changeset viewer.