Changeset 2877


Ignore:
Timestamp:
Jun 25, 2017 11:23:22 PM (6 years ago)
Author:
toby
Message:

Plot each histogram after fitting in a sequential refinement

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASII.py

    r2871 r2877  
    42594259        dlg.CenterOnParent()
    42604260        try:
    4261             OK,Msg = G2stMn.SeqRefine(self.GSASprojectfile,dlg)     #Msg is Rvals dict if Ok=True
     4261            OK,Msg = G2stMn.SeqRefine(self.GSASprojectfile,dlg,G2plt.SequentialPlotPattern,self)     #Msg is Rvals dict if Ok=True
    42624262        finally:
    42634263            dlg.Update(101.) # forces the Auto_Hide; needed after move w/Win & wx3.0
  • trunk/GSASIIplot.py

    r2871 r2877  
    11811181##### PlotPatterns
    11821182################################################################################
     1183def SequentialPlotPattern(G2frame,refdata,histogram):
     1184    '''This is passed into :func:`GSASIIstrMain.SeqRefine` where it is used to
     1185    provide a plot of the current powder histogram just after a refinement. It
     1186    takes the old refinement information (Rfactors, curve locations, etc.) and
     1187    combines it with the refinement results in refdata and passes that to
     1188    :func:`PlotPatterns`
     1189    '''
     1190    if not histogram.startswith('PWDR'): return
     1191    G2frame.PatternId = G2gd.GetPatternTreeItemId(G2frame, G2frame.root, histogram)
     1192    treedata = G2frame.PatternTree.GetItemPyData(G2frame.PatternId)
     1193    PlotPatterns(G2frame,newPlot=True,plotType='PWDR',data=[treedata[0],refdata])
     1194
    11831195def ReplotPattern(G2frame,newPlot,plotType,PatternName=None,PickName=None):
    11841196    '''This does the same as PlotPatterns except that it expects the information
     
    11961208    PlotPatterns(G2frame,newPlot,plotType)
    11971209
    1198 def PlotPatterns(G2frame,newPlot=False,plotType='PWDR'):
     1210def PlotPatterns(G2frame,newPlot=False,plotType='PWDR',data=None):
    11991211    '''Powder pattern plotting package - displays single or multiple powder patterns as intensity vs
    12001212    2-theta, q or TOF. Can display multiple patterns as "waterfall plots" or contour plots. Log I
     
    12201232        return
    12211233#patch
    1222     data = G2frame.PatternTree.GetItemPyData(G2frame.PatternId)
     1234    if data is None:
     1235        data = G2frame.PatternTree.GetItemPyData(G2frame.PatternId)
    12231236    if 'Offset' not in data[0] and plotType in ['PWDR','SASD','REFD']:     #plot offset data
    12241237        Ymax = max(data[1][1])
  • trunk/GSASIIstrMain.py

    r2876 r2877  
    256256    return [item for item in phaseVary if item.split(':')[0] in pIds]
    257257
    258 def SeqRefine(GPXfile,dlg):
     258def SeqRefine(GPXfile,dlg,PlotFunction=None,G2frame=None):
    259259    '''Perform a sequential refinement -- cycles through all selected histgrams,
    260260    one at a time
     
    410410            IfOK,Rvals,result,covMatrix,sig = RefineCore(Controls,Histo,Phases,restraintDict,
    411411                rigidbodyDict,parmDict,varyList,calcControls,pawleyLookup,ifPrint,printFile,dlg)
     412            if PlotFunction:
     413                PlotFunction(G2frame,Histo[histogram]['Data'],histogram)
    412414   
    413415            print '  wR = %7.2f%%, chi**2 = %12.6g, reduced chi**2 = %6.2f, last delta chi = %.4f'%(
Note: See TracChangeset for help on using the changeset viewer.