Changeset 547
- Timestamp:
- Apr 16, 2012 4:06:27 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/G2importphase_CIF.py
r525 r547 18 18 def __init__(self): 19 19 super(self.__class__,self).__init__( # fancy way to say ImportPhase.__init__ 20 #extensionlist=('.CIF','.cif'), 21 extensionlist=('.CIF','.cif','.pdb'), # just for test! 20 extensionlist=('.CIF','.cif'), 22 21 strictExtension=False, 23 22 formatName = 'CIF', -
trunk/GSASII.py
r541 r547 14 14 import sys 15 15 import math 16 import cPickle16 #import cPickle 17 17 import time 18 18 import copy … … 841 841 panel.Fit() 842 842 self.Fit() 843 844 class ConstraintDialog(wx.Dialog): 845 '''Window to edit Constraint values 846 ''' 847 def __init__(self,parent,title,text,data): 848 wx.Dialog.__init__(self,parent,-1,title, 849 pos=wx.DefaultPosition,style=wx.DEFAULT_DIALOG_STYLE) 850 self.data = data 851 panel = wx.Panel(self) 852 mainSizer = wx.BoxSizer(wx.VERTICAL) 853 topLabl = wx.StaticText(panel,-1,text) 854 mainSizer.Add((10,10),1) 855 mainSizer.Add(topLabl,0,wx.ALIGN_CENTER_VERTICAL|wx.LEFT,10) 856 mainSizer.Add((10,10),1) 857 dataGridSizer = wx.FlexGridSizer(rows=len(data),cols=2,hgap=2,vgap=2) 858 for id,item in enumerate(self.data[:-1]): 859 #name = wx.TextCtrl(panel,-1,item[1],size=wx.Size(200,20)) 860 name = wx.StaticText(panel,-1,item[1],size=wx.Size(200,20)) 861 #name.SetEditable(False) 862 scale = wx.TextCtrl(panel,id,'%.3f'%(item[0]),style=wx.TE_PROCESS_ENTER) 863 scale.Bind(wx.EVT_TEXT_ENTER,self.OnScaleChange) 864 scale.Bind(wx.EVT_KILL_FOCUS,self.OnScaleChange) 865 dataGridSizer.Add(scale,0,wx.LEFT,10) 866 dataGridSizer.Add(name,0,wx.RIGHT,10) 867 mainSizer.Add(dataGridSizer,0,wx.EXPAND) 868 OkBtn = wx.Button(panel,-1,"Ok") 869 OkBtn.Bind(wx.EVT_BUTTON, self.OnOk) 870 cancelBtn = wx.Button(panel,-1,"Cancel") 871 cancelBtn.Bind(wx.EVT_BUTTON, self.OnCancel) 872 btnSizer = wx.BoxSizer(wx.HORIZONTAL) 873 btnSizer.Add((20,20),1) 874 btnSizer.Add(OkBtn) 875 btnSizer.Add((20,20),1) 876 btnSizer.Add(cancelBtn) 877 btnSizer.Add((20,20),1) 878 879 mainSizer.Add(btnSizer,0,wx.EXPAND|wx.BOTTOM|wx.TOP, 10) 880 panel.SetSizer(mainSizer) 881 panel.Fit() 882 self.Fit() 843 883 844 884 def OnNameChange(self,event): … … 866 906 parent.Raise() 867 907 self.EndModal(wx.ID_CANCEL) 868 self.Destroy()908 #self.Destroy() 869 909 870 910 def GetData(self): -
trunk/GSASIIgrid.py
r537 r547 258 258 self.ConstraintEdit.Append(id=wxID_CONSTRAINTADD, kind=wx.ITEM_NORMAL,text='Add constraint', 259 259 help='Add constraint on parameter values') 260 self.ConstraintEdit.Append(id=wxID_FUNCTADD, kind=wx.ITEM_NORMAL,text='Add function',261 help='Add function of parameter values')260 self.ConstraintEdit.Append(id=wxID_FUNCTADD, kind=wx.ITEM_NORMAL,text='Add New Var', 261 help='Add variable composed of existing parameter') 262 262 263 263 # Restraints … … 1032 1032 G2frame.dataFrame.setSizePosLeft([700,350]) 1033 1033 1034 def UpdateConstraints(G2frame,data): 1035 # data.update({'Hist':[],'HAP':[],'Phase':[]}) #empty dict - fill it 1034 def UpdateConstraints(G2frame,data): 1035 '''Called when Constraints tree item is selected. 1036 Displays the constraints in the data window 1037 ''' 1036 1038 if not data: 1037 1039 data.update({'Hist':[],'HAP':[],'Phase':[]}) #empty dict - fill it … … 1103 1105 1104 1106 def SelectVarbs(page,FrstVarb,varList,legend,constType): 1107 '''Select variables used in Constraints after one variable has 1108 been selected which determines the appropriate variables to be 1109 used here. Then creates the constraint and adds it to the 1110 constraints list. 1111 Called from OnAddEquivalence, OnAddFunction & OnAddConstraint 1112 ''' 1105 1113 #future - add 'all:all:name', '0:all:name', etc. to the varList 1106 1114 if page[1] == 'phs': 1107 1115 atchoice = [item+' for '+phaseAtNames[item] for item in varList] 1108 dlg = wx.MultiChoiceDialog(G2frame,'Select more variables:'+legend,FrstVarb+' and:',atchoice) 1116 dlg = wx.MultiChoiceDialog(G2frame, 1117 'Select more variables:'+legend, 1118 'Constrain '+FrstVarb+' and...', 1119 atchoice) 1109 1120 else: 1110 dlg = wx.MultiChoiceDialog(G2frame,'Select more variables:'+legend,FrstVarb+' and:',varList) 1121 dlg = wx.MultiChoiceDialog(G2frame, 1122 'Select more variables:'+legend, 1123 'Constrain '+FrstVarb+' and...', 1124 varList) 1111 1125 varbs = [FrstVarb,] 1112 1126 if dlg.ShowModal() == wx.ID_OK: … … 1117 1131 if len(varbs) > 1: 1118 1132 if 'equivalence' in constType: 1119 constr = [ ]1133 constr = [[1.0,FrstVarb]] 1120 1134 for item in varbs[1:]: 1121 constr += [[ [1.0,FrstVarb],[-1.0,item],None,None],]1122 return constr #multiple constraints1135 constr += [[1.0,item]] 1136 return [constr+[None,None,'e']] # list of equivalent variables & mults 1123 1137 elif 'function' in constType: 1124 1138 constr = map(list,zip([1.0 for i in range(len(varbs))],varbs)) 1125 return [constr+[ 0.0,False]] #just one constraint1139 return [constr+[None,False,'f']] #just one constraint 1126 1140 else: #'constraint' 1127 1141 constr = map(list,zip([1.0 for i in range(len(varbs))],varbs)) 1128 return [constr+[1.0,None ]] #just one constraint - default sum to one1142 return [constr+[1.0,None,'c']] #just one constraint - default sum to one 1129 1143 return [] 1130 1144 1131 1145 def OnAddHold(event): 1146 '''add a Hold constraint''' 1132 1147 for phase in Phases: 1133 1148 Phase = Phases[phase] … … 1144 1159 sel = dlg.GetSelection() 1145 1160 FrstVarb = choice[2][sel] 1146 data[choice[3]] += [[[0.0,FrstVarb],None,None ],]1161 data[choice[3]] += [[[0.0,FrstVarb],None,None,'h'],] 1147 1162 dlg.Destroy() 1148 1163 choice[4]() 1149 1164 1150 1165 def OnAddEquivalence(event): 1166 '''add an Equivalence constraint''' 1151 1167 constr = [] 1152 1168 page = G2frame.Page … … 1168 1184 1169 1185 def OnAddFunction(event): 1186 '''add a Function (new variable) constraint''' 1170 1187 constr = [] 1171 1188 page = G2frame.Page … … 1187 1204 1188 1205 def OnAddConstraint(event): 1206 '''add a constraint equation to the constraints list''' 1189 1207 constr = [] 1190 1208 page = G2frame.Page … … 1206 1224 1207 1225 def ConstSizer(name,pageDisplay): 1208 constSizer = wx.FlexGridSizer(1,4,0,0) 1226 '''This creates a sizer displaying all of the constraints entered 1227 ''' 1228 constSizer = wx.FlexGridSizer(1,5,0,0) 1209 1229 for Id,item in enumerate(data[name]): 1230 eqString = ['',] 1231 if item[-1] == 'h': 1232 constSizer.Add((5,5),0) # blank space for edit button 1233 typeString = ' FIXED ' 1234 eqString[-1] = item[0][1]+' ' 1235 elif isinstance(item[-1],str): 1236 constEdit = wx.Button(pageDisplay,-1,'Edit',style=wx.BU_EXACTFIT) 1237 constEdit.Bind(wx.EVT_BUTTON,OnConstEdit) 1238 constSizer.Add(constEdit) # edit button 1239 Indx[constEdit.GetId()] = [Id,name] 1240 if item[-1] == 'f': 1241 for term in item[:-3]: 1242 if len(eqString[-1]) > 60: 1243 eqString.append(' ') 1244 if eqString[-1] != '': 1245 if term[0] > 0: 1246 eqString[-1] += ' + ' 1247 else: 1248 eqString[-1] += ' - ' 1249 eqString[-1] += '%.3f*%s '%(abs(term[0]),term[1]) 1250 typeString = ' NEWVAR ' 1251 eqString[-1] += ' = New Variable ' 1252 elif item[-1] == 'c': 1253 for term in item[:-3]: 1254 if len(eqString[-1]) > 60: 1255 eqString.append(' ') 1256 if eqString[-1] != '': 1257 if term[0] > 0: 1258 eqString[-1] += ' + ' 1259 else: 1260 eqString[-1] += ' - ' 1261 eqString[-1] += '%.3f*%s '%(abs(term[0]),term[1]) 1262 typeString = ' CONSTR ' 1263 eqString[-1] += ' = %.3f'%(item[-3])+' ' 1264 elif item[-1] == 'e': 1265 first = 1.0 1266 for term in item[:-3]: 1267 if len(eqString[-1]) > 60: 1268 eqString.append(' ') 1269 if eqString[-1] == '': 1270 eqString[-1] += '%s '%(term[1]) 1271 if term[0] != 0: first = term[0] 1272 else: 1273 eqString[-1] += ' = %.3f*%s '%(term[0]/first,term[1]) 1274 typeString = ' EQUIV ' 1275 else: 1276 print 'Unexpected constraint',item 1277 else: 1278 print 'Removing old-style constraints' 1279 data[name] = [] 1280 return constSizer 1210 1281 constDel = wx.Button(pageDisplay,-1,'Delete',style=wx.BU_EXACTFIT) 1211 1282 constDel.Bind(wx.EVT_BUTTON,OnConstDel) 1212 1283 Indx[constDel.GetId()] = [Id,name] 1213 if len(item) < 4: 1214 constSizer.Add((5,5),0) 1215 constSizer.Add(constDel) 1216 eqString = ' FIXED '+item[0][1]+' ' 1217 else: 1218 constEdit = wx.Button(pageDisplay,-1,'Edit',style=wx.BU_EXACTFIT) 1219 constEdit.Bind(wx.EVT_BUTTON,OnConstEdit) 1220 Indx[constEdit.GetId()] = [Id,name] 1221 constSizer.Add(constEdit) 1222 constSizer.Add(constDel) 1223 if isinstance(item[-1],bool): 1224 eqString = ' FUNCT ' 1225 elif isinstance(item[-2],float): 1226 eqString = ' CONSTR ' 1227 else: 1228 eqString = ' EQUIV ' 1229 for term in item[:-2]: 1230 eqString += '%+.3f*%s '%(term[0],term[1]) 1231 if isinstance(item[-2],float): 1232 eqString += ' = %.3f'%(item[-2])+' ' 1233 else: 1234 eqString += ' = 0 ' 1235 constSizer.Add(wx.StaticText(pageDisplay,-1,eqString),0,wx.ALIGN_CENTER_VERTICAL) 1236 if isinstance(item[-1],bool): 1237 constRef = wx.CheckBox(pageDisplay,-1,label=' Refine?') 1238 constRef.SetValue(item[-1]) 1284 constSizer.Add(constDel) # delete button 1285 constSizer.Add(wx.StaticText(pageDisplay,-1,typeString)) 1286 EqSizer = wx.BoxSizer(wx.VERTICAL) 1287 for s in eqString: 1288 EqSizer.Add(wx.StaticText(pageDisplay,-1,s),0,wx.ALIGN_CENTER_VERTICAL) 1289 constSizer.Add(EqSizer,0,wx.ALIGN_CENTER_VERTICAL) 1290 if item[-1] == 'f': 1291 constRef = wx.CheckBox(pageDisplay,-1,label=' Refine?') 1292 constRef.SetValue(item[-2]) 1239 1293 constRef.Bind(wx.EVT_CHECKBOX,OnConstRef) 1240 1294 Indx[constRef.GetId()] = item 1241 constSizer.Add(constRef ,0,wx.ALIGN_CENTER_VERTICAL)1295 constSizer.Add(constRef) 1242 1296 else: 1243 1297 constSizer.Add((5,5),0) … … 1246 1300 def OnConstRef(event): 1247 1301 Obj = event.GetEventObject() 1248 Indx[Obj.GetId()][- 1] = Obj.GetValue()1302 Indx[Obj.GetId()][-2] = Obj.GetValue() 1249 1303 1250 1304 def OnConstDel(event): … … 1255 1309 1256 1310 def OnConstEdit(event): 1311 '''Called to edit an individual contraint by the Edit button''' 1257 1312 Obj = event.GetEventObject() 1258 1313 Id,name = Indx[Obj.GetId()] 1259 const = data[name][Id][-2]1260 if isinstance(data[name][Id][-1],bool):1261 items = data[name][Id][:-2]+[[],]1262 constType = 'Function'1263 extra = '; sum = new variable'1264 elif isinstance(data[name][Id][-2],float):1265 items = data[name][Id][:-2]+[[const,'= fixed value'],[]]1314 if data[name][Id][-1] == 'f': 1315 items = data[name][Id][:-3]+[[],] 1316 constType = 'New Variable' 1317 lbl = 'Enter value for each term in constraint; sum = new variable' 1318 elif data[name][Id][-1] == 'c': 1319 items = data[name][Id][:-3]+[ 1320 [data[name][Id][-3],'= fixed value'],[]] 1266 1321 constType = 'Constraint' 1267 extra = ' sum = constant' 1322 lbl = 'Edit value for each term in constant constraint sum' 1323 elif data[name][Id][-1] == 'e': 1324 items = data[name][Id][:-3]+[[],] 1325 constType = 'Equivalence' 1326 lbl = 'Variable ' + items[0][1] + ' is equal to: ' 1268 1327 else: 1269 items = data[name][Id][:-2]+[[],] 1270 constType = 'Equivalence' 1271 extra = '; sum = 0' 1272 dlg = G2frame.SumDialog(G2frame,constType,'Enter value for each term in constraint'+extra,'',items) 1328 return 1329 dlg = G2frame.ConstraintDialog(G2frame,constType,lbl,items) 1273 1330 try: 1274 1331 if dlg.ShowModal() == wx.ID_OK: 1275 1332 result = dlg.GetData() 1276 if isinstance(data[name][Id][-2],float):1277 data[name][Id][:- 2] = result[:-2]1278 data[name][Id][- 2] = result[-2][0]1333 if data[name][Id][-1] == 'c': 1334 data[name][Id][:-3] = result[:-2] 1335 data[name][Id][-3] = result[-2][0] 1279 1336 else: 1280 data[name][Id][:- 2] = result[:-1]1337 data[name][Id][:-3] = result[:-1] 1281 1338 except: 1282 1339 import traceback … … 1287 1344 1288 1345 def UpdateHAPConstr(): 1346 '''Responds to press on Histogram/Phase Constraints tab, 1347 shows constraints in data window''' 1289 1348 HAPConstr.DestroyChildren() 1290 1349 HAPDisplay = wx.Panel(HAPConstr) … … 1297 1356 Size[1] = max(Size[1],250) + 20 1298 1357 HAPDisplay.SetSize(Size) 1358 # scroll bar not working, at least not on Mac 1299 1359 HAPConstr.SetScrollbars(10,10,Size[0]/10-4,Size[1]/10-1) 1300 1360 Size[1] = min(Size[1],250) … … 1302 1362 1303 1363 def UpdateHistConstr(): 1364 '''Responds to press on Histogram Constraints tab, 1365 shows constraints in data window''' 1304 1366 HistConstr.DestroyChildren() 1305 1367 HistDisplay = wx.Panel(HistConstr) … … 1317 1379 1318 1380 def UpdatePhaseConstr(): 1381 '''Responds to press on Phase Constraint tab, 1382 shows constraints in data window''' 1319 1383 PhaseConstr.DestroyChildren() 1320 1384 PhaseDisplay = wx.Panel(PhaseConstr) … … 1352 1416 1353 1417 plegend,hlegend,phlegend = GetPHlegends(Phases,Histograms) 1354 scope = {'hst':['Histogram variables:',hlegend,histList,'Hist',UpdateHistConstr],1355 'hap':['H AP variables:',phlegend,hapList,'HAP',UpdateHAPConstr],1356 'phs':['Phase variables:',plegend,phaseList,'Phase',UpdatePhaseConstr]}1418 scope = {'hst':['Histogram contraints:',hlegend,histList,'Hist',UpdateHistConstr], 1419 'hap':['Histogram * Phase contraints:',phlegend,hapList,'HAP',UpdateHAPConstr], 1420 'phs':['Phase contraints:',plegend,phaseList,'Phase',UpdatePhaseConstr]} 1357 1421 if G2frame.dataDisplay: 1358 1422 G2frame.dataDisplay.Destroy() -
trunk/GSASIIstruct.py
r529 r547 43 43 Controls = {'deriv type':'analytic Hessian','max cyc':3,'max Hprocess':1, 44 44 'max Rprocess':1,'min dM/M':0.0001,'shift factor':1.} 45 f ile= open(GPXfile,'rb')45 fl = open(GPXfile,'rb') 46 46 while True: 47 47 try: 48 data = cPickle.load(f ile)48 data = cPickle.load(fl) 49 49 except EOFError: 50 50 break … … 52 52 if datum[0] == 'Controls': 53 53 Controls.update(datum[1]) 54 f ile.close()54 fl.close() 55 55 return Controls 56 56 57 def GetConstraints(GPXfile): 57 def GetConstraints(GPXfile,varyList,parmDict): 58 '''Read the constraints from the GPX file and interpret them 59 Note that this needs an update to match the new-style constraints 60 ''' 58 61 constList = [] 59 f ile= open(GPXfile,'rb')62 fl = open(GPXfile,'rb') 60 63 while True: 61 64 try: 62 data = cPickle.load(f ile)65 data = cPickle.load(fl) 63 66 except EOFError: 64 67 break … … 68 71 for item in constDict: 69 72 constList += constDict[item] 70 f ile.close()73 fl.close() 71 74 constDict = [] 72 75 constFlag = [] 73 76 fixedList = [] 74 77 for item in constList: 75 if item[-2]: 76 fixedList.append(str(item[-2])) 78 if item[-1] == 'h': 79 # process a hold 80 fixedList.append('0') 81 constFlag.append([]) 82 constDict.append({item[0][1]:0.0}) 83 elif item[-1] == 'f': 84 # process a new variable 85 fixedList.append(None) 86 constFlag.append([]) 87 constDict.append({}) 88 for term in item[:-3]: 89 constDict[-1][term[1]] = term[0] 90 if item[-2]: 91 constFlag[-1] = ['Vary'] 92 elif item[-1] == 'c': 93 # process a contraint relationship 94 const = item[-3] 95 vars = 0 96 used = {} 97 for term in item[:-3]: 98 if term[1] in varyList: 99 used[term[1]] = term[0] 100 vars += 1 101 else: 102 const -= parmDict[term[1]]*term[0] 103 if vars == 0: 104 print 'Contraint is not used',item[:-3],'=',item[-3] 105 print 'no refined variables' 106 continue 107 fixedList.append(str(const)) 108 constFlag.append(['VaryFree']) 109 constDict.append(used) 110 elif item[-1] == 'e': 111 # process an equivalence 112 first = None 113 eqlist = [] 114 for term in item[:-3]: 115 if first is None: 116 first = term[0] 117 if first == 0: first = 1.0 118 firstvar = term[1] 119 else: 120 eqlist.append([term[1],term[0]/first]) 121 G2mv.StoreEquivalence(firstvar,eqlist) 77 122 else: 78 fixedList.append('0') 79 if item[-1]: 80 constFlag.append(['VARY']) 81 else: 82 constFlag.append([]) 83 itemDict = {} 84 for term in item[:-2]: 85 itemDict[term[1]] = term[0] 86 constDict.append(itemDict) 123 pass 87 124 return constDict,constFlag,fixedList 88 125 … … 94 131 PhaseNames = list of phase names 95 132 ''' 96 f ile= open(GPXfile,'rb')133 fl = open(GPXfile,'rb') 97 134 PhaseNames = [] 98 135 while True: 99 136 try: 100 data = cPickle.load(f ile)137 data = cPickle.load(fl) 101 138 except EOFError: 102 139 break … … 105 142 for datus in data[1:]: 106 143 PhaseNames.append(datus[0]) 107 f ile.close()144 fl.close() 108 145 return PhaseNames 109 146 … … 116 153 phase dictionary 117 154 ''' 118 f ile= open(GPXfile,'rb')155 fl = open(GPXfile,'rb') 119 156 General = {} 120 157 Atoms = [] 121 158 while True: 122 159 try: 123 data = cPickle.load(f ile)160 data = cPickle.load(fl) 124 161 except EOFError: 125 162 break … … 129 166 if datus[0] == PhaseName: 130 167 break 131 f ile.close()168 fl.close() 132 169 return datus[1] 133 170 … … 140 177 Histograms = dictionary of histograms (types = PWDR & HKLF) 141 178 """ 142 f ile= open(GPXfile,'rb')179 fl = open(GPXfile,'rb') 143 180 Histograms = {} 144 181 while True: 145 182 try: 146 data = cPickle.load(f ile)183 data = cPickle.load(fl) 147 184 except EOFError: 148 185 break … … 168 205 HKLFdata = datum[1:][0] 169 206 Histograms[hist] = HKLFdata 170 f ile.close()207 fl.close() 171 208 return Histograms 172 209 … … 179 216 HistogramNames = list of histogram names (types = PWDR & HKLF) 180 217 """ 181 f ile= open(GPXfile,'rb')218 fl = open(GPXfile,'rb') 182 219 HistogramNames = [] 183 220 while True: 184 221 try: 185 data = cPickle.load(f ile)222 data = cPickle.load(fl) 186 223 except EOFError: 187 224 break … … 189 226 if datum[0][:4] in hType: 190 227 HistogramNames.append(datum[0]) 191 f ile.close()228 fl.close() 192 229 return HistogramNames 193 230 … … 348 385 349 386 ''' 350 f ile= open(GPXfile,'rb')387 fl = open(GPXfile,'rb') 351 388 PWDRdata = {} 352 389 while True: 353 390 try: 354 data = cPickle.load(f ile)391 data = cPickle.load(fl) 355 392 except EOFError: 356 393 break … … 366 403 except IndexError: 367 404 PWDRdata['Reflection lists'] = {} 368 f ile.close()405 fl.close() 369 406 return PWDRdata 370 407 … … 378 415 HKLF = [np.array([h,k,l]),FoSq,sigFoSq,FcSq,Fcp,Fcpp,phase] 379 416 ''' 380 f ile= open(GPXfile,'rb')417 fl = open(GPXfile,'rb') 381 418 HKLFdata = [] 382 419 while True: 383 420 try: 384 data = cPickle.load(f ile)421 data = cPickle.load(fl) 385 422 except EOFError: 386 423 break … … 388 425 if datum[0] == HKLFname: 389 426 HKLFdata = datum[1:][0] 390 f ile.close()427 fl.close() 391 428 return HKLFdata 392 429 … … 2812 2849 calcControls = {} 2813 2850 calcControls.update(Controls) 2814 constrDict,constrFlag,fixedList = GetConstraints(GPXfile)2815 2851 Histograms,Phases = GetUsedHistogramsAndPhases(GPXfile) 2816 2852 if not Phases: … … 2836 2872 GetFprime(calcControls,Histograms) 2837 2873 # do constraint processing 2874 constrDict,constrFlag,fixedList = GetConstraints(GPXfile,varyList,parmDict) 2838 2875 try: 2839 2876 groups,parmlist = G2mv.GroupConstraints(constrDict) … … 2848 2885 print msg 2849 2886 raise Exception(' *** Refine aborted ***') 2887 print G2mv.VarRemapShow(varyList) 2850 2888 G2mv.Map2Dict(parmDict,varyList) 2851 # print G2mv.VarRemapShow(varyList)2852 2889 Rvals = {} 2853 2890 while True: … … 2931 2968 #for testing purposes!!! 2932 2969 # import cPickle 2933 # f ile= open('structTestdata.dat','wb')2934 # cPickle.dump(parmDict,f ile,1)2935 # cPickle.dump(varyList,f ile,1)2970 # fl = open('structTestdata.dat','wb') 2971 # cPickle.dump(parmDict,fl,1) 2972 # cPickle.dump(varyList,fl,1) 2936 2973 # for histogram in Histograms: 2937 2974 # if 'PWDR' in histogram[:4]: 2938 2975 # Histogram = Histograms[histogram] 2939 # cPickle.dump(Histogram,f ile,1)2940 # cPickle.dump(Phases,f ile,1)2941 # cPickle.dump(calcControls,f ile,1)2942 # cPickle.dump(pawleyLookup,f ile,1)2943 # f ile.close()2976 # cPickle.dump(Histogram,fl,1) 2977 # cPickle.dump(Phases,fl,1) 2978 # cPickle.dump(calcControls,fl,1) 2979 # cPickle.dump(pawleyLookup,fl,1) 2980 # fl.close() 2944 2981 2945 2982 if dlg: … … 2955 2992 Controls = GetControls(GPXfile) 2956 2993 ShowControls(Controls) 2957 constrDict,constrFlag,fixedList = GetConstraints(GPXfile)2958 2994 Histograms,Phases = GetUsedHistogramsAndPhases(GPXfile) 2959 2995 if not Phases: … … 3017 3053 parmDict.update(histDict) 3018 3054 GetFprime(calcControls,Histo) 3019 constrDict,constrFlag,fixedList = G2mv.InputParse([]) #constraints go here? 3055 # do constraint processing 3056 constrDict,constrFlag,fixedList = GetConstraints(GPXfile,varyList,parmDict) 3020 3057 groups,parmlist = G2mv.GroupConstraints(constrDict) 3021 3058 G2mv.GenerateConstraints(groups,parmlist,varyList,constrDict,constrFlag,fixedList)
Note: See TracChangeset
for help on using the changeset viewer.