Changeset 3241


Ignore:
Timestamp:
Jan 23, 2018 2:13:00 PM (5 years ago)
Author:
vondreele
Message:

Add Nobs to print from Hessian LS
fix bug in setting global TLS refinement flags for RB parameters

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIImath.py

    r3231 r3241  
    163163        time0 = time.time()
    164164        M = func(x0,*args)
     165        Nobs = len(M)
    165166        nfev += 1
    166167        chisq0 = np.sum(M**2)
     
    174175        Amat /= Anorm
    175176        if Print:
    176             print ('initial chi^2 %.5g'%(chisq0))
     177            print ('initial chi^2 %.5g on %d obs.'%(chisq0,Nobs))
    177178        chitol = ftol
    178179        while True:
     
    190191            nfev += 1
    191192            chisq1 = np.sum(M2**2)
    192             if chisq1 > chisq0*(1.+chitol):
     193            if chisq1 > chisq0*(1.+chitol):     #TODO put Alan Coehlo's criteria for lambda here
    193194                lam *= 10.
    194195                if Print:
    195                     print ('new chi^2 %.5g, %d SVD zeros ; matrix modification needed; lambda now %.1e'%(chisq1,Nzeros,lam))
     196                    print ('new chi^2 %.5g on %d obs., %d SVD zeros ; matrix modification needed; lambda now %.1e'  \
     197                           %(chisq1,Nobs,Nzeros,lam))
    196198            else:
    197199                x0 += Xvec
     
    205207        deltaChi2 = (chisq0-chisq1)/chisq0
    206208        if Print:
    207             print (' Cycle: %d, Time: %.2fs, Chi**2: %.5g, Lambda: %.3g,  Delta: %.3g'%(
    208                 icycle,time.time()-time0,chisq1,lamMax,deltaChi2))
     209            print (' Cycle: %d, Time: %.2fs, Chi**2: %.5g for %d obs., Lambda: %.3g,  Delta: %.3g'%(
     210                icycle,time.time()-time0,chisq1,Nobs,lamMax,deltaChi2))
    209211        if deltaChi2 < ftol:
    210212            ifConverged = True
  • trunk/GSASIIphsGUI.py

    r3239 r3241  
    74797479                        else:
    74807480                           rbObj['ThermalMotion'][2][0] = False
    7481                     elif 'T' in rbObj['ThermalMotion'][0]:
     7481                    if 'T' in rbObj['ThermalMotion'][0]:
    74827482                        if 'Tii' in parms:
    74837483                            rbObj['ThermalMotion'][2][0:2] = [True,True,True]
     
    74887488                        else:
    74897489                            rbObj['ThermalMotion'][2][3:6] = [False,False,False]
    7490                     elif 'L' in rbObj['ThermalMotion'][0]:
     7490                    if 'L' in rbObj['ThermalMotion'][0]:
    74917491                        if 'Lii' in parms:
    74927492                            rbObj['ThermalMotion'][2][6:9] = [True,True,True]
     
    74977497                        else:
    74987498                            rbObj['ThermalMotion'][2][9:12] = [False,False,False]
    7499                     elif 'S' in rbObj['ThermalMotion'][0]:
     7499                    if 'S' in rbObj['ThermalMotion'][0]:
    75007500                        if 'Sij' in parms:
    75017501                            rbObj['ThermalMotion'][2][12:20] = [True,True,True,True,True,True,True,True]
Note: See TracChangeset for help on using the changeset viewer.