Changeset 2720


Ignore:
Timestamp:
Feb 22, 2017 8:03:59 PM (5 years ago)
Author:
vondreele
Message:

fix crash when plot selected but PWDR item not selected
fix seq results table display of for not Used histograms in phases

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIgrid.py

    r2717 r2720  
    38173817    Dlookup = {} # provides the Ak term for each Dij term (where terms are refined)
    38183818    # N.B. These Dij vars are missing a histogram #
    3819     newCellDict = data[histNames[0]].get('newCellDict',{})
     3819    newCellDict = {}
     3820    for name in histNames:
     3821        newCellDict.update(data[name].get('newCellDict',{}))
     3822#    newCellDict = data[histNames[0]].get('newCellDict',{})
     3823    cellAlist = []
    38203824    for item in newCellDict:
     3825        cellAlist.append(newCellDict[item][0])
    38213826        if item in data['varyList']:
    38223827            ESDlookup[newCellDict[item][0]] = item
     
    39673972            colLabels += [pfx+'Vol']
    39683973            Types += (1+len(uniqCellIndx[pId]))*[wg.GRID_VALUE_FLOAT,]
    3969             for name in histNames:
    3970                 covData = {'varyList': [Dlookup.get(striphist(v),v) for v in data[name]['varyList']],
     3974            Albls = [pfx+'A'+str(i) for i in range(6)]
     3975            for hId,name in enumerate(histNames):
     3976                phfx = '%d:%d:'%(pId,hId)
     3977                esdLookUp = {}
     3978                dLookup = {}
     3979                for item in data[name]['newCellDict']:
     3980                    if phfx+item.split('::')[1] in data[name]['varyList']:
     3981                        esdLookUp[newCellDict[item][0]] = item
     3982                        dLookup[item] = newCellDict[item][0]
     3983                covData = {'varyList': [dLookup.get(striphist(v),v) for v in data[name]['varyList']],
    39713984                    'covMatrix': data[name]['covMatrix']}
    39723985                A = RecpCellTerms[pId][:] # make copy of starting A values
     
    39743987                for i in range(6):
    39753988                    var = str(pId)+'::A'+str(i)
    3976                     if var in ESDlookup:
     3989                    if var in cellAlist:
    39773990                        try:
    3978                             val = data[name]['newCellDict'][ESDlookup[var]][1] # get refined value
     3991                            val = data[name]['newCellDict'][esdLookUp[var]][1] # get refined value
    39793992                            A[i] = val # override with updated value
    39803993                        except KeyError:
    39813994                            A[i] = None
    39823995                # apply symmetry
    3983                 Albls = [pfx+'A'+str(i) for i in range(6)]
    39843996                cellDict = dict(zip(Albls,A))
    39853997                if None in A:
     
    46524664            G2frame.dataFrame.helpKey = G2frame.PatternTree.GetItemText(item) # save name of calling tree item for help
    46534665    if G2frame.PatternTree.GetItemParent(item) == G2frame.root:
    4654         G2frame.PatternId = item
     4666        G2frame.PatternId = 0
    46554667        if G2frame.PatternTree.GetItemText(item) == 'Notebook':
    46564668            SetDataMenuBar(G2frame,G2frame.dataFrame.DataNotebookMenu)
    4657             G2frame.PatternId = 0
    46584669            #for i in G2frame.ExportPattern: i.Enable(False)
    46594670            data = G2frame.PatternTree.GetItemPyData(item)
    46604671            UpdateNotebook(G2frame,data)
    46614672        elif G2frame.PatternTree.GetItemText(item) == 'Controls':
    4662             G2frame.PatternId = 0
    46634673            #for i in G2frame.ExportPattern: i.Enable(False)
    46644674            data = G2frame.PatternTree.GetItemPyData(item)
     
    47114721            G2plt.PlotPowderLines(G2frame)
    47124722        elif G2frame.PatternTree.GetItemText(item).startswith('PWDR '):
     4723            G2frame.PatternId = item
    47134724            #for i in G2frame.ExportPattern: i.Enable(True)
    47144725            if G2frame.EnablePlot:
    47154726                UpdatePWHKPlot(G2frame,'PWDR',item)
    47164727        elif G2frame.PatternTree.GetItemText(item).startswith('SASD '):
     4728            G2frame.PatternId = item
    47174729            #for i in G2frame.ExportPattern: i.Enable(True)
    47184730            if G2frame.EnablePlot:
Note: See TracChangeset for help on using the changeset viewer.