Changeset 5116
- Timestamp:
- Dec 21, 2021 2:46:05 PM (2 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/GSASIIlattice.py
r5112 r5116 1174 1174 pos = Inst['difC'][1]*dsp+Inst['Zero'][1]+Inst['difA'][1]*dsp**2+Inst.get('difB',[0,0,False])[1]/dsp 1175 1175 elif 'E' in Inst['Type'][0]: 1176 return 12.398/(2.0*dsp*sind(Inst['2-theta'][1]/2.0) +Inst['ZE'][1]+Inst['YE'][1]*dsp+Inst['XE'][1]*dsp**2)1176 return 12.398/(2.0*dsp*sind(Inst['2-theta'][1]/2.0))+Inst['ZE'][1]+Inst['YE'][1]*dsp+Inst['XE'][1]*dsp**2 1177 1177 else: #'C' or 'B' 1178 1178 wave = G2mth.getWave(Inst) -
trunk/GSASIIphsGUI.py
r5114 r5116 12972 12972 '''Set Pawley parameters and optionally recompute 12973 12973 ''' 12974 #GSASIIpath.IPyBreak()12975 12974 12976 12975 def DisablePawleyOpts(*args): … … 13118 13117 Inst = G2frame.GPXtree.GetItemPyData(G2gd.GetGPXtreeItemId(G2frame,PatternId,'Instrument Parameters'))[0] 13119 13118 Sample = G2frame.GPXtree.GetItemPyData(G2gd.GetGPXtreeItemId(G2frame,PatternId,'Sample Parameters')) 13120 wave = G2mth.getWave(Inst)13121 13119 const = 9.e-2/(np.pi*Sample['Gonio. radius']) #shifts in microns 13122 13120 gconst = 2.35482 # sqrt(8 ln 2) … … 13127 13125 try: 13128 13126 for ref in Refs: 13129 pos = 2.0*asind(wave/(2.0*ref[4+im]))13127 pos = G2lat.Dsp2pos(Inst,ref[4+im]) 13130 13128 if 'Bragg' in Sample['Type']: 13131 13129 pos -= const*(4.*Sample['Shift'][0]*cosd(pos/2.0)+ \ 13132 13130 Sample['Transparency'][0]*sind(pos)*100.0) #trans(=1/mueff) in cm 13133 el se: #Debye-Scherrer - simple but maybe not right - +Layer Disp from DData?13131 elif 'E' not in Inst['Type'][0]: #Debye-Scherrer - simple but maybe not right - +Layer Disp from DData? 13134 13132 pos -= const*(Sample['DisplaceX'][0]*cosd(pos)+Sample['DisplaceY'][0]*sind(pos)) 13135 13133 indx = np.searchsorted(xdata[0],pos) … … 13141 13139 # then divide by Icorr to get F^2. 13142 13140 ref[6+im] = (xdata[1][indx]-xdata[4][indx])*gconst/(FWHM*np.sqrt(np.pi)) #Area of Gaussian is height * FWHM * sqrt(pi) 13143 Lorenz = 1./(2.*sind(xdata[0][indx]/2.)**2*cosd(xdata[0][indx]/2.)) #Lorentz correction 13144 pola = 1.0 13145 if 'X' in Inst['Type']: 13146 pola,dIdPola = G2pwd.Polarization(Inst['Polariz.'][1],xdata[0][indx],Inst['Azimuth'][1]) 13141 if 'E' not in Inst['Type'][0]: 13142 Lorenz = 1./(2.*sind(xdata[0][indx]/2.)**2*cosd(xdata[0][indx]/2.)) #Lorentz correction 13143 pola = 1.0 13144 if 'X' in Inst['Type']: 13145 pola,dIdPola = G2pwd.Polarization(Inst['Polariz.'][1],xdata[0][indx],Inst['Azimuth'][1]) 13146 else: 13147 pola = 1.0 13148 # Include histo scale and volume in calculation 13149 ref[6+im] /= (Sample['Scale'][0] * Vst * Lorenz * pola * ref[3+im]) 13147 13150 else: 13148 pola = 1.0 13149 # Include histo scale and volume in calculation 13150 ref[6+im] /= (Sample['Scale'][0] * Vst * Lorenz * pola * ref[3+im]) 13151 ref[6+im] /= (Sample['Scale'][0] * ref[3+im]) 13151 13152 except IndexError: 13152 13153 pass -
trunk/GSASIIstrMath.py
r5114 r5116 2895 2895 pos -= const*(parmDict[hfx+'DisplaceX']*cosd(pos)+(parmDict[hfx+'DisplaceY']+parmDict[phfx+'LayerDisp'])*sind(pos)) 2896 2896 elif 'E' in calcControls[hfx+'histType']: 2897 pos = G2mth.wavekE(2.0*d*sind(parmDict[hfx+'2-theta']/2.0))+parmDict[hfx+'ZE']+parmDict[hfx+'YE']*d+parmDict[hfx+'XE']*d**22897 pos = 12.397639/(2.0*d*sind(parmDict[hfx+'2-theta']/2.0))+parmDict[hfx+'ZE']+parmDict[hfx+'YE']*d+parmDict[hfx+'XE']*d**2 2898 2898 elif 'T' in calcControls[hfx+'histType']: 2899 2899 pos = parmDict[hfx+'difC']*d+parmDict[hfx+'difA']*d**2+parmDict[hfx+'difB']/d+parmDict[hfx+'Zero'] … … 2938 2938 dpdXE = dsp**2 2939 2939 dpdA = np.array([h**2,k**2,l**2,h*k,h*l,k*l])*refl[5+im]*dsp**2/2. 2940 dpdTTh = -12.397639 /(2.*tand(tth)*dsp*sind(tth))2940 dpdTTh = -12.397639*cosd(tth)/(dsp*sind(tth)**2) 2941 2941 return dpdA,dpdTTh,dpdXE,dpdYE,dpdZE 2942 2942 elif 'T' in calcControls[hfx+'histType']: … … 2981 2981 return -180.*Dij*refl[4+im]**2*tand(refl[5+im]/2.0)/np.pi 2982 2982 elif 'E' in calcControls[hfx+'histType']: 2983 return Dij* (12.397639/(2.*dsp*sind(tth)))2983 return Dij*refl[5+im]/refl[4+im]**2 2984 2984 else: 2985 2985 return -Dij*parmDict[hfx+'difC']*0.5*refl[4+im]**2 … … 3017 3017 elif 'E' in calcControls[hfx+'histType']: 3018 3018 for item in dDijDict: 3019 dDijDict[item] *= refl[5+im] *refl[4+im]**2/2.3019 dDijDict[item] *= refl[5+im]/refl[4+im]**2 3020 3020 else: 3021 3021 for item in dDijDict: … … 3800 3800 elif 'E' in calcControls[hfx+'histType']: 3801 3801 dpdA,dpdTTh,dpdXE,dpdYE,dpdZE = GetReflPosDerv(refl,im,0.0,A,pfx,hfx,phfx,calcControls,parmDict) 3802 names = {hfx+'Scale':[dIdsh,'int'], 3802 names = {hfx+'Scale':[dIdsh,'int'],hfx+'2-theta':[dpdTTh,'pos'], 3803 3803 hfx+'A':[refl[5+im]**2,'sig'],hfx+'B':[refl[5+im],'sig'],hfx+'C':[1.0,'sig'], 3804 3804 hfx+'XE':[dpdXE,'pos'],hfx+'YE':[dpdYE,'pos'],hfx+'ZE':[dpdZE,'pos'] }
Note: See TracChangeset
for help on using the changeset viewer.