Ignore:
Timestamp:
Jun 24, 2018 5:54:25 PM (5 years ago)
Author:
toby
Message:

add weight fractions when phase fractions are constrained

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIdataGUI.py

    r3447 r3448  
    68876887    G2frame.colList += zip(*vals)
    68886888    G2frame.colSigs += zip(*esds)
     6889    # tabulate constrained variables, removing histogram numbers if needed
     6890    # from parameter label
     6891    depValDict = {}
     6892    depSigDict = {}
     6893    for name in histNames:
     6894        for var in data[name].get('depParmDict',{}):
     6895            val,sig = data[name]['depParmDict'][var]
     6896            svar = striphist(var,'*')
     6897            if svar not in depValDict:
     6898               depValDict[svar] = [val]
     6899               depSigDict[svar] = [sig]
     6900            else:
     6901               depValDict[svar].append(val)
     6902               depSigDict[svar].append(sig)
     6903   
     6904    # add the dependent constrained variables to the table
     6905    for var in sorted(depValDict):
     6906        if len(depValDict[var]) != len(histNames): continue
     6907        colLabels.append(var)
     6908        Types += [wg.GRID_VALUE_FLOAT+':10,5',]
     6909        G2frame.colSigs += [depSigDict[var]]
     6910        G2frame.colList += [depValDict[var]]
     6911
     6912    # add refined atom parameters to table
     6913    colLabels += sorted(atomLookup.keys())
     6914    for parm in sorted(atomLookup):
     6915        G2frame.colList += [[data[name]['newAtomDict'][atomLookup[parm]][1] for name in histNames]]
     6916        Types += [wg.GRID_VALUE_FLOAT+':10,5',]
     6917        if atomLookup[parm] in data[histNames[0]]['varyList']:
     6918            col = data[histNames[0]]['varyList'].index(atomLookup[parm])
     6919            G2frame.colSigs += [[data[name]['sig'][col] for name in histNames]]
     6920        else:
     6921            G2frame.colSigs += [None]
     6922           
    68896923    # compute and add weight fractions to table if varied
    68906924    for phase in Phases:
    68916925        var = str(Phases[phase]['pId'])+':*:Scale'
    6892         if var not in combinedVaryList: continue
     6926        if var not in combinedVaryList+depValDict.keys(): continue
    68936927        wtFrList = []
    68946928        sigwtFrList = []
     
    69156949        G2frame.colSigs += [sigwtFrList]
    69166950               
    6917     # tabulate constrained variables, removing histogram numbers if needed
    6918     # from parameter label
    6919     depValDict = {}
    6920     depSigDict = {}
    6921     for name in histNames:
    6922         for var in data[name].get('depParmDict',{}):
    6923             val,sig = data[name]['depParmDict'][var]
    6924             svar = striphist(var,'*')
    6925             if svar not in depValDict:
    6926                depValDict[svar] = [val]
    6927                depSigDict[svar] = [sig]
    6928             else:
    6929                depValDict[svar].append(val)
    6930                depSigDict[svar].append(sig)
    6931     # add the dependent constrained variables to the table
    6932     for var in sorted(depValDict):
    6933         if len(depValDict[var]) != len(histNames): continue
    6934         colLabels.append(var)
    6935         Types += [wg.GRID_VALUE_FLOAT+':10,5',]
    6936         G2frame.colSigs += [depSigDict[var]]
    6937         G2frame.colList += [depValDict[var]]
    6938 
    6939     # add atom parameters to table
    6940     colLabels += sorted(atomLookup.keys())
    6941     for parm in sorted(atomLookup):
    6942         G2frame.colList += [[data[name]['newAtomDict'][atomLookup[parm]][1] for name in histNames]]
    6943         Types += [wg.GRID_VALUE_FLOAT+':10,5',]
    6944         if atomLookup[parm] in data[histNames[0]]['varyList']:
    6945             col = data[histNames[0]]['varyList'].index(atomLookup[parm])
    6946             G2frame.colSigs += [[data[name]['sig'][col] for name in histNames]]
    6947         else:
    6948             G2frame.colSigs += [None]
    69496951    # evaluate Pseudovars, their ESDs and add them to grid
    69506952    for expr in data['SeqPseudoVars']:
Note: See TracChangeset for help on using the changeset viewer.