Changeset 4210
- Timestamp:
- Dec 18, 2019 3:44:47 AM (4 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/GSASIIphsGUI.py
r4209 r4210 1089 1089 def __init__(self,parent,Name,Phase): 1090 1090 title = 'RMCProfile setup' 1091 wx.Dialog.__init__(self,parent,wx.ID_ANY,title, 1091 wx.Dialog.__init__(self,parent,wx.ID_ANY,title,size=(500,500), 1092 1092 pos=wx.DefaultPosition,style=wx.DEFAULT_DIALOG_STYLE|wx.RESIZE_BORDER) 1093 1093 self.panel = wxscroll.ScrolledPanel(self) #just a dummy - gets destroyed in Draw! … … 1099 1099 self.atSeq = self.aTypes[:] 1100 1100 self.histogram = '' 1101 self.metadata = {'title':'none','owner':'no one','date':str(time.ctime()), 1102 'material':'nothing','comment':'none ','source':'nowhere'} 1101 self.files = {'Neutron real space data; G(r): ':['',0.01,'G(R)'], 1102 'Neutron reciprocal space data; F(Q): ':['',0.01,'F(Q)'], 1103 'Neutron reciprocal space data; S(Q): ':['',0.01,'S(Q)'], 1104 'Xray real space data; G(r): ':['',0.01,'G(R)'], 1105 'Xray reciprocal space data; F(Q): ':['',0.01,'F(Q)'],} 1106 self.metadata = {'title':'none','owner':'no one','date':str(time.ctime()),'temperature':'300K', 1107 'material':'nothing','phase':'vacuum','comment':'none ','source':'nowhere'} 1103 1108 self.Draw() 1104 1109 … … 1123 1128 def OnStrain(event): 1124 1129 self.UseSampBrd[1] = strain.GetValue() 1130 1131 def OnFileSel(event): 1132 Obj = event.GetEventObject() 1133 fil = Indx[Obj.GetId()] 1134 dlg = wx.FileDialog(self.panel, 'Choose '+fil+'NB: do not change directory; must be a local file', 1135 '.',style=wx.FD_OPEN,wildcard=fil+'(*.*)|*.*') 1136 if dlg.ShowModal() == wx.ID_OK: 1137 fName = os.path.split(dlg.GetPath())[1] 1138 if os.path.exists(fName): 1139 self.files[fil][0] = fName 1140 dlg.Destroy() 1141 else: 1142 dlg.Destroy() 1143 return 1144 self.Draw() 1145 1125 1146 1126 1147 self.panel.Destroy() 1127 self.panel = wxscroll.ScrolledPanel(self,style = wx.DEFAULT_DIALOG_STYLE )1148 self.panel = wxscroll.ScrolledPanel(self,style = wx.DEFAULT_DIALOG_STYLE,size=(500,500)) 1128 1149 mainSizer = wx.BoxSizer(wx.VERTICAL) 1129 1150 mainSizer.Add(wx.StaticText(self.panel,label=' Setup for: %s'%self.Name),0,WACV) … … 1148 1169 histograms = self.Phase['Histograms'] 1149 1170 histNames = list(histograms.keys()) 1150 mainSizer.Add(wx.StaticText(self.panel,label=' Select one histogram for processing:'),0,WACV)1171 mainSizer.Add(wx.StaticText(self.panel,label=' Select one histogram for Bragg processing:'),0,WACV) 1151 1172 histo = wx.ComboBox(self.panel,choices=histNames,style=wx.CB_DROPDOWN|wx.TE_READONLY) 1152 1173 histo.Bind(wx.EVT_COMBOBOX,OnHisto) … … 1162 1183 samSizer.Add(strain,0,WACV) 1163 1184 mainSizer.Add(samSizer,0,WACV) 1164 metalist = ['title','owner','material','comment','source'] 1185 mainSizer.Add(wx.StaticText(self.panel,label=' Select data for processing:'),0,WACV) 1186 fileSizer = wx.FlexGridSizer(2,5,5) 1187 for fil in self.files: 1188 filSel = wx.Button(self.panel,label='Select') 1189 filSel.Bind(wx.EVT_BUTTON,OnFileSel) 1190 Indx[filSel.GetId()] = fil 1191 fileSizer.Add(filSel,0,WACV) 1192 fileSizer.Add(wx.StaticText(self.panel,label=fil+self.files[fil][0]),0,WACV) 1193 mainSizer.Add(fileSizer,0,WACV) 1194 mainSizer.Add(wx.StaticText(self.panel,label=' Enter metadata items:'),0,WACV) 1195 metalist = ['title','owner','material','phase','comment','source','temperature',] 1165 1196 metaSizer = wx.FlexGridSizer(0,2,5,5) 1166 1197 for item in metalist: … … 1184 1215 def GetData(self): 1185 1216 'Returns the values from the dialog' 1186 return self.SuperCell,self.histogram,self.metadata,self.atSeq,self.UseSampBrd 1217 return self.SuperCell,self.histogram,self.metadata,self.atSeq,self.UseSampBrd,self.files 1187 1218 1188 1219 def OnOK(self,event): … … 4620 4651 dlg = SetUpRMCProfileDialog(G2frame,Name=pName,Phase=data) 4621 4652 if dlg.ShowModal() == wx.ID_OK: 4622 superCell,histoName,meta,atSeq,useSamBrd = dlg.GetData()4653 superCell,histoName,meta,atSeq,useSamBrd,files = dlg.GetData() 4623 4654 PWId = G2gd.GetGPXtreeItemId(G2frame,G2frame.root,histoName) 4624 4655 if PWId: 4625 # Progress4626 # print(useSamBrd)4627 # print(data['Histograms'][histoName]['Size'])4628 # print(data['Histograms'][histoName]['Mustrain'])4629 4656 print(G2pwd.MakeInst(G2frame,pName,data,useSamBrd,PWId)+ ' written') 4630 4657 backfile = G2pwd.MakeBack(G2frame,pName,PWId) … … 4635 4662 print(G2pwd.MakeBragg(G2frame,pName,data,PWId)+ ' written') 4636 4663 print(G2pwd.MakeRMC6f(G2frame,pName,data,meta,atSeq,superCell,PWId)+ ' written') 4664 print(G2pwd.MakeRMCPdat(G2frame,pName,data,meta,atSeq,superCell,files,PWId)+ ' written') 4637 4665 print('RMCProfile file build completed') 4638 4666 else: -
trunk/GSASIIpwd.py
r4206 r4210 2104 2104 Ysb = 0. 2105 2105 if 'T' in inst['Type'][1]: 2106 difC = inst[' DifC'][1]2106 difC = inst['difC'][1] 2107 2107 if useSamBrd[0]: 2108 2108 if 'ellipsoidal' not in Size[0]: #take the isotropic term only … … 2242 2242 fl.close() 2243 2243 return fname 2244 2245 def MakeRMCPdat(G2frame,Name,Phase,Meta,Atseq,Supercell,Files,PWId): 2246 fname = Name+'.testdat' 2247 fl = open(fname,'w') 2248 fl.write('TITLE :: '+Name+'\n') 2249 fl.write('MATERIAL :: '+Meta['material']+'\n') 2250 fl.write('PHASE :: '+Meta['phase']+'\n') 2251 fl.write('TEMPERATURE :: '+str(Meta['temperature'])+'\n') 2252 fl.write('INVESTIGATOR :: '+Meta['owner']+'\n') 2253 fl.write(' %% edit the following as needed\n') 2254 fl.write('MINIMUM_DISTANCES :: 4.00 1.37 2.0 Angstrom\n') 2255 fl.write('MAXIMUM_MOVES :: 0.05 0.10 Angstrom\n') 2256 fl.write('R_SPACING :: 0.0200 Angstrom\n') 2257 fl.write('PRINT_PERIOD :: 100\n') 2258 fl.write('TIME_LIMIT :: 10.00 MINUTES\n') 2259 fl.write('SAVE_PERIOD :: 1.00 MINUTES\n') 2260 fl.write('ATOMS :: '+' '.join(Atseq)+'\n') 2261 fl.write('FLAGS ::\n') 2262 fl.write(' > NO_MOVEOUT\n') 2263 fl.write(' > NO_SAVE_CONFIGURATIONS\n') 2264 fl.write(' > NO_RESOLUTION_CONVOLUTION\n') 2265 fl.write('INPUT_CONFIGURATION_FORMAT :: rmc6f\n') 2266 fl.write('SAVE_CONFIGURATION_FORMAT :: rmc6f\n') 2267 2268 2269 2270 2271 fl.close() 2272 return fname 2273 2244 2274 2245 2275 def MakePDB(G2frame,Name,Phase,Atseq,Supercell):
Note: See TracChangeset
for help on using the changeset viewer.