Changeset 961 for trunk/GSASIIphsGUI.py


Ignore:
Timestamp:
Jun 20, 2013 11:57:22 AM (9 years ago)
Author:
vondreele
Message:

fix rb constraints - useCount
fix Uij2Ueqv
mods to anneal algorithms
allow save of MC/SA results from one set of runs to another
use flat shading for polyhedra
a callafter in UpdatePDFGrid - may need more
fixes for when RBs defined but not used

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIphsGUI.py

    r953 r961  
    42084208                    resultsGrid.ForceRefresh()
    42094209                    result = Results[r]
    4210                     for key,val in zip(result[4],result[3]):
     4210                    for key,val in zip(result[-1],result[4:-1]):
    42114211                        vals = key.split(':')
    42124212                        nObj,name = int(vals[0]),vals[1]
     
    42344234                    wx.CallAfter(UpdateMCSA)
    42354235                    G2plt.PlotStructure(G2frame,data)
     4236                elif c == 1:
     4237                    if Results[r][1]:
     4238                        Results[r][1] = False
     4239                    else:
     4240                        Results[r][1] = True
     4241                    resultsTable.SetValue(r,c,Results[r][1])
     4242                    resultsGrid.ForceRefresh()
     4243                       
    42364244               
    42374245            resultsSizer = wx.BoxSizer(wx.VERTICAL)
     
    42394247            resultVals = []
    42404248            for result in Results:
    4241                 maxVary = max(maxVary,len(result[3]))
    4242                 resultVals.append(result[:3]+list(result[3]))
     4249                maxVary = max(maxVary,len(result[-1]))
     4250                resultVals.append(result[:-1])
    42434251            rowLabels = []
    42444252            for i in range(len(Results)): rowLabels.append(str(i))
    4245             colLabels = ['Select','Residual','Tmin',]
    4246             for item in result[4]: colLabels.append(item)
    4247 #            for i in range(maxVary): colLabels.append('variable:'+str(i))
    4248             Types = [wg.GRID_VALUE_BOOL,wg.GRID_VALUE_FLOAT+':10,4',
     4253            colLabels = ['Select','Keep','Residual','Tmin',]
     4254            for item in result[-1]: colLabels.append(item)   #from last result from for loop above
     4255            Types = [wg.GRID_VALUE_BOOL,wg.GRID_VALUE_BOOL,wg.GRID_VALUE_FLOAT+':10,4',
    42494256                wg.GRID_VALUE_FLOAT+':10,4',]+maxVary*[wg.GRID_VALUE_FLOAT+':10,5',]
    42504257            resultsTable = G2gd.Table(resultVals,rowLabels=rowLabels,colLabels=colLabels,types=Types)
     
    42554262            for r in range(resultsGrid.GetNumberRows()):
    42564263                for c in range(resultsGrid.GetNumberCols()):
    4257                     if c == 0:
     4264                    if c in [0,1]:
    42584265                        resultsGrid.SetReadOnly(r,c,isReadOnly=False)
    42594266                    else:
     
    43074314        if G2frame.dataFrame.PhaseUserSize is None:
    43084315            mainSizer.FitInside(G2frame.dataFrame)
    4309             Size = mainSizer.GetMinSize()
     4316            Size = mainSizer.Fit()
    43104317            Size[0] += 40
    4311             Size[1] = max(Size[1],290) + 35
     4318            Size[1] = max(Size[1],350) + 35
    43124319            MCSA.SetSize(Size)
    43134320            MCSA.SetScrollbars(10,10,Size[0]/10-4,Size[1]/10-1)
     
    43264333        phaseName = generalData['Name']
    43274334        MCSAdata = data['MCSA']
     4335        saveResult = []
     4336        for result in MCSAdata['Results']:
     4337            if result[1]:       #keep?
     4338                saveResult.append(result)
     4339        MCSAdata['Results'] = saveResult           
    43284340        covData = {}
    43294341        if 'PWDR' in reflName:
     
    43564368        pgbar.SetPosition(wx.Point(screenSize[2]-Size[0]-305,screenSize[1]+5))
    43574369        pgbar.SetSize(Size)
     4370        time1 = time.time()
    43584371        try:
     4372            tsf = 0.
    43594373            for i in range(mcsaControls['Cycles']):
    4360                 MCSAdata['Results'].append(G2mth.mcsaSearch(data,RBdata,reflType,reflData,covData,pgbar))
    4361                 print ' MC/SA runs completed: ',i
     4374                Result,tsum = G2mth.mcsaSearch(data,RBdata,reflType,reflData,covData,pgbar)
     4375                MCSAdata['Results'].append(Result)
     4376                print ' MC/SA runs completed: %d residual: %.3f%%'%(i,100*Result[2])
     4377                tsf += tsum
     4378            print ' MC/SA run time: %.2f'%(time.time()-time1)
     4379            print ' Structure factor time: %.2f'%(tsf)
    43624380        finally:
    43634381            pgbar.Destroy()
     4382        MCSAdata['Results'] = G2mth.sortArray(MCSAdata['Results'],2,reverse=False)
    43644383        UpdateMCSA()
    43654384        G2plt.PlotStructure(G2frame,data)
Note: See TracChangeset for help on using the changeset viewer.