Changeset 1252 for trunk/GSASIIpwdGUI.py


Ignore:
Timestamp:
Mar 18, 2014 1:45:39 PM (8 years ago)
Author:
vondreele
Message:

unsuccessful implementation of IPG method (commented out) for size distribution
revisit later
plot SASD background on changes
document SASD shape form factors & volumes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIpwdGUI.py

    r1250 r1252  
    8686        'logBins':True,'Method':'MaxEnt','Distribution':[],
    8787        'Shape':['Spheroid',1.0],'MaxEnt':{'Niter':100,'Precision':0.01,'Sky':-3},
    88         'IPG':{'Niter':100,'Approach':0.8},'Reg':{},},           
     88        'IPG':{'Niter':100,'Approach':0.8,'Power':-1},'Reg':{},},           
    8989        'Unified':{'Levels':[],},           
    9090        'Particle':{'Levels':[],},
     
    24752475    if isinstance(data['Size']['MaxEnt']['Sky'],float):
    24762476        data['Size']['MaxEnt']['Sky'] = -3
     2477    if 'Power' not in data['Size']['IPG']:
     2478        data['Size']['IPG']['Power'] = -1
    24772479    #end patches
    24782480   
     
    24832485    def OnFitModel(event):
    24842486        print 'fit model for '+data['Current']
     2487        if not any(Sample['Contrast']):
     2488            G2frame.ErrorDialog('No contrast; your sample is a vacuum!',
     2489                'You need to define a scattering substance!\n'+    \
     2490                ' Do Substances and then Sample parameters')
     2491            return
    24852492        if data['Current'] == 'Size dist.':
    24862493            G2sasd.SizeDistribution(Profile,ProfDict,Limits,Substances,Sample,data)
     
    25012508        Obj.SetValue(fmt%(value))
    25022509        data[itemKey][ind] = value
     2510        if itemKey == 'Back':
     2511            Profile[4][:] = value
     2512        G2plt.PlotPatterns(G2frame,plotType='SASD',newPlot=True)
    25032513       
    25042514    def OnCheckBox(event):
     
    25872597        sizeSizer.Add((5,5),0)
    25882598        fitSizer = wx.BoxSizer(wx.HORIZONTAL)
    2589         methods = ['MaxEnt','IPG',]
     2599        methods = ['MaxEnt',]   #'IPG',]
    25902600        fitSizer.Add(wx.StaticText(G2frame.dataDisplay,label='Fitting method: '),0,WACV)
    25912601        method = wx.ComboBox(G2frame.dataDisplay,value=data['Size']['Method'],choices=methods,
     
    26092619            floor.Bind(wx.EVT_COMBOBOX,OnIntVal)
    26102620            fitSizer.Add(floor,0,WACV)
     2621        elif 'IPG' in data['Size']['Method']:
     2622            fitSizer.Add(wx.StaticText(G2frame.dataDisplay,label=' Q power weight (-1 for sigma): '),0,WACV)
     2623            choices = ['-1','0','1','2','3','4']
     2624            power = wx.ComboBox(G2frame.dataDisplay,value=str(data['Size']['IPG']['Power']),choices=choices,
     2625                style=wx.CB_READONLY|wx.CB_DROPDOWN)
     2626            Indx[power.GetId()] = [data['Size']['IPG'],'Power',-2]
     2627            power.Bind(wx.EVT_COMBOBOX,OnIntVal)
     2628            fitSizer.Add(power,0,WACV)
    26112629        sizeSizer.Add(fitSizer,0)
    26122630
     
    26682686    G2gd.HorizontalLine(mainSizer,G2frame.dataDisplay)
    26692687    if 'Size' in data['Current']:
     2688        if 'MaxEnt' in data['Size']['Method']:
     2689            Status.SetStatusText('Size distribution by Maximum entropy')
     2690        elif 'IPG' in data['Size']['Method']:
     2691            Status.SetStatusText('Size distribution by Interior-Point Gradient')
    26702692        mainSizer.Add(SizeSizer())       
    26712693    elif 'Particle' in data['Current']:
     
    26812703    backVal.Bind(wx.EVT_KILL_FOCUS,OnValueChange)
    26822704    backSizer.Add(backVal,0,WACV)
    2683     backVar = wx.CheckBox(G2frame.dataDisplay,label='Apply?')
     2705    backVar = wx.CheckBox(G2frame.dataDisplay,label='Refine?')
    26842706    Indx[backVar.GetId()] = [data['Back'],1]
    26852707    backVar.SetValue(data['Back'][1])
Note: See TracChangeset for help on using the changeset viewer.