Changeset 1498 for trunk/GSASIIgrid.py


Ignore:
Timestamp:
Sep 16, 2014 4:20:57 PM (7 years ago)
Author:
vondreele
Message:

try to implement drag/drop of tree items - commented out as it doesn't work
add 'ShowCell?' to Controls to avoid cell errors for sequential single peak fitting when normal sequential refinement has been done
fix a neg. peak width error

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIgrid.py

    r1496 r1498  
    29212921        self.AutoSearch = self.PeakEdit.Append(help='Automatic peak search',
    29222922            id=wxID_AUTOSEARCH, kind=wx.ITEM_NORMAL,text='Auto search')
    2923         self.PeakCopy = self.PeakEdit.Append(help='Copy peaks to other histograms',
    2924             id=wxID_PEAKSCOPY, kind=wx.ITEM_NORMAL,text='Peak copy')
    29252923        self.UnDo = self.PeakEdit.Append(help='Undo last least squares refinement',
    29262924            id=wxID_UNDO, kind=wx.ITEM_NORMAL,text='UnDo')
     
    29292927        self.PFOneCycle = self.PeakEdit.Append(id=wxID_LSQONECYCLE, kind=wx.ITEM_NORMAL,text='Peakfit one cycle',
    29302928            help='One cycle of Peak fitting' )
     2929        self.PeakEdit.Append(id=wxID_RESETSIGGAM, kind=wx.ITEM_NORMAL,
     2930            text='Reset sig and gam',help='Reset sigma and gamma to global fit' )
     2931        self.PeakCopy = self.PeakEdit.Append(help='Copy peaks to other histograms',
     2932            id=wxID_PEAKSCOPY, kind=wx.ITEM_NORMAL,text='Peak copy')
    29312933        self.SeqPeakFit = self.PeakEdit.Append(id=wxID_SEQPEAKFIT, kind=wx.ITEM_NORMAL,text='Seq PeakFit',
    29322934            help='Sequential Peak fitting for all histograms' )
    2933         wxID_PEAKSCOPY
    2934         self.PeakEdit.Append(id=wxID_RESETSIGGAM, kind=wx.ITEM_NORMAL,
    2935             text='Reset sig and gam',help='Reset sigma and gamma to global fit' )
    29362935        self.PeakEdit.Append(id=wxID_CLEARPEAKS, kind=wx.ITEM_NORMAL,text='Clear peaks',
    29372936            help='Clear the peak list' )
     
    32843283        self.TextureEdit = wx.Menu(title='')
    32853284        self.TextureMenu.Append(menu=self.TextureEdit, title='Texture')
    3286         self.TextureEdit.Append(id=wxID_REFINETEXTURE, kind=wx.ITEM_NORMAL,text='Refine texture',
    3287             help='Refine the texture coefficients from sequential Pawley results')
     3285#        self.TextureEdit.Append(id=wxID_REFINETEXTURE, kind=wx.ITEM_NORMAL,text='Refine texture',
     3286#            help='Refine the texture coefficients from sequential Pawley results')
    32883287        self.TextureEdit.Append(id=wxID_CLEARTEXTURE, kind=wx.ITEM_NORMAL,text='Clear texture',
    32893288            help='Clear the texture coefficients' )
     
    47314730        Types += [wg.GRID_VALUE_FLOAT+':10,3',]
    47324731    # add % change in Chi^2 in last cycle
    4733     if histNames[0][:4] not in ['SASD','IMG ']:
     4732    if histNames[0][:4] not in ['SASD','IMG '] and Controls['ShowCell']:
    47344733        colList += [[100.*data[name]['Rvals'].get('DelChi2',-1) for name in histNames]]
    47354734        colSigs += [None]
     
    47444743        Types += [wg.GRID_VALUE_FLOAT,]
    47454744    # add unique cell parameters
    4746     for pId in sorted(RecpCellTerms):
    4747         pfx = str(pId)+'::' # prefix for A values from phase
    4748         cells = []
    4749         cellESDs = []
    4750         colLabels += [pfx+cellUlbl[i] for i in uniqCellIndx[pId]]
    4751         colLabels += [pfx+'Vol']
    4752         Types += (1+len(uniqCellIndx[pId]))*[wg.GRID_VALUE_FLOAT,]
    4753         for name in histNames:
    4754             covData = {
    4755                 'varyList': [Dlookup.get(striphist(v),v) for v in data[name]['varyList']],
    4756                 'covMatrix': data[name]['covMatrix']
    4757                 }
    4758             A = RecpCellTerms[pId][:] # make copy of starting A values
    4759             # update with refined values
    4760             for i in range(6):
    4761                 var = str(pId)+'::A'+str(i)
    4762                 if var in ESDlookup:
    4763                     val = data[name]['newCellDict'][ESDlookup[var]][1] # get refined value
    4764                     A[i] = val # override with updated value
    4765             # apply symmetry
    4766             Albls = [pfx+'A'+str(i) for i in range(6)]
    4767             cellDict = dict(zip(Albls,A))
    4768             A,zeros = G2stIO.cellFill(pfx,SGdata[pId],cellDict,zeroDict[pId])
    4769             # convert to direct cell & add only unique values to table
    4770             c = G2lat.A2cell(A)
    4771             vol = G2lat.calc_V(A)
    4772             cE = G2stIO.getCellEsd(pfx,SGdata[pId],A,covData)
    4773             cells += [[c[i] for i in uniqCellIndx[pId]]+[vol]]
    4774             cellESDs += [[cE[i] for i in uniqCellIndx[pId]]+[cE[-1]]]
    4775         colList += zip(*cells)
    4776         colSigs += zip(*cellESDs)
     4745    if Controls['ShowCell']:
     4746        for pId in sorted(RecpCellTerms):
     4747            pfx = str(pId)+'::' # prefix for A values from phase
     4748            cells = []
     4749            cellESDs = []
     4750            colLabels += [pfx+cellUlbl[i] for i in uniqCellIndx[pId]]
     4751            colLabels += [pfx+'Vol']
     4752            Types += (1+len(uniqCellIndx[pId]))*[wg.GRID_VALUE_FLOAT,]
     4753            for name in histNames:
     4754                covData = {
     4755                    'varyList': [Dlookup.get(striphist(v),v) for v in data[name]['varyList']],
     4756                    'covMatrix': data[name]['covMatrix']
     4757                    }
     4758                A = RecpCellTerms[pId][:] # make copy of starting A values
     4759                # update with refined values
     4760                for i in range(6):
     4761                    var = str(pId)+'::A'+str(i)
     4762                    if var in ESDlookup:
     4763                        val = data[name]['newCellDict'][ESDlookup[var]][1] # get refined value
     4764                        A[i] = val # override with updated value
     4765                # apply symmetry
     4766                Albls = [pfx+'A'+str(i) for i in range(6)]
     4767                cellDict = dict(zip(Albls,A))
     4768                A,zeros = G2stIO.cellFill(pfx,SGdata[pId],cellDict,zeroDict[pId])
     4769                # convert to direct cell & add only unique values to table
     4770                c = G2lat.A2cell(A)
     4771                vol = G2lat.calc_V(A)
     4772                cE = G2stIO.getCellEsd(pfx,SGdata[pId],A,covData)
     4773                cells += [[c[i] for i in uniqCellIndx[pId]]+[vol]]
     4774                cellESDs += [[cE[i] for i in uniqCellIndx[pId]]+[cE[-1]]]
     4775            colList += zip(*cells)
     4776            colSigs += zip(*cellESDs)
    47774777    # add the variables that were refined; change from rows to columns
    47784778    colList += zip(*[data[name]['variables'] for name in histNames])
     
    48234823            G2mv.InitVars()
    48244824            parmDict = data[name].get('parmDict')
    4825             if parmDict:
     4825            if parmDict and Controls['ShowCell']:
    48264826                constraintInfo = data[name].get('constraintInfo',[[],[],{},[],seqnum])
    48274827                groups,parmlist,constrDict,fixedList,ihst = constraintInfo
     
    51595159            data = G2frame.PatternTree.GetItemPyData(item)
    51605160            UpdateSeqResults(G2frame,data)
    5161         elif G2frame.PatternTree.GetItemText(item) == 'Small Angle Sequential results':
    5162             data = G2frame.PatternTree.GetItemPyData(item)
    5163             UpdateSASDSeqResults(G2frame,data)
    51645161        elif G2frame.PatternTree.GetItemText(item) == 'Covariance':
    51655162            data = G2frame.PatternTree.GetItemPyData(item)
Note: See TracChangeset for help on using the changeset viewer.