# Changeset 1175

Ignore:
Timestamp:
Dec 19, 2013 9:37:07 AM (10 years ago)
Message:

add surface roughness (Surotti model) to Bragg-Brentano sample parameters
seems to work OK but I don't have a good test data set.

Location:
trunk
Files:
4 edited

Unmodified
Removed
• ## trunk/GSASIIpwd.py

 r1174 elif 'Bragg' in Geometry: return 0.0 def SurfaceRough(SRA,SRB,Tth): ''' Suortti surface roughness correction ''' sth = npsind(Tth/2.) T1 = np.exp(-SRB/sth) T2 = SRA+(1.-SRA)*np.exp(-SRB) return (SRA+(1.-SRA)*T1)/T2 def SurfaceRoughDerv(SRA,SRB,Tth): ''' Suortti surface roughness correction derivatives ''' sth = npsind(Tth/2.) T1 = np.exp(-SRB/sth) T2 = SRA+(1.-SRA)*np.exp(-SRB) Trans = (SRA+(1.-SRA)*T1)/T2 dydSRA = ((1.-T1)*T2-(1.-np.exp(-SRB))*Trans)/T2**2 dydSRB = ((SRA-1.)*T1*T2/sth-Trans*(SRA-T2))/T2**2 return [dydSRA,dydSRB] def Absorb(Geometry,MuR,Tth,Phi=0,Psi=0):
• ## trunk/GSASIIpwdGUI.py

 r1147 copyNames += ['DisplaceX','DisplaceY','Absorption'] else:       #Bragg-Brentano copyNames += ['Shift','Transparency'] copyNames += ['Shift','Transparency','SurfRoughA','SurfRoughB'] if len(addNames): copyNames += addNames if 'FreePrm3' not in data: data['FreePrm3'] = 0. if 'SurfRoughA' not in data: data['SurfRoughA'] = [0.,False] data['SurfRoughB'] = [0.,False] #patch end elif data['Type'] == 'Bragg-Brentano': parms += [['Shift',u'Sample displacement(\xb5m): '], ['Transparency',u'Sample transparency(1/\xb5eff, cm): '],] ['Transparency',u'Sample transparency(1/\xb5eff, cm): '], ['SurfRoughA','Surface roughness A: '], ['SurfRoughB','Surface roughness B: '],] parms.append(['Omega','Goniometer omega:',]) parms.append(['Chi','Goniometer chi:',])
• ## trunk/GSASIIstrIO.py

 r1160 Type = Sample['Type'] if 'Bragg' in Type:             #Bragg-Brentano for item in ['Scale','Shift','Transparency']:       #surface roughness?, diffuse scattering? for item in ['Scale','Shift','Transparency','SurfRoughA','SurfRoughB']: sampDict[hfx+item] = Sample[item][0] if Sample[item][1]: varstr = ' refine:' if 'Bragg' in Sample['Type']: for item in ['Scale','Shift','Transparency']: for item in ['Scale','Shift','Transparency','SurfRoughA','SurfRoughB']: ptlbls += '%14s'%(item) ptstr += '%14.4f'%(Sample[item][0]) def SetSampleParms(pfx,Sample,parmDict,sigDict): if 'Bragg' in Sample['Type']:             #Bragg-Brentano sampSig = [0 for i in range(3)] for i,item in enumerate(['Scale','Shift','Transparency']):       #surface roughness?, diffuse scattering? sampSig = [0 for i in range(5)] for i,item in enumerate(['Scale','Shift','Transparency','SurfRoughA','SurfRoughB']): Sample[item][0] = parmDict[pfx+item] if pfx+item in sigDict: refine = False if 'Bragg' in Sample['Type']: for i,item in enumerate(['Scale','Shift','Transparency']): for i,item in enumerate(['Scale','Shift','Transparency','SurfRoughA','SurfRoughB']): ptlbls += '%14s'%(item) ptstr += '%14.4f'%(Sample[item][0])
• ## trunk/GSASIIstrMath.py

 r1140 return G2pwd.Absorb('Cylinder',parmDict[hfx+'Absorption'],refl[5],0,0) else: return 1.0 return G2pwd.SurfaceRough(parmDict[hfx+'SurfRoughA'],parmDict[hfx+'SurfRoughB'],refl[5]) def GetAbsorbDerv(refl,hfx,calcControls,parmDict): return G2pwd.AbsorbDerv('Cylinder',parmDict[hfx+'Absorption'],refl[5],0,0) else: return 0.0 return G2pwd.SurfaceRoughDerv(parmDict[hfx+'SurfRoughA'],parmDict[hfx+'SurfRoughB'],refl[5]) def GetIntensityCorr(refl,uniq,G,g,pfx,phfx,hfx,SGData,calcControls,parmDict): hfx+'I(L2)/I(L1)':[1.0,'L1/L2'],hfx+'Zero':[dpdZ,'pos'],hfx+'Lam':[dpdw,'pos'], hfx+'Shift':[dpdSh,'pos'],hfx+'Transparency':[dpdTr,'pos'],hfx+'DisplaceX':[dpdX,'pos'], hfx+'DisplaceY':[dpdY,'pos'],hfx+'Absorption':[dFdAb,'int'],} hfx+'DisplaceY':[dpdY,'pos'],} if 'Bragg' in calcControls[hfx+'instType']: names.update({hfx+'SurfRoughA':[dFdAb[0],'int'], hfx+'SurfRoughB':[dFdAb[1],'int'],}) else: names.update({hfx+'Absorption':[dFdAb,'int'],}) for name in names: item = names[name]
Note: See TracChangeset for help on using the changeset viewer.