Changeset 1300 for trunk/GSASIIplot.py


Ignore:
Timestamp:
Apr 25, 2014 12:47:06 PM (9 years ago)
Author:
vondreele
Message:

Add additional column to SASD profile - contains fixed background
remove contour plotting from SASD data
Add background file to SASD models GUI
this change breaks old SASD gpx files, they will need to be recreated!

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIplot.py

    r1297 r1300  
    450450        elif event.key == 'e' and 'SASD' in plottype:
    451451            G2frame.ErrorBars = not G2frame.ErrorBars
    452         elif event.key == 'b' and 'PWDR' in plottype:
     452        elif event.key == 'b':
    453453            G2frame.SubBack = not G2frame.SubBack
    454454            if not G2frame.SubBack:
     
    479479            G2frame.Cmax = 1.0
    480480            G2frame.Offset = [0,0]
    481         elif event.key == 'c':
     481        elif event.key == 'c' and 'PWDR' in plottype:
    482482            newPlot = True
    483483            G2frame.Contour = not G2frame.Contour
     
    766766                    'c: contour on','q: toggle q plot','s: toggle single plot','+: no selection')
    767767            elif 'SASD' in plottype:
    768                 Page.Choice = (' key press','c: contour on','n: semilog on',
     768                Page.Choice = (' key press','b: toggle subtract background','n: semilog on',
    769769                    'd: offset down','l: offset left','r: offset right','u: offset up','o: reset offset',
    770770                    'q: toggle S(q) plot','s: toggle single plot','+: no selection')
     
    775775                    'q: toggle q plot','s: toggle single plot','w: toggle divide by sig','+: no selection')
    776776            elif 'SASD' in plottype:
    777                 Page.Choice = (' key press','c: contour on','n: loglog on','e: toggle error bars',
     777                Page.Choice = (' key press','b: toggle subtract background','n: loglog on','e: toggle error bars',
    778778                    'd: offset down','l: offset left','r: offset right','u: offset up','o: reset offset',
    779779                    'q: toggle S(q) plot','s: toggle single plot','+: no selection')
     
    896896            Y = xye[1]+offset*N
    897897        elif 'SASD' in plottype:
     898            B = xye[5]
    898899            if G2frame.sqPlot:
    899900                Y = xye[1]*Sample['Scale'][0]*(1.005)**(offset*N)*X**4
     
    934935                elif 'SASD' in plottype:
    935936                    if G2frame.sqPlot:
    936                         D = xye[4]*X**4
     937                        W = xye[4]*X**4
    937938                        Z = xye[3]*X**4
     939                        B = B*X**4
    938940                    else:
    939                         D = xye[4]
     941                        W = xye[4]
     942                    if G2frame.SubBack:
     943                        YB = Y-B
     944                        ZB = Z
     945                    else:
     946                        YB = Y
     947                        ZB = Z+B
    940948                    Plot.set_yscale("log",nonposy='mask')
    941949                    Plot.set_ylim(bottom=np.min(np.trim_zeros(Y))/2.,top=np.max(Y)*2.)
     
    951959                        if G2frame.ErrorBars:
    952960                            if G2frame.sqPlot:
    953                                 Plot.errorbar(X,Y,yerr=X**4*Sample['Scale'][0]*np.sqrt(1./(Pattern[0]['wtFactor']*xye[2])),
     961                                Plot.errorbar(X,YB,yerr=X**4*Sample['Scale'][0]*np.sqrt(1./(Pattern[0]['wtFactor']*xye[2])),
    954962                                    ecolor=colors[N%6],picker=3.,clip_on=False)
    955963                            else:
    956                                 Plot.errorbar(X,Y,yerr=Sample['Scale'][0]*np.sqrt(1./(Pattern[0]['wtFactor']*xye[2])),
     964                                Plot.errorbar(X,YB,yerr=Sample['Scale'][0]*np.sqrt(1./(Pattern[0]['wtFactor']*xye[2])),
    957965                                    ecolor=colors[N%6],picker=3.,clip_on=False)
    958966                        else:
    959                             Plot.plot(X,Y,colors[N%6]+'+',picker=3.,clip_on=False)
    960                         Plot.plot(X,D,colors[(N+2)%6],picker=False)
    961                         Plot.plot(X,Z,colors[(N+1)%6],picker=False)
     967                            Plot.plot(X,YB,colors[N%6]+'+',picker=3.,clip_on=False)
     968                        Plot.plot(X,W,colors[(N+2)%6],picker=False)
     969                        Plot.plot(X,ZB,colors[(N+1)%6],picker=False)
    962970                elif G2frame.Weight and 'PWDR' in plottype:
    963971                    DY = xye[1]*np.sqrt(xye[2])
     
    970978                    Plot.axhline(0.,color=wx.BLACK)
    971979                else:
    972                     if G2frame.SubBack and 'PWDR' in plottype:
     980                    if G2frame.SubBack:
    973981                        Plot.plot(Xum,Y-W,colors[N%6]+'+',picker=3.,clip_on=False)
    974982                        Plot.plot(X,Z-W,colors[(N+1)%6],picker=False)
     
    981989                    if 'PWDR' in plottype:
    982990                        Plot.plot(X,W,colors[(N+2)%6],picker=False)
    983                     Plot.plot(X,D,colors[(N+3)%6],picker=False)
     991                        Plot.plot(X,D,colors[(N+3)%6],picker=False)
    984992                    Plot.axhline(0.,color=wx.BLACK)
    985993                Page.canvas.SetToolTipString('')
Note: See TracChangeset for help on using the changeset viewer.