- Timestamp:
- Sep 10, 2011 9:52:32 AM (14 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified trunk/GSASII.py ¶
r368 r369 1373 1373 self.OnFileSave(event) 1374 1374 #works - but it'd be better if it could restore plots 1375 G2str.Refine(self.GSASprojectfile) 1375 dlg = wx.ProgressDialog('Residual','Powder profile Rwp =',101.0, 1376 style = wx.PD_ELAPSED_TIME|wx.PD_AUTO_HIDE|wx.PD_REMAINING_TIME|wx.PD_CAN_ABORT) 1377 screenSize = wx.ClientDisplayRect() 1378 Size = dlg.GetSize() 1379 dlg.SetPosition(wx.Point(screenSize[2]-Size[0]-305,screenSize[1]+5)) 1380 try: 1381 G2str.Refine(self.GSASprojectfile,dlg) 1382 finally: 1383 dlg.Destroy() 1376 1384 dlg = wx.MessageDialog(self,'Load new result?','Refinement results',wx.OK|wx.CANCEL) 1377 1385 try: -
TabularUnified trunk/GSASIIstruct.py ¶
r368 r369 14 14 import time 15 15 import math 16 import wx17 16 import GSASIIpath 18 17 import GSASIIElem as G2el … … 1404 1403 return dMdv 1405 1404 1406 def Refine(GPXfile ):1405 def Refine(GPXfile,dlg): 1407 1406 1408 1407 def dervRefine(values,HistoPhases,parmdict,varylist,calcControls,pawleyLookup,dlg): … … 1498 1497 begin = time.time() 1499 1498 values = np.array(Dict2Values(parmDict, varyList)) 1500 dlg = wx.ProgressDialog('Residual','Powder profile Rwp =',101.0,1501 style = wx.PD_ELAPSED_TIME|wx.PD_AUTO_HIDE|wx.PD_REMAINING_TIME|wx.PD_CAN_ABORT)1502 screenSize = wx.ClientDisplayRect()1503 Size = dlg.GetSize()1504 dlg.SetPosition(wx.Point(screenSize[2]-Size[0]-305,screenSize[1]+5))1505 1499 Ftol = Controls['min dM/M'] 1506 1500 Factor = Controls['shift factor'] 1507 try: 1508 if Controls['deriv type'] == 'analytic': 1509 result = so.leastsq(errRefine,values,Dfun=dervRefine,full_output=True, 1510 ftol=Ftol,col_deriv=True,factor=Factor, 1511 args=([Histograms,Phases],parmDict,varyList,calcControls,pawleyLookup,dlg)) 1512 ncyc = int(result[2]['nfev']/2) 1513 else: #'numeric' 1514 result = so.leastsq(errRefine,values,full_output=True,ftol=Ftol,epsfcn=1.e-8,factor=Factor, 1515 args=([Histograms,Phases],parmDict,varyList,calcControls,pawleyLookup,dlg)) 1516 ncyc = int(result[2]['nfev']/len(varyList)) 1517 finally: 1518 dlg.Destroy() 1501 if Controls['deriv type'] == 'analytic': 1502 result = so.leastsq(errRefine,values,Dfun=dervRefine,full_output=True, 1503 ftol=Ftol,col_deriv=True,factor=Factor, 1504 args=([Histograms,Phases],parmDict,varyList,calcControls,pawleyLookup,dlg)) 1505 ncyc = int(result[2]['nfev']/2) 1506 else: #'numeric' 1507 result = so.leastsq(errRefine,values,full_output=True,ftol=Ftol,epsfcn=1.e-8,factor=Factor, 1508 args=([Histograms,Phases],parmDict,varyList,calcControls,pawleyLookup,dlg)) 1509 ncyc = int(result[2]['nfev']/len(varyList)) 1519 1510 runtime = time.time()-begin 1520 1511 chisq = np.sum(result[2]['fvec']**2)
Note: See TracChangeset
for help on using the changeset viewer.