Changeset 1175
- Timestamp:
- Dec 19, 2013 9:37:07 AM (10 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/GSASIIpwd.py
r1174 r1175 89 89 elif 'Bragg' in Geometry: 90 90 return 0.0 91 92 def SurfaceRough(SRA,SRB,Tth): 93 ''' Suortti surface roughness correction 94 ''' 95 sth = npsind(Tth/2.) 96 T1 = np.exp(-SRB/sth) 97 T2 = SRA+(1.-SRA)*np.exp(-SRB) 98 return (SRA+(1.-SRA)*T1)/T2 99 100 def SurfaceRoughDerv(SRA,SRB,Tth): 101 ''' Suortti surface roughness correction derivatives 102 ''' 103 sth = npsind(Tth/2.) 104 T1 = np.exp(-SRB/sth) 105 T2 = SRA+(1.-SRA)*np.exp(-SRB) 106 Trans = (SRA+(1.-SRA)*T1)/T2 107 dydSRA = ((1.-T1)*T2-(1.-np.exp(-SRB))*Trans)/T2**2 108 dydSRB = ((SRA-1.)*T1*T2/sth-Trans*(SRA-T2))/T2**2 109 return [dydSRA,dydSRB] 91 110 92 111 def Absorb(Geometry,MuR,Tth,Phi=0,Psi=0): -
trunk/GSASIIpwdGUI.py
r1147 r1175 1100 1100 copyNames += ['DisplaceX','DisplaceY','Absorption'] 1101 1101 else: #Bragg-Brentano 1102 copyNames += ['Shift','Transparency' ]1102 copyNames += ['Shift','Transparency','SurfRoughA','SurfRoughB'] 1103 1103 if len(addNames): 1104 1104 copyNames += addNames … … 1311 1311 if 'FreePrm3' not in data: 1312 1312 data['FreePrm3'] = 0. 1313 if 'SurfRoughA' not in data: 1314 data['SurfRoughA'] = [0.,False] 1315 data['SurfRoughB'] = [0.,False] 1313 1316 #patch end 1314 1317 … … 1322 1325 elif data['Type'] == 'Bragg-Brentano': 1323 1326 parms += [['Shift',u'Sample displacement(\xb5m): '], 1324 ['Transparency',u'Sample transparency(1/\xb5eff, cm): '],] 1327 ['Transparency',u'Sample transparency(1/\xb5eff, cm): '], 1328 ['SurfRoughA','Surface roughness A: '], 1329 ['SurfRoughB','Surface roughness B: '],] 1325 1330 parms.append(['Omega','Goniometer omega:',]) 1326 1331 parms.append(['Chi','Goniometer chi:',]) -
trunk/GSASIIstrIO.py
r1160 r1175 2222 2222 Type = Sample['Type'] 2223 2223 if 'Bragg' in Type: #Bragg-Brentano 2224 for item in ['Scale','Shift','Transparency' ]: #surface roughness?, diffuse scattering?2224 for item in ['Scale','Shift','Transparency','SurfRoughA','SurfRoughB']: 2225 2225 sampDict[hfx+item] = Sample[item][0] 2226 2226 if Sample[item][1]: … … 2295 2295 varstr = ' refine:' 2296 2296 if 'Bragg' in Sample['Type']: 2297 for item in ['Scale','Shift','Transparency' ]:2297 for item in ['Scale','Shift','Transparency','SurfRoughA','SurfRoughB']: 2298 2298 ptlbls += '%14s'%(item) 2299 2299 ptstr += '%14.4f'%(Sample[item][0]) … … 2420 2420 def SetSampleParms(pfx,Sample,parmDict,sigDict): 2421 2421 if 'Bragg' in Sample['Type']: #Bragg-Brentano 2422 sampSig = [0 for i in range( 3)]2423 for i,item in enumerate(['Scale','Shift','Transparency' ]): #surface roughness?, diffuse scattering?2422 sampSig = [0 for i in range(5)] 2423 for i,item in enumerate(['Scale','Shift','Transparency','SurfRoughA','SurfRoughB']): 2424 2424 Sample[item][0] = parmDict[pfx+item] 2425 2425 if pfx+item in sigDict: … … 2514 2514 refine = False 2515 2515 if 'Bragg' in Sample['Type']: 2516 for i,item in enumerate(['Scale','Shift','Transparency' ]):2516 for i,item in enumerate(['Scale','Shift','Transparency','SurfRoughA','SurfRoughB']): 2517 2517 ptlbls += '%14s'%(item) 2518 2518 ptstr += '%14.4f'%(Sample[item][0]) -
trunk/GSASIIstrMath.py
r1140 r1175 1025 1025 return G2pwd.Absorb('Cylinder',parmDict[hfx+'Absorption'],refl[5],0,0) 1026 1026 else: 1027 return 1.01027 return G2pwd.SurfaceRough(parmDict[hfx+'SurfRoughA'],parmDict[hfx+'SurfRoughB'],refl[5]) 1028 1028 1029 1029 def GetAbsorbDerv(refl,hfx,calcControls,parmDict): … … 1032 1032 return G2pwd.AbsorbDerv('Cylinder',parmDict[hfx+'Absorption'],refl[5],0,0) 1033 1033 else: 1034 return 0.01034 return G2pwd.SurfaceRoughDerv(parmDict[hfx+'SurfRoughA'],parmDict[hfx+'SurfRoughB'],refl[5]) 1035 1035 1036 1036 def GetIntensityCorr(refl,uniq,G,g,pfx,phfx,hfx,SGData,calcControls,parmDict): … … 1582 1582 hfx+'I(L2)/I(L1)':[1.0,'L1/L2'],hfx+'Zero':[dpdZ,'pos'],hfx+'Lam':[dpdw,'pos'], 1583 1583 hfx+'Shift':[dpdSh,'pos'],hfx+'Transparency':[dpdTr,'pos'],hfx+'DisplaceX':[dpdX,'pos'], 1584 hfx+'DisplaceY':[dpdY,'pos'],hfx+'Absorption':[dFdAb,'int'],} 1584 hfx+'DisplaceY':[dpdY,'pos'],} 1585 if 'Bragg' in calcControls[hfx+'instType']: 1586 names.update({hfx+'SurfRoughA':[dFdAb[0],'int'], 1587 hfx+'SurfRoughB':[dFdAb[1],'int'],}) 1588 else: 1589 names.update({hfx+'Absorption':[dFdAb,'int'],}) 1585 1590 for name in names: 1586 1591 item = names[name]
Note: See TracChangeset
for help on using the changeset viewer.