Changeset 369


Ignore:
Timestamp:
Sep 10, 2011 9:52:32 AM (10 years ago)
Author:
vondreele
Message:

remove wx from GSASIIstruct.py

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASII.py

    r368 r369  
    13731373        self.OnFileSave(event)
    13741374        #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()       
    13761384        dlg = wx.MessageDialog(self,'Load new result?','Refinement results',wx.OK|wx.CANCEL)
    13771385        try:
  • trunk/GSASIIstruct.py

    r368 r369  
    1414import time
    1515import math
    16 import wx
    1716import GSASIIpath
    1817import GSASIIElem as G2el
     
    14041403    return dMdv   
    14051404                   
    1406 def Refine(GPXfile):
     1405def Refine(GPXfile,dlg):
    14071406   
    14081407    def dervRefine(values,HistoPhases,parmdict,varylist,calcControls,pawleyLookup,dlg):
     
    14981497        begin = time.time()
    14991498        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))
    15051499        Ftol = Controls['min dM/M']
    15061500        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))
    15191510        runtime = time.time()-begin
    15201511        chisq = np.sum(result[2]['fvec']**2)
Note: See TracChangeset for help on using the changeset viewer.