Changeset 404
- Timestamp:
- Oct 28, 2011 1:59:03 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/GSASII.py
r400 r404 356 356 DataType = DataType.strip()[0:3] #just 1st 3 chars 357 357 wx.BeginBusyCursor() 358 Sample = G2pdG.GetDefaultSample() 358 Sample = G2pdG.SetDefaultSample() 359 Sample['Temperature'] = Temperature 359 360 try: 360 361 for Item in Data: -
trunk/GSASIIgrid.py
r400 r404 700 700 histNames = data['histNames'] 701 701 702 def GetSigData(parm): 703 sigData = [] 704 for name in histNames: 705 sigList = data[name]['sig'] 706 sigData.append(sigList[parm]) 707 return sigData 708 702 709 def Select(event): 703 710 cols = self.dataDisplay.GetSelectedCols() … … 705 712 if cols: 706 713 plotData = [] 714 plotSig = [] 707 715 plotNames = [] 708 716 for col in cols: 709 717 plotData.append(self.SeqTable.GetColValues(col)) 718 plotSig.append(GetSigData(col)) 710 719 plotNames.append(self.SeqTable.GetColLabelValue(col)) 711 720 plotData = np.array(plotData) 712 G2plt.PlotSeq(self,plotData,plot Names)721 G2plt.PlotSeq(self,plotData,plotSig,plotNames) 713 722 elif rows: 714 723 name = histNames[rows[0]] -
trunk/GSASIIphsGUI.py
r402 r404 2530 2530 mainSizer.Add((0,5),0) 2531 2531 2532 mainSizer.Add(wx.StaticText(dataDisplay,-1,' Hydrostatic strain:'))2532 mainSizer.Add(wx.StaticText(dataDisplay,-1,' Hydrostatic/elastic strain:')) 2533 2533 mainSizer.Add(HstrainSizer()) 2534 2534 -
trunk/GSASIIplot.py
r400 r404 1446 1446 Page.canvas.draw() 1447 1447 1448 def PlotSeq(self,SeqData,Seq Names):1448 def PlotSeq(self,SeqData,SeqSig,SeqNames): 1449 1449 1450 1450 try: … … 1464 1464 if len(SeqData): 1465 1465 X = np.arange(0,len(SeqData[0]),1) 1466 for Y, name in zip(SeqData,SeqNames):1467 Plot. plot(X,Y,label=name)1466 for Y,sig,name in zip(SeqData,SeqSig,SeqNames): 1467 Plot.errorbar(X,Y,yerr=sig,label=name) 1468 1468 Plot.legend(loc='best') 1469 1469 Page.canvas.draw() -
trunk/GSASIIspc.py
r388 r404 551 551 uniq = SGData['SGUniq'] 552 552 if laue in ['m3','m3m']: 553 return ['D11' ]553 return ['D11','eA'] #add cubic strain term 554 554 elif laue in ['6/m','6/mmm','3m1','31m','3']: 555 555 return ['D11','D33'] -
trunk/GSASIIstruct.py
r403 r404 201 201 return Histograms,Phases 202 202 203 def GPXBackup(GPXfile ):203 def GPXBackup(GPXfile,makeBack=True): 204 204 import distutils.file_util as dfu 205 205 GPXpath,GPXname = ospath.split(GPXfile) … … 210 210 name = name.split('.') 211 211 if len(name) == 3 and name[0] == Name and 'bak' in name[1]: 212 last = max(last,int(name[1].strip('bak'))+1) 212 if makeBack: 213 last = max(last,int(name[1].strip('bak'))+1) 214 else: 215 last = max(last,int(name[1].strip('bak'))) 213 216 GPXback = ospath.join(GPXpath,ospath.splitext(GPXname)[0]+'.bak'+str(last)+'.gpx') 214 217 dfu.copy_file(GPXfile,GPXback) 215 218 return GPXback 216 219 217 def SetUsedHistogramsAndPhases(GPXfile,Histograms,Phases,CovData ):220 def SetUsedHistogramsAndPhases(GPXfile,Histograms,Phases,CovData,makeBack=True): 218 221 ''' Updates gpxfile from all histograms that are found in any phase 219 222 and any phase that used a histogram … … 223 226 Phases = dictionary of phases that use histograms 224 227 CovData = dictionary of refined variables, varyList, & covariance matrix 228 makeBack = True if new backup of .gpx file is to be made; else use the last one made 225 229 ''' 226 230 227 GPXback = GPXBackup(GPXfile )231 GPXback = GPXBackup(GPXfile,makeBack) 228 232 print '\n',135*'-' 229 233 print 'Read from file:',GPXback … … 906 910 907 911 def PrintHStrain(hapData,SGData): 908 print '\n Hydrostatic strain: '912 print '\n Hydrostatic/elastic strain: ' 909 913 Hsnames = G2spc.HStrainNames(SGData) 910 914 ptlbls = ' names :' … … 1098 1102 1099 1103 def PrintHStrainAndSig(hapData,strainSig,SGData): 1100 print '\n Hydrostatic strain: '1104 print '\n Hydrostatic/elastic strain: ' 1101 1105 Hsnames = G2spc.HStrainNames(SGData) 1102 1106 ptlbls = ' name :' … … 1897 1901 h,k,l = refl[:3] 1898 1902 if laue in ['m3','m3m']: 1899 Dij = parmDict[phfx+'D11']*(h**2+k**2+l**2) 1903 Dij = parmDict[phfx+'D11']*(h**2+k**2+l**2)+ \ 1904 refl[4]**2*parmDict[phfx+'eA']*((h*k)**2+(h*l)**2+(k*l)**2)/(h**2+k**2+l**2)**2 1900 1905 elif laue in ['6/m','6/mmm','3m1','31m','3']: 1901 1906 Dij = parmDict[phfx+'D11']*(h**2+k**2+h*k)+parmDict[phfx+'D33']*l**2 … … 1924 1929 h,k,l = refl[:3] 1925 1930 if laue in ['m3','m3m']: 1926 dDijDict = {phfx+'D11':h**2+k**2+l**2,} 1931 dDijDict = {phfx+'D11':h**2+k**2+l**2, 1932 phfx+'eA':((h*k)**2+(h*l)**2+(k*l)**2)/(h**2+k**2+l**2)**2} 1927 1933 elif laue in ['6/m','6/mmm','3m1','31m','3']: 1928 1934 dDijDict = {phfx+'D11':h**2+k**2+h*k,phfx+'D33':l**2} … … 2421 2427 GetFobsSq(Histograms,Phases,parmDict,calcControls) 2422 2428 sigDict = dict(zip(varyList,sig)) 2423 covData = {'variables':result[0],'varyList':varyList,' covMatrix':covMatrix,2424 ' title':GPXfile,'newAtomDict':newAtomDict}2429 covData = {'variables':result[0],'varyList':varyList,'sig':sig, 2430 'covMatrix':covMatrix,'title':GPXfile,'newAtomDict':newAtomDict} 2425 2431 SetPhaseData(parmDict,sigDict,Phases,covData) 2426 2432 SetHistogramPhaseData(parmDict,sigDict,Phases,Histograms) … … 2468 2474 histNames.reverse() 2469 2475 SeqResult = {'histNames':histNames} 2470 2476 makeBack = True 2471 2477 for ihst,histogram in enumerate(histNames): 2472 2478 ifPrint = False … … 2560 2566 GetFobsSq(Histo,Phases,parmDict,calcControls) 2561 2567 sigDict = dict(zip(varyList,sig)) 2562 covData = {'variables':result[0],'varyList':varyList,' covMatrix':covMatrix,2563 ' title':histogram,'newAtomDict':newAtomDict}2568 covData = {'variables':result[0],'varyList':varyList,'sig':sig, 2569 'covMatrix':covMatrix,'title':histogram,'newAtomDict':newAtomDict} 2564 2570 SetHistogramPhaseData(parmDict,sigDict,Phases,Histo,ifPrint) 2565 2571 SetHistogramData(parmDict,sigDict,Histo,ifPrint) 2566 2572 SeqResult[histogram] = covData 2573 SetUsedHistogramsAndPhases(GPXfile,Histograms,Phases,covData,makeBack) 2574 makeBack = False 2567 2575 SetSeqResult(GPXfile,Histograms,SeqResult) 2568 2576
Note: See TracChangeset
for help on using the changeset viewer.