Changeset 4299 for trunk/GSASIIimgGUI.py
- Timestamp:
- Feb 13, 2020 9:56:45 AM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/GSASIIimgGUI.py
r4286 r4299 28 28 import matplotlib as mpl 29 29 import numpy as np 30 import numpy.ma as ma 30 31 import GSASIIpath 31 32 GSASIIpath.SetVersionNumber("$Revision$") … … 1644 1645 Controls = copy.deepcopy(G2frame.GPXtree.GetItemPyData( 1645 1646 G2gd.GetGPXtreeItemId(G2frame,G2frame.Image,'Image Controls'))) 1646 Error = G2img.AutoSpotMasks(G2frame.ImageZ,data,Controls) 1647 nChans = Controls['outChannels'] 1648 dlg = wx.ProgressDialog("Auto spot masking","Processed 2-theta rings = ",nChans+1, 1649 style = wx.PD_ELAPSED_TIME|wx.PD_CAN_ABORT) 1650 Error = G2img.AutoSpotMasks2(G2frame.ImageZ,data,Controls,dlg) 1647 1651 if not Error is None: 1648 1652 G2frame.ErrorDialog('Auto spot search error',Error) … … 1842 1846 maxSizer.Add(autoSizer) 1843 1847 return maxSizer 1844 1848 1849 def OnDelBtn(event): 1850 data['SpotMask'] = {'esdMul':2,'spotMask':None} 1851 wx.CallAfter(UpdateMasks,G2frame,data) 1852 1853 1845 1854 G2frame.dataWindow.ClearData() 1846 1855 startScroll = None … … 1891 1900 if 'Frames' not in data: 1892 1901 data['Frames'] = [] 1902 if 'SpotMask' not in data: 1903 data['SpotMask'] = {'esdMul':2,'spotMask':None} 1893 1904 frame = data['Frames'] #3+ x,y pairs 1894 1905 Arcs = data['Arcs'] #radius, start/end azimuth, thickness … … 1917 1928 littleSizer.Add(upperThreshold,0,WACV) 1918 1929 mainSizer.Add(littleSizer,0,) 1930 spotSizer = wx.BoxSizer(wx.HORIZONTAL) 1931 spotSizer.Add(wx.StaticText(G2frame.dataWindow,label=' Select spot range factor (1-10): '),0,WACV) 1932 spotSizer.Add(G2G.ValidatedTxtCtrl(G2frame.dataWindow,loc=data['SpotMask'], 1933 key='esdMul',min=1,max=10,size=(40,25)),0,WACV) 1934 numPix = 0 1935 if data['SpotMask']['spotMask'] is not None: 1936 numPix = np.count_nonzero(data['SpotMask']['spotMask']) 1937 spotSizer.Add(wx.StaticText(G2frame.dataWindow,label=' Number of pixels in spot mask: %d '%numPix),0,WACV) 1938 delbtn = wx.Button(G2frame.dataWindow,label='Clear spot mask') 1939 delbtn.Bind(wx.EVT_BUTTON,OnDelBtn) 1940 spotSizer.Add(delbtn,0,WACV) 1941 mainSizer.Add(spotSizer,0,WACV) 1919 1942 if len(Spots): 1920 1943 lbl = wx.StaticText(parent=G2frame.dataWindow,label=' Spot masks(on plot LB drag to move, shift-LB drag to resize, RB to delete)')
Note: See TracChangeset
for help on using the changeset viewer.