Changeset 2931
- Timestamp:
- Jul 13, 2017 1:08:24 PM (6 years ago)
- Location:
- branch/2frame
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branch/2frame/GSASIIdataGUI.py
r2929 r2931 4912 4912 # Sequential results 4913 4913 G2G.Define_wxId('wxID_RENAMESEQSEL', 'wxID_SAVESEQSEL', 'wxID_SAVESEQCSV', 'wxID_SAVESEQSELCSV', 'wxID_PLOTSEQSEL', 4914 'wxID_ORGSEQSEL', 'wxID_ADDSEQVAR', 'wxID_DELSEQVAR', 'wxID_EDITSEQVAR', 'wxID_COPYPARFIT', 'wxID_AVESEQSEL', 4914 'wxID_ORGSEQSEL', 'wxID_ADDSEQVAR', 'wxID_DELSEQVAR', 'wxID_EDITSEQVAR', 'wxID_COPYPARFIT', 'wxID_AVESEQSEL','wxID_SELECTUSE', 4915 4915 'wxID_ADDPARFIT', 'wxID_DELPARFIT', 'wxID_EDITPARFIT', 'wxID_DOPARFIT', 'wxID_ADDSEQDIST', 'wxID_ADDSEQANGLE', 'wxID_ORGSEQINC',) 4916 4916 self.SequentialMenu = wx.MenuBar() … … 4918 4918 self.SequentialFile = wx.Menu(title='') 4919 4919 self.SequentialMenu.Append(menu=self.SequentialFile, title='Columns') 4920 self.SequentialFile.Append(id=G2G.wxID_SELECTUSE, kind=wx.ITEM_NORMAL,text='Select used', 4921 help='Select rows to be used in plots/equation fitting') 4920 4922 self.SequentialFile.Append(id=G2G.wxID_RENAMESEQSEL, kind=wx.ITEM_NORMAL,text='Rename selected', 4921 4923 help='Rename selected sequential refinement columns') … … 5918 5920 try: 5919 5921 if 'Seq Data' in data: 5920 for item in data['Seq Data']:5921 sel.append(choices.index(item))5922 # for item in data['Seq Data']: 5923 # sel.append(choices.index(item)) 5922 5924 sel = [choices.index(item) for item in data['Seq Data']] 5923 5925 except ValueError: #data changed somehow - start fresh … … 6206 6208 G2plt.PlotCovariance(G2frame,data[name]) 6207 6209 else: 6208 G2frame.ErrorDialog( 6209 'Select columns', 6210 'No columns or rows selected in table. Click on row or column labels to select fields for plotting.' 6211 ) 6210 G2frame.ErrorDialog('Select columns', 6211 'No columns or rows selected in table. Click on row or column labels to select fields for plotting.') 6212 6212 6213 6213 def OnAveSelSeq(event): … … 6224 6224 print ' Average for '+G2frame.SeqTable.GetColLabelValue(col)+': '+'%.6g'%(ave)+' +/- '+'%.6g'%(sig) 6225 6225 else: 6226 G2frame.ErrorDialog( 6227 'Select columns', 6228 'No columns selected in table. Click on column labels to select fields for averaging.' 6229 ) 6226 G2frame.ErrorDialog('Select columns', 6227 'No columns selected in table. Click on column labels to select fields for averaging.') 6228 6229 def OnSelectUse(event): 6230 dlg = G2G.G2MultiChoiceDialog(G2frame, 'Select rows to use','Select rows',histNames) 6231 sellist = [i for i,item in enumerate(G2frame.colList[0]) if item] 6232 dlg.SetSelections(sellist) 6233 if dlg.ShowModal() == wx.ID_OK: 6234 sellist = dlg.GetSelections() 6235 for row in range(G2frame.SeqTable.GetNumberRows()): 6236 G2frame.SeqTable.SetValue(row,0,False) 6237 G2frame.colList[0][row] = False 6238 for row in sellist: 6239 G2frame.SeqTable.SetValue(row,0,True) 6240 G2frame.colList[0][row] = True 6241 G2frame.dataDisplay.ForceRefresh() 6242 dlg.Destroy() 6230 6243 6231 6244 def OnRenameSelSeq(event): … … 6249 6262 G2plt.PlotSelectedSequence(G2frame,cols,GetColumnInfo,SelectXaxis) 6250 6263 6251 def OnReOrgSelSeq(event):6252 'Reorder the columns -- probably not fully implemented'6253 G2G.GetItemOrder(G2frame,VaryListChanges,vallookup,posdict)6254 UpdateSeqResults(G2frame,data,G2frame.dataDisplay.GetSize()) # redisplay variables6264 # def OnReOrgSelSeq(event): 6265 # 'Reorder the columns -- probably not fully implemented' 6266 # G2G.GetItemOrder(G2frame,VaryListChanges,vallookup,posdict) 6267 # UpdateSeqResults(G2frame,data,G2frame.dataDisplay.GetSize()) # redisplay variables 6255 6268 6256 6269 def OnSaveSelSeqCSV(event): … … 6970 6983 G2frame.SetTitle('Sequential refinement results') 6971 6984 G2frame.GetStatusBar().SetStatusText('',1) 6985 G2frame.Bind(wx.EVT_MENU, OnSelectUse, id=G2G.wxID_SELECTUSE) 6972 6986 G2frame.Bind(wx.EVT_MENU, OnRenameSelSeq, id=G2G.wxID_RENAMESEQSEL) 6973 6987 G2frame.Bind(wx.EVT_MENU, OnSaveSelSeq, id=G2G.wxID_SAVESEQSEL) … … 7045 7059 nRows = len(histNames) 7046 7060 G2frame.colList = [nRows*[True]] 7047 G2frame.colSigs = [None ]7048 colLabels = ['Use' ]7049 Types = [wg.GRID_VALUE_BOOL ]7061 G2frame.colSigs = [None,] 7062 colLabels = ['Use',] 7063 Types = [wg.GRID_VALUE_BOOL,] 7050 7064 # start with Rwp values 7051 7065 if 'IMG ' not in histNames[0][:4]: … … 7315 7329 colLabels=colLabels,rowLabels=histNames,types=Types) 7316 7330 G2frame.dataDisplay.SetTable(G2frame.SeqTable, True) 7317 #G2frame.dataDisplay.EnableEditing(False)7318 # make all but first columnread-only7319 for c in range(1,len(colLabels)):7320 for r in range(nRows):7321 G2frame.dataDisplay.SetCellReadOnly(r,c)7331 G2frame.dataDisplay.EnableEditing(False) 7332 # make all read-only 7333 # for c in range(len(colLabels)): 7334 # for r in range(nRows): 7335 # G2frame.dataDisplay.SetCellReadOnly(r,c) 7322 7336 G2frame.dataDisplay.Bind(wg.EVT_GRID_LABEL_LEFT_CLICK, PlotSSelect) 7323 7337 G2frame.dataDisplay.Bind(wg.EVT_GRID_LABEL_LEFT_DCLICK, PlotSelect) … … 7624 7638 u' Unweighted phase residuals RF\u00b2: %.3f%%, RF: %.3f%% on %d reflections '% \ 7625 7639 (data[0][pfx+'Rf^2'],data[0][pfx+'Rf'],data[0][value]))) 7640 7626 7641 7627 7642 G2frame.GPXtree.SetItemPyData(item,data) -
branch/2frame/GSASIIddataGUI.py
r2917 r2931 23 23 import GSASIIspc as G2spc 24 24 import GSASIIplot as G2plt 25 import GSASIIdataGUI as G2gd26 25 import GSASIIpwd as G2pwd 27 26 import GSASIIphsGUI as G2phsGUI -
branch/2frame/GSASIIplot.py
r2914 r2931 4244 4244 Plot.clear() 4245 4245 colors=['b','g','r','c','m','k'] 4246 uselist = Page.seqTableGet(0)[1] 4246 4247 if G2frame.seqXaxis is not None: 4247 4248 xName,X,Xsig = Page.seqTableGet(G2frame.seqXaxis) … … 4257 4258 Ysnew = [] 4258 4259 for i in range(len(X)): 4260 if not uselist[i]: 4261 continue 4259 4262 if X[i] is None or Y[i] is None: 4260 4263 if Ysnew: … … 5668 5671 except AttributeError: #if from OnKeyBox above 5669 5672 key = str(event.key).upper() 5670 if key in ['+','-','=','0'] and generalData['Modulated']: 5671 if key == '0': 5672 G2frame.tau = 0. 5673 elif key in ['+','=']: 5674 G2frame.tau += 0.1 5675 elif key == '-': 5676 G2frame.tau -= 0.1 5677 G2frame.tau %= 1. #force 0-1 range 5678 G2frame.G2plotNB.status.SetStatusText('Modulation tau = %.2f'%(G2frame.tau),1) 5679 data['Drawing']['Atoms'],Fade = G2mth.ApplyModulation(data,G2frame.tau) #modifies drawing atom array! 5680 SetDrawAtomsText(data['Drawing']['Atoms']) 5681 G2phG.FindBondsDraw(data) #rebuild bonds & polygons 5682 if not np.any(Fade): 5683 Fade += 1 5684 Draw('key down',Fade) 5673 if key in ['+','-','=','0']: 5674 if generalData['Modulated']: 5675 if key == '0': 5676 G2frame.tau = 0. 5677 elif key in ['+','=']: 5678 G2frame.tau += 0.1 5679 elif key == '-': 5680 G2frame.tau -= 0.1 5681 G2frame.tau %= 1. #force 0-1 range 5682 G2frame.G2plotNB.status.SetStatusText('Modulation tau = %.2f'%(G2frame.tau),1) 5683 data['Drawing']['Atoms'],Fade = G2mth.ApplyModulation(data,G2frame.tau) #modifies drawing atom array! 5684 SetDrawAtomsText(data['Drawing']['Atoms']) 5685 G2phG.FindBondsDraw(data) #rebuild bonds & polygons 5686 if not np.any(Fade): 5687 Fade += 1 5688 Draw('key down',Fade) 5689 else: 5690 pass #TODO sequential result movie here 5685 5691 5686 5692 def GetTruePosition(xy,Add=False):
Note: See TracChangeset
for help on using the changeset viewer.