Changeset 4094 for trunk/GSASIIpwdGUI.py
- Timestamp:
- Aug 15, 2019 2:54:58 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/GSASIIpwdGUI.py
r4092 r4094 356 356 'MaxEnt':{'Niter':100,'Precision':0.01,'Sky':-3}, 357 357 'IPG':{'Niter':100,'Approach':0.8,'Power':-1},'Reg':{},}, 358 'Pair':{'Method':' Regularization','MaxRadius':100.,'NBins':100,'Errors':'User',358 'Pair':{'Method':'Moore','MaxRadius':100.,'NBins':100,'Errors':'User', 359 359 'Percent error':2.5,'Background':[0,False],'Distribution':[], 360 360 'Moore':20,'Dist G':100.,'Result':[],}, … … 5230 5230 data['BackFile'] = '' 5231 5231 if 'Pair' not in data: 5232 data['Pair'] = {'Method':' Regularization','MaxRadius':100.,'NBins':100,'Errors':'User','Result':[],5232 data['Pair'] = {'Method':'Moore','MaxRadius':100.,'NBins':100,'Errors':'User','Result':[], 5233 5233 'Percent error':2.5,'Background':[0,False],'Distribution':[],'Moore':[20,False],'Dist G':100.,} 5234 5234 if 'Shapes' not in data: … … 5422 5422 SaveState() 5423 5423 G2sasd.PairDistFxn(Profile,ProfDict,Limits,Sample,data) 5424 RefreshPlots(True) 5424 5425 G2plt.PlotSASDPairDist(G2frame) 5425 RefreshPlots(True)5426 5426 wx.CallAfter(UpdateModelsGrid,G2frame,data) 5427 5427 … … 5432 5432 A New Algroithm for the Reconstruction of Protein Molecular Envelopes 5433 5433 from X-ray Solution Scattering Data, 5434 J. Badger, Jour. of Appl. Chrystallogr. 2019, XX, xxx-xxx.5435 doi: xxx''',5434 J. Badger, Jour. of Appl. Chrystallogr. 2019, 52, xxx-xxx. 5435 doi: 10.1107/S1600576719009774''', 5436 5436 caption='Program Shapes',style=wx.ICON_INFORMATION) 5437 5437 data['Pair']['Result'] = [] #clear old results (if any) for now … … 5607 5607 def OnMooreTerms(event): 5608 5608 data['Pair']['Moore'] = int(round(Limits[1][1]*data['Pair']['MaxRadius']/np.pi))-1 5609 wx.CallAfter(UpdateModelsGrid,G2frame,data) 5609 wx.CallAfter(UpdateModelsGrid,G2frame,data) 5610 5611 def OnNewVal(invalid,value,tc): 5612 if invalid: return 5613 parmDict = {'Rg':data['Pair']['MaxRadius']/2.5,'G':data['Pair']['Dist G'], 5614 'B':data['Pair'].get('Dist B',Profile[1][-1]*Profile[0][-1]**4), 5615 'Back':data['Back'][0]} 5616 Profile[2] = G2sasd.getSASDRg(Profile[0],parmDict) 5617 RefreshPlots(True) 5610 5618 5611 5619 pairSizer = wx.BoxSizer(wx.VERTICAL) … … 5620 5628 binSizer.Add(nbins,0,WACV) 5621 5629 binSizer.Add(wx.StaticText(G2frame.dataWindow,label=' Max diam.: '),0,WACV) 5622 maxdiam = G2G.ValidatedTxtCtrl(G2frame.dataWindow,data['Pair'],'MaxRadius',min=10.,nDig=(10,1) )5630 maxdiam = G2G.ValidatedTxtCtrl(G2frame.dataWindow,data['Pair'],'MaxRadius',min=10.,nDig=(10,1),OnLeave=OnNewVal) 5623 5631 binSizer.Add(maxdiam,0,WACV) 5624 5632 maxest = wx.Button(G2frame.dataWindow,label='Make estimate') … … 5628 5636 pairSizer.Add((5,5),0) 5629 5637 fitSizer = wx.BoxSizer(wx.HORIZONTAL) 5630 methods = [' Regularization','Moore']5638 methods = ['Moore',] #'Regularization', 5631 5639 fitSizer.Add(wx.StaticText(G2frame.dataWindow,label='Fitting method: '),0,WACV) 5632 5640 method = wx.ComboBox(G2frame.dataWindow,value=data['Pair']['Method'],choices=methods, … … 5634 5642 method.Bind(wx.EVT_COMBOBOX,OnMethod) 5635 5643 fitSizer.Add(method,0,WACV) 5644 if data['Pair']['Method'] == 'Moore': 5645 fitSizer.Add(wx.StaticText(G2frame.dataWindow,label=" P.B. Moore, J. Appl. Cryst., 13, 168-175 (1980)"),0,WACV) 5646 else: 5647 fitSizer.Add(wx.StaticText(G2frame.dataWindow,label=" D.I. Svergun, J. Appl. Cryst., 24, 485-492 (1991)"),0,WACV) 5636 5648 pairSizer.Add(fitSizer,0,WACV) 5637 5649 if 'Moore' in data['Pair']['Method']: 5638 5650 mooreSizer = wx.BoxSizer(wx.HORIZONTAL) 5639 5651 mooreSizer.Add(wx.StaticText(G2frame.dataWindow,label='Number of functions: '),0,WACV) 5640 moore = G2G.ValidatedTxtCtrl(G2frame.dataWindow,data['Pair'],'Moore',min= 10)5652 moore = G2G.ValidatedTxtCtrl(G2frame.dataWindow,data['Pair'],'Moore',min=2) 5641 5653 mooreSizer.Add(moore,0,WACV) 5642 5654 mooreterms = wx.Button(G2frame.dataWindow,label = 'Auto determine?') … … 5671 5683 selAtoms = Atoms[2*r+(c-1)] 5672 5684 pattern = Patterns[r] 5673 data['Pair']['Pair Calc'] = np.array([PRcalc[r][0],PRcalc[r][2]]).T 5685 prCalc = PRcalc[r][2] 5686 prDelt= np.diff(PRcalc[r][0])[0] 5687 prsum = np.sum(prCalc) 5688 prCalc /= prsum*prDelt 5689 data['Pair']['Pair Calc'] = np.array([PRcalc[r][0],prCalc]).T 5674 5690 print('%s %d'%('num. beads',len(selAtoms[1]))) 5675 5691 print('%s %.3f'%('selected r value',pattern[-1])) 5676 5692 print('%s %.3f'%('selected Delta P(r)',PRcalc[r][-1])) 5693 G2plt.PlotBeadModel(G2frame,selAtoms,plotDefaults) 5694 RefreshPlots(True) 5677 5695 G2plt.PlotSASDPairDist(G2frame) 5678 RefreshPlots(True)5679 5696 5680 G2plt.PlotBeadModel(G2frame,selAtoms,plotDefaults)5681 5697 5682 5698 … … 5696 5712 inflate = G2G.ValidatedTxtCtrl(G2frame.dataWindow,data['Shapes'],'inflateV',min=1.,max=1.4,nDig=(10,2)) 5697 5713 parmSizer.Add(inflate,0,WACV) 5698 parmSizer.Add(wx.StaticText(G2frame.dataWindow,label=' Axial symmetry (1- 6): '),0,WACV)5699 symm = G2G.ValidatedTxtCtrl(G2frame.dataWindow,data['Shapes'],'Symm',min=1,max= 6)5714 parmSizer.Add(wx.StaticText(G2frame.dataWindow,label=' Axial symmetry (1-12): '),0,WACV) 5715 symm = G2G.ValidatedTxtCtrl(G2frame.dataWindow,data['Shapes'],'Symm',min=1,max=12) 5700 5716 parmSizer.Add(symm,0,WACV) 5701 5717 #3rd row … … 6074 6090 backSizer.Add(wx.StaticText(G2frame.dataWindow,label=' Background:'),0,WACV) 6075 6091 backVal = G2G.ValidatedTxtCtrl(G2frame.dataWindow,data['Back'],0, 6076 nDig=(10,3 ),typeHint=float,OnLeave=OnBackChange)6092 nDig=(10,3,'g'),OnLeave=OnBackChange) 6077 6093 backSizer.Add(backVal,0,WACV) 6078 6094 backVar = wx.CheckBox(G2frame.dataWindow,label='Refine?')
Note: See TracChangeset
for help on using the changeset viewer.