Changeset 2197 for trunk/GSASIIphsGUI.py


Ignore:
Timestamp:
Apr 6, 2016 4:14:46 PM (6 years ago)
Author:
vondreele
Message:

replace pyd files for binwin2.7 & binwin64-2.7
implement new pyGetSpc routine for PWDR simulations - checked against DIFFaX
Add a transition probability normalizer button
change transition plots from DCLICK to CLICK - much nicer
invoke G2frame.G2plotNB.RaisePageNoRefresh?(Page) in a number of places to get plots to appear on demand
fix layer plotting issues after normal structure plots made

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIphsGUI.py

    r2195 r2197  
    26572657                    Obj.SetCellValue(Xi,5,'')
    26582658                    G2plt.PlotLayers(G2frame,Layers,[Yi,Xi,],plotDefaults)
     2659                else:
     2660                    event.Skip()
     2661                   
     2662            def OnNormProb(event):
     2663                for Yi,Yname in enumerate(Names):
     2664                    Psum = 0.
     2665                    for Xi,Xname in enumerate(Names):
     2666                        Psum += transArray[Yi][Xi][0]
     2667                    if not Psum:
     2668                        transArray[Yi][0][0] = 1.0
     2669                        Psum = 1.0
     2670                    for Xi,Xname in enumerate(Names):
     2671                        transArray[Yi][Xi][0] /= Psum
     2672                wx.CallAfter(UpdateLayerData)
    26592673           
    26602674            transSizer = wx.BoxSizer(wx.VERTICAL)
    2661             transSizer.Add(wx.StaticText(layerData,label=' Layer-Layer transition probabilities:'),0,WACV)
     2675            topSizer = wx.BoxSizer(wx.HORIZONTAL)
     2676            topSizer.Add(wx.StaticText(layerData,label=' Layer-Layer transition probabilities: '),0,WACV)
     2677            normprob = wx.CheckBox(layerData,label=' Normalize probabilities?')
     2678            normprob.Bind(wx.EVT_CHECKBOX,OnNormProb)
     2679            topSizer.Add(normprob,0,WACV)
     2680            transSizer.Add(topSizer,0,WACV)
    26622681            Names = [layer['Name'] for layer in Layers['Layers']]
    26632682            transArray = Layers['Transitions']
     
    26842703                    attr.SetEditor(G2G.GridFractionEditor(transGrid))
    26852704                    transGrid.SetColAttr(c, attr)
    2686                 transGrid.Bind(wg.EVT_GRID_CELL_LEFT_DCLICK, PlotSelect)
     2705                transGrid.Bind(wg.EVT_GRID_CELL_LEFT_CLICK, PlotSelect)
    26872706                transGrid.AutoSizeColumns(True)
    26882707                transSizer.Add(transGrid)
     
    29262945        dlg = G2gd.DIFFaXcontrols(G2frame,ctrls)
    29272946        if dlg.ShowModal() == wx.ID_OK:
    2928             ctrls,plane,lmax,x,x,x = dlg.GetSelection()
    2929             data['Layers']['Sadp'] = {}
    2930             data['Layers']['Sadp']['Plane'] = plane
    2931             data['Layers']['Sadp']['Lmax'] = lmax
     2947            simCodes = dlg.GetSelection()
    29322948        else:
    29332949            return
    2934         if ctrls == '0\n0\n3\n':    #powder pattern
     2950        if 'PWDR' in  simCodes[0]:    #powder pattern
     2951            data['Layers']['selInst'] = simCodes[1]
    29352952            UseList = []
    29362953            for item in data['Histograms']:
     
    29632980            profile = G2frame.PatternTree.GetItemPyData(G2frame.PatternId)[1]
    29642981            dlg.Destroy()       
    2965             G2pwd.StackSim(data['Layers'],ctrls,HistName,scale,background,limits,inst,profile)
    2966             G2pwd.CalcStackingPWDR(data['Layers'],HistName,scale,background,limits,inst,profile)
     2982            ctrls = '0\n0\n3\n'
     2983            G2pwd.StackSim(data['Layers'],ctrls,scale,background,limits,inst,profile)
     2984            test1 = np.copy(profile[3])
     2985            test1 = np.where(test1,test1,1.0)
     2986            G2pwd.CalcStackingPWDR(data['Layers'],scale,background,limits,inst,profile)
     2987            test2 = np.copy(profile[3])
     2988            rat = (test1-test2)/test1
     2989#            GSASIIpath.IPyBreak()
    29672990            G2plt.PlotPatterns(G2frame,plotType='PWDR')
    29682991        else:   #selected area
     2992            data['Layers']['Sadp'] = {}
     2993            data['Layers']['Sadp']['Plane'] = simCodes[1]
     2994            data['Layers']['Sadp']['Lmax'] = simCodes[2]
     2995#            planeChoice = ['h0l','0kl','hhl','h-hl',]
     2996#            lmaxChoice = [str(i+1) for i in range(6)]
     2997#            ctrls = '0\n0\n4\n1\n%d\n1\n16\n1\n%d\n0\nend\n'%    \
     2998#                (planeChoice.index(simCodes[1])+1,lmaxChoice.index(simCodes[2])+1)
    29692999#            G2pwd.StackSim(data['Layers'],ctrls)
    29703000            G2pwd.CalcStackingSADP(data['Layers'])
     
    29773007        dlg = G2gd.DIFFaXcontrols(G2frame,ctrls,Parms)
    29783008        if dlg.ShowModal() == wx.ID_OK:
    2979             ctrls,plane,lmax,mult,parm,parmRange,parmStep = dlg.GetSelection()
    2980             data['Layers']['Sadp'] = {}
    2981             data['Layers']['Sadp']['Plane'] = plane
    2982             data['Layers']['Sadp']['Lmax'] = lmax
    2983             data['Layers']['Multi'] = [parm,parmRange,parmStep]
     3009            simCodes = dlg.GetSelection()
     3010            data['Layers']['Multi'] = [simCodes[2:5]]
    29843011        else:
    29853012            return
Note: See TracChangeset for help on using the changeset viewer.