Changeset 362 for trunk/GSASIIstruct.py
 Timestamp:
 Sep 4, 2011 8:04:31 AM (11 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

trunk/GSASIIstruct.py
r360 r362 44 44 Controls = dictionary of control items 45 45 ''' 46 Controls = {'deriv type':'analytical','min dM/M':0.0001,'shift factor':1.} 46 47 file = open(GPXfile,'rb') 47 48 while True: … … 52 53 datum = data[0] 53 54 if datum[0] == 'Controls': 54 Controls = datum[1]55 Controls.update(datum[1]) 55 56 file.close() 56 57 return Controls … … 60 61 print ' Derivative type: ',Controls['deriv type'] 61 62 print ' Minimum deltaM/M for convergence: ','%.2g'%(Controls['min dM/M']) 63 print ' Initial shift factor: ','%.3f'%(Controls['shift factor']) 62 64 63 65 def GetPhaseNames(GPXfile): … … 1201 1203 tanth = tand(refl[5]/2.) 1202 1204 if calcControls[phfx+'SizeType'] == 'isotropic': 1203 gam = 1 .8*wave/(np.pi*parmDict[phfx+'Size:0']*costh)1204 gamDict[phfx+'Size:0'] = gam/parmDict[phfx+'Size:0']1205 gam = 180.*wave/(np.pi*parmDict[phfx+'Size:0']*costh) 1206 gamDict[phfx+'Size:0'] = gam/parmDict[phfx+'Size:0'] 1205 1207 elif calcControls[phfx+'SizeType'] == 'uniaxial': 1206 1208 H = np.array(refl[:3]) … … 1209 1211 Si = parmDict[phfx+'Size:0'] 1210 1212 Sa = parmDict[phfx+'Size:1'] 1211 gami = (1 .8*wave/np.pi)/(Si*Sa)1213 gami = (180.*wave/np.pi)/(Si*Sa) 1212 1214 sqtrm = np.sqrt((cosP*Sa)**2+(sinP*Si)**2) 1213 1215 gam = gami*sqtrm/costh 1214 1216 gamDict[phfx+'Size:0'] = gami*Si*sinP**2/(sqtrm*costh)gam/Si 1215 gamDict[phfx+'Size:1'] = gam i*Sa*cosP**2/(sqtrm*costh)gam/Sa1217 gamDict[phfx+'Size:1'] = gam/Sagami*Sa*cosP**2/(sqtrm*costh) 1216 1218 else: #ellipsoidal crystallites  do numerically? 1217 1219 H = np.array(refl[:3]) … … 1489 1491 dlg.SetPosition(wx.Point(screenSize[2]Size[0]305,screenSize[1]+5)) 1490 1492 Ftol = Controls['min dM/M'] 1493 Factor = Controls['shift factor'] 1491 1494 try: 1492 1495 if Controls['deriv type'] == 'analytic': 1493 result = so.leastsq(errRefine,values,Dfun=dervRefine,full_output=True,ftol=Ftol,col_deriv=True, 1496 result = so.leastsq(errRefine,values,Dfun=dervRefine,full_output=True, 1497 ftol=Ftol,col_deriv=True,factor=Factor, 1494 1498 args=([Histograms,Phases],parmDict,varyList,calcControls,pawleyLookup,dlg)) 1495 1499 ncyc = int(result[2]['nfev']/2) 1496 1500 else: #'numeric' 1497 result = so.leastsq(errRefine,values,full_output=True,ftol=Ftol,epsfcn=1.e8, 1501 result = so.leastsq(errRefine,values,full_output=True,ftol=Ftol,epsfcn=1.e8,factor=Factor, 1498 1502 args=([Histograms,Phases],parmDict,varyList,calcControls,pawleyLookup,dlg)) 1499 1503 ncyc = int(result[2]['nfev']/len(varyList))
Note: See TracChangeset
for help on using the changeset viewer.