Changeset 2493 for trunk/GSASIIpwd.py


Ignore:
Timestamp:
Oct 17, 2016 10:30:33 AM (5 years ago)
Author:
vondreele
Message:

add display of phase weight fraction to DData tab

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIpwd.py

    r2481 r2493  
    6262npT2q = lambda tth,wave: 2.0*np.pi*npT2stl(tth,wave)    #=2pi*d*
    6363ateln2 = 8.0*math.log(2.0)
    64    
     64
     65################################################################################
     66#### Powder utilities
     67################################################################################
     68
     69def PhaseWtSum(G2frame,histo):
     70    '''
     71    Calculate sum of phase mass*shase fraction for PWDR data (exclude magnetic phases)
     72   
     73    :param G2frame: GSASII main frame structure
     74    :param str histo: histogram name
     75    :returns sum(scale*mass) for phases in histo
     76    '''
     77    Histograms,Phases = G2frame.GetUsedHistogramsAndPhasesfromTree()
     78    wtSum = 0.0
     79    for phase in Phases:
     80        if Phases[phase]['General']['Type'] != 'magnetic':
     81            if histo in Phases[phase]['Histograms']:
     82                mass = Phases[phase]['General']['Mass']
     83                phFr = Phases[phase]['Histograms'][histo]['Scale'][0]
     84                wtSum += mass*phFr
     85    return wtSum
     86   
     87################################################################################
    6588#GSASII pdf calculation routines
     89################################################################################
    6690       
    6791def Transmission(Geometry,Abs,Diam):
Note: See TracChangeset for help on using the changeset viewer.