Changeset 5122
- Timestamp:
- Jan 1, 2022 3:00:59 PM (21 months ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/GSASIIElemGUI.py
r4660 r5122 20 20 import os 21 21 import wx.lib.colourselect as wscs 22 # for Python 3.10+, define a version of wxPoint that accepts float params 23 def wxPoint(x,y): return wx.Point(int(x),int(y)) 22 24 class PickElement(wx.Dialog): 23 25 '''Makes periodic table widget for picking element. Modes: … … 49 51 color=E[6] 50 52 self.ElButton(name=E[0], 51 pos=wx .Point(E[1]*self.butWid+25,E[2]*24+24),53 pos=wxPoint(E[1]*self.butWid+25,E[2]*24+24), 52 54 tip=E[3],color=color) 53 55 i+=1 54 56 if self.multiple: 55 57 b = wx.Button(self,wx.ID_CLOSE, 56 pos=wx .Point(16.5*self.butWid+25,7.75*24+24),label="Done")58 pos=wxPoint(16.5*self.butWid+25,7.75*24+24),label="Done") 57 59 b.Bind(wx.EVT_BUTTON, self.OnClose) 58 60 … … 246 248 for E in self.ElTable: 247 249 PickElements.ElButton(self,parent=elPanel,name=E[0], 248 pos=wx .Point(E[1]*30+20,E[2]*30+25),tip=E[3],color=E[4])250 pos=wxPoint(E[1]*30+20,E[2]*30+25),tip=E[3],color=E[4]) 249 251 i+=1 250 252 mainSizer.Add(elPanel,0,wx.EXPAND) … … 321 323 Elem = [] 322 324 for Elem in choice: 323 self.ElButton(name=Elem,pos=wx .Point(16+i*24, 16))325 self.ElButton(name=Elem,pos=wxPoint(16+i*24, 16)) 324 326 i+=1 325 327 -
trunk/GSASIIphsGUI.py
r5117 r5122 4940 4940 def OnRefSel(event): 4941 4941 RMCPdict['refinement'] = reftype.GetStringSelection() 4942 wx.Call After(UpdateRMC)4942 wx.CallLater(100,UpdateRMC) 4943 4943 4944 4944 def OnDataSel(event): … … 4952 4952 4953 4953 Indx = {} 4954 topSizer = wx.BoxSizer(wx.HORIZONTAL)4955 topSizer.Add(wx.StaticText(G2frame.FRMC,label=' Select data for processing: '))4956 4954 if G2frame.RMCchoice == 'PDFfit': 4955 topSizer = wx.BoxSizer(wx.HORIZONTAL) 4957 4956 reftype = wx.RadioBox(G2frame.FRMC,label='PDFfit refinement type:',choices=['normal','sequential']) 4958 4957 reftype.SetStringSelection(RMCPdict.get('refinement','normal')) … … 4974 4973 endSizer.Add(seqreverse) 4975 4974 topSizer.Add(endSizer,0,WACV) 4976 4977 mainSizer.Add(topSizer) 4978 if G2frame.RMCchoice == 'fullrmc': 4975 mainSizer.Add(topSizer) 4976 elif G2frame.RMCchoice == 'fullrmc': 4977 topSizer = wx.BoxSizer(wx.HORIZONTAL) 4978 topSizer.Add(wx.StaticText(G2frame.FRMC,label=' Select data for processing (files must be 2 columns w/headers preceeded by "#"; edit if needed)')) 4979 mainSizer.Add(topSizer) 4979 4980 Heads = ['Name','File','type','Plot','Delete'] 4980 4981 fileSizer = wx.FlexGridSizer(5,5,5) … … 5044 5045 fitscale.Bind(wx.EVT_CHECKBOX,OnFitScale) 5045 5046 mainSizer.Add(fitscale,0) 5046 mainSizer.Add(wx.StaticText(G2frame.FRMC,5047 label=' NB: fullrmc data files must be 2 columns; all other lines preceeded by "#". Edit before use.'),0)5048 5047 return 5049 5048 elif G2frame.RMCchoice == 'PDFfit' and RMCPdict['refinement'] == 'sequential': 5050 5051 5049 def OnAddPDF(event): 5052 5050 ''' Add PDF G(r)s while maintanining original sequence … … 5084 5082 5085 5083 def OnSetColVal(event): 5086 5087 5084 parms = {'Rmin':[0.0,5.0],'Rmax':[5.,30.],'dscale':[0.5,2.0], 5088 5085 'qdamp':[0.0,0.5],'qbroad':[0.0,0.1],'Temp':300} … … 5133 5130 else: 5134 5131 RMCPdict['seqfiles'][r][1]['Fitrange'][c] = float(seqGrid.GetCellValue(r,c)) 5135 5132 5133 topSizer = wx.BoxSizer(wx.HORIZONTAL) 5134 topSizer.Add(wx.StaticText(G2frame.FRMC,label=' Select data for processing: ')) 5135 mainSizer.Add(topSizer) 5136 5136 G2frame.GetStatusBar().SetStatusText('NB: All PDFs used in sequential PDFfit must be the same type ("X" or "N") - there is no check',1) 5137 5137 if 'seqfiles' not in RMCPdict: … … 5162 5162 seqGrid.Bind(wg.EVT_GRID_CELL_CHANGED, OnSetVal) 5163 5163 mainSizer.Add(seqGrid) 5164 5165 5164 return 5165 topSizer = wx.BoxSizer(wx.HORIZONTAL) 5166 topSizer.Add(wx.StaticText(G2frame.FRMC,label=' Select data for processing: ')) 5167 mainSizer.Add(topSizer) 5166 5168 # RMCProfile & PDFfit (Normal) 5167 5169 Heads = ['Name','File','Format','Weight','Plot','Delete'] … … 5242 5244 def fullrmcSizer(RMCPdict): 5243 5245 mainSizer = wx.BoxSizer(wx.VERTICAL) 5244 if G2pwd.findfullrmc() is None:5245 dlg = wx.MessageDialog(G2frame,5246 'The fullrmc code is not installed or could not be'5247 ' located. Do you want help information on fullrmc?',5248 'Install info',5249 wx.YES|wx.NO)5250 try:5251 dlg.CenterOnParent()5252 result = dlg.ShowModal()5253 finally:5254 dlg.Destroy()5255 if result == wx.ID_YES:5256 G2G.ShowHelp('fullrmc',G2frame)5257 return mainSizer5258 5246 mainSizer.Add(wx.StaticText(G2frame.FRMC,label= 5259 5247 ''' "Fullrmc, a Rigid Body Reverse Monte Carlo Modeling Package Enabled with … … 5261 5249 (2016), 37, 1102-1111. doi: https://doi.org/10.1002/jcc.24304 5262 5250 ''')) 5251 if G2pwd.findfullrmc() is None: 5252 mainSizer.Add(wx.StaticText(G2frame.FRMC, 5253 label="\nsorry, fullrmc not installed or was not located")) 5254 return mainSizer 5263 5255 G2frame.dataWindow.FRMCDataEdit.Enable(G2G.wxID_SETUPRMC,True) 5264 5256 G2frame.dataWindow.FRMCDataEdit.Enable(G2G.wxID_RUNRMC,True) 5265 5257 G2frame.dataWindow.FRMCDataEdit.Enable(G2G.wxID_VIEWRMC,True) 5266 5258 #mainSizer.Add(wx.StaticText(G2frame.FRMC,label=' fullrmc big box starting pdb file preparation:'),0) 5267 if not data['RMC']['fullrmc']: 5268 Atypes = [atype.split('+')[0].split('-')[0] for atype in data['General']['AtomTypes']] 5269 aTypes = dict(zip(Atypes,len(Atypes)*[0.10,])) 5270 atSeq = list(aTypes.keys()) 5271 lenA = len(atSeq) 5272 Pairs= [] 5273 for pair in [[' %s-%s'%(atSeq[i],atSeq[j]) for j in range(i,lenA) if 'Va' not in atSeq[j]] for i in range(lenA) if 'Va' not in atSeq[i]]: 5274 Pairs += pair 5275 Pairs = {pairs:[0.0,0.0,0.0] for pairs in Pairs} 5276 files = {'Neutron real space data; G(r): ':['Select',1.,'G(r)',0,True], 5277 'Neutron reciprocal space data; S(Q)-1: ':['Select',1.,'F(Q)',0,True], 5278 'Xray real space data; G(r): ':['Select',1.,'G(r)',0,True], 5279 'Xray reciprocal space data; S(Q)-1: ':['Select',1.,'F(Q)',0,True],} 5280 data['RMC']['fullrmc'] = {'SuperCell':[1,1,1],'Box':[10.,10.,10.],'aTypes':aTypes, 5281 'atSeq':atSeq,'Pairs':Pairs,'files':files,'ReStart':[False,False],'Cycles':1, 5282 'Swaps':[],'useBVS':False,'FitScale':False,'AveCN':[],'FxCN':[],'Angles':[],'Angle Weight':1.e-5, 5283 'moleculePdb':'Select','targetDensity':1.0,'maxRecursion':10000,'Torsions':[],'Torsion Weight':1.e-5, 5284 'Bond Weight':1.e-5,'min Contact':1.5,'periodicBound':True} 5259 5260 # initialize fullrmc dictionary if needed 5261 RMCPdict = data['RMC']['fullrmc'] = data['RMC'].get('fullrmc',{}) 5262 # always update, in case atoms have been updated 5263 Atypes = [atype.split('+')[0].split('-')[0] for atype in data['General']['AtomTypes']] 5264 aTypes = dict(zip(Atypes,len(Atypes)*[0.10,])) 5265 atSeq = list(aTypes.keys()) 5266 lenA = len(atSeq) 5267 Pairs= [] 5268 for pair in [[' %s-%s'%(atSeq[i],atSeq[j]) for j in range(i,lenA) if 'Va' not in atSeq[j]] 5269 for i in range(lenA) if 'Va' not in atSeq[i]]: 5270 Pairs += pair 5271 Pairs = {pairs:[0.0,0.0,0.0] for pairs in Pairs} 5272 RMCPdict.update({'aTypes':aTypes,'atSeq':atSeq,'Pairs':Pairs}) 5273 RMCPdict['files'] = RMCPdict.get('files', 5274 {'Neutron real space data; G(r): ':['Select',1.,'G(r)',0,True], 5275 'Neutron reciprocal space data; S(Q)-1: ':['Select',1.,'F(Q)',0,True], 5276 'Xray real space data; G(r): ':['Select',1.,'G(r)',0,True], 5277 'Xray reciprocal space data; S(Q)-1: ':['Select',1.,'F(Q)',0,True]}) 5278 if 'moleculePdb' not in RMCPdict: 5279 RMCPdict.update({'moleculePdb':'Select','targetDensity':1.0,'maxRecursion':10000}) 5280 if 'Angles' not in RMCPdict: 5281 RMCPdict.update({'Angles':[],'Angle Weight':1.e-5,'Bond Weight':1.e-5,'Torsions':[],'Torsion Weight':1.e-5}) 5282 for key,val in {'SuperCell':[1,1,1],'Box':[10.,10.,10.],'ReStart':[False,False],'Cycles':1, 5283 'Swaps':[],'useBVS':False,'FitScale':False,'AveCN':[],'FxCN':[], 5284 'min Contact':1.5,'periodicBound':True}.items(): 5285 RMCPdict[key] = RMCPdict.get(key,val) 5285 5286 5286 5287 def GetSuperSizer(): … … 5425 5426 # torsionSizer.Add(G2G.ValidatedTxtCtrl(G2frame.FRMC,torsion,i,xmin=0.,xmax=360.,OnLeave=SetRestart1,size=(50,25)),0,WACV) 5426 5427 # return torsionSizer 5427 #patches5428 if 'useBVS' not in RMCPdict:5429 RMCPdict['useBVS'] = False5430 if 'moleculePdb' not in RMCPdict:5431 RMCPdict.update({'moleculePdb':'Select','targetDensity':1.0,'maxRecursion':10000})5432 if 'FitScale' not in RMCPdict:5433 RMCPdict['FitScale'] = False5434 # if 'atomPDB' not in RMCPdict:5435 # RMCPdict['atomPDB'] = ''5436 if 'Angles' not in RMCPdict:5437 RMCPdict.update({'Angles':[],'Angle Weight':1.e-5,'Bond Weight':1.e-5,'Torsions':[],'Torsion Weight':1.e-5})5438 if 'Cycles' not in RMCPdict:5439 RMCPdict['Cycles'] = 15440 if 'min Contact' not in RMCPdict:5441 RMCPdict['min Contact'] = 1.55442 #if 'periodicBound' not in RMCPdict:5443 # RMCPdict['periodicBound'] = True5444 #end patches5445 5428 5446 5429 generalData = data['General'] … … 6210 6193 G2G.HorizontalLine(mainSizer,G2frame.FRMC) 6211 6194 mainSizer.Add(wx.StaticText(G2frame.FRMC, 6212 label=' NB: if you change any of the entries below, you must redo the Operations/Setup RMC step \n above to apply them before doing Operations/Execute'),0 ,WACV)6195 label=' NB: if you change any of the entries below, you must redo the Operations/Setup RMC step \n above to apply them before doing Operations/Execute'),0) 6213 6196 G2G.HorizontalLine(mainSizer,G2frame.FRMC) 6214 6197 if G2frame.RMCchoice == 'fullrmc': … … 6226 6209 bigSizer.Add(G2G.HelpButton(G2frame.FRMC,helpIndex=G2frame.dataWindow.helpKey)) 6227 6210 SetPhaseWindow(G2frame.FRMC,bigSizer) 6211 if G2frame.RMCchoice == 'fullrmc' and G2pwd.findfullrmc() is None: 6212 dlg = wx.MessageDialog(G2frame, 6213 'The fullrmc code is not installed or could not be' 6214 ' located. Do you want help information on fullrmc?', 6215 'Install info', 6216 wx.YES|wx.NO) 6217 try: 6218 dlg.CenterOnParent() 6219 result = dlg.ShowModal() 6220 finally: 6221 dlg.Destroy() 6222 if result == wx.ID_YES: 6223 G2G.ShowHelp('fullrmc',G2frame) 6224 return mainSizer 6228 6225 6229 6226 def OnSetupRMC(event): -
trunk/help/gsasII-phase.html
r4971 r5122 5525 5525 can I do here?</h5> 5526 5526 5527 <div class=MsoNormal align=center style='text-align:center;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><a 5528 name="Phase-Pawley_reflections"></a><span style='mso-fareast-font-family:"Times New Roman"; 5529 mso-no-proof:yes'> 5527 5528 <h4 style='margin-left:.25in'> 5529 <a name="Phase-RMC">RMC</a></h4> 5530 <h5 style='margin-left:.5in'> 5531 What can I do here?</h5> 5532 5533 <h4 style='margin-left:.25in'> 5534 <a name="Phase-ISODISTORT">ISODISTORT</a></h4> 5535 <h5 style='margin-left:.5in'> 5536 What can I do here?</h5> 5537 5538 <h4 style='margin-left:.25in'> 5539 <a name="Phase-Pawley_reflections">Pawley_reflections</a></h4> 5540 <h5 style='margin-left:.5in'> 5541 What can I do here?</h5> 5542 5543 5530 5544 5531 5545 <hr size=3 width="100%" align=center> 5532 5546 5533 </span></div>5534 5535 <div class=MsoNormal align=center style='text-align:center;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><span5536 style='mso-fareast-font-family:"Times New Roman";mso-no-proof:yes'>5537 5538 <hr size=3 width="100%" align=center>5539 5540 </span></div>5541 5542 5547 <p class=MsoNormal style='tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><span 5543 style='mso-fareast-font-family:"Times New Roman"'><!-- hhmts start -->Last 5544 modified: Sat Jun 19 21:43:10 CDT 2021 <!-- hhmts end --><o:p></o:p></span></p> 5548 style='mso-fareast-font-family:"Times New Roman"'><!-- hhmts start -->Last modified: Sat Jan 1 14:45:09 CST 2022 <!-- hhmts end --><o:p></o:p></span></p> 5545 5549 5546 5550 </div>
Note: See TracChangeset
for help on using the changeset viewer.