Changeset 2108
- Timestamp:
- Dec 24, 2015 9:10:30 PM (7 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/GSASIIimage.py
r2051 r2108 502 502 503 503 def ImageRecalibrate(G2frame,data,masks): 504 'Needs a doc string' 504 '''Called to repeat the calibration on an image, usually called after 505 calibration is done initially to improve the fit. 506 ''' 505 507 import ImageCalibrants as calFile 506 508 print 'Image recalibration:' … … 581 583 582 584 def ImageCalibrate(G2frame,data): 583 'Needs a doc string' 585 '''Called to perform an initial image calibration after points have been 586 selected for the inner ring. 587 ''' 584 588 import copy 585 589 import ImageCalibrants as calFile -
trunk/GSASIIimgGUI.py
r2107 r2108 120 120 # Menu items 121 121 122 def OnCalibrate(event): 123 G2frame.dataFrame.ImageEdit.Enable(id=G2gd.wxID_IMRECALIBRATE,enable=True) 122 def OnCalibrate(event): 123 if not data.get('calibrant'): 124 G2G.G2MessageBox(G2frame,'A calibrant must first be selected') 124 125 G2frame.dataFrame.GetStatusBar().SetStatusText('Select > 4 points on 1st used ring; LB to pick, RB on point to delete else RB to finish') 125 126 G2frame.ifGetRing = True … … 133 134 data['rings'] = [] 134 135 data['ellipses'] = [] 135 # G2frame.dataFrame.ImageEdit.Enable(id=G2gd.wxID_IMRECALIBRATE,enable=False)136 136 G2plt.PlotExposedImage(G2frame,event=event) 137 137 … … 351 351 S = File.readline() 352 352 data.update(save) 353 G2frame.PatternTree.SetItemPyData(G2gd.GetPatternTreeItemId(G2frame,G2frame.Image, 'Image Controls'),copy.deepcopy(data)) 353 # next line removed. Previous updates tree contents. The next 354 # makes a copy of data, puts it into tree and "disconnects" data 355 # from tree contents (later changes to data are lost!) 356 #G2frame.PatternTree.SetItemPyData(G2gd.GetPatternTreeItemId(G2frame,G2frame.Image, 'Image Controls'),copy.deepcopy(data)) 354 357 File.close() 355 358 finally: … … 1059 1062 G2frame.dataFrame.Bind(wx.EVT_MENU, OnRecalibrate, id=G2gd.wxID_IMRECALIBRATE) 1060 1063 G2frame.dataFrame.Bind(wx.EVT_MENU, OnClearCalib, id=G2gd.wxID_IMCLEARCALIB) 1061 if 'chisq' not in data: 1062 G2frame.dataFrame.ImageEdit.Enable(id=G2gd.wxID_IMRECALIBRATE,enable=False) 1064 if data.get('calibrant'): 1065 G2frame.dataFrame.ImageEdit.Enable(id=G2gd.wxID_IMRECALIBRATE,enable=True) 1066 else: 1067 G2frame.dataFrame.ImageEdit.Enable(id=G2gd.wxID_IMRECALIBRATE,enable=False) 1063 1068 G2frame.dataFrame.Bind(wx.EVT_MENU, OnIntegrate, id=G2gd.wxID_IMINTEGRATE) 1064 1069 G2frame.dataFrame.Bind(wx.EVT_MENU, OnIntegrateAll, id=G2gd.wxID_INTEGRATEALL) -
trunk/GSASIIplot.py
r2107 r2108 3609 3609 import numpy.ma as ma 3610 3610 Dsp = lambda tth,wave: wave/(2.*npsind(tth/2.)) 3611 global Data,Masks,StrSta3611 #global Data,Masks,StrSta # BHT: I don't see why these need to be globals. Where are they accessed? 3612 3612 colors=['b','g','r','c','m','k'] 3613 3613 Data = G2frame.PatternTree.GetItemPyData( … … 3915 3915 G2frame.itemPicked = None 3916 3916 3917 # PlotImage execution starts here 3917 # PlotImage execution starts here 3918 3918 xylim = [] 3919 3919 try: … … 4072 4072 xring,yring = np.array(ring).T[:2] 4073 4073 Plot.plot(xring,yring,'.',color=colors[N%6]) 4074 N += 1 4074 N += 1 4075 4075 for ellipse in Data['ellipses']: #what about hyperbola? 4076 4076 cent,phi,[width,height],col = ellipse
Note: See TracChangeset
for help on using the changeset viewer.