Changeset 1453 for trunk/GSASII.py
- Timestamp:
- Aug 1, 2014 3:19:48 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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(
Note: See TracChangeset
for help on using the changeset viewer.