Changeset 4206


Ignore:
Timestamp:
Dec 16, 2019 8:20:02 AM (4 years ago)
Author:
vondreele
Message:

add importer for phase from RMCProfile rmc6f file - structure result from RMC run
implement optional inclusion of isotropic sample broadening (size & mustrain) to formation of RMCProfile .inst file

Location:
trunk
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIphsGUI.py

    r4202 r4206  
    46274627#                    print(data['Histograms'][histoName]['Size'])
    46284628#                    print(data['Histograms'][histoName]['Mustrain'])
    4629                     print(G2pwd.MakeInst(G2frame,pName,PWId)+ ' written')
     4629                    print(G2pwd.MakeInst(G2frame,pName,data,useSamBrd,PWId)+ ' written')
    46304630                    backfile = G2pwd.MakeBack(G2frame,pName,PWId)
    46314631                    if backfile is None:
     
    47644764                    print('RMCProfile file %s not found'%(pName+item))
    47654765#total result plots
    4766             Labels = {'_PDF1.csv':[r'$\mathsf{R,\AA}$','G(R)','RMCprofile G(R) for '],
    4767                 '_SQ1.csv':[r'$\mathsf{Q,\AA^-1}$','S(Q)','RMCprofile S(Q) for '],
    4768                 '_FQ1.csv':[r'$\mathsf{Q,\AA^-1}$','F(Q)','RMCprofile F(Q) for '],
    4769                 '_FT_XFQ1.csv':[r'$\mathsf{R,\AA}$','G(R)','RMCprofile x-ray G(R) for '],
    4770                 '_XFQ1.csv':[r'$\mathsf{Q,\AA^-1}$','F(Q)','RMCprofile x-ray F(Q) for '],
    4771                 '_bragg.csv':[r'$\mathsf{TOF,\mu s}$','Normalized Intensity','RMCprofile bragg for ']}
     4766            Labels = {'_PDF1.csv':[r'$\mathsf{R,\AA}$','G(R)','RMCP G(R) for '],
     4767                '_SQ1.csv':[r'$\mathsf{Q,\AA^-1}$','S(Q)','RMCP S(Q) for '],
     4768                '_FQ1.csv':[r'$\mathsf{Q,\AA^-1}$','F(Q)','RMCP F(Q) for '],
     4769                '_FT_XFQ1.csv':[r'$\mathsf{R,\AA}$','G(R)','RMCP x-ray G(R) for '],
     4770                '_XFQ1.csv':[r'$\mathsf{Q,\AA^-1}$','F(Q)','RMCP x-ray F(Q) for '],
     4771                '_bragg.csv':[r'$\mathsf{TOF,\mu s}$','Normalized Intensity','RMCP bragg for ']}
    47724772            for label in Labels:
    47734773                X = []
     
    47874787                        lines=True,names=Names[1:])
    47884788#partials plots
    4789             Labels = {'_PDFpartials.csv':[r'$\mathsf{R,\AA}$','G(R)','RMCprofile G(R) partials for '],
    4790                 '_SQ1partials.csv':[r'$\mathsf{Q,\AA^-1}$','S(Q)','RMCprofile S(Q) partials for '],
    4791                 '_FQ1partials.csv':[r'$\mathsf{Q,\AA^-1}$','F(Q)','RMCprofile F(Q) partials for ']}
     4789            Labels = {'_PDFpartials.csv':[r'$\mathsf{R,\AA}$','G(R)','RMCP G(R) partials for '],
     4790                '_SQ1partials.csv':[r'$\mathsf{Q,\AA^-1}$','S(Q)','RMCP S(Q) partials for '],
     4791                '_FQ1partials.csv':[r'$\mathsf{Q,\AA^-1}$','F(Q)','RMCP F(Q) partials for ']}
    47924792            for label in Labels:
    47934793                X = []
     
    48084808            X = []
    48094809            Chi = []
    4810             Names = files['.chi2'][0][:-1].split()
    48114810            if len(files['.chi2']) > 2:
     4811                Names = files['.chi2'][0][:-1].split()
    48124812                for line in files['.chi2'][1:]:
    48134813                    items = line[:-1].split()
     
    48184818                XY = [[X.T,Y.T] for Y in Chi]
    48194819                G2plt.PlotXY(G2frame,XY,labelX='no. generated',
    4820                     labelY=r'$\mathsf{\chi^2}$',newPlot=True,Title='RMCProfile Chi^2 for '+pName,
     4820                    labelY=r'$\mathsf{\chi^2}$',newPlot=True,Title='RMCP Chi^2 for '+pName,
    48214821                    lines=True,names=Names[3:])
    48224822           
  • trunk/GSASIIpwd.py

    r4204 r4206  
    20952095################################################################################
    20962096   
    2097 def MakeInst(G2frame,Name,PWId):
     2097def MakeInst(G2frame,Name,Phase,useSamBrd,PWId):
    20982098    PWDdata = G2frame.GetPWDRdatafromTree(PWId)
     2099    histoName = G2frame.GPXtree.GetItemPyData(PWId)[2]
     2100    Size = Phase['Histograms'][histoName]['Size']
     2101    Mustrain = Phase['Histograms'][histoName]['Mustrain']
    20992102    inst = PWDdata['Instrument Parameters'][0]
     2103    Xsb = 0.
     2104    Ysb = 0.
    21002105    if 'T' in inst['Type'][1]:
     2106        difC = inst['DifC'][1]
     2107        if useSamBrd[0]:
     2108            if 'ellipsoidal' not in Size[0]:    #take the isotropic term only
     2109                Xsb = 1.e-4*difC/Size[1][0]
     2110        if useSamBrd[1]:
     2111            if 'generalized' not in Mustrain[0]:    #take the isotropic term only
     2112                Ysb = 1.e-6*difC*Mustrain[1][0]
    21012113        prms = ['Bank',
    21022114                'difC','difA','Zero','2-theta',
     
    21112123        fl.write('%10.3f%10.6f%10.6f\n'%(inst[prms[5]][1],inst[prms[6]][1],inst[prms[7]][1]))
    21122124        fl.write('%10.3f%10.3f%10.3f\n'%(inst[prms[8]][1],inst[prms[9]][1],inst[prms[10]][1]))   
    2113         fl.write('%10.4f%10.3f%10.3f%10.3f%10.3f\n'%(inst[prms[11]][1],inst[prms[12]][1],inst[prms[13]][1],0.0,0.0))
     2125        fl.write('%10.4f%10.3f%10.3f%10.3f%10.3f\n'%(inst[prms[11]][1],inst[prms[12]][1]+Xsb,inst[prms[13]][1]+Ysb,0.0,0.0))
    21142126        fl.close()
    21152127    else:
     2128        if useSamBrd[0]:
     2129            wave = G2mth.getWave(inst)
     2130            if 'ellipsoidal' not in Size[0]:    #take the isotropic term only
     2131                Xsb = 1.8*wave/(np.pi*Size[1][0])
     2132        if useSamBrd[1]:
     2133            if 'generalized' not in Mustrain[0]:    #take the isotropic term only
     2134                Ysb = 0.018*np.pi*Mustrain[1][0]
    21162135        prms = ['Bank',
    21172136                'Lam','Zero','Polariz.',
     
    21242143        fl.write('%10.5f%10.5f%10.4f%10d\n'%(inst[prms[1]][1],inst[prms[2]][1]/100.,inst[prms[3]][1],0))
    21252144        fl.write('%10.3f%10.3f%10.3f\n'%(inst[prms[4]][1],inst[prms[5]][1],inst[prms[6]][1]))
    2126         fl.write('%10.3f%10.3f%10.3f\n'%(inst[prms[7]][1],inst[prms[8]][1],0.0))   
     2145        fl.write('%10.3f%10.3f%10.3f\n'%(inst[prms[7]][1]+Xsb,inst[prms[8]][1]+Ysb,0.0))   
    21272146        fl.write('%10.3f%10.3f%10.3f\n'%(0.0,0.0,0.0))
    21282147        fl.close()
Note: See TracChangeset for help on using the changeset viewer.