Changeset 1188
- Timestamp:
- Jan 9, 2014 4:05:59 PM (9 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/GSASII.py
r1181 r1188 1770 1770 self.ifGetRing = False 1771 1771 self.MaskKey = '' #trigger for making image masks 1772 self.StrainKey = '' #ditto for new strain d-zeros 1772 1773 arg = sys.argv 1773 1774 if len(arg) > 1: -
trunk/GSASIIimage.py
r1187 r1188 868 868 return Ring,ring 869 869 else: 870 ring['ImxyObs'] = [[],[]] 871 ring['ImtaObs'] = [[],[]] 872 ring['ImtaCalc'] = [[],[]] 870 873 return [],[] #bad ring; no points found 871 874 -
trunk/GSASIIimgGUI.py
r1186 r1188 24 24 GSASIIpath.SetVersionNumber("$Revision$") 25 25 import GSASIIimage as G2img 26 import GSASIImath as G2mth 26 27 import GSASIIplot as G2plt 27 28 import GSASIIIO as G2IO … … 1454 1455 Obj.SetValue("%.5f"%(value)) 1455 1456 data['d-zero'][Indx[Obj.GetId()]]['Dset'] = value 1457 data['d-zero'] = G2mth.sortArray(data['d-zero'],'Dset',reverse=True) 1456 1458 Ring,R = G2img.MakeStrStaRing(data['d-zero'][Indx[Obj.GetId()]],G2frame.ImageZ,Controls) 1457 1459 if len(Ring): … … 1459 1461 else: 1460 1462 G2frame.ErrorDialog('Strain peak selection','WARNING - No points found for this ring selection') 1463 1461 1464 #sort them on d-spacing? 1462 1465 UpdateStressStrain(G2frame,data) … … 1548 1551 if not G2frame.dataFrame.GetStatusBar(): 1549 1552 Status = G2frame.dataFrame.CreateStatusBar() 1550 Status.SetStatusText(" test ") 1553 if G2frame.StrainKey == 'a': #probably doesn't happen 1554 G2frame.dataFrame.GetStatusBar().SetStatusText('Add strain ring active - LB pick d-zero value') 1555 else: 1556 G2frame.dataFrame.GetStatusBar().SetStatusText("To add strain data: On On 2D Powder Image, key a:add ring") 1557 1551 1558 G2frame.dataDisplay = wx.Panel(G2frame.dataFrame) 1552 1559 mainSizer = wx.BoxSizer(wx.VERTICAL) -
trunk/GSASIIplot.py
r1185 r1188 2168 2168 G2imG.UpdateMasks(G2frame,Masks) 2169 2169 PlotImage(G2frame,newImage=True) 2170 2171 def OnStartNewDzero(G2frame): 2172 '''Initiate the start of adding a new d-zero to a strain data set 2173 2174 :param wx.Frame G2frame: The main GSAS-II tree "window" 2175 :param str eventkey: a single letter ('a') that 2176 triggers the addition of a d-zero. 2177 ''' 2178 StrSta = G2frame.PatternTree.GetItemPyData( 2179 G2gd.GetPatternTreeItemId(G2frame,G2frame.Image, 'Stress/Strain')) 2170 2180 2171 2181 def PlotImage(G2frame,newPlot=False,event=None,newImage=True): … … 2224 2234 tth,azm,D,dsp = G2img.GetTthAzmDsp(xpos,ypos,Data) 2225 2235 Q = 2.*math.pi/dsp 2236 fields = ['','Detector 2-th =%9.3fdeg, dsp =%9.3fA, Q = %6.5fA-1, azm = %7.2fdeg, I = %6d'%(tth,dsp,Q,azm,Int)] 2226 2237 if G2frame.MaskKey in ['p','f']: 2227 G2frame.G2plotNB.status.SetFields(['','Polygon/frame mask pick - LB next point, RB close polygon'])2228 el se:2229 G2frame.G2plotNB.status.SetFields(\2230 ['','Detector 2-th =%9.3fdeg, dsp =%9.3fA, Q = %6.5fA-1, azm = %7.2fdeg, I = %6d'%(tth,dsp,Q,azm,Int)])2238 fields[1] = 'Polygon/frame mask pick - LB next point, RB close polygon' 2239 elif G2frame.StrainKey: 2240 fields[0] = 'd-zero pick active' 2241 G2frame.G2plotNB.status.SetFields(fields) 2231 2242 2232 2243 def OnImPlotKeyPress(event): … … 2239 2250 G2frame.MaskKey = event.key 2240 2251 OnStartMask(G2frame) 2252 2253 elif PickName == 'Stress/Strain': 2254 if event.key in ['a',]: 2255 G2frame.StrainKey = event.key 2256 OnStartNewDzero(G2frame) 2257 2241 2258 2242 2259 elif PickName == 'Image Controls': … … 2270 2287 else: 2271 2288 Data['invert_y'] = True 2272 PlotImage(G2frame,newPlot= True)2289 PlotImage(G2frame,newPlot=False) 2273 2290 2274 2291 def OnKeyBox(event): … … 2365 2382 G2imG.UpdateMasks(G2frame,Masks) 2366 2383 PlotImage(G2frame,newImage=False) 2367 elif PickName == 'Stress/Strain' :2384 elif PickName == 'Stress/Strain' and G2frame.StrainKey: 2368 2385 Xpos,Ypos = [event.xdata,event.ydata] 2369 2386 if not Xpos or not Ypos or Page.toolbar._active: #got point out of frame or zoom/pan selected … … 2376 2393 del StrSta['d-zero'][-1] 2377 2394 G2frame.ErrorDialog('Strain peak selection','WARNING - No points found for this ring selection') 2395 StrSta['d-zero'] = G2mth.sortArray(StrSta['d-zero'],'Dset',reverse=True) 2396 G2frame.StrainKey = '' 2378 2397 G2imG.UpdateStressStrain(G2frame,StrSta) 2379 2398 PlotStrain(G2frame,StrSta) … … 2502 2521 Page.Choice = (' key press','s: spot mask','a: arc mask','r: ring mask', 2503 2522 'p: polygon mask','f: frame mask',) 2523 Page.keyPress = OnImPlotKeyPress 2524 elif G2frame.PatternTree.GetItemText(G2frame.PickId) in ['Stress/Strain',]: 2525 Page.Choice = (' key press','a: add new ring',) 2504 2526 Page.keyPress = OnImPlotKeyPress 2505 2527 except TypeError:
Note: See TracChangeset
for help on using the changeset viewer.