Changeset 1453
- Timestamp:
- Aug 1, 2014 3:19:48 PM (9 years ago)
- Location:
- trunk
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Exercises/single crystal/IB3.EXP
r902 r1453 13 13 HSTRY 11 GENLES Win32 Apr 18 15:20:59 2013 14 14 HSTRY 12 EXPEDT Win32 May 02 11:05:24 2013 L L 15 HSTRY 13 GENLES Win32 May 02 11:05:28 2013 16 HSTRY 14 EXPEDT Win32 Jul 30 15:03:20 2014 L O 15 17 DSGL CDAT1 DRAD ARAD NOFO 16 18 FOUR CDAT1 PTSN X 1 NOPR 0.00 999.99 … … 128 130 INST 1PHIR -1. 129 131 ZZZZZZZZZZZZ Last EXP file record 130 HSTRY 1 3 GENLES Win32 May 02 11:05:28 2013132 HSTRY 15 GENLES Win32 Jul 30 15:03:24 2014 -
trunk/GSASII.py
r1449 r1453 99 99 return GSASII(parent) 100 100 101 def SetDefaultDData(dType,histoName,NShkl=0,NDij=0): 102 if dType in ['SXC','SNC']: 103 return {'Histogram':histoName,'Show':False,'Scale':[1.0,True], 104 'Babinet':{'BabA':[0.0,False],'BabU':[0.0,False]}, 105 'Extinction':['Lorentzian','None', {'Tbar':0.1,'Cos2TM':0.955, 106 'Eg':[1.e-10,False],'Es':[1.e-10,False],'Ep':[1.e-10,False]}]} 107 elif dType == 'SNT': 108 return {'Histogram':histoName,'Show':False,'Scale':[1.0,True], 109 'Babinet':{'BabA':[0.0,False],'BabU':[0.0,False]}, 110 'Extinction':['Lorentzian','None', { 111 'Eg':[1.e-10,False],'Es':[1.e-10,False],'Ep':[1.e-10,False]}]} 112 elif 'P' in dType: 113 return {'Histogram':histoName,'Show':False,'Scale':[1.0,False], 114 'Pref.Ori.':['MD',1.0,False,[0,0,1],0,{}], 115 'Size':['isotropic',[1.,1.,1.],[False,False,False],[0,0,1], 116 [1.,1.,1.,0.,0.,0.],6*[False,]], 117 'Mustrain':['isotropic',[1000.0,1000.0,1.0],[False,False,False],[0,0,1], 118 NShkl*[0.01,],NShkl*[False,]], 119 'HStrain':[NDij*[0.0,],NDij*[False,]], 120 'Extinction':[0.0,False],'Babinet':{'BabA':[0.0,False],'BabU':[0.0,False]}} 121 101 122 class GSASII(wx.Frame): 102 123 '''Define the main GSAS-II frame and its associated menu items 103 124 ''' 125 104 126 def _Add_FileMenuItems(self, parent): 105 127 item = parent.Append( … … 625 647 histoName = TextList[i] 626 648 if histoName in HKLFlist: 627 UseList[histoName] = {628 'Histogram':histoName,'Show':False,'Scale':[1.0,True],629 'Babinet':{'BabA':[0.0,False],'BabU':[0.0,False]},630 'Extinction':['Lorentzian','None', {'Tbar':0.1,'Cos2TM':0.955,631 'Eg':[1.e-10,False],632 'Es':[1.e-10,False],633 'Ep':[1.e-10,False]},]634 }635 649 #redo UpdateHKLFdata(histoName) here: 636 650 Id = G2gd.GetPatternTreeItemId(self,self.root,histoName) … … 641 655 ref[4] = np.sqrt(1./G2lat.calc_rDsq2(H,G)) 642 656 iabsnt,ref[3],Uniq,phi = G2spc.GenHKLf(H,SGData) 657 UseList[histoName] = SetDefaultDData(refDict['Type'],histoName) 643 658 elif histoName in PWDRlist: 644 UseList[histoName] = {645 'Histogram':histoName,'Show':False,646 'Scale':[1.0,False],'Pref.Ori.':['MD',1.0,False,[0,0,1],0,{}],647 'Size':['isotropic',[1.,1.,1.],[False,False,False],[0,0,1],648 [1.,1.,1.,0.,0.,0.],6*[False,]],649 'Mustrain':['isotropic',[1000.0,1000.0,1.0],[False,False,False],[0,0,1],650 NShkl*[0.01,],NShkl*[False,]],651 'HStrain':[NDij*[0.0,],NDij*[False,]],652 'Extinction':[0.0,False],'Babinet':{'BabA':[0.0,False],'BabU':[0.0,False]}}653 659 Id = G2gd.GetPatternTreeItemId(self,self.root,histoName) 654 660 refList = self.PatternTree.GetItemPyData( 655 661 G2gd.GetPatternTreeItemId(self,Id,'Reflection Lists')) 656 662 refList[generalData['Name']] = [] 663 UseList[histoName] = SetDefaultDData('PWDR',histoName,NShkl=NShkl,NDij=NDij) 657 664 else: 658 665 raise Exception('Unexpected histogram '+str(histoName)) … … 714 721 HistName = 'HKLF '+HistName 715 722 # make new histogram names unique 716 valuesdict = {717 'wtFactor':1.0,718 'Dummy':False,719 'ranId':ran.randint(0,sys.maxint),720 }721 723 if len(rd.Banks): 722 724 for Bank in rd.Banks: 725 valuesdict = {'wtFactor':1.0,'Dummy':False,'ranId':ran.randint(0,sys.maxint),} 723 726 HistName = G2obj.MakeUniqueLabel(HistName,HKLFlist) 724 727 print 'Read structure factor table '+str(HistName)+' from file '+str(self.lastimport) … … 732 735 self.PatternTree.AppendItem(Id,text='Reflection List'),[]) #dummy entry for GUI use 733 736 else: 737 valuesdict = {'wtFactor':1.0,'Dummy':False,'ranId':ran.randint(0,sys.maxint),} 734 738 HistName = G2obj.MakeUniqueLabel(HistName,HKLFlist) 735 739 print 'Read structure factor table '+str(HistName)+' from file '+str(self.lastimport) … … 774 778 SGData = generalData['SGData'] 775 779 UseList = data['Histograms'] 776 NShkl = len(G2spc.MustrainNames(SGData))777 NDij = len(G2spc.HStrainNames(SGData))778 780 for histoName in newHistList: 779 UseList[histoName] = {780 'Histogram':histoName,'Show':False,'Scale':[1.0,True],781 'Babinet':{'BabA':[0.0,False],'BabU':[0.0,False]},782 'Extinction':['Lorentzian','None', {'Tbar':0.1,'Cos2TM':0.955,783 'Eg':[1.e-10,False],784 'Es':[1.e-10,False],785 'Ep':[1.e-10,False]},]786 }787 781 #redo UpdateHKLFdata(histoName) here: 788 782 Id = G2gd.GetPatternTreeItemId(self,self.root,histoName) 789 783 refDict,reflData = self.PatternTree.GetItemPyData(Id) 784 UseList[histoName] = SetDefaultDData(refDict['Type'],histoName) 790 785 G,g = G2lat.cell2Gmat(generalData['Cell'][1:7]) 791 786 for iref,ref in enumerate(reflData['RefList']): … … 1326 1321 NDij = len(G2spc.HStrainNames(SGData)) 1327 1322 for histoName in newHistList: 1328 UseList[histoName] = { 1329 'Histogram':histoName,'Show':False, 1330 'Scale':[1.0,False],'Pref.Ori.':['MD',1.0,False,[0,0,1],0,{}], 1331 'Size':['isotropic',[1.,1.,1.],[False,False,False],[0,0,1], 1332 [1.,1.,1.,0.,0.,0.],6*[False,]], 1333 'Mustrain':['isotropic',[1000.0,1000.0,1.0],[False,False,False],[0,0,1], 1334 NShkl*[0.01,],NShkl*[False,]], 1335 'HStrain':[NDij*[0.0,],NDij*[False,]], 1336 'Extinction':[0.0,False],'Babinet':{'BabA':[0.0,False],'BabU':[0.0,False]}} 1323 UseList[histoName] = SetDefaultDData('PWDR',histoName,NShkl=NShkl,NDij=NDij) 1337 1324 Id = G2gd.GetPatternTreeItemId(self,self.root,histoName) 1338 1325 refList = self.PatternTree.GetItemPyData( … … 1496 1483 NShkl = len(G2spc.MustrainNames(SGData)) 1497 1484 NDij = len(G2spc.HStrainNames(SGData)) 1498 UseList[HistName] = { 1499 'Histogram':HistName,'Show':False, 1500 'Scale':[1.0,False],'Pref.Ori.':['MD',1.0,False,[0,0,1],0,{}], 1501 'Size':['isotropic',[1.,1.,1.],[False,False,False],[0,0,1], 1502 [1.,1.,1.,0.,0.,0.],6*[False,]], 1503 'Mustrain':['isotropic',[1000.0,1000.0,1.0],[False,False,False],[0,0,1], 1504 NShkl*[0.01,],NShkl*[False,]], 1505 'HStrain':[NDij*[0.0,],NDij*[False,]], 1506 'Extinction':[0.0,False],'Babinet':{'BabA':[0.0,False],'BabU':[0.0,False]}} 1485 UseList[HistName] = SetDefaultDData('PWDR',histoName,NShkl=NShkl,NDij=NDij) 1507 1486 Id = G2gd.GetPatternTreeItemId(self,self.root,HistName) 1508 1487 refList = self.PatternTree.GetItemPyData( -
trunk/GSASIIElem.py
r1428 r1453 326 326 return FP,FPP 327 327 328 def BlenResTOF(El ,BLtables,wave):329 FP = np.zeros( len(wave))330 FPP = np.zeros( len(wave))331 BL = BLtables[El][1]332 print BL333 if 'BW-LS' in BL:334 Re,Im,E0,gam,A,E1,B,E2 = BL['BW-LS'][1:]335 Emev = 81.80703/wave**2336 T0 = Emev-E0337 T1 = Emev-E1338 T2 = Emev-E2339 D0 = T0**2+gam**2340 D1 = T1**2+gam**2341 D2 = T2**2+gam**2342 FP= Re*(T0/D0+A*T1/D1+B*T2/D2)343 FPP= Im*(1/D0+A/D1+B/D2)344 else:345 FPP = np.ones(len(wave))*BL['SL'][1] #for Li, B, etc.328 def BlenResTOF(Els,BLtables,wave): 329 FP = np.zeros((len(Els),len(wave))) 330 FPP = np.zeros((len(Els),len(wave))) 331 BL = [BLtables[el][1] for el in Els] 332 for i,El in enumerate(Els): 333 if 'BW-LS' in BL[i]: 334 Re,Im,E0,gam,A,E1,B,E2 = BL[i]['BW-LS'][1:] 335 Emev = 81.80703/wave**2 336 T0 = Emev-E0 337 T1 = Emev-E1 338 T2 = Emev-E2 339 D0 = T0**2+gam**2 340 D1 = T1**2+gam**2 341 D2 = T2**2+gam**2 342 FP[i] = Re*(T0/D0+A*T1/D1+B*T2/D2) 343 FPP[i] = Im*(1/D0+A/D1+B/D2) 344 else: 345 FPP[i] = np.ones(len(wave))*BL[i]['SL'][1] #for Li, B, etc. 346 346 return FP,FPP 347 347 -
trunk/GSASIIddataGUI.py
r1378 r1453 163 163 hist = Indx[Obj.GetId()] 164 164 sourceDict = UseList[hist] 165 copyNames = ['Scale','Pref.Ori.','Size','Mustrain','HStrain','Extinction','Babinet'] 165 if 'HKLF' in sourceDict['Histogram']: 166 copyNames = ['Scale','Extinction','Babinet'] 167 else: #PWDR 168 copyNames = ['Scale','Pref.Ori.','Size','Mustrain','HStrain','Extinction','Babinet'] 166 169 copyDict = {} 167 170 for name in copyNames: … … 185 188 sourceDict = UseList[hist] 186 189 copyDict = {} 187 copyNames = ['Scale','Pref.Ori.','Size','Mustrain','HStrain','Extinction','Babinet'] 190 if 'HKLF' in sourceDict['Histogram']: 191 copyNames = ['Scale','Extinction','Babinet'] 192 else: #PWDR 193 copyNames = ['Scale','Pref.Ori.','Size','Mustrain','HStrain','Extinction','Babinet'] 188 194 babNames = ['BabA','BabU'] 189 195 for name in copyNames: 190 196 if name in ['Scale','Extinction','HStrain']: 191 copyDict[name] = sourceDict[name][1] 197 if name == 'Extinction' and 'HKLF' in sourceDict['Histogram']: 198 copyDict[name] = {} 199 for item in ['Eg','Es','Ep']: 200 copyDict[name][item] = sourceDict[name][2][item][1] 201 else: 202 copyDict[name] = sourceDict[name][1] 192 203 elif name in ['Size','Mustrain']: 193 204 copyDict[name] = [sourceDict[name][0],sourceDict[name][2],sourceDict[name][4]] … … 216 227 for name in copyNames: 217 228 if name in ['Scale','Extinction','HStrain']: 218 UseList[item][name][1] = copy.copy(copyDict[name]) 229 if name == 'Extinction' and 'HKLF' in sourceDict['Histogram']: 230 for itm in ['Eg','Es','Ep']: 231 UseList[item][name][2][itm][1] = copy.copy(copyDict[name][itm]) 232 else: 233 UseList[item][name][1] = copy.copy(copyDict[name]) 219 234 elif name in ['Size','Mustrain']: 220 235 UseList[item][name][0] = copy.copy(copyDict[name][0]) … … 779 794 if UseList[item]['Extinction'][1] != 'None': 780 795 extSizer.Add((0,5),) 781 valSizer =wx.BoxSizer(wx.HORIZONTAL) 782 valSizer.Add(wx.StaticText(DData,-1,' Tbar(mm):'),0,WACV) 783 tbarVal = wx.TextCtrl(DData,wx.ID_ANY, 784 '%.3f'%(UseList[item]['Extinction'][2]['Tbar']),style=wx.TE_PROCESS_ENTER) 785 Indx[tbarVal.GetId()] = item 786 tbarVal.Bind(wx.EVT_TEXT_ENTER,OnTbarVal) 787 tbarVal.Bind(wx.EVT_KILL_FOCUS,OnTbarVal) 788 valSizer.Add(tbarVal,0,WACV) 789 valSizer.Add(wx.StaticText(DData,-1,' cos(2ThM):'),0,WACV) 790 cos2tm = wx.TextCtrl(DData,wx.ID_ANY, 791 '%.3f'%(UseList[item]['Extinction'][2]['Cos2TM']),style=wx.TE_PROCESS_ENTER) 792 Indx[cos2tm.GetId()] = item 793 cos2tm.Bind(wx.EVT_TEXT_ENTER,OnCos2TM) 794 cos2tm.Bind(wx.EVT_KILL_FOCUS,OnCos2TM) 795 valSizer.Add(cos2tm,0,WACV) 796 extSizer.Add(valSizer,0,WACV) 796 if 'Tbar' in UseList[item]['Extinction'][2]: #skipped for TOF 797 valSizer =wx.BoxSizer(wx.HORIZONTAL) 798 valSizer.Add(wx.StaticText(DData,-1,' Tbar(mm):'),0,WACV) 799 tbarVal = wx.TextCtrl(DData,wx.ID_ANY, 800 '%.3f'%(UseList[item]['Extinction'][2]['Tbar']),style=wx.TE_PROCESS_ENTER) 801 Indx[tbarVal.GetId()] = item 802 tbarVal.Bind(wx.EVT_TEXT_ENTER,OnTbarVal) 803 tbarVal.Bind(wx.EVT_KILL_FOCUS,OnTbarVal) 804 valSizer.Add(tbarVal,0,WACV) 805 valSizer.Add(wx.StaticText(DData,-1,' cos(2ThM):'),0,WACV) 806 cos2tm = wx.TextCtrl(DData,wx.ID_ANY, 807 '%.3f'%(UseList[item]['Extinction'][2]['Cos2TM']),style=wx.TE_PROCESS_ENTER) 808 Indx[cos2tm.GetId()] = item 809 cos2tm.Bind(wx.EVT_TEXT_ENTER,OnCos2TM) 810 cos2tm.Bind(wx.EVT_KILL_FOCUS,OnCos2TM) 811 valSizer.Add(cos2tm,0,WACV) 812 extSizer.Add(valSizer,0,WACV) 797 813 val2Sizer =wx.BoxSizer(wx.HORIZONTAL) 798 814 if 'Primary' in UseList[item]['Extinction'][1]: -
trunk/GSASIImath.py
r1418 r1453 152 152 break 153 153 icycle += 1 154 else: #after last cycle or if zero cycles155 M = func(x0,*args)156 nfev += 1157 Yvec,Amat = Hess(x0,*args)158 Adiag = np.sqrt(np.diag(Amat))159 Anorm = np.outer(Adiag,Adiag)160 Amatlam = Amat*(One+Lam)/Anorm #scale Amat to Marquardt array154 M = func(x0,*args) 155 nfev += 1 156 Yvec,Amat = Hess(x0,*args) 157 Adiag = np.sqrt(np.diag(Amat)) 158 Anorm = np.outer(Adiag,Adiag) 159 Lam = np.eye(Amat.shape[0])*lam 160 Amatlam = Amat/Anorm #*(One+Lam) #don't scale Amat to Marquardt array 161 161 try: 162 Bmat = nl.inv(Amatlam) *(One+Lam)/Anorm #rescale Bmat to Marquardt array162 Bmat = nl.inv(Amatlam)/Anorm #*(One+Lam) #don't rescale Bmat to Marquardt array 163 163 return [x0,Bmat,{'num cyc':icycle,'fvec':M,'nfev':nfev,'lamMax':lamMax,'psing':[], 'Converged': ifConverged, 'DelChi2':deltaChi2}] 164 164 except nl.LinAlgError: 165 print 'ouch #2 linear algebra error in LS'165 print 'ouch #2 linear algebra error in making v-cov matrix' 166 166 psing = [] 167 167 if maxcyc: -
trunk/GSASIIobj.py
r1402 r1453 1271 1271 'Mustrain;.*' : 'Microstrain coef.', 1272 1272 'Size;.*' : 'Crystallite size value', 1273 'eA' : '?', 1273 'eA' : 'Cubic mustrain value', 1274 'Ep' : 'Primary extinction', 1275 'Es' : 'Secondary type II extinction', 1276 'Eg' : 'Secondary type I extinction', 1274 1277 #Histogram vars (:h:<var>) 1275 1278 'Absorption' : 'Absorption coef.', -
trunk/GSASIIphsGUI.py
r1450 r1453 75 75 phasePage.SetScrollbars(10,10,Size[0]/10-4,Size[1]/10-1) 76 76 mainFrame.setSizePosLeft(Size) 77 77 78 78 def UpdatePhaseData(G2frame,Item,data,oldPage): 79 79 '''Create the data display window contents when a phase is clicked on -
trunk/GSASIIpwdGUI.py
r1445 r1453 2506 2506 Types = 4*[wg.GRID_VALUE_LONG,]+4*[wg.GRID_VALUE_FLOAT+':10,4',]+ \ 2507 2507 2*[wg.GRID_VALUE_FLOAT+':10,2',]+[wg.GRID_VALUE_FLOAT+':10,3',]+ \ 2508 [wg.GRID_VALUE_FLOAT+':10, 2',]2508 [wg.GRID_VALUE_FLOAT+':10,3',] 2509 2509 G2frame.PeakTable = G2gd.Table(refs,rowLabels=rowLabels,colLabels=colLabels,types=Types) 2510 2510 G2frame.dataFrame.SetLabel('Reflection List for '+phaseName) -
trunk/GSASIIstrMath.py
r1391 r1453 557 557 Tdata,Mdata,Fdata,Xdata,dXdata,IAdata,Uisodata,Uijdata = GetAtomFXU(pfx,calcControls,parmDict) 558 558 FF = np.zeros(len(Tdata)) 559 if 'N ' in calcControls[hfx+'histType']:559 if 'NC' in calcControls[hfx+'histType']: 560 560 FP,FPP = G2el.BlenResCW(Tdata,BLtables,parmDict[hfx+'Lam']) 561 561 else: … … 572 572 refDict['FF']['FF'] = np.zeros((len(refDict['RefList']),len(dat))) 573 573 for iref,refl in enumerate(refDict['RefList']): 574 if 'NT' in calcControls[hfx+'histType']: 575 FP,FPP = G2el.BlenResCW(Tdata,BLtables,refl[12]) 574 576 fbs = np.array([0,0]) 575 577 H = refl[:3] … … 632 634 Tdata,Mdata,Fdata,Xdata,dXdata,IAdata,Uisodata,Uijdata = GetAtomFXU(pfx,calcControls,parmDict) 633 635 FF = np.zeros(len(Tdata)) 634 if 'N ' in calcControls[hfx+'histType']:636 if 'NC' in calcControls[hfx+'histType']: 635 637 FP,FPP = G2el.BlenResCW(Tdata,BLtables,parmDict[hfx+'Lam']) 636 el se:638 elif 'X' in calcControls[hfx+'histType']: 637 639 FP = np.array([FFtables[El][hfx+'FP'] for El in Tdata]) 638 640 FPP = np.array([FFtables[El][hfx+'FPP'] for El in Tdata]) … … 662 664 SQ = 1./(2.*refl.T[4])**2 663 665 SQfactor = 4.0*SQ*twopisq 666 if 'T' in calcControls[hfx+'histType']: 667 FP,FPP = G2el.BlenResTOF(Tdata,BLtables,refl.T[12]) 668 FP = np.repeat(FP.T,len(SGT),axis=0) 669 FPP = np.repeat(FPP.T,len(SGT),axis=0) 664 670 Bab = np.repeat(parmDict[phfx+'BabA']*np.exp(-parmDict[phfx+'BabU']*SQfactor),len(SGT)) 665 671 Tindx = np.array([refDict['FF']['El'].index(El) for El in Tdata]) … … 796 802 dervDict = {} 797 803 if calcControls[phfx+'EType'] != 'None': 798 cos2T = 1.0-0.5*(parmDict[hfx+'Lam']/ref[4])**2 #cos(2theta) 804 SQ = 1/(4.*ref[4]**2) 805 if 'C' in parmDict[hfx+'Type']: 806 cos2T = 1.0-2.*SQ*parmDict[hfx+'Lam']**2 #cos(2theta) 807 else: #'T' 808 cos2T = 1.0-2.*SQ*ref[12]**2 #cos(2theta) 799 809 if 'SXC' in parmDict[hfx+'Type']: 800 810 AV = 7.9406e5/parmDict[pfx+'Vol']**2 801 811 PL = np.sqrt(1.0-cos2T**2)/parmDict[hfx+'Lam'] 802 812 P12 = (calcControls[phfx+'Cos2TM']+cos2T**4)/(calcControls[phfx+'Cos2TM']+cos2T**2) 813 PLZ = AV*P12*ref[7]*parmDict[hfx+'Lam']**2 803 814 elif 'SNT' in parmDict[hfx+'Type']: 804 815 AV = 1.e7/parmDict[pfx+'Vol']**2 805 PL = 1./(4.*refl[4]**2)806 P 12 = 1.0816 PL = SQ 817 PLZ = AV*ref[7]*ref[12]**2 807 818 elif 'SNC' in parmDict[hfx+'Type']: 808 819 AV = 1.e7/parmDict[pfx+'Vol']**2 809 820 PL = np.sqrt(1.0-cos2T**2)/parmDict[hfx+'Lam'] 810 P 12 = 1.0821 PLZ = AV*ref[7]*parmDict[hfx+'Lam']**2 811 822 812 PLZ = AV*P12*parmDict[hfx+'Lam']**2*ref[7]813 823 if 'Primary' in calcControls[phfx+'EType']: 814 824 PLZ *= 1.5 815 825 else: 816 PLZ *= calcControls[phfx+'Tbar'] 817 826 if 'C' in parmDict[hfx+'Type']: 827 PLZ *= calcControls[phfx+'Tbar'] 828 else: #'T' 829 PLZ *= ref[13] 818 830 if 'Primary' in calcControls[phfx+'EType']: 831 PLZ *= 1.5 819 832 PSIG = parmDict[phfx+'Ep'] 820 833 elif 'I & II' in calcControls[phfx+'EType']: … … 844 857 PF3 = 0.5*(CL+2.*AL*PF/(1.+BL*PF)-AL*PF**2*BL/(1.+BL*PF)**2)/(PF4*extCor) 845 858 846 dervCor = (1.+PF)*PF3 859 dervCor = (1.+PF)*PF3 #extinction corr for other derivatives 847 860 if 'Primary' in calcControls[phfx+'EType'] and phfx+'Ep' in varyList: 848 861 dervDict[phfx+'Ep'] = -ref[7]*PLZ*PF3 … … 1893 1906 time0 = time.time() 1894 1907 dFdvDict = StructureFactorDerv(refDict,G,hfx,pfx,SGData,calcControls,parmDict) 1895 print 'sf-deriv time: %.3f'%(time.time()-time0)1908 # print 'sf-deriv time: %.3f'%(time.time()-time0) 1896 1909 ApplyRBModelDervs(dFdvDict,parmDict,rigidbodyDict,Phase) 1897 1910 dMdvh = np.zeros((len(varylist),len(refDict['RefList']))) … … 1916 1929 depDerivDict[var][iref] = w*dFdvDict[var][iref]*dervCor*parmDict[phfx+'Scale'] 1917 1930 if phfx+'Scale' in varylist: 1918 dMdvh[varylist.index(phfx+'Scale')][iref] = w*ref[9] *dervCor1931 dMdvh[varylist.index(phfx+'Scale')][iref] = w*ref[9] #*dervCor 1919 1932 elif phfx+'Scale' in dependentVars: 1920 depDerivDict[phfx+'Scale'][iref] = w*ref[9] *dervCor1933 depDerivDict[phfx+'Scale'][iref] = w*ref[9] #*dervCor 1921 1934 for item in ['Ep','Es','Eg']: 1922 1935 if phfx+item in varylist: … … 1926 1939 for item in ['BabA','BabU']: 1927 1940 if phfx+item in varylist: 1928 dMdvh[varylist.index(phfx+item)][iref] = w*dFdvDict[pfx+item][iref]*parmDict[phfx+'Scale'] *dervCor1941 dMdvh[varylist.index(phfx+item)][iref] = w*dFdvDict[pfx+item][iref]*parmDict[phfx+'Scale'] #*dervCor 1929 1942 elif phfx+item in dependentVars: 1930 depDerivDict[phfx+item][iref] = w*dFdvDict[pfx+item][iref]*parmDict[phfx+'Scale'] *dervCor1943 depDerivDict[phfx+item][iref] = w*dFdvDict[pfx+item][iref]*parmDict[phfx+'Scale'] #*dervCor 1931 1944 else: 1932 1945 for iref,ref in enumerate(refDict['RefList']): … … 1949 1962 depDerivDict[phfx+'Scale'][iref] = w*ref[9]*dervCor 1950 1963 for item in ['Ep','Es','Eg']: 1951 if phfx+item in varylist :1952 dMdvh[varylist.index(phfx+item)][iref] = w*dervDict[phfx+item]*parmDict[phfx+'Scale']1953 elif phfx+item in dependentVars :1954 depDerivDict[phfx+item][iref] = w*dervDict[phfx+item]*parmDict[phfx+'Scale'] 1964 if phfx+item in varylist and dervDict: 1965 dMdvh[varylist.index(phfx+item)][iref] = w*dervDict[phfx+item]*parmDict[phfx+'Scale']/dervCor 1966 elif phfx+item in dependentVars and dervDict: 1967 depDerivDict[phfx+item][iref] = w*dervDict[phfx+item]*parmDict[phfx+'Scale']/dervCor 1955 1968 for item in ['BabA','BabU']: 1956 1969 if phfx+item in varylist: 1957 dMdvh[varylist.index(phfx+item)][iref] = w*dFdvDict[pfx+item][iref]*parmDict[phfx+'Scale'] *dervCor1970 dMdvh[varylist.index(phfx+item)][iref] = w*dFdvDict[pfx+item][iref]*parmDict[phfx+'Scale'] #*dervCor 1958 1971 elif phfx+item in dependentVars: 1959 depDerivDict[phfx+item][iref] = w*dFdvDict[pfx+item][iref]*parmDict[phfx+'Scale'] *dervCor1972 depDerivDict[phfx+item][iref] = w*dFdvDict[pfx+item][iref]*parmDict[phfx+'Scale'] #*dervCor 1960 1973 # now process derivatives in constraints 1961 1974 G2mv.Dict2Deriv(varylist,depDerivDict,dMdvh) 1962 print 'matrix build time: %.3f'%(time.time()-time0)1975 # print 'matrix build time: %.3f'%(time.time()-time0) 1963 1976 1964 1977 if dlg: … … 2049 2062 time0 = time.time() 2050 2063 StructureFactor2(refDict,G,hfx,pfx,SGData,calcControls,parmDict) 2051 print 'sf-calc time: %.3f'%(time.time()-time0)2064 # print 'sf-calc time: %.3f'%(time.time()-time0) 2052 2065 df = np.zeros(len(refDict['RefList'])) 2053 2066 sumwYo = 0 -
trunk/imports/G2sfact.py
r1446 r1453 75 75 self.errors = 'Error after reading reflections (unexpected!)' 76 76 self.RefDict['RefList'] = np.array(self.RefDict['RefList']) 77 self.RefDict['Type'] = 'SXC' 77 78 self.UpdateParameters(Type='SXC',Wave=None) # histogram type 78 79 return True … … 115 116 self.errors = 'Error after reading reflections (unexpected!)' 116 117 self.RefDict['RefList'] = np.array(self.RefDict['RefList']) 118 self.RefDict['Type'] = 'SXC' 117 119 self.UpdateParameters(Type='SXC',Wave=None) # histogram type 118 120 return True … … 174 176 self.UpdateParameters(Type='SNT',Wave=None) # histogram type 175 177 for Bank in self.Banks: 176 Bank['RefDict']['RefList'] = np.array(Bank['RefDict']['RefList']) 178 Bank['RefDict']['RefList'] = np.array(Bank['RefDict']['RefList']) 179 Bank['RefDict']['Type'] = 'SNT' 177 180 else: 178 181 self.RefDict['RefList'] = np.array(self.RefDict['RefList']) 182 self.RefDict['Type'] = 'SNT' 179 183 self.errors = 'Error after reading reflections (unexpected!)' 180 184 self.UpdateParameters(Type='SNT',Wave=None) # histogram type … … 235 239 self.UpdateParameters(Type='SNT',Wave=None) # histogram type 236 240 for Bank in self.Banks: 237 Bank['RefDict']['RefList'] = np.array(Bank['RefDict']['RefList']) 241 Bank['RefDict']['RefList'] = np.array(Bank['RefDict']['RefList']) 242 Bank['RefDict']['Type'] = 'SNT' 238 243 else: 239 244 self.RefDict['RefList'] = np.array(self.RefDict['RefList']) 245 self.RefDict['Type'] = 'SNT' 240 246 self.errors = 'Error after reading reflections (unexpected!)' 241 247 self.UpdateParameters(Type='SNT',Wave=None) # histogram type -
trunk/imports/G2sfact_CIF.py
r1418 r1453 316 316 if blk.get('_diffrn_radiation_probe'): 317 317 if blk['_diffrn_radiation_probe'] == 'neutron': 318 type = 'SNC'318 Type = 'SNC' 319 319 elif blk.get('_diffrn_radiation.probe'): 320 320 if blk['_diffrn_radiation.probe'] == 'neutron': 321 type = 'SNC'321 Type = 'SNC' 322 322 else: 323 323 type = 'SXC' 324 self.RefDict['Type'] = Type 324 325 if blk.get('_diffrn_radiation_wavelength'): 325 326 wave = float(blk['_diffrn_radiation_wavelength']) … … 328 329 else: 329 330 wave = 1.5418 330 self.UpdateParameters(Type= type,Wave=wave) # histogram type331 self.UpdateParameters(Type=Type,Wave=wave) # histogram type 331 332 return True 332 333 except Exception as detail:
Note: See TracChangeset
for help on using the changeset viewer.