Changeset 404 for trunk/GSASIIstruct.py
- Timestamp:
- Oct 28, 2011 1:59:03 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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.