Changeset 4206 for trunk/GSASIIpwd.py


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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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.