Changeset 1776
- Timestamp:
- Apr 4, 2015 7:31:34 PM (8 years ago)
- Location:
- trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/GSASII.py
r1773 r1776 990 990 Create and return the contents of the instrument parameter tree entry. 991 991 ''' 992 Irads = {0:' ',1:'CrKa',2:'FeKa',3:'CuKa',4:'MoKa',5:'AgKa',6:'TiKa',7:'CoKa'} 992 993 DataType = Iparm['INS HTYPE '].strip()[:3] # take 1st 3 chars 993 994 # override inst values with values read from data file … … 996 997 data = [DataType,] 997 998 instname = Iparm.get('INS 1INAME ') 999 irad = int(Iparm.get('INS 1 IRAD ','0')) 998 1000 if instname: 999 1001 rd.Sample['InstrName'] = instname.strip() … … 1040 1042 data.extend([0.0,0.0,0.002,azm]) #OK defaults if fxn #3 not 1st in iprm file 1041 1043 codes.extend([0,0,0,0,0,0,0]) 1042 return [G2IO.makeInstDict(names,data,codes),{}] 1044 Iparm1 = G2IO.makeInstDict(names,data,codes) 1045 Iparm1['Source'] = [Irads[irad],Irads[irad]] 1046 return [Iparm1,{}] 1043 1047 elif 'T' in DataType: 1044 1048 names = ['Type','fltPath','2-theta','difC','difA', 'difB','Zero','alpha','beta-0','beta-1', -
trunk/GSASIIddataGUI.py
r1773 r1776 120 120 def OnScaleRef(event): 121 121 Obj = event.GetEventObject() 122 UseList[ Indx[Obj.GetId()]]['Scale'][1] = Obj.GetValue()122 UseList[hist]['Scale'][1] = Obj.GetValue() 123 123 124 124 def OnScaleVal(event): … … 127 127 scale = float(Obj.GetValue()) 128 128 if scale > 0: 129 UseList[ Indx[Obj.GetId()]]['Scale'][0] = scale129 UseList[hist]['Scale'][0] = scale 130 130 except ValueError: 131 131 pass 132 Obj.SetValue("%.4f"%(UseList[ Indx[Obj.GetId()]]['Scale'][0])) #reset in case of error132 Obj.SetValue("%.4f"%(UseList[hist]['Scale'][0])) #reset in case of error 133 133 134 134 scaleSizer = wx.BoxSizer(wx.HORIZONTAL) … … 138 138 scaleRef = wx.CheckBox(DData,-1,label=' Scale factor: ') 139 139 scaleRef.SetValue(UseList[hist]['Scale'][1]) 140 Indx[scaleRef.GetId()] = hist141 140 scaleRef.Bind(wx.EVT_CHECKBOX, OnScaleRef) 142 141 scaleSizer.Add(scaleRef,0,WACV) 143 142 scaleVal = wx.TextCtrl(DData,wx.ID_ANY, 144 143 '%.4f'%(UseList[hist]['Scale'][0]),style=wx.TE_PROCESS_ENTER) 145 Indx[scaleVal.GetId()] = hist146 144 scaleVal.Bind(wx.EVT_TEXT_ENTER,OnScaleVal) 147 145 scaleVal.Bind(wx.EVT_KILL_FOCUS,OnScaleVal) … … 151 149 def OnUseData(event): 152 150 Obj = event.GetEventObject() 153 hist = Indx[Obj.GetId()]154 151 UseList[hist]['Use'] = Obj.GetValue() 155 152 156 def OnCopyData(event):157 Obj = event.GetEventObject()158 hist = Indx[Obj.GetId()]159 sourceDict = UseList[hist]160 if 'HKLF' in sourceDict['Histogram']:161 copyNames = ['Scale','Extinction','Babinet']162 else: #PWDR163 copyNames = ['Scale','Pref.Ori.','Size','Mustrain','HStrain','Extinction','Babinet']164 copyDict = {}165 for name in copyNames:166 copyDict[name] = copy.deepcopy(sourceDict[name]) #force copy167 keyList = sorted(UseList.keys())168 if UseList:169 dlg = G2G.G2MultiChoiceDialog(G2frame.dataFrame, 'Copy parameters',170 'Copy parameters to which histograms?',171 keyList)172 try:173 if dlg.ShowModal() == wx.ID_OK:174 for sel in dlg.GetSelections():175 UseList[keyList[sel]].update(copy.deepcopy(copyDict))176 wx.CallLater(100,UpdateDData,G2frame,DData,data)177 finally:178 dlg.Destroy()179 180 def OnCopyFlags(event):181 Obj = event.GetEventObject()182 hist = Indx[Obj.GetId()]183 sourceDict = UseList[hist]184 copyDict = {}185 if 'HKLF' in sourceDict['Histogram']:186 copyNames = ['Scale','Extinction','Babinet']187 else: #PWDR188 copyNames = ['Scale','Pref.Ori.','Size','Mustrain','HStrain','Extinction','Babinet']189 babNames = ['BabA','BabU']190 for name in copyNames:191 if name in ['Scale','Extinction','HStrain']:192 if name == 'Extinction' and 'HKLF' in sourceDict['Histogram']:193 copyDict[name] = {name:[sourceDict[name][:2]]}194 for item in ['Eg','Es','Ep']:195 copyDict[name][item] = sourceDict[name][2][item][1]196 else:197 copyDict[name] = sourceDict[name][1]198 elif name in ['Size','Mustrain']:199 copyDict[name] = [sourceDict[name][0],sourceDict[name][2],sourceDict[name][4]]200 elif name == 'Pref.Ori.':201 copyDict[name] = [sourceDict[name][0],sourceDict[name][2]]202 if sourceDict[name][0] == 'SH':203 SHterms = sourceDict[name][5]204 SHflags = {}205 for item in SHterms:206 SHflags[item] = SHterms[item]207 copyDict[name].append(SHflags)208 elif name == 'Babinet':209 copyDict[name] = {}210 for bab in babNames:211 copyDict[name][bab] = sourceDict[name][bab][1]212 keyList = sorted(UseList.keys())213 if UseList:214 dlg = G2G.G2MultiChoiceDialog(G2frame.dataFrame, 'Copy parameters',215 'Copy parameters to which histograms?',216 keyList)217 try:218 if dlg.ShowModal() == wx.ID_OK:219 for sel in dlg.GetSelections():220 item = keyList[sel]221 UseList[item]222 for name in copyNames:223 if name in ['Scale','Extinction','HStrain']:224 if name == 'Extinction' and 'HKLF' in sourceDict['Histogram']:225 UseList[item][name][:2] = copy.deepcopy(sourceDict[name][:2])226 for itm in ['Eg','Es','Ep']:227 UseList[item][name][2][itm][1] = copy.deepcopy(copyDict[name][itm])228 else:229 UseList[item][name][1] = copy.deepcopy(copyDict[name])230 elif name in ['Size','Mustrain']:231 UseList[item][name][0] = copy.deepcopy(copyDict[name][0])232 UseList[item][name][2] = copy.deepcopy(copyDict[name][1])233 UseList[item][name][4] = copy.deepcopy(copyDict[name][2])234 elif name == 'Pref.Ori.':235 UseList[item][name][0] = copy.deepcopy(copyDict[name][0])236 UseList[item][name][2] = copy.deepcopy(copyDict[name][1])237 if sourceDict[name][0] == 'SH':238 SHflags = copy.deepcopy(copyDict[name][2])239 SHterms = copy.deepcopy(sourceDict[name][5])240 elif name == 'Babinet':241 for bab in babNames:242 UseList[item][name][bab][1] = copy.deepcopy(copyDict[name][bab])243 wx.CallLater(100,UpdateDData,G2frame,DData,data)244 finally:245 dlg.Destroy()246 247 153 def OnLGmixRef(event): 248 154 Obj = event.GetEventObject() … … 265 171 def OnSizeType(event): 266 172 Obj = event.GetEventObject() 267 hist = Indx[Obj.GetId()]268 173 UseList[hist]['Size'][0] = Obj.GetValue() 269 174 G2plt.PlotSizeStrainPO(G2frame,data,hist) … … 303 208 def OnSizeAxis(event): 304 209 Obj = event.GetEventObject() 305 hist = Indx[Obj.GetId()]306 210 Saxis = Obj.GetValue().split() 307 211 try: … … 333 237 def OnStrainType(event): 334 238 Obj = event.GetEventObject() 335 hist = Indx[Obj.GetId()]336 239 UseList[hist]['Mustrain'][0] = Obj.GetValue() 337 240 wx.CallLater(100,UpdateDData,G2frame,DData,data) … … 370 273 def OnStrainAxis(event): 371 274 Obj = event.GetEventObject() 372 hist = Indx[Obj.GetId()]373 275 Saxis = Obj.GetValue().split() 374 276 try: … … 420 322 def OnPOVal(event): 421 323 Obj = event.GetEventObject() 422 hist = Indx[Obj.GetId()]423 324 try: 424 325 mdVal = float(Obj.GetValue()) … … 431 332 def OnPOAxis(event): 432 333 Obj = event.GetEventObject() 433 hist = Indx[Obj.GetId()]434 334 Saxis = Obj.GetValue().split() 435 335 try: … … 445 345 def OnPOOrder(event): 446 346 Obj = event.GetEventObject() 447 hist = Indx[Obj.GetId()]448 347 Order = int(Obj.GetValue()) 449 348 UseList[hist]['Pref.Ori.'][4] = Order … … 453 352 def OnPOType(event): 454 353 Obj = event.GetEventObject() 455 hist = Indx[Obj.GetId()]456 354 if 'March' in Obj.GetValue(): 457 355 UseList[hist]['Pref.Ori.'][0] = 'MD' … … 462 360 def OnPORef(event): 463 361 Obj = event.GetEventObject() 464 hist = Indx[Obj.GetId()]465 362 UseList[hist]['Pref.Ori.'][2] = Obj.GetValue() 466 363 … … 476 373 def OnExtRef(event): 477 374 Obj = event.GetEventObject() 478 UseList[ Indx[Obj.GetId()]]['Extinction'][1] = Obj.GetValue()375 UseList[hist]['Extinction'][1] = Obj.GetValue() 479 376 480 377 def OnExtVal(event): … … 483 380 ext = float(Obj.GetValue()) 484 381 if ext >= 0: 485 UseList[ Indx[Obj.GetId()]]['Extinction'][0] = ext382 UseList[hist]['Extinction'][0] = ext 486 383 except ValueError: 487 384 pass 488 Obj.SetValue("%.2f"%(UseList[ Indx[Obj.GetId()]]['Extinction'][0]))385 Obj.SetValue("%.2f"%(UseList[hist]['Extinction'][0])) 489 386 490 387 def OnBabRef(event): … … 509 406 tbar = float(Obj.GetValue()) 510 407 if tbar > 0: 511 UseList[ Indx[Obj.GetId()]]['Extinction'][2]['Tbar'] = tbar408 UseList[hist]['Extinction'][2]['Tbar'] = tbar 512 409 except ValueError: 513 410 pass 514 Obj.SetValue("%.3f"%(UseList[ Indx[Obj.GetId()]]['Extinction'][2]['Tbar']))411 Obj.SetValue("%.3f"%(UseList[hist]['Extinction'][2]['Tbar'])) 515 412 516 413 def OnCos2TM(event): … … 519 416 val = float(Obj.GetValue()) 520 417 if 0. < val <= 1.: 521 UseList[ Indx[Obj.GetId()]]['Extinction'][2]['Cos2TM'] = val418 UseList[hist]['Extinction'][2]['Cos2TM'] = val 522 419 except ValueError: 523 420 pass 524 Obj.SetValue("%.3f"%(UseList[ Indx[Obj.GetId()]]['Extinction'][2]['Cos2TM']))421 Obj.SetValue("%.3f"%(UseList[hist]['Extinction'][2]['Cos2TM'])) 525 422 526 423 def OnEval(event): … … 557 454 style=wx.CB_READONLY|wx.CB_DROPDOWN) 558 455 sizeType.Bind(wx.EVT_COMBOBOX, OnType) 559 Indx[sizeType.GetId()] = hist560 456 topSizer.Add(sizeType) 561 457 topSizer.Add((5,0),0) … … 610 506 h,k,l = UseList[hist][parm][3] 611 507 Axis = wx.TextCtrl(DData,-1,'%3d %3d %3d'%(h,k,l),style=wx.TE_PROCESS_ENTER) 612 Indx[Axis.GetId()] = hist613 508 Axis.Bind(wx.EVT_TEXT_ENTER,OnAxis) 614 509 Axis.Bind(wx.EVT_KILL_FOCUS,OnAxis) … … 700 595 POType = wx.ComboBox(DData,wx.ID_ANY,value=POtype,choices=choice, 701 596 style=wx.CB_READONLY|wx.CB_DROPDOWN) 702 Indx[POType.GetId()] = hist703 597 POType.Bind(wx.EVT_COMBOBOX, OnPOType) 704 598 poSizer.Add(POType) … … 707 601 poOrder = wx.ComboBox(DData,wx.ID_ANY,value=str(POData[4]),choices=[str(2*i) for i in range(18)], 708 602 style=wx.CB_READONLY|wx.CB_DROPDOWN) 709 Indx[poOrder.GetId()] = hist710 603 poOrder.Bind(wx.EVT_COMBOBOX,OnPOOrder) 711 604 poSizer.Add(poOrder,0,WACV) 712 605 poRef = wx.CheckBox(DData,-1,label=' Refine? ') 713 606 poRef.SetValue(POData[2]) 714 Indx[poRef.GetId()] = hist715 607 poRef.Bind(wx.EVT_CHECKBOX,OnPORef) 716 608 poSizer.Add(poRef,0,WACV) … … 721 613 poRef = wx.CheckBox(DData,-1,label=' March-Dollase ratio: ') 722 614 poRef.SetValue(POData[2]) 723 Indx[poRef.GetId()] = hist724 615 poRef.Bind(wx.EVT_CHECKBOX,OnPORef) 725 616 poSizer.Add(poRef,0,WACV) 726 617 poVal = wx.TextCtrl(DData,wx.ID_ANY, 727 618 '%.3f'%(POData[1]),style=wx.TE_PROCESS_ENTER) 728 Indx[poVal.GetId()] = hist729 619 poVal.Bind(wx.EVT_TEXT_ENTER,OnPOVal) 730 620 poVal.Bind(wx.EVT_KILL_FOCUS,OnPOVal) … … 733 623 h,k,l =POData[3] 734 624 poAxis = wx.TextCtrl(DData,-1,'%3d %3d %3d'%(h,k,l),style=wx.TE_PROCESS_ENTER) 735 Indx[poAxis.GetId()] = hist736 625 poAxis.Bind(wx.EVT_TEXT_ENTER,OnPOAxis) 737 626 poAxis.Bind(wx.EVT_KILL_FOCUS,OnPOAxis) … … 810 699 extRef = wx.CheckBox(DData,-1,label=' Extinction: ') 811 700 extRef.SetValue(UseList[hist]['Extinction'][1]) 812 Indx[extRef.GetId()] = hist813 701 extRef.Bind(wx.EVT_CHECKBOX, OnExtRef) 814 702 extSizer.Add(extRef,0,WACV) 815 703 extVal = wx.TextCtrl(DData,wx.ID_ANY, 816 704 '%.2f'%(UseList[hist]['Extinction'][0]),style=wx.TE_PROCESS_ENTER) 817 Indx[extVal.GetId()] = hist818 705 extVal.Bind(wx.EVT_TEXT_ENTER,OnExtVal) 819 706 extVal.Bind(wx.EVT_KILL_FOCUS,OnExtVal) … … 846 733 tbarVal = wx.TextCtrl(DData,wx.ID_ANY, 847 734 '%.3f'%(UseList[hist]['Extinction'][2]['Tbar']),style=wx.TE_PROCESS_ENTER) 848 Indx[tbarVal.GetId()] = hist849 735 tbarVal.Bind(wx.EVT_TEXT_ENTER,OnTbarVal) 850 736 tbarVal.Bind(wx.EVT_KILL_FOCUS,OnTbarVal) … … 853 739 cos2tm = wx.TextCtrl(DData,wx.ID_ANY, 854 740 '%.3f'%(UseList[hist]['Extinction'][2]['Cos2TM']),style=wx.TE_PROCESS_ENTER) 855 Indx[cos2tm.GetId()] = hist856 741 cos2tm.Bind(wx.EVT_TEXT_ENTER,OnCos2TM) 857 742 cos2tm.Bind(wx.EVT_KILL_FOCUS,OnCos2TM) … … 915 800 mainSizer = wx.BoxSizer(wx.VERTICAL) 916 801 mainSizer.Add(wx.StaticText(DData,-1,' Histogram data for '+PhaseName+':'),0,WACV) 802 DData.G2hist = hist #so can be used in G2phsGUI for Copy, etc. 917 803 if hist != '': 918 804 topSizer = wx.FlexGridSizer(1,2,5,5) … … 939 825 UseList[hist]['Babinet'] = {'BabA':[0.0,False],'BabU':[0.0,False]} 940 826 mainSizer.Add((5,5),0) 941 mainSizer.Add(wx.StaticText(DData,label=' Histogram: '+hist),0,WACV)942 827 showSizer = wx.BoxSizer(wx.HORIZONTAL) 943 useData = wx.CheckBox(DData,-1,label='Use?') 944 Indx[useData.GetId()] = hist 828 useData = wx.CheckBox(DData,-1,label='Use Histogram: '+hist+' ?') 945 829 showSizer.Add(useData,0,WACV) 946 830 useData.Bind(wx.EVT_CHECKBOX, OnUseData) 947 831 useData.SetValue(UseList[hist]['Use']) 948 copyData = wx.Button(DData,-1,label=' Copy?')949 Indx[copyData.GetId()] = hist950 copyData.Bind(wx.EVT_BUTTON,OnCopyData)951 showSizer.Add(copyData,WACV)952 copyFlags = wx.Button(DData,-1,label=' Copy flags?')953 Indx[copyFlags.GetId()] = hist954 copyFlags.Bind(wx.EVT_BUTTON,OnCopyFlags)955 showSizer.Add(copyFlags,WACV)956 832 mainSizer.Add((5,5),0) 957 833 mainSizer.Add(showSizer,0,WACV) -
trunk/GSASIIgrid.py
r1772 r1776 67 67 68 68 [ wxID_PWDRADD, wxID_HKLFADD, wxID_PWDANALYSIS, wxID_PWDCOPY, wxID_PLOTCTRLCOPY, 69 wxID_DATADELETE, 70 ] = [wx.NewId() for item in range( 6)]69 wxID_DATADELETE,wxID_DATACOPY,wxID_DATACOPYFLAGS,wxID_DATASELCOPY, 70 ] = [wx.NewId() for item in range(9)] 71 71 72 72 [ wxID_ATOMSEDITADD, wxID_ATOMSEDITINSERT, wxID_ATOMSEDITDELETE, wxID_ATOMSREFINE, … … 1662 1662 self.DataEdit = wx.Menu(title='') 1663 1663 self.DataMenu.Append(menu=self.DataEdit, title='Edit') 1664 self.DataEdit.Append(id=wxID_DATACOPY, kind=wx.ITEM_NORMAL,text='Copy data', 1665 help='Copy phase data to other histograms') 1666 self.DataEdit.Append(id=wxID_DATACOPYFLAGS, kind=wx.ITEM_NORMAL,text='Copy flags', 1667 help='Copy phase data flags to other histograms') 1668 self.DataEdit.Append(id=wxID_DATASELCOPY, kind=wx.ITEM_NORMAL,text='Copy selected data', 1669 help='Copy selected phase data to other histograms') 1664 1670 self.DataEdit.Append(id=wxID_PWDRADD, kind=wx.ITEM_NORMAL,text='Add powder histograms', 1665 1671 help='Select new powder histograms to be used for this phase') -
trunk/GSASIIphsGUI.py
r1773 r1776 3802 3802 #G2frame.PatternTree.SetItemPyData(Id,[refDict,reflData]) #removed by BHT -- not needed! 3803 3803 3804 def OnDataCopy(event): 3805 UseList = data['Histograms'] 3806 hist = DData.G2hist 3807 sourceDict = UseList[hist] 3808 if 'HKLF' in sourceDict['Histogram']: 3809 copyNames = ['Scale','Extinction','Babinet'] 3810 else: #PWDR 3811 copyNames = ['Scale','Pref.Ori.','Size','Mustrain','HStrain','Extinction','Babinet'] 3812 copyDict = {} 3813 for name in copyNames: 3814 copyDict[name] = copy.deepcopy(sourceDict[name]) #force copy 3815 keyList = sorted(UseList.keys()) 3816 if UseList: 3817 dlg = G2G.G2MultiChoiceDialog(G2frame.dataFrame, 'Copy parameters', 3818 'Copy parameters to which histograms?', 3819 keyList) 3820 try: 3821 if dlg.ShowModal() == wx.ID_OK: 3822 for sel in dlg.GetSelections(): 3823 UseList[keyList[sel]].update(copy.deepcopy(copyDict)) 3824 finally: 3825 dlg.Destroy() 3826 3827 def OnDataCopyFlags(event): 3828 UseList = data['Histograms'] 3829 hist = DData.G2hist 3830 sourceDict = UseList[hist] 3831 copyDict = {} 3832 if 'HKLF' in sourceDict['Histogram']: 3833 copyNames = ['Scale','Extinction','Babinet'] 3834 else: #PWDR 3835 copyNames = ['Scale','Pref.Ori.','Size','Mustrain','HStrain','Extinction','Babinet'] 3836 babNames = ['BabA','BabU'] 3837 for name in copyNames: 3838 if name in ['Scale','Extinction','HStrain']: 3839 if name == 'Extinction' and 'HKLF' in sourceDict['Histogram']: 3840 copyDict[name] = {name:[sourceDict[name][:2]]} 3841 for item in ['Eg','Es','Ep']: 3842 copyDict[name][item] = sourceDict[name][2][item][1] 3843 else: 3844 copyDict[name] = sourceDict[name][1] 3845 elif name in ['Size','Mustrain']: 3846 copyDict[name] = [sourceDict[name][0],sourceDict[name][2],sourceDict[name][4]] 3847 elif name == 'Pref.Ori.': 3848 copyDict[name] = [sourceDict[name][0],sourceDict[name][2]] 3849 if sourceDict[name][0] == 'SH': 3850 SHterms = sourceDict[name][5] 3851 SHflags = {} 3852 for item in SHterms: 3853 SHflags[item] = SHterms[item] 3854 copyDict[name].append(SHflags) 3855 elif name == 'Babinet': 3856 copyDict[name] = {} 3857 for bab in babNames: 3858 copyDict[name][bab] = sourceDict[name][bab][1] 3859 keyList = sorted(UseList.keys()) 3860 if UseList: 3861 dlg = G2G.G2MultiChoiceDialog(G2frame.dataFrame, 'Copy parameters', 3862 'Copy parameters to which histograms?', 3863 keyList) 3864 try: 3865 if dlg.ShowModal() == wx.ID_OK: 3866 for sel in dlg.GetSelections(): 3867 item = keyList[sel] 3868 UseList[item] 3869 for name in copyNames: 3870 if name in ['Scale','Extinction','HStrain']: 3871 if name == 'Extinction' and 'HKLF' in sourceDict['Histogram']: 3872 UseList[item][name][:2] = copy.deepcopy(sourceDict[name][:2]) 3873 for itm in ['Eg','Es','Ep']: 3874 UseList[item][name][2][itm][1] = copy.deepcopy(copyDict[name][itm]) 3875 else: 3876 UseList[item][name][1] = copy.deepcopy(copyDict[name]) 3877 elif name in ['Size','Mustrain']: 3878 UseList[item][name][0] = copy.deepcopy(copyDict[name][0]) 3879 UseList[item][name][2] = copy.deepcopy(copyDict[name][1]) 3880 UseList[item][name][4] = copy.deepcopy(copyDict[name][2]) 3881 elif name == 'Pref.Ori.': 3882 UseList[item][name][0] = copy.deepcopy(copyDict[name][0]) 3883 UseList[item][name][2] = copy.deepcopy(copyDict[name][1]) 3884 if sourceDict[name][0] == 'SH': 3885 SHflags = copy.deepcopy(copyDict[name][2]) 3886 SHterms = copy.deepcopy(sourceDict[name][5]) 3887 UseList[item][name][6] = copy.deepcopy(sourceDict[name][6]) 3888 UseList[item][name][7] = copy.deepcopy(sourceDict[name][7]) 3889 elif name == 'Babinet': 3890 for bab in babNames: 3891 UseList[item][name][bab][1] = copy.deepcopy(copyDict[name][bab]) 3892 finally: 3893 dlg.Destroy() 3894 3895 3896 def OnSelDataCopy(event): 3897 print 'selected data copy' 3898 event.Skip() 3899 3804 3900 def OnPwdrAdd(event): 3805 3901 generalData = data['General'] … … 3828 3924 Id = G2gd.GetPatternTreeItemId(G2frame,G2frame.root,histoName) 3829 3925 UseList[histoName] = {'Histogram':histoName,'Show':False, 3830 'Scale':[1.0,False],'Pref.Ori.':['MD',1.0,False,[0,0,1],0,{} ],3926 'Scale':[1.0,False],'Pref.Ori.':['MD',1.0,False,[0,0,1],0,{},[],0.1], 3831 3927 'Size':['isotropic',[1.,1.,1.],[False,False,False],[0,0,1], 3832 3928 [1.,1.,1.,0.,0.,0.],6*[False,]], … … 5874 5970 # Data 5875 5971 FillSelectPageMenu(TabSelectionIdDict, G2frame.dataFrame.DataMenu) 5972 G2frame.dataFrame.Bind(wx.EVT_MENU, OnDataCopy, id=G2gd.wxID_DATACOPY) 5973 G2frame.dataFrame.Bind(wx.EVT_MENU, OnDataCopyFlags, id=G2gd.wxID_DATACOPYFLAGS) 5974 G2frame.dataFrame.Bind(wx.EVT_MENU, OnSelDataCopy, id=G2gd.wxID_DATASELCOPY) 5876 5975 G2frame.dataFrame.Bind(wx.EVT_MENU, OnPwdrAdd, id=G2gd.wxID_PWDRADD) 5877 5976 G2frame.dataFrame.Bind(wx.EVT_MENU, OnHklfAdd, id=G2gd.wxID_HKLFADD) -
trunk/GSASIIpwdGUI.py
r1770 r1776 1342 1342 if 'Source' not in data: data['Source'] = ['CuKa','?'] 1343 1343 choice = ['TiKa','CrKa','FeKa','CoKa','CuKa','MoKa','AgKa'] 1344 lamPick = wx.ComboBox(G2frame.dataDisplay,value=data['Source'][ 1],choices=choice,style=wx.CB_READONLY|wx.CB_DROPDOWN)1344 lamPick = wx.ComboBox(G2frame.dataDisplay,value=data['Source'][0],choices=choice,style=wx.CB_READONLY|wx.CB_DROPDOWN) 1345 1345 lamPick.Bind(wx.EVT_COMBOBOX, OnLamPick) 1346 1346 waveSizer.Add(lamPick,0) … … 2965 2965 G2frame.dataFrame.SelectPhase.Enable(True) 2966 2966 try: #patch for old reflection lists 2967 if not len(data[phaseName]): 2968 return None 2967 2969 refList = np.array(data[phaseName]['RefList']) 2968 2970 I100 = refList.T[8+Super]*refList.T[11+Super] -
trunk/GSASIIstrMath.py
r1775 r1776 389 389 pVals.append(Z1[ind[0]][ind[1]]) 390 390 pWt.append(wt/esd1**2) 391 pWsum[name] += wt*(-Z1[ind[0]][ind[1]]/esd )**2391 pWsum[name] += wt*(-Z1[ind[0]][ind[1]]/esd1)**2 392 392 if ifesd2: 393 393 Z2 = 1.-Z … … 396 396 pVals.append(Z1[ind[0]][ind[1]]) 397 397 pWt.append(wt/esd2**2) 398 pWsum[name] += wt*( (obs-calc)/esd)**2398 pWsum[name] += wt*(Z2/esd2)**2 399 399 400 400 name = 'SH-Pref.Ori.' … … 534 534 pass 535 535 536 # lasthkl = np.array([0,0,0]) 536 537 # for ip,pName in enumerate(pNames): 538 # deriv = [] 539 # dNames = [] 540 # if np.any(lasthkl-hkl): 541 # PH = np.array(hkl) 542 # phi,beta = G2lat.CrsAng(np.array(hkl),cell,SGData) 543 # ODFln = G2lat.Flnh(False,SHCoef,phi,beta,SGData) 544 # lasthkl = copy.copy(hkl) 545 546 # gam = float(pnames[3]) 547 # psi = float(pnames[4]) 548 # for SHname in ODFln: 549 # l,m,n = eval(SHname[1:]) 550 # Ksl = G2lat.GetKsl(l,m,sam,psi,gam)[0] 551 # dNames += [str(pId)+'::'+SHname] 552 # deriv.append(-ODFln[SHname][0]*Ksl/SHCoef[SHname]) 553 # for dName,drv in zip(dNames,deriv): 554 # try: 555 # ind = varyList.index(dName) 556 # pDerv[ind][ip] += drv 557 # except ValueError: 558 # pass 537 559 # pnames = pNames.split(':') 538 560 # if 'SH-' in pName and pId == int(pnames[0]): 539 # name = pnames[2]540 # L,N = eval(name.strip('C'))541 561 # hId = int(pnames[1]) 542 562 # phfx = '%d:%d:'%(pId,hId) … … 547 567 # SHcofNames = Phases[phase]['Histograms'][hist]['Pref.Ori.'][5].keys() 548 568 # SHcof = dict(zip(SHcofNames,[parmDict[phfx+cof] for cof in SHcofNames])) 549 # 569 # 570 # L,N = eval(name.strip('C')) 571 550 572 # raise Exception 551 573 … … 1086 1108 PL = np.sqrt(1.0-cos2T**2)/parmDict[hfx+'Lam'] 1087 1109 P12 = (calcControls[phfx+'Cos2TM']+cos2T**4)/(calcControls[phfx+'Cos2TM']+cos2T**2) 1088 PLZ = AV*P12*ref[ 7+im]*parmDict[hfx+'Lam']**21110 PLZ = AV*P12*ref[9+im]*parmDict[hfx+'Lam']**2 1089 1111 elif 'SNT' in parmDict[hfx+'Type']: 1090 1112 AV = 1.e7/parmDict[pfx+'Vol']**2 1091 1113 PL = SQ 1092 PLZ = AV*ref[ 7+im]*ref[12+im]**21114 PLZ = AV*ref[9+im]*ref[12+im]**2 1093 1115 elif 'SNC' in parmDict[hfx+'Type']: 1094 1116 AV = 1.e7/parmDict[pfx+'Vol']**2 1095 1117 PL = np.sqrt(1.0-cos2T**2)/parmDict[hfx+'Lam'] 1096 PLZ = AV*ref[9 ]*parmDict[hfx+'Lam']**2 #Fcsq as per GSAS, why not FcTsq (ref[9])?1118 PLZ = AV*ref[9+im]*parmDict[hfx+'Lam']**2 1097 1119 1098 1120 if 'Primary' in calcControls[phfx+'EType']:
Note: See TracChangeset
for help on using the changeset viewer.