Changeset 3913 for trunk/GSASIImath.py


Ignore:
Timestamp:
Apr 21, 2019 10:05:23 PM (3 years ago)
Author:
toby
Message:

Update Rietveld cycle-by-cycle

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIImath.py

    r3900 r3913  
    9999    return res,nzero
    100100
    101 def HessianLSQ(func,x0,Hess,args=(),ftol=1.49012e-8,xtol=1.e-6, maxcyc=0,lamda=-3,Print=False):
    102    
     101def HessianLSQ(func,x0,Hess,args=(),ftol=1.49012e-8,xtol=1.e-6, maxcyc=0,lamda=-3,Print=False,refPlotUpdate=None):
    103102    """
    104103    Minimize the sum of squares of a function (:math:`f`) evaluated on a series of
     
    209208            print (' Cycle: %d, Time: %.2fs, Chi**2: %.5g for %d obs., Lambda: %.3g,  Delta: %.3g'%(
    210209                icycle,time.time()-time0,chisq1,Nobs,lamMax,deltaChi2))
     210        Histograms = args[0][0]
     211        if refPlotUpdate is not None: refPlotUpdate(Histograms,icycle)   # update plot
    211212        if deltaChi2 < ftol:
    212213            ifConverged = True
     
    233234        return [x0,None,{'num cyc':icycle,'fvec':M,'nfev':nfev,'lamMax':lamMax,'psing':psing,'SVD0':-1}]         
    234235           
    235 def HessianSVD(func,x0,Hess,args=(),ftol=1.49012e-8,xtol=1.e-6, maxcyc=0,lamda=-3,Print=False):
     236def HessianSVD(func,x0,Hess,args=(),ftol=1.49012e-8,xtol=1.e-6, maxcyc=0,lamda=-3,Print=False,refPlotUpdate=None):
    236237   
    237238    """
     
    319320            print (' Cycle: %d, Time: %.2fs, Chi**2: %.5g, Delta: %.3g'%(
    320321                icycle,time.time()-time0,chisq1,deltaChi2))
     322        Histograms = args[0][0]
     323        if refPlotUpdate is not None: refPlotUpdate(Histograms,icycle)   # update plot
    321324        if deltaChi2 < ftol:
    322325            ifConverged = True
Note: See TracChangeset for help on using the changeset viewer.