Changeset 5066
- Timestamp:
- Nov 5, 2021 1:03:50 PM (23 months ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/GSASIIdataGUI.py
r5064 r5066 2693 2693 Id = self.GPXtree.AppendItem(self.root,text=HistName) 2694 2694 Ymin = np.min(rd.pdfdata[1]) 2695 Ymax = np.max(rd.pdfdata[1]) 2695 Ymax = np.max(rd.pdfdata[1]) 2696 Rmin = np.min(rd.pdfdata[0]) 2697 Rmax = np.max(rd.pdfdata[0]) 2696 2698 valuesdict = { 2697 2699 'wtFactor':1.0,'Dummy':False,'ranId':ran.randint(0,sys.maxsize), … … 2702 2704 self.GPXtree.SetItemPyData(self.GPXtree.AppendItem(Id,text='PDF Controls'), 2703 2705 {'G(R)':[valuesdict,rd.pdfdata,HistName],'diffGRname':'','diffMult':1.0,'Rmax':Ymax,'Type':rd.Type, 2704 'dscale':[1.0,False],'Fitrange':[ Ymin,Ymax],'qdamp':[0.03,False],'qbroad':[0,False]})2706 'dscale':[1.0,False],'Fitrange':[Rmin,Rmax],'qdamp':[0.03,False],'qbroad':[0,False]}) 2705 2707 self.GPXtree.SetItemPyData(self.GPXtree.AppendItem(Id,text='PDF Peaks'), 2706 2708 {'Limits':[1.,5.],'Background':[2,[0.,-0.2*np.pi],False],'Peaks':[]}) -
trunk/GSASIIphsGUI.py
r5065 r5066 2914 2914 2915 2915 def OnRunISODISTORT(event): 2916 ''' this needs to setup for method #3 or #4 in ISODISTORT 2917 after providing parent cif: 2918 #3 asks for transformation matrix & space group of child structure 2919 #4 asks for cif file of child structure 2920 ''' 2916 2921 import ISODISTORT as ISO 2917 2922 dlg = wx.FileDialog(General, 'Choose parent cif file for ISODISTORT',G2G.GetImportPath(G2frame), … … 4900 4905 def OnRefSel(event): 4901 4906 RMCPdict['refinement'] = reftype.GetStringSelection() 4902 wx.CallAfter(UpdateRMC) 4903 4907 wx.CallAfter(UpdateRMC) 4908 4909 def OnAddPDF(event): 4910 usedList = RMCPdict['seqfiles'] 4911 PDFdict = dict([item[1:] for item in G2frame.GetFileList('PDF')]) 4912 PDFnames = [item for item in PDFdict if item not in usedList] 4913 dlg = G2G.G2MultiChoiceDialog(G2frame.FRMC,'PDF dataset', 4914 'Select G(r) data to use in seq. PDFfit',PDFnames) 4915 # style=wx.DEFAULT_DIALOG_STYLE|wx.RESIZE_BORDER|wx.OK|wx.CENTRE) 4916 if dlg.ShowModal() == wx.ID_OK: 4917 PDFuse = dlg.GetSelections() 4918 for item in PDFuse: 4919 pId = G2gd.GetGPXtreeItemId(G2frame,G2frame.root,PDFnames[item]) 4920 data = G2frame.GPXtree.GetItemPyData(G2gd.GetGPXtreeItemId(G2frame,pId,'PDF Controls')) 4921 RMCPdict['seqfiles'].append([PDFnames[item],data]) 4922 dlg.Destroy() 4923 wx.CallAfter(UpdateRMC) 4924 4904 4925 Indx = {} 4905 4926 topSizer = wx.BoxSizer(wx.HORIZONTAL) … … 4983 5004 return 4984 5005 elif G2frame.RMCchoice == 'PDFfit' and RMCPdict['refinement'] == 'sequential': 4985 mainSizer.Add(wx.StaticText(G2frame.FRMC,label='sequential file list - TBD')) 5006 5007 def OnSetColVal(event): 5008 5009 parms = {'Rmin':[0.0,5.0],'Rmax':[5.,30.],'dscale':[0.5,2.0],'qdamp':[0.0,0.5],'qbroad':[0.0,0.1]} 5010 c = event.GetCol() 5011 if c >= 0: 5012 if c in [3,5,7]: 5013 seqGrid.ClearSelection() 5014 seqGrid.SelectCol(c,True) 5015 if seqGrid.GetColLabelValue(c) != 'refine': return 5016 choice = ['Y - vary all','N - vary none',] 5017 dlg = wx.SingleChoiceDialog(G2frame,'Select refinement option for '+seqGrid.GetColLabelValue(c-1), 5018 'Refinement controls',choice) 5019 dlg.CenterOnParent() 5020 if dlg.ShowModal() == wx.ID_OK: 5021 sel = dlg.GetSelection() 5022 varib = colLabels[c-1] 5023 if sel == 0: 5024 for row in range(seqGrid.GetNumberRows()): RMCPdict['seqfiles'][row][1][varib][1]=True 5025 else: 5026 for row in range(seqGrid.GetNumberRows()): RMCPdict['seqfiles'][row][1][varib][1]=False 5027 elif c in [0,1,2,4,6]: 5028 seqGrid.ClearSelection() 5029 seqGrid.SelectCol(c,True) 5030 parm = colLabels[c] 5031 dlg = G2G.SingleFloatDialog(G2frame,'New value','Enter value for '+parm,0.0,parms[parm]) 5032 if dlg.ShowModal() == wx.ID_OK: 5033 value = dlg.GetValue() 5034 if c in [2,4,6]: 5035 for row in range(seqGrid.GetNumberRows()): RMCPdict['seqfiles'][row][1][parm][0] = value 5036 else: 5037 for row in range(seqGrid.GetNumberRows()): RMCPdict['seqfiles'][row][1]['Fitrange'][c] = value 5038 wx.CallAfter(UpdateRMC) 5039 5040 if 'seqfiles' not in RMCPdict: 5041 RMCPdict['seqfiles'] = [] 5042 topSizer = wx.BoxSizer(wx.HORIZONTAL) 5043 topSizer.Add(wx.StaticText(G2frame.FRMC,label=' Sequential file list for PDFfit: '),0,WACV) 5044 addPDF = wx.Button(G2frame.FRMC,label='Add PDF G(r) data sets') 5045 addPDF.Bind(wx.EVT_BUTTON,OnAddPDF) 5046 topSizer.Add(addPDF,0,WACV) 5047 mainSizer.Add(topSizer) 5048 table = [[item[1]['Fitrange'][0],item[1]['Fitrange'][1], 5049 item[1]['dscale'][0],item[1]['dscale'][1],item[1]['qdamp'][0],item[1]['qdamp'][1], 5050 item[1]['qbroad'][0],item[1]['qbroad'][1],] for item in RMCPdict['seqfiles']] 5051 colLabels = ['Rmin','Rmax','dscale','refine','qdamp','refine','qbroad','refine'] 5052 rowLabels = [item[0] for item in RMCPdict['seqfiles']] 5053 Types = [wg.GRID_VALUE_FLOAT+':10,2',wg.GRID_VALUE_FLOAT+':10,2', 5054 wg.GRID_VALUE_FLOAT+':10,4',wg.GRID_VALUE_BOOL, 5055 wg.GRID_VALUE_FLOAT+':10,4',wg.GRID_VALUE_BOOL, 5056 wg.GRID_VALUE_FLOAT+':10,4',wg.GRID_VALUE_BOOL,] 5057 seqTable = G2G.Table(table,rowLabels=rowLabels,colLabels=colLabels,types=Types) 5058 seqGrid = G2G.GSGrid(G2frame.FRMC) 5059 seqGrid.SetTable(seqTable, True) 5060 seqGrid.AutoSizeColumns(True) 5061 seqGrid.Bind(wg.EVT_GRID_LABEL_LEFT_DCLICK, OnSetColVal) 5062 mainSizer.Add(seqGrid) 5063 4986 5064 return 4987 5065 # RMCProfile & PDFfit (Normal) … … 5406 5484 oldPairs = data['RMC']['RMCProfile'].get('Pairs',{}) 5407 5485 Pairs = {} 5408 for pairs in [[' %s-%s'%(atSeq[i],atSeq[j]) for j in range(i,lenA) if 'Va' not in atSeq[j]] for i in range(lenA) if 'Va' not in atSeq[i]]: 5486 # for pairs in [[' %s-%s'%(atSeq[i],atSeq[j]) for j in range(i,lenA) if 'Va' not in atSeq[j]] for i in range(lenA) if 'Va' not in atSeq[i]]: 5487 for pairs in [[' %s-%s'%(atSeq[i],atSeq[j]) for j in range(i,lenA)] for i in range(lenA)]: 5409 5488 for pair in pairs: 5410 5489 if pair in oldPairs: … … 5416 5495 if not data['RMC']['RMCProfile'] or 'metadata' not in RMCPdict: 5417 5496 Pairs = {} 5418 for pairs in [[' %s-%s'%(atSeq[i],atSeq[j]) for j in range(i,lenA) if 'Va' not in atSeq[j]] for i in range(lenA) if 'Va' not in atSeq[i]]: 5497 # for pairs in [[' %s-%s'%(atSeq[i],atSeq[j]) for j in range(i,lenA) if 'Va' not in atSeq[j]] for i in range(lenA) if 'Va' not in atSeq[i]]: 5498 for pairs in [[' %s-%s'%(atSeq[i],atSeq[j]) for j in range(i,lenA)] for i in range(lenA)]: 5419 5499 for pair in pairs: 5420 5500 Pairs[pair] = [0.0,0.0,0.0] 5421 5501 BVSpairs = [] 5422 5502 if lenA > 1: 5423 for pair in [[' %s-%s'%(atSeq[i],atSeq[j]) for j in range(i,lenA) if 'Va' not in atSeq[j]] for i in range(lenA) if 'Va' not in atSeq[i]]: 5503 # for pair in [[' %s-%s'%(atSeq[i],atSeq[j]) for j in range(i,lenA) if 'Va' not in atSeq[j]] for i in range(lenA) if 'Va' not in atSeq[i]]: 5504 for pair in [[' %s-%s'%(atSeq[i],atSeq[j]) for j in range(i,lenA)] for i in range(lenA)]: 5424 5505 BVSpairs += pair 5425 5506 BVS = {pairs:[0.0,0.0,0.0,0.0] for pairs in BVSpairs} … … 5438 5519 'Stretch search':10.,'Pot. Temp.':300.,'useGPU':False,}}) 5439 5520 5521 # data['RMC']['RMCProfile']['aTypes'] = {aTypes[atype] for atype in aTypes if atype in Atypes} 5440 5522 data['RMC']['RMCProfile']['Isotope'] = copy.copy(data['General']['Isotope']) 5441 5523 data['RMC']['RMCProfile']['Isotopes'] = copy.deepcopy(data['General']['Isotopes']) -
trunk/GSASIIpwd.py
r5058 r5066 2621 2621 Isotopes = RMCPdict['Isotopes'] 2622 2622 Atypes = RMCPdict['aTypes'] 2623 if 'Va' in Atypes: 2624 Isotope['Va'] = 'Nat. Abund.' 2625 Isotopes['Va'] = {'Nat. Abund.':{'SL':[0.0,0.0]}} 2623 2626 atPairs = RMCPdict['Pairs'] 2624 2627 Files = RMCPdict['files'] … … 2652 2655 pair = pair.replace(' ','') 2653 2656 at1,at2 = pair.split('-') 2654 ncoef = Isotopes[at1][Isotope[at1]]['SL'][0]*Natoms[at1]/sumatms 2655 ncoef *= Isotopes[at2][Isotope[at2]]['SL'][0]*Natoms[at2]/sumatms 2657 if at1 == 'Va' or at2 == 'Va': 2658 ncoef = 0.0 2659 else: 2660 ncoef = Isotopes[at1][Isotope[at1]]['SL'][0]*Natoms[at1]/sumatms 2661 ncoef *= Isotopes[at2][Isotope[at2]]['SL'][0]*Natoms[at2]/sumatms 2656 2662 if at1 != at2: 2657 2663 ncoef *= 2. 2658 2664 Ncoeff += [ncoef,] 2659 pairMin = [atPairs[pair] for pair in Pairs if pair in atPairs]2660 maxMoves = [Atypes[atm] for atm in Atseq if atm in Atypes]2665 pairMin = [atPairs[pair] if pair in atPairs else [0.0,0.,0.] for pair in Pairs ] 2666 maxMoves = [Atypes[atm] if atm in Atypes else 0.0 for atm in Atseq ] 2661 2667 fname = Name+'.dat' 2662 2668 fl = open(fname,'w')
Note: See TracChangeset
for help on using the changeset viewer.