Changeset 1835


Ignore:
Timestamp:
May 4, 2015 4:44:41 PM (7 years ago)
Author:
vondreele
Message:

fix problem with deleting/inserting data into phases
fix plot problem from Ddata
fix problem with testDeriv & constraints

Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIddataGUI.py

    r1834 r1835  
    919919    mainSizer.Add(wx.StaticText(DData,wx.ID_ANY,' Histogram data for '+PhaseName+':'),0,WACV)
    920920    if G2frame.hist != '':
     921        useList = UseList.keys()
    921922        topSizer = wx.FlexGridSizer(1,2,5,5)
    922         select = wx.ListBox(DData,choices=keyList,style=wx.LB_SINGLE,size=(-1,120))
    923         select.SetSelection(keyList.index(G2frame.hist))
    924         select.SetFirstItem(keyList.index(G2frame.hist))
     923        select = wx.ListBox(DData,choices=useList,style=wx.LB_SINGLE,size=(-1,120))
     924        select.SetSelection(useList.index(G2frame.hist))
     925        select.SetFirstItem(useList.index(G2frame.hist))
    925926        select.Bind(wx.EVT_LISTBOX,OnSelect)
    926927        topSizer.Add(select,0,WACV|wx.LEFT,5)
  • trunk/GSASIIphsGUI.py

    r1831 r1835  
    39923992                    for i in DelList:
    39933993                        del UseList[i]
     3994                    data['Histograms'] = UseList
    39943995                    wx.CallAfter(G2ddG.UpdateDData,G2frame,DData,data)
    39953996            finally:
  • trunk/GSASIIplot.py

    r1831 r1835  
    19671967    Xb = [0.,10.]
    19681968    Yb = [0.,-40.*np.pi*numbDen]
    1969     Ymax = 1.0
     1969    Ymax = 0.01
    19701970    lenX = 0
    19711971    for Pattern in PlotList:
     
    25472547    numPlots = len(useList)
    25482548
    2549     if plotType in ['Mustrain','Size']:
    2550         Plot = mp3d.Axes3D(G2frame.G2plotNB.add3D(plotType))
    2551     else:
    2552         Plot = G2frame.G2plotNB.addMpl(plotType).gca()       
    2553     plotNum = G2frame.G2plotNB.plotList.index(plotType)
    2554     Page = G2frame.G2plotNB.nb.GetPage(plotNum)
     2549    try:
     2550        plotNum = G2frame.G2plotNB.plotList.index(plotType)
     2551        Page = G2frame.G2plotNB.nb.GetPage(plotNum)
     2552        Page.figure.clf()
     2553        Plot = Page.figure.gca()
     2554        if not Page.IsShown():
     2555            Page.Show()
     2556    except ValueError:
     2557        if plotType in ['Mustrain','Size']:
     2558            Plot = mp3d.Axes3D(G2frame.G2plotNB.add3D(plotType))
     2559        else:
     2560            Plot = G2frame.G2plotNB.addMpl(plotType).gca()               
     2561        plotNum = G2frame.G2plotNB.plotList.index(plotType)
     2562        Page = G2frame.G2plotNB.nb.GetPage(plotNum)
    25552563    Page.Choice = None
    2556     Page.SetFocus()
    25572564    G2frame.G2plotNB.status.SetStatusText('',1)
    2558     if not Page.IsShown():
    2559         Page.Show()
    25602565   
    25612566    PHI = np.linspace(0.,360.,30,True)
  • trunk/GSASIIstrMain.py

    r1819 r1835  
    225225        cPickle.dump(result[0],fl,1)
    226226        cPickle.dump([Histograms,Phases,restraintDict,rigidbodyDict],fl,1)
    227         cPickle.dump([G2mv.dependentParmList,G2mv.arrayList,G2mv.invarrayList,
    228             G2mv.indParmList,G2mv.invarrayList],fl,1)
     227        cPickle.dump([constrDict,fixedList],fl,1)
    229228        cPickle.dump(parmDict,fl,1)
    230229        cPickle.dump(varyList,fl,1)
     
    232231        cPickle.dump(pawleyLookup,fl,1)
    233232        fl.close()
    234 
    235233    if dlg:
    236234        return True,Rvals['Rwp']
  • trunk/GSASIIstrMath.py

    r1816 r1835  
    12671267    H = refl[:3]
    12681268    cell = G2lat.Gmat2cell(g)
    1269     Sangl = [0.,0.,0.]
     1269    Sangls = [0.,0.,0.]
    12701270    if 'Bragg' in calcControls[hfx+'instType']:
    12711271        Gangls = [0.,90.,0.,parmDict[hfx+'Azimuth']]
     
    12751275        IFCoup = False
    12761276    phi,beta = G2lat.CrsAng(H,cell,SGData)
    1277     psi,gam,x,x = G2lat.SamAng(tth/2.,Gangls,Sangl,IFCoup) #ignore 2 sets of angle derivs.
     1277    psi,gam,x,x = G2lat.SamAng(tth/2.,Gangls,Sangls,IFCoup) #ignore 2 sets of angle derivs.
    12781278    SHnames = calcControls[phfx+'SHnames']
    12791279    for item in SHnames:
     
    12831283        Lnorm = G2lat.Lnorm(L)
    12841284        odfCor += parmDict[phfx+item]*Lnorm*Kcl*Ksl
    1285 #        Kcsl,Lnorm = G2lat.GetKclKsl(L,N,SGData['SGLaue'],psi,phi,beta)
    1286 #        odfCor += parmDict[phfx+item]*Lnorm*Kcsl
    12871285    return np.squeeze(odfCor)
    12881286   
     
    12971295    H = refl[:3]
    12981296    cell = G2lat.Gmat2cell(g)
    1299     Sangl = [0.,0.,0.]
     1297    Sangls = [0.,0.,0.]
    13001298    if 'Bragg' in calcControls[hfx+'instType']:
    13011299        Gangls = [0.,90.,0.,parmDict[hfx+'Azimuth']]
     
    13051303        IFCoup = False
    13061304    phi,beta = G2lat.CrsAng(H,cell,SGData)
    1307     psi,gam,x,x = G2lat.SamAng(tth/2.,Gangls,Sangl,IFCoup) #ignore 2 sets of angle derivs.
     1305    psi,gam,x,x = G2lat.SamAng(tth/2.,Gangls,Sangls,IFCoup) #ignore 2 sets of angle derivs.
    13081306    SHnames = calcControls[phfx+'SHnames']
    13091307    for item in SHnames:
     
    13141312        odfCor += parmDict[phfx+item]*Lnorm*Kcl*Ksl
    13151313        dFdODF[phfx+item] = Kcl*Ksl*Lnorm
    1316 #        Kcsl,Lnorm = G2lat.GetKclKsl(L,N,SGData['SGLaue'],psi,phi,beta)
    1317 #        odfCor += parmDict[phfx+item]*Lnorm*Kcsl
    1318 #        dFdODF[phfx+item] = Kcsl*Lnorm
    13191314    return odfCor,dFdODF
    13201315   
  • trunk/testDeriv.py

    r1493 r1835  
    9595                self.values = cPickle.load(file)
    9696                self.HistoPhases = cPickle.load(file)
    97                 (G2mv.dependentParmList,G2mv.arrayList,G2mv.invarrayList,G2mv.indParmList,
    98                     G2mv.invarrayList) = cPickle.load(file)
     97                (self.constrDict,self.fixedList) = cPickle.load(file)
    9998                self.parmDict = cPickle.load(file)
    10099                self.varylist = cPickle.load(file)
     
    104103                self.delt = [max(abs(self.parmDict[name])*0.001,1e-6) for name in self.varylist]
    105104                file.close()
     105                groups,parmlist = G2mv.GroupConstraints(self.constrDict)
     106                G2mv.GenerateConstraints(groups,parmlist,self.varylist,self.constrDict,self.fixedList,self.parmDict)
    106107                self.UpdateControls(event)
    107108                print G2mv.VarRemapShow(self.varylist)
Note: See TracChangeset for help on using the changeset viewer.