Changeset 1291
- Timestamp:
- Apr 21, 2014 2:48:45 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/GSASIIstrMain.py
r1289 r1291 266 266 varyList = rbVary+phaseVary+hapVary+histVary 267 267 if not ihst: 268 # s ubsequent refinements268 # save the initial vary list, but without histogram numbers on parameters 269 269 saveVaryList = varyList[:] 270 270 for i,item in enumerate(saveVaryList): … … 275 275 saveVaryList[i] = item 276 276 SeqResult['varyList'] = saveVaryList 277 else: 278 # first histogram to refine against 279 newVaryList = varyList[:] 280 for i,item in enumerate(newVaryList): 281 items = item.split(':') 282 if items[1]: 283 items[1] = '' 284 item = ':'.join(items) 285 newVaryList[i] = item 286 if newVaryList != SeqResult['varyList']: 287 # variable lists are expected to match between sequential refinements 288 print '**** ERROR - variable list for this histogram does not match previous' 289 print '\ncurrent histogram',histogram,'has',len(newVaryList),'variables' 290 combined = list(set(SeqResult['varyList']+newVaryList)) 291 c = [var for var in combined if var not in newVaryList] 292 p = [var for var in combined if var not in SeqResult['varyList']] 293 line = 'Variables in previous but not in current: ' 294 if c: 295 for var in c: 296 if len(line) > 100: 297 print line 298 line = ' ' 299 line += var + ', ' 300 else: 301 line += 'none' 302 print line 303 print '\nPrevious refinement has',len(SeqResult['varyList']),'variables' 304 line = 'Variables in current but not in previous: ' 305 if p: 306 for var in p: 307 if len(line) > 100: 308 print line 309 line = ' ' 310 line += var + ', ' 311 else: 312 line += 'none' 313 print line 314 raise Exception 277 origvaryList = varyList[:] 315 278 parmDict = {} 316 279 parmDict.update(phaseDict) … … 335 298 raise Exception(' *** Refine aborted ***') 336 299 #print G2mv.VarRemapShow(varyList) 300 if not ihst: 301 # first histogram to refine against 302 firstVaryList = [] 303 for item in varyList: 304 items = item.split(':') 305 if items[1]: 306 items[1] = '' 307 item = ':'.join(items) 308 firstVaryList.append(item) 309 newVaryList = firstVaryList 310 else: 311 newVaryList = [] 312 for item in varyList: 313 items = item.split(':') 314 if items[1]: 315 items[1] = '' 316 item = ':'.join(items) 317 newVaryList.append(item) 318 if newVaryList != firstVaryList: 319 # variable lists are expected to match between sequential refinements 320 print '**** ERROR - variable list for this histogram does not match previous' 321 print '\ncurrent histogram',histogram,'has',len(newVaryList),'variables' 322 combined = list(set(firstVaryList+newVaryList)) 323 c = [var for var in combined if var not in newVaryList] 324 p = [var for var in combined if var not in firstVaryList] 325 line = 'Variables in previous but not in current: ' 326 if c: 327 for var in c: 328 if len(line) > 100: 329 print line 330 line = ' ' 331 line += var + ', ' 332 else: 333 line += 'none' 334 print line 335 print '\nPrevious refinement has',len(firstVaryList),'variables' 336 line = 'Variables in current but not in previous: ' 337 if p: 338 for var in p: 339 if len(line) > 100: 340 print line 341 line = ' ' 342 line += var + ', ' 343 else: 344 line += 'none' 345 print line 346 raise Exception 337 347 338 348 ifPrint = False … … 342 352 rigidbodyDict,parmDict,varyList,calcControls,pawleyLookup,ifPrint,printFile,dlg) 343 353 354 print ' wR = %7.2f%%, chi**2 = %12.6g, reduced chi**2 = %6.2f, last delta chi = %.4f'%( 355 Rvals['Rwp'],Rvals['chisq'],Rvals['GOF'],Rvals['DelChi2']) 344 356 # add the uncertainties into the esd dictionary (sigDict) 345 357 sigDict = dict(zip(varyList,sig))
Note: See TracChangeset
for help on using the changeset viewer.