Changeset 3241
- Timestamp:
- Jan 23, 2018 2:13:00 PM (5 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/GSASIImath.py
r3231 r3241 163 163 time0 = time.time() 164 164 M = func(x0,*args) 165 Nobs = len(M) 165 166 nfev += 1 166 167 chisq0 = np.sum(M**2) … … 174 175 Amat /= Anorm 175 176 if Print: 176 print ('initial chi^2 %.5g '%(chisq0))177 print ('initial chi^2 %.5g on %d obs.'%(chisq0,Nobs)) 177 178 chitol = ftol 178 179 while True: … … 190 191 nfev += 1 191 192 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 193 194 lam *= 10. 194 195 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)) 196 198 else: 197 199 x0 += Xvec … … 205 207 deltaChi2 = (chisq0-chisq1)/chisq0 206 208 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)) 209 211 if deltaChi2 < ftol: 210 212 ifConverged = True -
trunk/GSASIIphsGUI.py
r3239 r3241 7479 7479 else: 7480 7480 rbObj['ThermalMotion'][2][0] = False 7481 elif 'T' in rbObj['ThermalMotion'][0]:7481 if 'T' in rbObj['ThermalMotion'][0]: 7482 7482 if 'Tii' in parms: 7483 7483 rbObj['ThermalMotion'][2][0:2] = [True,True,True] … … 7488 7488 else: 7489 7489 rbObj['ThermalMotion'][2][3:6] = [False,False,False] 7490 elif 'L' in rbObj['ThermalMotion'][0]:7490 if 'L' in rbObj['ThermalMotion'][0]: 7491 7491 if 'Lii' in parms: 7492 7492 rbObj['ThermalMotion'][2][6:9] = [True,True,True] … … 7497 7497 else: 7498 7498 rbObj['ThermalMotion'][2][9:12] = [False,False,False] 7499 elif 'S' in rbObj['ThermalMotion'][0]:7499 if 'S' in rbObj['ThermalMotion'][0]: 7500 7500 if 'Sij' in parms: 7501 7501 rbObj['ThermalMotion'][2][12:20] = [True,True,True,True,True,True,True,True]
Note: See TracChangeset
for help on using the changeset viewer.