Changeset 1244 for trunk/GSASIIplot.py


Ignore:
Timestamp:
Mar 11, 2014 4:49:15 PM (9 years ago)
Author:
vondreele
Message:

fix geometric correction in integrate - too many 1/cos(2-theta)
plot of size distribution from SASD
MaxEnt? size distribution in operation (some tuning/errors)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIplot.py

    r1237 r1244  
    950950                        Plot.semilogy(X,Y,colors[N%6],picker=False,nonposy='mask')
    951951                    elif 'SASD' in plottype:
    952                         Plot.loglog(X,Y,colors[N%6],picker=False,nonposy='mask')
     952                        Plot.semilogy(X,Y,colors[N%6],picker=False,nonposy='mask')
    953953                else:
    954954                    if 'PWDR' in plottype:
    955955                        Plot.plot(X,Y,colors[N%6],picker=False)
    956956                    elif 'SASD' in plottype:
    957                         Plot.semilogy(X,Y,colors[N%6],picker=False,nonposy='mask')
     957                        Plot.loglog(X,Y,colors[N%6],picker=False,nonposy='mask')
    958958                        Plot.set_ylim(bottom=np.min(np.trim_zeros(Y))/2.,top=np.max(Y)*2.)
    959959            if G2frame.logPlot:
     
    13981398    else:
    13991399        Page.canvas.draw()
     1400       
     1401################################################################################
     1402##### PlotSASDSizeDist
     1403################################################################################
     1404           
     1405def PlotSASDSizeDist(G2frame):
     1406   
     1407    def OnMotion(event):
     1408        xpos = event.xdata
     1409        if xpos:                                        #avoid out of frame mouse position
     1410            ypos = event.ydata
     1411            Page.canvas.SetCursor(wx.CROSS_CURSOR)
     1412            try:
     1413                G2frame.G2plotNB.status.SetStatusText('diameter =%9.5f f(D) =%9.3f'%(ypos,xpos),1)                   
     1414            except TypeError:
     1415                G2frame.G2plotNB.status.SetStatusText('Select Strain pattern first',1)
     1416
     1417    try:
     1418        plotNum = G2frame.G2plotNB.plotList.index('Size Distribution')
     1419        Page = G2frame.G2plotNB.nb.GetPage(plotNum)
     1420        Page.figure.clf()
     1421        Plot = Page.figure.gca()          #get a fresh plot after clf()
     1422    except ValueError:
     1423        newPlot = True
     1424        Plot = G2frame.G2plotNB.addMpl('Size Distribution').gca()
     1425        plotNum = G2frame.G2plotNB.plotList.index('Size Distribution')
     1426        Page = G2frame.G2plotNB.nb.GetPage(plotNum)
     1427        Page.canvas.mpl_connect('motion_notify_event', OnMotion)
     1428    Page.Choice = None
     1429    Page.SetFocus()
     1430    PatternId = G2frame.PatternId
     1431    data = G2frame.PatternTree.GetItemPyData(G2gd.GetPatternTreeItemId(G2frame,PatternId, 'Models'))
     1432    Bins,Dbins,BinMag = data['Size']['Distribution']
     1433    Plot.set_title('Size Distribution')
     1434    Plot.set_xlabel(r'$D, \AA$',fontsize=14)
     1435    Plot.set_ylabel(r'$Volume fraction$',fontsize=14)
     1436    if data['Size']['logBins']:
     1437        Plot.set_xscale("log",nonposy='mask')
     1438        Plot.set_xlim([np.min(2.*Bins)/2.,np.max(2.*Bins)*2.])
     1439    Plot.bar(2.*Bins-Dbins,BinMag,2.*Dbins,facecolor='green')       #plot diameters
     1440    Page.canvas.draw()
    14001441
    14011442################################################################################
Note: See TracChangeset for help on using the changeset viewer.