Changeset 3998


Ignore:
Timestamp:
May 27, 2019 12:07:29 PM (3 years ago)
Author:
vondreele
Message:

make use of pgrid files from Dysnomia as prior & restart maps

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIphsGUI.py

    r3996 r3998  
    41324132        ''' Present the controls for running Dysnomia
    41334133        '''
    4134 #data['Dysnomia'] = {'DenStart':'uniform','Optimize':'ZSPA','Lagrange':['user',0.001,0.05],
    4135 #    'wt pwr':0,'E_factor':1.,'Ncyc':5000,'prior':'uniform','Lam frac':[1,0,0,0,0,0,0,0]}
    41364134        def OnOptMeth(event):
    41374135            DysData['Optimize'] = OptMeth.GetValue()
     
    41474145        def OnPrior(event):
    41484146            DysData['prior'] = Prior.GetValue()
    4149        
     4147            if DysData['prior'] == 'last run':
     4148                if os.path.isfile(pName+'_prior.pgrid'):
     4149                    os.remove(pName+'_prior.pgrid')
     4150                os.rename(pName+'.pgrid',pName+'_prior.pgrid')
     4151       
     4152        generalData = data['General']
     4153        pName = generalData['Name'].replace(' ','_')
    41504154        MEMData = G2frame.MEMData
    41514155        if MEMData.GetSizer():
     
    41864190        Esizer.Add(Efact,0,WACV)
    41874191        mainSizer.Add(Esizer)
    4188         PriorSizer = wx.BoxSizer(wx.HORIZONTAL)
    4189         PriorSizer.Add(wx.StaticText(MEMData,label=' Start from densities: '),0,WACV)
    4190         Start = wx.ComboBox(MEMData,-1,value=DysData['DenStart'],choices=['uniform','last run'],
    4191             style=wx.CB_READONLY|wx.CB_DROPDOWN)
    4192         Start.Bind(wx.EVT_COMBOBOX,OnStart)
    4193         PriorSizer.Add(Start,0,WACV)
    4194         PriorSizer.Add(wx.StaticText(MEMData,label=' Use as prior: '),0,WACV)
    4195         Prior = wx.ComboBox(MEMData,-1,value=DysData['prior'],choices=['uniform','last run'],
    4196             style=wx.CB_READONLY|wx.CB_DROPDOWN)
    4197         Prior.Bind(wx.EVT_COMBOBOX,OnPrior)
    4198         PriorSizer.Add(Prior,0,WACV)
    4199         mainSizer.Add(PriorSizer)       
     4192       
     4193        if os.path.isfile(pName+'.pgrid'):
     4194            PriorSizer = wx.BoxSizer(wx.HORIZONTAL)
     4195            PriorSizer.Add(wx.StaticText(MEMData,label=' Start from densities: '),0,WACV)
     4196            Start = wx.ComboBox(MEMData,-1,value=DysData['DenStart'],choices=['uniform','last run'],
     4197                style=wx.CB_READONLY|wx.CB_DROPDOWN)
     4198            Start.Bind(wx.EVT_COMBOBOX,OnStart)
     4199            PriorSizer.Add(Start,0,WACV)
     4200            PriorSizer.Add(wx.StaticText(MEMData,label=' Use as prior: '),0,WACV)
     4201            Prior = wx.ComboBox(MEMData,-1,value=DysData['prior'],choices=['uniform','last run'],
     4202                style=wx.CB_READONLY|wx.CB_DROPDOWN)
     4203            Prior.Bind(wx.EVT_COMBOBOX,OnPrior)
     4204            PriorSizer.Add(Prior,0,WACV)
     4205            mainSizer.Add(PriorSizer)
     4206        else:
     4207            DysData['DenStart'] = 'uniform'
     4208            DysData['prior'] = 'uniform'
     4209       
    42004210        Csizer = wx.BoxSizer(wx.HORIZONTAL)
    42014211        Csizer.Add(wx.StaticText(MEMData,label=' Maximum number of cycles: '),0,WACV)
     
    42154225        path2GSAS2 = os.path.dirname(os.path.abspath(os.path.expanduser(__file__)))
    42164226        DYSNOMIA = os.path.join(path2GSAS2,'Dysnomia','Dysnomia64.exe')
     4227        DysData = data['Dysnomia']
    42174228       
    42184229        if not os.path.exists(DYSNOMIA):
     
    42534264            return
    42544265
    4255 
    42564266        wx.MessageBox(''' For use of Dysnomia, please cite:
    42574267      Dysnomia, a computer program for maximum-entropy method (MEM)
     
    42624272        print('Run '+DYSNOMIA)       
    42634273        subp.call([DYSNOMIA,prfName])
     4274       
     4275        DysData['DenStart'] = 'uniform'
     4276        DysData['prior'] = 'uniform'
     4277        wx.CallAfter(UpdateDysnomia)
    42644278       
    42654279        if G2pwd.MEMupdateReflData(prfName,reflData):
Note: See TracChangeset for help on using the changeset viewer.