Changeset 4666 for trunk/GSASIIstrIO.py


Ignore:
Timestamp:
Dec 1, 2020 12:48:35 PM (11 months ago)
Author:
vondreele
Message:

Add output of resonant neutron scattering lengths for CW powder & single crystal histograms to .lst file

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIstrIO.py

    r4661 r4666  
    365365        FPstr += ' %8.3f'%(FFtables[El][pfx+'FP'])
    366366        FPPstr += ' %8.3f'%(FFtables[El][pfx+'FPP'])
     367    pFile.write(Elstr+'\n')
     368    pFile.write(FPstr+'\n')
     369    pFile.write(FPPstr+'\n')
     370   
     371def PrintBlength(BLtables,wave,pFile):
     372    pFile.write('\n Resonant neutron scattering lengths:\n')
     373    Elstr = ' Element:'
     374    FPstr = " b'     :"
     375    FPPstr = ' b"     :'
     376    for El in BLtables:
     377        BP,BPP = G2el.BlenResCW([El,],BLtables,wave)
     378        Elstr += ' %8s'%(El)
     379        FPstr += ' %8.3f'%(BP)
     380        FPPstr += ' %8.3f'%(BPP)
    367381    pFile.write(Elstr+'\n')
    368382    pFile.write(FPstr+'\n')
     
    27482762    return hapVary,hapDict,controlDict
    27492763   
    2750 def SetHistogramPhaseData(parmDict,sigDict,Phases,Histograms,FFtables,Print=True,pFile=None):
     2764def SetHistogramPhaseData(parmDict,sigDict,Phases,Histograms,calcControls,Print=True,pFile=None):
    27512765    'needs a doc string'
    27522766   
     
    30603074                pFile.write('\n Phase: %s in histogram: %s\n'%(phase,histogram))
    30613075                pFile.write(135*'='+'\n')
     3076                Inst = Histogram['Instrument Parameters'][0]
    30623077                if 'PWDR' in histogram:
    30633078                    pFile.write(' Final refinement RF, RF^2 = %.2f%%, %.2f%% on %d reflections\n'%
     
    30693084                        pFile.write(' Performed LeBail extraction for phase %s in histogram %s\n'%(phase,histogram))
    30703085                    else:
     3086                        # if calcControls != None:    #skipped in seqRefine
     3087                        #     if 'X'in Inst['Type'][0]:
     3088                        #         PrintFprime(calcControls['FFtables'],hfx,pFile)
     3089                        #     elif 'NC' in Inst['Type'][0]:
     3090                        #         PrintBlength(calcControls['BLtables'],Inst['Lam'][1],pFile)
    30713091                        if pfx+'Scale' in PhFrExtPOSig:
    30723092                            wtFr = hapData['Scale'][0]*General['Mass']/wtFrSum[hId]
     
    30913111                   
    30923112                elif 'HKLF' in histogram:
    3093                     Inst = Histogram['Instrument Parameters'][0]
    30943113                    pFile.write(' Final refinement RF, RF^2 = %.2f%%, %.2f%% on %d reflections (%d user rejected, %d sp.gp.extinct)\n'%
    30953114                        (Histogram['Residuals'][pfx+'Rf'],Histogram['Residuals'][pfx+'Rf^2'],Histogram['Residuals'][pfx+'Nref'],
    30963115                        Histogram['Residuals'][pfx+'Nrej'],Histogram['Residuals'][pfx+'Next']))
    3097                     if FFtables != None and 'N' not in Inst['Type'][0]:
    3098                         PrintFprime(FFtables,hfx,pFile)
     3116                    if calcControls != None:    #skipped in seqRefine
     3117                        if 'X'in Inst['Type'][0]:
     3118                            PrintFprime(calcControls['FFtables'],hfx,pFile)
     3119                        elif 'NC' in Inst['Type'][0]:
     3120                            PrintBlength(calcControls['BLtables'],Inst['Lam'][1],pFile)
    30993121                    pFile.write(' HKLF histogram weight factor = %.3f\n'%(Histogram['wtFactor']))
    31003122                    if pfx+'Scale' in ScalExtSig:
     
    33653387    return histVary,histDict,controlDict
    33663388   
    3367 def SetHistogramData(parmDict,sigDict,Histograms,FFtables,Print=True,pFile=None,seq=False):
     3389def SetHistogramData(parmDict,sigDict,Histograms,calcControls,Print=True,pFile=None,seq=False):
    33683390    'Shows histogram data after a refinement'
    33693391   
     
    35683590            if Print:
    35693591                pFile.write(' Instrument type: %s\n'%Sample['Type'])
    3570                 if FFtables != None and 'N' not in Inst['Type'][0]:
    3571                     PrintFprime(FFtables,pfx,pFile)
     3592                if calcControls != None:    #skipped in seqRefine
     3593                    if 'X' in Inst['Type'][0]:
     3594                        PrintFprime(calcControls['FFtables'],pfx,pFile)
     3595                    elif 'NC' in Inst['Type'][0]:
     3596                        PrintBlength(calcControls['BLtables'],Inst['Lam'][1],pFile)
    35723597                PrintSampleParmsSig(Sample,sampSig)
    35733598                PrintInstParmsSig(Inst,instSig)
Note: See TracChangeset for help on using the changeset viewer.