Changeset 2551
- Timestamp:
- Nov 30, 2016 3:17:17 PM (6 years ago)
- Location:
- trunk
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/GSASIIconstrGUI.py
r2546 r2551 1800 1800 VectorRBDisplay.SetSizer(VectorRBSizer,True) 1801 1801 Size = VectorRBSizer.GetMinSize() 1802 Size[0] += 401803 Size[1] = max(Size[1],450) + 201802 # Size[0] += 40 1803 # Size[1] = max(Size[1],450) + 20 1804 1804 VectorRBDisplay.SetSize(Size) 1805 1805 VectorRB.SetScrollbars(10,10,Size[0]/10-4,Size[1]/10-1) 1806 1806 VectorRB.Scroll(0,Scroll) 1807 Size[1] = min(Size[1], 450)1807 Size[1] = min(Size[1],500) 1808 1808 G2frame.dataFrame.setSizePosLeft(Size) 1809 1809 … … 2085 2085 ResidueRBDisplay.SetSizer(ResidueRBSizer,True) 2086 2086 Size = ResidueRBSizer.GetMinSize() 2087 Size[0] += 402088 Size[1] = max(Size[1],450) + 202087 # Size[0] += 40 2088 # Size[1] = max(Size[1],450) + 20 2089 2089 ResidueRBDisplay.SetSize(Size) 2090 2090 ResidueRB.SetScrollbars(10,10,Size[0]/10-4,Size[1]/10-1) 2091 Size[1] = min( 600,Size[1])2091 Size[1] = min(500,Size[1]) 2092 2092 G2frame.dataFrame.setSizePosLeft(Size) 2093 2093 -
trunk/GSASIIgrid.py
r2546 r2551 99 99 100 100 [ wxID_MASKCOPY, wxID_MASKSAVE, wxID_MASKLOAD, wxID_NEWMASKSPOT,wxID_NEWMASKARC,wxID_NEWMASKRING, 101 wxID_NEWMASKFRAME, wxID_NEWMASKPOLY, wxID_MASKLOADNOT, 102 ] = [wx.NewId() for item in range( 9)]101 wxID_NEWMASKFRAME, wxID_NEWMASKPOLY, wxID_MASKLOADNOT,wxID_FINDSPOTS, 102 ] = [wx.NewId() for item in range(10)] 103 103 104 104 [ wxID_STRSTACOPY, wxID_STRSTAFIT, wxID_STRSTASAVE, wxID_STRSTALOAD,wxID_STRSTSAMPLE, … … 2129 2129 self.MaskEdit.Append(help='Load mask from file; ignore threshold', 2130 2130 id=wxID_MASKLOADNOT, kind=wx.ITEM_NORMAL,text='Load mask w/o threshold') 2131 self.MaskEdit.Append(help='Auto search for spot masks', 2132 id=wxID_FINDSPOTS, kind=wx.ITEM_NORMAL,text='Auto spot masks') 2131 2133 submenu.Append(help='Create an arc mask with mouse input', 2132 2134 id=wxID_NEWMASKARC, kind=wx.ITEM_NORMAL,text='Arc mask') -
trunk/GSASIIimage.py
r2546 r2551 1122 1122 return vals,sig 1123 1123 1124 1124 def AutoSpotMasks(Image,Masks,Controls): 1125 rollImage = lambda rho,roll: np.roll(np.roll(rho,roll[0],axis=0),roll[1],axis=1) 1126 print 'auto spot search' 1127 spotMask = ma.array(Image,mask=(Image<10.*np.mean(Image))) 1128 incre = np.array(Image.shape,dtype=np.float) 1129 indices = (-1,0,1) 1130 rolls = np.array([[ix,iy] for ix in indices for iy in indices]) 1131 for roll in rolls: 1132 if np.any(roll): #avoid [0,0] 1133 spotMask = ma.array(spotMask,mask=(spotMask-rollImage(Image,roll)<=0.)) 1134 indx = np.transpose(spotMask.nonzero()) 1135 peaks = indx 1136 mags = spotMask[spotMask.nonzero()] 1137 print zip(peaks,mags) 1138 1139 -
trunk/GSASIIimgGUI.py
r2477 r2551 19 19 import glob 20 20 import re 21 import bisect22 21 import math 23 import time24 22 import sys 25 23 import wx … … 640 638 calibSizer.Add(wx.StaticText(parent=G2frame.dataDisplay,label=' Calibration coefficients'),0,WACV) 641 639 calibSizer.Add((5,0),0) 642 cent = data['center']643 640 Names = ['det-X','det-Y','wave','dist','tilt','phi'] 644 641 if 'PWDR' in data['type']: … … 1150 1147 try: 1151 1148 if dlg.ShowModal() == wx.ID_OK: 1152 result = dlg.GetData() 1149 result = dlg.GetData() #?? what was this for? 1153 1150 id, cookie = G2frame.PatternTree.GetFirstChild(G2frame.root) 1154 1151 while id: … … 1389 1386 dlg.Destroy() 1390 1387 1388 def OnAutoSpotMask(event): 1389 'Do auto search for spot masks' 1390 Controls = copy.deepcopy(G2frame.PatternTree.GetItemPyData( 1391 G2gd.GetPatternTreeItemId(G2frame,G2frame.PatternId,'Image Controls'))) 1392 G2img.AutoSpotMasks(G2frame.ImageZ,data,Controls) 1393 event.Skip() 1394 1391 1395 def OnNewSpotMask(event): 1392 1396 'Start a new spot mask' … … 1425 1429 G2frame.dataFrame.Bind(wx.EVT_MENU, OnLoadMask, id=G2gd.wxID_MASKLOADNOT) 1426 1430 G2frame.dataFrame.Bind(wx.EVT_MENU, OnSaveMask, id=G2gd.wxID_MASKSAVE) 1431 G2frame.dataFrame.Bind(wx.EVT_MENU, OnAutoSpotMask, id=G2gd.wxID_FINDSPOTS) 1427 1432 G2frame.dataFrame.Bind(wx.EVT_MENU, OnNewSpotMask, id=G2gd.wxID_NEWMASKSPOT) 1428 1433 G2frame.dataFrame.Bind(wx.EVT_MENU, OnNewArcMask, id=G2gd.wxID_NEWMASKARC) … … 1431 1436 G2frame.dataFrame.Bind(wx.EVT_MENU, OnNewFrameMask, id=G2gd.wxID_NEWMASKFRAME) 1432 1437 if not G2frame.dataFrame.GetStatusBar(): 1433 Status =G2frame.dataFrame.CreateStatusBar()1438 G2frame.dataFrame.CreateStatusBar() 1434 1439 if G2frame.MaskKey == 'f': 1435 1440 G2frame.dataFrame.GetStatusBar().SetStatusText('Frame mask active - LB pick next point, RB close polygon') … … 1667 1672 filename = dlg.GetPath() 1668 1673 File = open(filename,'w') 1669 save = {}1670 1674 keys = ['Type','Sample phi','Sample z','Sample load'] 1671 1675 keys2 = ['Dset','Dcalc','pixLimit','cutoff','Emat'] … … 1821 1825 continue 1822 1826 goodnames.append(name) 1823 id = G2gd.GetPatternTreeItemId(G2frame, G2frame.root, name)1824 1827 Npix,imagefile,imagetag = G2frame.PatternTree.GetImageLoc(Id) 1825 1828 image = GetImageZ(G2frame,Controls) 1829 sig = [] 1830 varyList = [] 1831 variables = [] 1826 1832 if i and CopyForward: 1827 1833 for j,ring in enumerate(StaCtrls['d-zero']): … … 1832 1838 parmDict = {'Sample load':StaCtrls['Sample load'],} 1833 1839 varyNames = ['e11','e12','e22'] 1834 sig = []1835 varyList = []1836 variables = []1837 1840 for j,item in enumerate(StaCtrls['d-zero']): 1838 1841 variables += item['Emat'] … … 2037 2040 G2frame.dataFrame.Bind(wx.EVT_MENU, OnStrStaSample, id=G2gd.wxID_STRSTSAMPLE) 2038 2041 if not G2frame.dataFrame.GetStatusBar(): 2039 Status =G2frame.dataFrame.CreateStatusBar()2042 G2frame.dataFrame.CreateStatusBar() 2040 2043 if G2frame.StrainKey == 'a': #probably doesn't happen 2041 2044 G2frame.dataFrame.GetStatusBar().SetStatusText('Add strain ring active - LB pick d-zero value') … … 2112 2115 type conversions 2113 2116 ''' 2114 file_opt = options = {}2115 2117 save = {'filename':imctrl_file} 2116 2118 immask_file = os.path.splitext(imctrl_file)[0]+'.immask' … … 2309 2311 self.imageBase = G2frame.Image 2310 2312 2311 controlsId =G2frame.PatternTree.GetSelection()2313 G2frame.PatternTree.GetSelection() 2312 2314 size,imagefile,imagetag = G2frame.PatternTree.GetImageLoc(self.imageBase) 2313 2315 self.imagedir,fileroot = os.path.split(imagefile) … … 2709 2711 x = np.array([float(i) for i in parms[0]]) 2710 2712 closest = abs(x-dist).argmin() 2711 closeX = x[closest]2712 2713 D = {'distance':dist} 2713 2714 imctfile = IMfileList[closest] … … 2845 2846 try: 2846 2847 float(tmpDict[key][0]) 2847 parms.append([str(G2py3.FormatSigFigs(val ,sigfigs=5)) for valin tmpDict[key]])2848 parms.append([str(G2py3.FormatSigFigs(val1,sigfigs=5)) for val1 in tmpDict[key]]) 2848 2849 except ValueError: 2849 2850 parms.append(tmpDict[key]) … … 2876 2877 parms = [] 2877 2878 for c in range(cols): 2878 lbl = self.ParmList[c]2879 2879 parms.append([]) 2880 2880 for r in range(rows): -
trunk/GSASIIphsGUI.py
r2550 r2551 74 74 phasePage.SetSize(Size) 75 75 phasePage.Scroll(0,Scroll) 76 Size[1] = min(500,Size[1]) 76 77 mainFrame.setSizePosLeft(Size) 77 78 -
trunk/GSASIIplot.py
r2547 r2551 1021 1021 def SetLights(): 1022 1022 GL.glEnable(GL.GL_DEPTH_TEST) 1023 GL.glShadeModel(GL.GL_SMOOTH)1023 # GL.glShadeModel(GL.GL_SMOOTH) 1024 1024 GL.glEnable(GL.GL_LIGHTING) 1025 1025 GL.glEnable(GL.GL_LIGHT0) 1026 1026 GL.glLightModeli(GL.GL_LIGHT_MODEL_TWO_SIDE,0) 1027 GL.glLightfv(GL.GL_LIGHT0,GL.GL_AMBIENT,[1,1,1, .8])1027 GL.glLightfv(GL.GL_LIGHT0,GL.GL_AMBIENT,[1,1,1,1]) 1028 1028 GL.glLightfv(GL.GL_LIGHT0,GL.GL_DIFFUSE,[1,1,1,1]) 1029 1029 -
trunk/GSASIItestplot.py
r1860 r2551 31 31 'creates a Wx application and a plotting notebook' 32 32 def __init__(self, id = -1): 33 self.app = wx. PySimpleApp()33 self.app = wx.App() 34 34 self.frame = wx.Frame(None,-1,'Plotter', size=wx.Size(600,600), 35 35 style=wx.DEFAULT_FRAME_STYLE ^ wx.CLOSE_BOX) -
trunk/testDeriv.py
r2550 r2551 147 147 mainSizer.Add(delVal,0) 148 148 self.testDerivPanel.SetSizer(mainSizer) 149 Size = mainSizer.Fit(self.testDerivPanel) 150 Size[0] = 800 151 Size[1] = max(Size[1],290) + 35 149 Size = mainSizer.GetMinSize() 152 150 self.testDerivPanel.SetScrollbars(10,10,Size[0]/10-4,Size[1]/10-1) 151 Size[1] = min(200,Size[1]) 153 152 self.testDerivPanel.SetSize(Size) 154 153
Note: See TracChangeset
for help on using the changeset viewer.