Changeset 1493
- Timestamp:
- Sep 11, 2014 4:35:59 PM (9 years ago)
- Location:
- trunk
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/GSASIIphsGUI.py
r1489 r1493 2443 2443 if atom[cuia] == 'A': 2444 2444 Uij = atom[cuij:cuij+6] 2445 result = G2spc.GenAtom(XYZ,SGData,False,Uij, False)2445 result = G2spc.GenAtom(XYZ,SGData,False,Uij,True) 2446 2446 for item in result: 2447 2447 atom = copy.copy(atomData[ind]) … … 2460 2460 atomData.append(atom[:]) 2461 2461 else: 2462 result = G2spc.GenAtom(XYZ,SGData,False,Move= False)2462 result = G2spc.GenAtom(XYZ,SGData,False,Move=True) 2463 2463 for item in result: 2464 2464 atom = copy.copy(atomData[ind]) -
trunk/GSASIIplot.py
r1480 r1493 1842 1842 Page.canvas.SetCursor(wx.CROSS_CURSOR) 1843 1843 try: 1844 G2frame.G2plotNB.status.SetStatusText('X =%9.3f %s =%9.3 f'%(xpos,Title,ypos),1)1844 G2frame.G2plotNB.status.SetStatusText('X =%9.3f %s =%9.3g'%(xpos,Title,ypos),1) 1845 1845 except TypeError: 1846 1846 G2frame.G2plotNB.status.SetStatusText('Select '+Title+' pattern first',1) … … 1886 1886 else: 1887 1887 Plot.set_ylabel(r'$\mathsf{\Delta}T/T$',fontsize=14) 1888 for ixy,xy in enumerate(XY): 1889 X,Y = xy 1888 for ixy,xyw in enumerate(XY): 1889 if len(xyw) > 2: 1890 X,Y,W = xyw 1891 else: 1892 X,Y = xyw 1893 W = 0. 1890 1894 Yc = G2lat.Dsp2pos(Inst,X) 1891 1895 if 'C' in Inst['Type'][0]: 1892 1896 Y = Y-Yc 1893 1897 E = Sigs[ixy] 1898 bin = W/2. 1894 1899 else: 1895 1900 Y = (Y-Yc)/Yc 1896 1901 E = Sigs[ixy]/Yc 1902 bin = W/(2.*Yc) 1897 1903 if E: 1898 1904 Plot.errorbar(X,Y,ecolor='k',yerr=E) 1899 Plot.plot(X,Y,'kx',picker=3) 1905 if ixy: 1906 Plot.plot(X,Y,'kx',picker=3) 1907 else: 1908 Plot.plot(X,Y,'kx',label='peak') 1909 if W: 1910 if ixy: 1911 Plot.plot(X,bin,'b+') 1912 else: 1913 Plot.plot(X,bin,'b+',label='bin width') 1914 Plot.plot(X,-bin,'b+') 1900 1915 Plot.axhline(0.,color='r',linestyle='--') 1916 Plot.legend(loc='best') 1901 1917 if not newPlot: 1902 1918 Page.toolbar.push_current() -
trunk/GSASIIpwd.py
r1484 r1493 1219 1219 parmDict.update(insDict) 1220 1220 varyList = insVary 1221 if not len(varyList): 1222 print '**** ERROR - nothing to refine! ****' 1223 return False 1221 1224 while True: 1222 1225 begin = time.time() … … 1239 1242 except ValueError: #result[1] is None on singular matrix 1240 1243 print '**** Refinement failed - singular matrix ****' 1241 return1244 return True 1242 1245 1243 1246 sigDict = dict(zip(varyList,sig)) -
trunk/GSASIIpwdGUI.py
r1475 r1493 956 956 957 957 def OnCalibrate(event): 958 Pattern = G2frame.PatternTree.GetItemPyData(G2frame.PatternId) 959 xye = ma.array(ma.getdata(Pattern[1])) 960 cw = np.diff(xye[0]) 958 961 IndexPeaks = G2frame.PatternTree.GetItemPyData(G2gd.GetPatternTreeItemId(G2frame,G2frame.PatternId, 'Index Peak List')) 959 962 if not len(IndexPeaks[0]): … … 967 970 G2frame.ErrorDialog('Can not calibrate','Index Peak List not indexed') 968 971 return 969 G2pwd.DoCalibInst(IndexPeaks,data) 970 UpdateInstrumentGrid(G2frame,data) 971 XY = [] 972 Sigs = [] 973 for ip,peak in enumerate(IndexPeaks[0]): 974 if peak[2] and peak[3]: 975 XY.append([peak[8],peak[0]]) 976 Sigs.append(IndexPeaks[1][ip]) 977 if len(XY): 978 XY = np.array(XY) 979 G2plt.PlotCalib(G2frame,data,XY,Sigs,newPlot=True) 972 if G2pwd.DoCalibInst(IndexPeaks,data): 973 UpdateInstrumentGrid(G2frame,data) 974 XY = [] 975 Sigs = [] 976 for ip,peak in enumerate(IndexPeaks[0]): 977 if peak[2] and peak[3]: 978 binwid = cw[np.searchsorted(xye[0],peak[0])] 979 XY.append([peak[8],peak[0],binwid]) 980 Sigs.append(IndexPeaks[1][ip]) 981 if len(XY): 982 XY = np.array(XY) 983 G2plt.PlotCalib(G2frame,data,XY,Sigs,newPlot=True) 984 else: 985 G2frame.ErrorDialog('Can not calibrate','Nothing selected for refinement') 986 980 987 981 988 def OnLoad(event): -
trunk/GSASIIstrMain.py
r1491 r1493 42 42 43 43 ateln2 = 8.0*math.log(2.0) 44 DEBUG = False44 DEBUG = True 45 45 46 46 def RefineCore(Controls,Histograms,Phases,restraintDict,rigidbodyDict,parmDict,varyList, … … 207 207 cPickle.dump(result[0],fl,1) 208 208 cPickle.dump([Histograms,Phases,restraintDict,rigidbodyDict],fl,1) 209 cPickle.dump([G2mv.dependentParmList,G2mv.arrayList,G2mv.invarrayList, 210 G2mv.indParmList,G2mv.invarrayList],fl,1) 209 211 cPickle.dump(parmDict,fl,1) 210 212 cPickle.dump(varyList,fl,1) -
trunk/GSASIIstrMath.py
r1491 r1493 1548 1548 iBeg = max(xB,np.searchsorted(x,refl[5]-fmin)) 1549 1549 iFin = max(xB,min(np.searchsorted(x,refl[5]+fmax),xF)) 1550 yp[iBeg:iFin] = refl[11]*refl[9]*G2pwd.getEpsVoigt(refl[5],refl[12],refl[13],refl[6],refl[7],ma.getdata(x[iBeg:iFin])) #>90% of time spent here 1551 refl[8] = np.sum(np.where(ratio[iBeg:iFin]>0.,yp[iBeg:iFin]*ratio[iBeg:iFin]/refl[11],0.0)) 1550 if iBeg < iFin: 1551 yp[iBeg:iFin] = refl[11]*refl[9]*G2pwd.getEpsVoigt(refl[5],refl[12],refl[13],refl[6],refl[7],ma.getdata(x[iBeg:iFin])) #>90% of time spent here 1552 refl[8] = np.sum(np.where(ratio[iBeg:iFin]>0.,yp[iBeg:iFin]*ratio[iBeg:iFin]/refl[11],0.0)) 1552 1553 Fo = np.sqrt(np.abs(refl[8])) 1553 1554 Fc = np.sqrt(np.abs(refl[9])) … … 2001 2002 for iref,ref in enumerate(refDict['RefList']): 2002 2003 if ref[6] > 0: 2003 dervDict = SCExtinction(ref,phfx,hfx,pfx,calcControls,parmDict,varylist )[1]2004 dervDict = SCExtinction(ref,phfx,hfx,pfx,calcControls,parmDict,varylist+dependentVars)[1] 2004 2005 w = 1.0/ref[6] 2005 2006 if w*ref[5] >= calcControls['minF/sig']: … … 2016 2017 depDerivDict[phfx+'Scale'][iref] = w*ref[9]*ref[11] 2017 2018 for item in ['Ep','Es','Eg']: 2018 if phfx+item in varylist and dervDict:2019 if phfx+item in varylist and phfx+item in dervDict: 2019 2020 dMdvh[varylist.index(phfx+item)][iref] = w*dervDict[phfx+item]/ref[11] #OK 2020 elif phfx+item in dependentVars and dervDict:2021 elif phfx+item in dependentVars and phfx+item in dervDict: 2021 2022 depDerivDict[phfx+item][iref] = w*dervDict[phfx+item]/ref[11] #OK 2022 2023 for item in ['BabA','BabU']: … … 2028 2029 for iref,ref in enumerate(refDict['RefList']): 2029 2030 if ref[5] > 0.: 2030 dervDict = SCExtinction(ref,phfx,hfx,pfx,calcControls,parmDict,varylist )[1]2031 dervDict = SCExtinction(ref,phfx,hfx,pfx,calcControls,parmDict,varylist+dependentVars)[1] 2031 2032 Fo = np.sqrt(ref[5]) 2032 2033 Fc = np.sqrt(ref[7]) … … 2045 2046 depDerivDict[phfx+'Scale'][iref] = w*ref[9]*ref[11] 2046 2047 for item in ['Ep','Es','Eg']: 2047 if phfx+item in varylist and dervDict:2048 if phfx+item in varylist and phfx+item in dervDict: 2048 2049 dMdvh[varylist.index(phfx+item)][iref] = w*dervDict[phfx+item]/ref[11] #correct 2049 elif phfx+item in dependentVars and dervDict:2050 elif phfx+item in dependentVars and phfx+item in dervDict: 2050 2051 depDerivDict[phfx+item][iref] = w*dervDict[phfx+item]/ref[11] 2051 2052 for item in ['BabA','BabU']: -
trunk/testDeriv.py
r1483 r1493 31 31 import GSASIIstrMath as G2stMth 32 32 import GSASIItestplot as plot 33 import GSASIImapvars as G2mv 33 34 import pytexture as ptx 34 35 ptx.pyqlmninit() #initialize fortran arrays for spherical harmonics … … 94 95 self.values = cPickle.load(file) 95 96 self.HistoPhases = cPickle.load(file) 97 (G2mv.dependentParmList,G2mv.arrayList,G2mv.invarrayList,G2mv.indParmList, 98 G2mv.invarrayList) = cPickle.load(file) 96 99 self.parmDict = cPickle.load(file) 97 100 self.varylist = cPickle.load(file) … … 102 105 file.close() 103 106 self.UpdateControls(event) 107 print G2mv.VarRemapShow(self.varylist) 104 108 finally: 105 109 dlg.Destroy()
Note: See TracChangeset
for help on using the changeset viewer.