Changeset 4806 for trunk


Ignore:
Timestamp:
Feb 8, 2021 3:32:39 PM (2 years ago)
Author:
vondreele
Message:

remove bigSizer from UpdatePWHKPlot - use mainSizer = vertical box sizer. Fixed bug in UpdateLimits? where GUI got wrong sizer shape. BHT fix might make this go away?
Implement new PWDR plot command 'X' to show/hide excluded data, etc. Uses masks.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIdataGUI.py

    r4803 r4806  
    85258525        G2frame.dataWindow.ClearData()
    85268526    #G2frame.dataWindow.GetSizer() # don't use this since may be wx.HORIZONTAL or wx.VERTICAL
    8527     bigSizer = wx.BoxSizer(wx.HORIZONTAL)
    85288527    mainSizer = wx.BoxSizer(wx.VERTICAL)
    85298528    mainSizer.Add((5,5),)
    85308529    wtSizer = wx.BoxSizer(wx.HORIZONTAL)
     8530    wtSizer.Add(G2G.HelpButton(G2frame.dataWindow,helpIndex=G2frame.dataWindow.helpKey))
    85318531    wtSizer.Add(wx.StaticText(G2frame.dataWindow,-1,' Weight factor: '),0,WACV)
    85328532    wtSizer.Add(G2G.ValidatedTxtCtrl(G2frame.dataWindow,data[0],'wtFactor',nDig=(10,3),xmin=1.e-9),0,WACV)
     
    85398539#        comp.Bind(wx.EVT_COMBOBOX, OnCompression)
    85408540#        wtSizer.Add(comp,0,WACV)
     8541
    85418542    mainSizer.Add(wtSizer)
    85428543    wtSizer = wx.BoxSizer(wx.HORIZONTAL)
     
    86388639        mainSizer.Add(mSizer)
    86398640       
    8640     bigSizer.Add(mainSizer)   
    8641     bigSizer.Add(G2G.HelpButton(G2frame.dataWindow,helpIndex=kind))
    8642     G2frame.dataWindow.SetSizer(bigSizer)
     8641    G2frame.dataWindow.SetSizer(mainSizer)
    86438642   
    86448643    G2frame.GPXtree.SetItemPyData(item,data)
  • trunk/GSASIIplot.py

    r4804 r4806  
    321321        self.toolbar = GSASIItoolbar(self.canvas,publish=publish)
    322322        self.toolbar.Realize()
    323         self.plotStyle = {'qPlot':False,'dPlot':False,'sqrtPlot':False,'sqPlot':False,'logPlot':False}
     323        self.plotStyle = {'qPlot':False,'dPlot':False,'sqrtPlot':False,'sqPlot':False,'logPlot':False,'exclude':False}
    324324       
    325325        sizer=wx.BoxSizer(wx.VERTICAL)
     
    17791779        elif event.key == 'e' and plottype in ['SASD','REFD']:
    17801780            G2frame.ErrorBars = not G2frame.ErrorBars
     1781        elif event.key == 'x'and 'PWDR' in plottype:
     1782            Page.plotStyle['exclude'] = not Page.plotStyle['exclude']
    17811783        elif event.key == '.':
    17821784            Page.plotStyle['WgtDiagnostic'] = not Page.plotStyle.get('WgtDiagnostic',False)
     
    28632865            Page.Choice = [' key press',
    28642866                'a: add magnification region','b: toggle subtract background',
    2865                 'c: contour on','g: toggle grid','m: toggle multidata plot',
    2866                 'n: toggle log(I)',]
     2867                'c: contour on','x: toggle excluded regions','g: toggle grid',
     2868                'm: toggle multidata plot','n: toggle log(I)',]
    28672869            if obsInCaption:
    28682870                Page.Choice += ['o: remove obs, calc,... from legend',]
     
    31493151            else:
    31503152                Y = xye[1]*Sample['Scale'][0]*(1.05)**NoffY
     3153        if Page.plotStyle['exclude']:
     3154            Y = ma.array(Y,mask=ma.getmask(X))
     3155               
    31513156        if LimitId and ifpicked:
    31523157            limits = np.array(G2frame.GPXtree.GetItemPyData(LimitId))
     
    32523257                BackLine = None
    32533258                DifLine = [None]
     3259                if 'PWDR' in plottype and Page.plotStyle['exclude']:
     3260                    Emask = ma.getmask(ma.masked_less_equal(xye[3],0.))
     3261                    Xum = ma.array(Xum,mask=Emask)
     3262                    X = ma.array(X,mask=Emask)
     3263                    Y = ma.array(Y,mask=Emask)
     3264                    Z = ma.array(Z,mask=Emask)
     3265                    W = ma.array(W,mask=Emask)
     3266
    32543267                if G2frame.Weight:
    32553268                    Plot1.set_yscale("linear")                                                 
     
    32593272                    else:
    32603273                        DZ = (xye[1]-xye[3])*np.sqrt(wtFactor*xye[2])
     3274                        if Page.plotStyle['exclude']:
     3275                            DZ = ma.array(DZ,mask=Emask)
    32613276                    DifLine = Plot1.plot(X,DZ,colors[3],
    32623277                        picker=True,pickradius=1.,label=incCptn('diff'))                    #(Io-Ic)/sig(Io)
    32633278                    Plot1.axhline(0.,color='k')
    3264 
     3279                   
    32653280                if Page.plotStyle['logPlot']:
    32663281                    if 'PWDR' in plottype:
Note: See TracChangeset for help on using the changeset viewer.