Changeset 5045


Ignore:
Timestamp:
Oct 8, 2021 1:24:20 PM (20 months ago)
Author:
vondreele
Message:

Add plotting of results after a PDFfit run.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIphsGUI.py

    r5043 r5045  
    60946094                    # TODO: better to create this in a new terminal on Linux
    60956095                    subp.Popen(['/bin/bash','pdffit2.sh'])
     6096                   
    60966097           
    60976098    def OnStopRMC(event):
     
    64726473            RMCPdict = data['RMC']['PDFfit']
    64736474            pName = generalData['Name'].replace(' ','_')
    6474             print(data['RMC']['PDFfit'])
    6475             print('PDFfit plots under construction')
     6475            Labels = [r'$\mathsf{R,\AA}$','G(R)','PDFfit2 G(R) for ']
     6476            files = RMCPdict['files']
     6477            for file in files:
     6478                if 'Select' not in files[file][0]:
     6479                    XY = np.empty((1,2))
     6480                    start = 0
     6481                    while XY.shape[0] == 1:
     6482                        try:
     6483                            XY = np.loadtxt(files[file][0],skiprows=start)
     6484                        except ValueError:
     6485                            start += 1
     6486                    if 'Neutron' in file:
     6487                        cname = pName+'-PDFfitN.fgr'
     6488                    else:
     6489                        cname = pName+'-PDFfitX.fgr'
     6490                    XYobs = XY.T[:2]
     6491                    XY = np.empty((1,2))
     6492                    start = 0
     6493                    while XY.shape[0] == 1:
     6494                        try:
     6495                            XY = np.loadtxt(cname,skiprows=start)
     6496                        except ValueError:
     6497                            start += 1
     6498                    XYcalc = XY.T[:2]
     6499                    XYdiff = np.zeros_like(XYcalc)
     6500                    XYdiff[0] = XYcalc[0]
     6501                    ibeg = np.searchsorted(XYobs[0],XYdiff[0][0])
     6502                    ifin = ibeg+XYcalc.shape[1]
     6503                    XYdiff[1] = XYobs[1][ibeg:ifin]-XYcalc[1]
     6504                    offset = 1.1*(np.max(XYdiff[1])-np.min(XYcalc[1]))
     6505                    XYdiff[1] -= offset
     6506                    G2plt.PlotXY(G2frame,[XYobs,],XY2=[XYcalc,XYdiff],labelX=Labels[0],
     6507                        labelY=Labels[1],newPlot=True,Title=Labels[2]+files[file][0],
     6508                        lines=False,names=['G(R) obs','G(R) calc','diff',])
    64766509           
    64776510    def OnRunISODISTORT(event):
Note: See TracChangeset for help on using the changeset viewer.