Changeset 432
- Timestamp:
- Dec 5, 2011 4:00:00 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/GSASIIIO.py
r430 r432 439 439 File = open(filename,'Ur') 440 440 cons = Bank.split() 441 print cons442 441 Nch = int(cons[2]) 443 442 if DataType[2] == 'C': … … 468 467 y.append(yi) 469 468 w.append(1.0/vi) 470 print '%8.3f %8.0f %d %8g'%(xi,yi,ni,1./vi)471 469 S = File.readline() 472 470 File.close() 473 471 N = len(x) 474 print N475 472 return [np.array(x),np.array(y),np.array(w),np.zeros(N),np.zeros(N),np.zeros(N)] 476 473 -
trunk/GSASIIlattice.py
r395 r432 190 190 G,g = A2Gmat(A) 191 191 return Gmat2cell(G) 192 193 def Gmat2AB(G): 194 """Computes orthogonalization matrix from reciprocal metric tensor G 195 returns tuple of two 3x3 numpy arrays (A,B) 196 A for crystal to Cartesian transformations A*x = np.inner(A,x) = X 197 B (= inverse of A) for Cartesian to crystal transformation B*X = np.inner(B,X) = x 198 """ 199 cellstar = Gmat2cell(G) 200 g = nl.inv(G) 201 cell = Gmat2cell(g) 202 A = np.zeros(shape=(3,3)) 203 # from Giacovazzo (Fundamentals 2nd Ed.) p.75 204 A[0][0] = cell[0] # a 205 A[0][1] = cell[1]*cosd(cell[5]) # b cos(gamma) 206 A[0][2] = cell[2]*cosd(cell[4]) # c cos(beta) 207 A[1][1] = cell[1]*sind(cell[5]) # b sin(gamma) 208 A[1][2] = -cell[2]*cosd(cellstar[3])*sind(cell[4]) # - c cos(alpha*) sin(beta) 209 A[2][2] = 1/cellstar[2] # 1/c* 210 B = nl.inv(A) 211 return A,B 212 192 213 193 214 def cell2AB(cell): … … 196 217 returns tuple of two 3x3 numpy arrays (A,B) 197 218 A for crystal to Cartesian transformations A*x = np.inner(A,x) = X 198 B (= inverse of A) for Cartesian to crystal transformation B*X = np.inner(B *x) = x219 B (= inverse of A) for Cartesian to crystal transformation B*X = np.inner(B,X) = x 199 220 """ 200 221 G,g = cell2Gmat(cell) -
trunk/GSASIIphsGUI.py
r430 r432 2030 2030 pfType.Bind(wx.EVT_COMBOBOX,OnPfType) 2031 2031 PTSizer.Add(pfType,0,wx.ALIGN_CENTER_VERTICAL) 2032 PTSizer.Add(wx.StaticText(dataDisplay,-1,' Projection type: '),0,wx.ALIGN_CENTER_VERTICAL) 2033 projSel = wx.ComboBox(dataDisplay,-1,value=self.Projection,choices=['equal area','stereographic'], 2034 style=wx.CB_READONLY|wx.CB_DROPDOWN) 2035 projSel.Bind(wx.EVT_COMBOBOX,OnProjSel) 2036 PTSizer.Add(projSel,0,wx.ALIGN_CENTER_VERTICAL) 2032 if 'Axial' not in textureData['PlotType']: 2033 PTSizer.Add(wx.StaticText(dataDisplay,-1,' Projection type: '),0,wx.ALIGN_CENTER_VERTICAL) 2034 projSel = wx.ComboBox(dataDisplay,-1,value=self.Projection,choices=['equal area','stereographic','3D display'], 2035 style=wx.CB_READONLY|wx.CB_DROPDOWN) 2036 projSel.Bind(wx.EVT_COMBOBOX,OnProjSel) 2037 PTSizer.Add(projSel,0,wx.ALIGN_CENTER_VERTICAL) 2037 2038 if textureData['PlotType'] in ['Pole figure','Axial pole distribution']: 2038 2039 PTSizer.Add(wx.StaticText(dataDisplay,-1,' Pole figure HKL: '),0,wx.ALIGN_CENTER_VERTICAL) … … 2046 2047 pfVal.Bind(wx.EVT_KILL_FOCUS,OnPFValue) 2047 2048 PTSizer.Add(pfVal,0,wx.ALIGN_CENTER_VERTICAL) 2048 PTSizer.Add(wx.StaticText(dataDisplay,-1,' Color scheme'),0,wx.ALIGN_CENTER_VERTICAL) 2049 choice = [m for m in mpl.cm.datad.keys() if not m.endswith("_r")] 2050 choice.sort() 2051 colorSel = wx.ComboBox(dataDisplay,-1,value=self.ContourColor,choices=choice, 2052 style=wx.CB_READONLY|wx.CB_DROPDOWN) 2053 colorSel.Bind(wx.EVT_COMBOBOX,OnColorSel) 2054 PTSizer.Add(colorSel,0,wx.ALIGN_CENTER_VERTICAL) 2049 if 'Axial' not in textureData['PlotType']: 2050 PTSizer.Add(wx.StaticText(dataDisplay,-1,' Color scheme'),0,wx.ALIGN_CENTER_VERTICAL) 2051 choice = [m for m in mpl.cm.datad.keys() if not m.endswith("_r")] 2052 choice.sort() 2053 colorSel = wx.ComboBox(dataDisplay,-1,value=self.ContourColor,choices=choice, 2054 style=wx.CB_READONLY|wx.CB_DROPDOWN) 2055 colorSel.Bind(wx.EVT_COMBOBOX,OnColorSel) 2056 PTSizer.Add(colorSel,0,wx.ALIGN_CENTER_VERTICAL) 2055 2057 mainSizer.Add(PTSizer,0,wx.ALIGN_CENTER_VERTICAL) 2056 2058 mainSizer.Add((0,5),0) … … 2187 2189 hist = Indx[Obj.GetId()] 2188 2190 UseList[hist]['Size'][0] = Obj.GetValue() 2191 G2plt.PlotSizeStrainPO(self,data) 2189 2192 UpdateDData() 2190 2193 … … 2198 2201 2199 2202 def OnSizeVal(event): 2203 print 'new val event' 2200 2204 Obj = event.GetEventObject() 2201 2205 hist,pid = Indx[Obj.GetId()] … … 2204 2208 size = float(Obj.GetValue()) 2205 2209 if pid < 3 and size <= 0.01: #10A lower limit! 2206 raise ValueError 2210 raise ValueError 2211 UseList[hist]['Size'][4][pid] = size 2207 2212 except ValueError: 2208 2213 pass 2214 Obj.SetValue("%.3f"%(UseList[hist]['Size'][4][pid])) #reset in case of error 2209 2215 else: 2210 2216 try: … … 2215 2221 except ValueError: 2216 2222 pass 2217 Obj.SetValue("%.3f"%(UseList[hist]['Size'][1][pid])) #reset in case of error 2223 Obj.SetValue("%.3f"%(UseList[hist]['Size'][1][pid])) #reset in case of error 2224 G2plt.PlotSizeStrainPO(self,data) 2218 2225 2219 2226 def OnSizeAxis(event): … … 2235 2242 hist = Indx[Obj.GetId()] 2236 2243 UseList[hist]['Mustrain'][0] = Obj.GetValue() 2244 G2plt.PlotSizeStrainPO(self,data) 2237 2245 UpdateDData() 2238 G2plt.PlotSizeStrainPO(self,data)2239 2246 2240 2247 def OnStrainRef(event): … … 2601 2608 return extSizer 2602 2609 2603 DData.DestroyChildren() 2604 dataDisplay = wx.Panel(DData) 2605 mainSizer = wx.BoxSizer(wx.VERTICAL) 2610 if DData.GetChildren(): 2611 dataDisplay = DData.GetChildren()[0] 2612 mainSizer = dataDisplay.GetSizer() 2613 mainSizer.Clear() 2614 else: 2615 dataDisplay = wx.Panel(DData) 2616 mainSizer = wx.BoxSizer(wx.VERTICAL) 2606 2617 mainSizer.Add(wx.StaticText(dataDisplay,-1,'Histogram data for '+PhaseName+':'),0,wx.ALIGN_CENTER_VERTICAL) 2607 2618 mainSizer.Add(PlotSizer()) … … 2629 2640 2630 2641 if item[:4] == 'PWDR' and UseList[item]['Show']: 2631 sizeSizer = wx.BoxSizer(wx.VERTICAL)2632 2642 if UseList[item]['Size'][0] == 'isotropic': 2633 2643 isoSizer = wx.BoxSizer(wx.HORIZONTAL) … … 2636 2646 isoSizer.Add(IsoSizer(u' Cryst. size(\xb5m): ','Size','%.3f', 2637 2647 OnSizeVal,OnSizeRef),0,wx.ALIGN_CENTER_VERTICAL) 2638 sizeSizer.Add(isoSizer)2648 mainSizer.Add(isoSizer) 2639 2649 elif UseList[item]['Size'][0] == 'uniaxial': 2640 2650 uniSizer = wx.BoxSizer(wx.HORIZONTAL) … … 2642 2652 'Size',OnSizeType),0,wx.ALIGN_CENTER_VERTICAL) 2643 2653 uniSizer.Add(UniSizer('Size',OnSizeAxis),0,wx.ALIGN_CENTER_VERTICAL) 2644 sizeSizer.Add(uniSizer)2645 sizeSizer.Add(UniDataSizer(u'size(\xb5m): ','Size','%.3f',OnSizeVal,OnSizeRef))2654 mainSizer.Add(uniSizer) 2655 mainSizer.Add(UniDataSizer(u'size(\xb5m): ','Size','%.3f',OnSizeVal,OnSizeRef)) 2646 2656 elif UseList[item]['Size'][0] == 'ellipsoidal': 2647 2657 ellSizer = wx.BoxSizer(wx.HORIZONTAL) … … 2649 2659 'Size',OnSizeType),0,wx.ALIGN_CENTER_VERTICAL) 2650 2660 ellSizer.Add(wx.StaticText(dataDisplay,-1,u' Coefficients(\xb5m): '),0,wx.ALIGN_CENTER_VERTICAL) 2651 sizeSizer.Add(ellSizer) 2652 sizeSizer.Add(EllSizeDataSizer()) 2653 mainSizer.Add(sizeSizer) 2661 mainSizer.Add(ellSizer) 2662 mainSizer.Add(EllSizeDataSizer()) 2654 2663 mainSizer.Add((0,5),0) 2655 2664 2656 strainSizer = wx.BoxSizer(wx.VERTICAL)2657 2665 if UseList[item]['Mustrain'][0] == 'isotropic': 2658 2666 isoSizer = wx.BoxSizer(wx.HORIZONTAL) … … 2661 2669 isoSizer.Add(IsoSizer(' microstrain: ','Mustrain','%.1f', 2662 2670 OnStrainVal,OnStrainRef),0,wx.ALIGN_CENTER_VERTICAL) 2663 strainSizer.Add(isoSizer) 2671 mainSizer.Add(isoSizer) 2672 mainSizer.Add((0,5),0) 2664 2673 elif UseList[item]['Mustrain'][0] == 'uniaxial': 2665 2674 uniSizer = wx.BoxSizer(wx.HORIZONTAL) … … 2667 2676 'Mustrain',OnStrainType),0,wx.ALIGN_CENTER_VERTICAL) 2668 2677 uniSizer.Add(UniSizer('Mustrain',OnStrainAxis),0,wx.ALIGN_CENTER_VERTICAL) 2669 sizeSizer.Add(uniSizer)2670 sizeSizer.Add(UniDataSizer('mustrain: ','Mustrain','%.1f',OnStrainVal,OnStrainRef))2678 mainSizer.Add(uniSizer) 2679 mainSizer.Add(UniDataSizer('mustrain: ','Mustrain','%.1f',OnStrainVal,OnStrainRef)) 2671 2680 elif UseList[item]['Mustrain'][0] == 'generalized': 2672 2681 genSizer = wx.BoxSizer(wx.HORIZONTAL) … … 2674 2683 'Mustrain',OnStrainType),0,wx.ALIGN_CENTER_VERTICAL) 2675 2684 genSizer.Add(wx.StaticText(dataDisplay,-1,' Coefficients: '),0,wx.ALIGN_CENTER_VERTICAL) 2676 strainSizer.Add(genSizer) 2677 strainSizer.Add(GenStrainDataSizer()) 2678 mainSizer.Add(strainSizer) 2685 mainSizer.Add(genSizer) 2686 mainSizer.Add(GenStrainDataSizer()) 2679 2687 mainSizer.Add((0,5),0) 2680 2688 … … 2761 2769 UseList[histoName] = {'Histogram':histoName,'Show':False, 2762 2770 'Scale':[1.0,False],'Pref.Ori.':['MD',1.0,False,[0,0,1],0,{}], 2763 'Size':['isotropic',[4.,4.,],[False,False],[0,0,1], 6*[0.0,],6*[False,]],2771 'Size':['isotropic',[4.,4.,],[False,False],[0,0,1],[4.,4.,4.,0.,0.,0.],6*[False,]], 2764 2772 'Mustrain':['isotropic',[1000.0,1000.0],[False,False],[0,0,1], 2765 2773 NShkl*[0.01,],NShkl*[False,]], -
trunk/GSASIIplot.py
r431 r432 1220 1220 axes /= nl.norm(axes) 1221 1221 Shkl = np.array(coeff[1]) 1222 Shape = X.shape[0]1223 1222 XYZ = np.dstack((X,Y,Z)) 1224 1223 XYZ = np.nan_to_num(np.apply_along_axis(uniaxCalc,2,XYZ,iso,aniso,axes)) … … 1228 1227 Z = Z[:,:,0] 1229 1228 1229 elif coeff[0] == 'ellipsoidal': 1230 1231 def ellipseCalc(xyz,E,R): 1232 XYZ = xyz*E.T 1233 return np.inner(XYZ.T,R) 1234 1235 S6 = coeff[4] 1236 Sij = G2lat.U6toUij(S6) 1237 E,R = nl.eigh(Sij) 1238 XYZ = np.dstack((X,Y,Z)) 1239 XYZ = np.nan_to_num(np.apply_along_axis(ellipseCalc,2,XYZ,E,R)) 1240 X,Y,Z = np.dsplit(XYZ,3) 1241 X = X[:,:,0] 1242 Y = Y[:,:,0] 1243 Z = Z[:,:,0] 1244 1230 1245 elif coeff[0] == 'generalized': 1231 1246 … … 1240 1255 Shkl = np.array(coeff[4]) 1241 1256 if np.any(Shkl): 1242 Shape = X.shape[0]1243 1257 XYZ = np.dstack((X,Y,Z)) 1244 1258 XYZ = np.nan_to_num(np.apply_along_axis(genMustrain,2,XYZ,SGData,A,Shkl)) … … 1248 1262 Z = Z[:,:,0] 1249 1263 1250 elif coeff[0] == 'ellipsoidal':1251 print 'ellipsoid plot'1252 1253 1264 if np.any(X) and np.any(Y) and np.any(Z): 1265 errFlags = np.seterr(all='ignore') 1254 1266 Plot.plot_surface(X,Y,Z,rstride=1,cstride=1,color='g',linewidth=1) 1267 np.seterr(all='ignore') 1268 xyzlim = np.array([Plot.get_xlim3d(),Plot.get_ylim3d(),Plot.get_zlim3d()]).T 1269 XYZlim = [min(xyzlim[0]),max(xyzlim[1])] 1270 Plot.set_xlim3d(XYZlim) 1271 Plot.set_ylim3d(XYZlim) 1272 Plot.set_zlim3d(XYZlim) 1273 Plot.set_aspect('equal') 1255 1274 if plotType == 'Size': 1256 1275 Plot.set_title('Crystallite size for '+phase+'\n'+coeff[0]+' model') … … 1258 1277 Plot.set_ylabel(r'Y, $\mu$m') 1259 1278 Plot.set_zlabel(r'Z, $\mu$m') 1260 Plot.set_aspect('equal')1261 1279 else: 1262 1280 Plot.set_title(r'$\mu$strain for '+phase+'\n'+coeff[0]+' model') … … 1264 1282 Plot.set_ylabel(r'Y, $\mu$strain') 1265 1283 Plot.set_zlabel(r'Z, $\mu$strain') 1266 Plot.set_aspect('equal')1267 1284 else: 1268 1285 h,k,l = generalData['POhkl'] … … 1288 1305 1289 1306 def PlotTexture(self,data,newPlot=False,Start=False): 1290 '''Pole figure, inverse pole figure(?), 3D pole distribution and 3D inverse pole distribution(?) 1291 plotting; Need way to select 1292 pole figure or pole distribution to be displayed - do in key enter menu 1307 '''Pole figure, inverse pole figure, 3D pole distribution and 3D inverse pole distribution 1308 plotting. 1293 1309 dict generalData contains all phase info needed which is in data 1294 1310 ''' … … 1346 1362 pf = G2lat.polfcal(ODFln,SamSym[textureData['Model']],np.array([r,]),np.array([p,])) 1347 1363 self.G2plotNB.status.SetFields(['','phi =%9.3f, gam =%9.3f, MRD =%9.3f'%(r,p,pf)]) 1348 1349 Plot = self.G2plotNB.addMpl('Texture').gca() 1364 1365 if self.Projection == '3D display' and 'Axial' not in SHData['PlotType']: 1366 Plot = mp3d.Axes3D(self.G2plotNB.add3D('Texture')) 1367 else: 1368 Plot = self.G2plotNB.addMpl('Texture').gca() 1350 1369 plotNum = self.G2plotNB.plotList.index('Texture') 1351 1370 Page = self.G2plotNB.nb.GetPage(plotNum) 1352 Page.canvas.mpl_connect('motion_notify_event', OnMotion) 1371 if self.Projection == '3D display': 1372 pass 1373 else: 1374 Page.canvas.mpl_connect('motion_notify_event', OnMotion) 1353 1375 1354 1376 Page.SetFocus() -
trunk/GSASIIpwd.py
r429 r432 708 708 sumDf = np.sum(Df) 709 709 return Df,dFdp,dFds,dFdg,dFdsh 710 710 711 def ellipseSize(H,Sij,GB): 712 HX = np.inner(H.T,GB) 713 lenHX = np.sqrt(np.sum(HX**2)) 714 Esize,Rsize = nl.eigh(G2lat.U6toUij(Sij)) 715 R = np.inner(HX/lenHX,Rsize)*Esize #want column length for hkl in crystal 716 lenR = np.sqrt(np.sum(R**2)) 717 return lenR 718 719 def ellipseSizeDerv(H,Sij,GB): 720 lenR = ellipseSize(H,Sij,GB) 721 delt = 0.001 722 dRdS = np.zeros(6) 723 for i in range(6): 724 dSij = Sij[:] 725 dSij[i] += delt 726 dRdS[i] = (ellipseSize(H,dSij,GB)-lenR)/delt 727 return lenR,dRdS 711 728 712 729 def getPeakProfile(parmDict,xdata,varyList,bakType): -
trunk/GSASIIstruct.py
r429 r432 1895 1895 return dIdsh,dIdsp,dIdPola,dIdPO,dFdODF,dFdSA 1896 1896 1897 def GetSampleGam(refl,wave,G, phfx,calcControls,parmDict,sizeEllipse):1897 def GetSampleGam(refl,wave,G,GB,phfx,calcControls,parmDict): 1898 1898 costh = cosd(refl[5]/2.) 1899 1899 #crystallite size … … 1906 1906 gam = (1.8*wave/np.pi)/(parmDict[phfx+'Size:0']*parmDict[phfx+'Size:1']*costh) 1907 1907 gam *= np.sqrt((cosP*parmDict[phfx+'Size:1'])**2+(sinP*parmDict[phfx+'Size:0'])**2) 1908 else: #ellipsoidal crystallites - wrong not make sense 1908 else: #ellipsoidal crystallites 1909 Sij =[parmDict[phfx+'Size:%d'%(i)] for i in range(6)] 1909 1910 H = np.array(refl[:3]) 1910 gam += 1.8*wave/(np.pi*costh*np.inner(H,np.inner(sizeEllipse,H))) 1911 lenR = G2pwd.ellipseSize(H,Sij,GB) 1912 gam = 1.8*wave/(np.pi*costh*lenR) 1911 1913 #microstrain 1912 1914 if calcControls[phfx+'MustrainType'] == 'isotropic': … … 1927 1929 return gam 1928 1930 1929 def GetSampleGamDerv(refl,wave,G, phfx,calcControls,parmDict,sizeEllipse):1931 def GetSampleGamDerv(refl,wave,G,GB,phfx,calcControls,parmDict): 1930 1932 gamDict = {} 1931 1933 costh = cosd(refl[5]/2.) … … 1940 1942 Si = parmDict[phfx+'Size:0'] 1941 1943 Sa = parmDict[phfx+'Size:1'] 1942 gami = (1.8 0*wave/np.pi)/(Si*Sa)1944 gami = (1.8*wave/np.pi)/(Si*Sa) 1943 1945 sqtrm = np.sqrt((cosP*Sa)**2+(sinP*Si)**2) 1944 1946 gam = gami*sqtrm/costh 1945 1947 gamDict[phfx+'Size:0'] = gami*Si*sinP**2/(sqtrm*costh)-gam/Si 1946 1948 gamDict[phfx+'Size:1'] = gami*Sa*cosP**2/(sqtrm*costh)-gam/Sa 1947 else: #ellipsoidal crystallites - do numerically? - not right not make sense 1949 else: #ellipsoidal crystallites 1950 const = 1.8*wave/(np.pi*costh) 1951 Sij =[parmDict[phfx+'Size:%d'%(i)] for i in range(6)] 1948 1952 H = np.array(refl[:3]) 1949 gam = 1.8*wave/(np.pi*costh*np.inner(H,np.inner(sizeEllipse,H))) 1953 R,dRdS = G2pwd.ellipseSizeDerv(H,Sij,GB) 1954 for i,item in enumerate([phfx+'Size:%d'%(j) for j in range(6)]): 1955 gamDict[item] = -(const/R**2)*dRdS[i] 1950 1956 #microstrain derivatives 1951 1957 if calcControls[phfx+'MustrainType'] == 'isotropic': … … 2082 2088 def getPowderProfile(parmDict,x,varylist,Histogram,Phases,calcControls,pawleyLookup): 2083 2089 2084 def GetReflSIgGam(refl,wave,G, hfx,phfx,calcControls,parmDict,sizeEllipse):2090 def GetReflSIgGam(refl,wave,G,GB,hfx,phfx,calcControls,parmDict): 2085 2091 U = parmDict[hfx+'U'] 2086 2092 V = parmDict[hfx+'V'] … … 2091 2097 sig = U*tanPos**2+V*tanPos+W #save peak sigma 2092 2098 sig = max(0.001,sig) 2093 gam = X/cosd(refl[5]/2.0)+Y*tanPos+GetSampleGam(refl,wave,G, phfx,calcControls,parmDict,sizeEllipse) #save peak gamma2099 gam = X/cosd(refl[5]/2.0)+Y*tanPos+GetSampleGam(refl,wave,G,GB,phfx,calcControls,parmDict) #save peak gamma 2094 2100 gam = max(0.001,gam) 2095 2101 return sig,gam … … 2124 2130 A = [parmDict[pfx+'A%d'%(i)] for i in range(6)] 2125 2131 G,g = G2lat.A2Gmat(A) #recip & real metric tensors 2132 GA,GB = G2lat.Gmat2AB(G) #Orthogonalization matricies 2126 2133 Vst = np.sqrt(nl.det(G)) #V* 2127 2134 if 'Pawley' not in Phase['General']['Type']: 2128 2135 refList = StructureFactor(refList,G,hfx,pfx,SGData,calcControls,parmDict) 2129 sizeEllipse = []2130 if calcControls[phfx+'SizeType'] == 'ellipsoidal':2131 sizeEllipse = G2lat.U6toUij([parmDIct[phfx+'Size:%d'%(i)] for i in range(6)])2132 2136 for refl in refList: 2133 2137 if 'C' in calcControls[hfx+'histType']: … … 2136 2140 Lorenz = 1./(2.*sind(refl[5]/2.)**2*cosd(refl[5]/2.)) #Lorentz correction 2137 2141 refl[5] += GetHStrainShift(refl,SGData,phfx,parmDict) #apply hydrostatic strain shift 2138 refl[6:8] = GetReflSIgGam(refl,wave,G, hfx,phfx,calcControls,parmDict,sizeEllipse) #peak sig & gam2142 refl[6:8] = GetReflSIgGam(refl,wave,G,GB,hfx,phfx,calcControls,parmDict) #peak sig & gam 2139 2143 GetIntensityCorr(refl,G,g,pfx,phfx,hfx,SGData,calcControls,parmDict) #puts corrections in refl[13] 2140 2144 refl[13] *= Vst*Lorenz … … 2291 2295 A = [parmDict[pfx+'A%d'%(i)] for i in range(6)] 2292 2296 G,g = G2lat.A2Gmat(A) #recip & real metric tensors 2297 GA,GB = G2lat.Gmat2AB(G) #Orthogonalization matricies 2293 2298 if 'Pawley' not in Phase['General']['Type']: 2294 2299 dFdvDict = StructureFactorDerv(refList,G,hfx,pfx,SGData,calcControls,parmDict) 2295 sizeEllipse = []2296 if calcControls[phfx+'SizeType'] == 'ellipsoidal':2297 sizeEllipse = G2lat.U6toUij([parmDIct[phfx+'Size:%d'%(i)] for i in range(6)])2298 2300 for iref,refl in enumerate(refList): 2299 2301 if 'C' in calcControls[hfx+'histType']: #CW powder … … 2384 2386 elif name in dependentVars: 2385 2387 depDerivDict[name] += dDijDict[name]*dervDict['pos'] 2386 gamDict = GetSampleGamDerv(refl,wave,G, phfx,calcControls,parmDict,sizeEllipse)2388 gamDict = GetSampleGamDerv(refl,wave,G,GB,phfx,calcControls,parmDict) 2387 2389 for name in gamDict: 2388 2390 if name in varylist: … … 2595 2597 SetUsedHistogramsAndPhases(GPXfile,Histograms,Phases,covData) 2596 2598 #for testing purposes!!! 2597 #file = open('structTestdata.dat','wb')2598 #cPickle.dump(parmDict,file,1)2599 #cPickle.dump(varyList,file,1)2600 #for histogram in Histograms:2601 #if 'PWDR' in histogram[:4]:2602 #Histogram = Histograms[histogram]2603 #cPickle.dump(Histogram,file,1)2604 #cPickle.dump(Phases,file,1)2605 #cPickle.dump(calcControls,file,1)2606 #cPickle.dump(pawleyLookup,file,1)2607 #file.close()2599 file = open('structTestdata.dat','wb') 2600 cPickle.dump(parmDict,file,1) 2601 cPickle.dump(varyList,file,1) 2602 for histogram in Histograms: 2603 if 'PWDR' in histogram[:4]: 2604 Histogram = Histograms[histogram] 2605 cPickle.dump(Histogram,file,1) 2606 cPickle.dump(Phases,file,1) 2607 cPickle.dump(calcControls,file,1) 2608 cPickle.dump(pawleyLookup,file,1) 2609 file.close() 2608 2610 2609 2611 def SeqRefine(GPXfile,dlg):
Note: See TracChangeset
for help on using the changeset viewer.