Changeset 1273


Ignore:
Timestamp:
Apr 7, 2014 1:23:59 PM (8 years ago)
Author:
vondreele
Message:

clean up SASD Model plotting
clean up form factor functions

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIplot.py

    r1272 r1273  
    14151415################################################################################
    14161416           
    1417 def PlotSASDSizeDist(G2frame,Rbins=[],Dist=[]):
     1417def PlotSASDSizeDist(G2frame):
    14181418   
    14191419    def OnPageChanged(event):
     
    14221422            PlotPatterns(G2frame,plotType='SASD',newPlot=True)
    14231423        elif 'Size' in PlotText:
    1424             PlotSASDSizeDist(G2frame,Rbins,Dist)
     1424            PlotSASDSizeDist(G2frame)
    14251425   
    14261426    def OnMotion(event):
  • trunk/GSASIIpwdGUI.py

    r1269 r1273  
    28542854       
    28552855        ffChoices = {'Sphere':{},'Spheroid':{'Aspect ratio':[1.0,False]},
    2856             'Cylinder':{'Length':[100.,False]},'CylinderD':{'Diameter':[100.,False]},
    2857             'CylinderAR':{'Aspect ratio':[1.0,False]},'UniSphere':{},
    2858             'UniRod':{'Length':[100.,False]},'UniRodAR':{'Aspect ratio':[1.0,False]},
    2859             'UniDisk':{'Thickness':[100.,False]},
    2860             'UniTube':{'Length':[100.,False],'Thickness':[10.,False]},}
     2856            'Cylinder':{'Length':[100.,False]},'Cylinder diam':{'Diameter':[100.,False]},
     2857            'Cylinder AR':{'Aspect ratio':[1.0,False]},'Unified sphere':{},
     2858            'Unified rod':{'Length':[100.,False]},'Unified rod AR':{'Aspect ratio':[1.0,False]},
     2859            'Unified disk':{'Thickness':[100.,False]},
     2860            'Unified tube':{'Length':[100.,False],'Thickness':[10.,False]},}
    28612861               
    2862         def RefreshPlots(Rbins=[],Dist=[]):
     2862        def RefreshPlots():
    28632863            PlotText = G2frame.G2plotNB.nb.GetPageText(G2frame.G2plotNB.nb.GetSelection())
    28642864            if 'Powder' in PlotText:
    28652865                G2plt.PlotPatterns(G2frame,plotType='SASD',newPlot=True)
    28662866            elif 'Size' in PlotText:
    2867                 G2plt.PlotSASDSizeDist(G2frame,Rbins,Dist)
     2867                G2plt.PlotSASDSizeDist(G2frame)
    28682868               
    28692869        def OnValue(event):
     
    28802880            sldrObj.SetRange(1000.*(np.log10(value)-2),1000.*(np.log10(value)+2))
    28812881            sldrObj.SetValue(1000.*np.log10(value))
    2882             Rbins,Dist = G2sasd.ModelFxn(Profile,ProfDict,Limits,Substances,Sample,data)
    2883             RefreshPlots(Rbins,Dist)
     2882            G2sasd.ModelFxn(Profile,ProfDict,Limits,Substances,Sample,data)
     2883            RefreshPlots()
    28842884           
    28852885        def OnSelect(event):
     
    28902890                if 'FormFact' in key:
    28912891                    item['FFargs'] = ffChoices[Obj.GetValue()]
     2892                G2sasd.ModelFxn(Profile,ProfDict,Limits,Substances,Sample,data)
     2893                RefreshPlots()
    28922894                wx.CallAfter(UpdateModelsGrid,G2frame,data)
    2893                 Rbins,Dist = G2sasd.ModelFxn(Profile,ProfDict,Limits,Substances,Sample,data)
    2894                 RefreshPlots(Rbins,Dist)
    28952895           
    28962896        def OnDelLevel(event):
     
    28992899            del data['Particle']['Levels'][item]
    29002900            wx.CallAfter(UpdateModelsGrid,G2frame,data)
    2901             Rbins,Dist = G2sasd.ModelFxn(Profile,ProfDict,Limits,Substances,Sample,data)
    2902             RefreshPlots(Rbins,Dist)
     2901            G2sasd.ModelFxn(Profile,ProfDict,Limits,Substances,Sample,data)
     2902            RefreshPlots()
    29032903           
    29042904        def OnParmSlider(event):
     
    29072907            item[key] = 10.**float(Obj.GetValue()/1000.)
    29082908            pvObj.SetValue('%.3g'%(item[key]))
    2909             Rbins,Dist = G2sasd.ModelFxn(Profile,ProfDict,Limits,Substances,Sample,data)
    2910             RefreshPlots(Rbins,Dist)
     2909            G2sasd.ModelFxn(Profile,ProfDict,Limits,Substances,Sample,data)
     2910            RefreshPlots()
    29112911           
    29122912        def SizeSizer():
     
    29942994            FFargs = level['Controls']['FFargs']
    29952995            for iparm,parm in enumerate(list(Parms)):
    2996                 parmVar = wx.CheckBox(G2frame.dataDisplay,label='Refine? '+parm)
     2996                parmVar = wx.CheckBox(G2frame.dataDisplay,label='Refine? Dist '+parm)
    29972997                parmVar.SetValue(Parms[parm][1])
    29982998                parmVar.Bind(wx.EVT_CHECKBOX, OnSelect)
     
    30153015                parmSizer.Add(parmSldr,1,wx.EXPAND)
    30163016            for parm in list(FFargs):
    3017                 parmVar = wx.CheckBox(G2frame.dataDisplay,label='Refine? '+parm)
     3017                parmVar = wx.CheckBox(G2frame.dataDisplay,label='Refine? FF '+parm)
    30183018                parmVar.SetValue(FFargs[parm][1])
    30193019                Indx[parmVar.GetId()] = [FFargs[parm],1]
     
    30313031                parmSldr = wx.Slider(G2frame.dataDisplay,minValue=1000.*valMinMax[0],
    30323032                    maxValue=1000.*valMinMax[1],value=1000.*value)
    3033                 Indx[parmVar.GetId()] = [Parms[parm],parm]
    3034                 Indx[parmValue.GetId()] = [Parms[parm],0,parmSldr]
     3033                Indx[parmVar.GetId()] = [FFargs[parm],parm]
     3034                Indx[parmValue.GetId()] = [FFargs[parm],0,parmSldr]
    30353035                Indx[parmSldr.GetId()] = [FFargs[parm],0,parmValue]
    30363036                parmSldr.Bind(wx.EVT_SLIDER,OnParmSlider)
  • trunk/GSASIIsasd.py

    r1272 r1273  
    167167    '''
    168168    AR = args[0]
    169     return UniRodFF(Q,R,args=[AR*R,])
     169    return UniRodFF(Q,R,args=[2.*AR*R,])
    170170   
    171171def UniDiskFF(Q,R,args):
     
    313313    returns float: volume (A^3) of tube wall
    314314    '''
    315     L,T = arg[:2]
     315    L,T = args[:2]
    316316    return CylinderVol(R,[L,])-CylinderVol(R-T,[L,])
    317317   
     
    868868        'Cylinder AR':[CylinderARFF,CylinderARVol],'Unified sphere':[UniSphereFF,UniSphereVol],
    869869        'Unified rod':[UniRodFF,UniRodVol],'Unified rod AR':[UniRodARFF,UniRodARVol],
    870         'Unified disk':[UniDiskFF,UniDiskVol]}
     870        'Unified disk':[UniDiskFF,UniDiskVol],'Sphere':[SphereFF,SphereVol],
     871        'Cylinder diam':[CylinderDFF,CylinderDVol]}
    871872    Shape = data['Size']['Shape'][0]
    872873    Parms = data['Size']['Shape'][1:]
     
    933934        'Cylinder AR':[CylinderARFF,CylinderARVol],'Unified sphere':[UniSphereFF,UniSphereVol],
    934935        'Unified rod':[UniRodFF,UniRodVol],'Unified rod AR':[UniRodARFF,UniRodARVol],
    935         'Unified disk':[UniDiskFF,UniDiskVol],'Sphere':[SphereFF,SphereVol]}
     936        'Unified disk':[UniDiskFF,UniDiskVol],'Sphere':[SphereFF,SphereVol],
     937        'Unified tube':[UniTubeFF,UniTubeVol],'Cylinder diam':[CylinderDFF,CylinderDVol]}
    936938#    pdb.set_trace()
    937939    partData = sasdData['Particle']
     
    970972        Dist.append(dist)
    971973    sasdData['Size Calc'] = [Rbins,Dist]
    972     return Rbins,Dist
    973974   
    974975def MakeDiamDist(DistName,nPoints,cutoff,parmDict):
Note: See TracChangeset for help on using the changeset viewer.