Changeset 527
- Timestamp:
- Apr 3, 2012 1:26:28 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/GSASIIElemGUI.py
r484 r527 10 10 ########### SVN repository information ################### 11 11 import wx 12 import os 12 13 import wx.lib.colourselect as wscs 13 14 class PickElement(wx.Dialog): … … 19 20 style=wx.DEFAULT_DIALOG_STYLE, title='Pick Element') 20 21 import ElementTable as ET 21 self.SetClientSize(wx.Size(770, 250)) 22 self.butWid = 55 23 if 'nt' in os.name: 24 self.butWid = 40 25 self.SetClientSize(wx.Size(130+16*self.butWid, 250)) 22 26 23 27 i=0 … … 28 32 color=E[6] 29 33 PickElement.ElButton(self,name=E[0], 30 pos=wx.Point(E[1]* 40+25,E[2]*24+24),tip=E[3],color=color,oneOnly=oneOnly)34 pos=wx.Point(E[1]*self.butWid+25,E[2]*24+24),tip=E[3],color=color,oneOnly=oneOnly) 31 35 i+=1 32 36 … … 38 42 if oneOnly: 39 43 El = wscs.ColourSelect(label=name[0], parent=self,colour=color, 40 pos=pos, size=wx.Size( 40,23), style=wx.RAISED_BORDER)44 pos=pos, size=wx.Size(self.butWid,23), style=wx.RAISED_BORDER) 41 45 # El.SetLabel(name) 42 46 El.Bind(wx.EVT_BUTTON, self.OnElButton) 43 47 else: 44 El = wx.ComboBox(choices=name, parent=self, pos=pos, size=wx.Size( 40,23),48 El = wx.ComboBox(choices=name, parent=self, pos=pos, size=wx.Size(self.butWid,23), 45 49 style=wx.CB_READONLY, value=name[0]) 46 50 El.Bind(wx.EVT_COMBOBOX,self.OnElButton) … … 50 54 51 55 def OnElButton(self, event): 52 El = event.GetEventObject().Get Label()56 El = event.GetEventObject().GetValue() 53 57 self.Elem = El 54 58 self.EndModal(wx.ID_OK) -
trunk/GSASIIgrid.py
r524 r527 99 99 def ShowHelp(helpType,frame): 100 100 '''Called to bring up a web page for documentation.''' 101 global htmlFirstUse 101 102 # look up a definition for help info from dict 102 103 helplink = helpLocDict.get(helpType) -
trunk/GSASIIphsGUI.py
r526 r527 3461 3461 3462 3462 def OnSearchMaps(event): 3463 3464 def findRoll(rhoMask,mapHalf): 3465 indx = np.array(ma.nonzero(rhoMask)).T 3466 rhoList = np.array([rho[i,j,k] for i,j,k in indx]) 3467 rhoMax = np.max(rhoList) 3468 return mapHalf-indx[np.argmax(rhoList)] 3469 3463 3470 generalData = data['General'] 3464 3471 phaseName = generalData['Name'] … … 3471 3478 contLevel = mapData['cutOff']*mapData['rhoMax']/100. 3472 3479 rho = copy.copy(mapData['rho']) #don't mess up original 3480 mapHalf = np.array(rho.shape)/2 3481 step = max(1.0,1./mapData['Resolution']) 3482 steps = 3*np.array(3*[step,]) 3473 3483 except KeyError: 3474 3484 print '**** ERROR - Fourier map not defined' … … 3476 3486 peaks = [] 3477 3487 while True: 3478 rhoMask = ma.array(rho,mask=(mapData['rho']<contLevel)) 3479 indx = np.array(ma.nonzero(rhoMask)).T 3480 rhoList = np.array([rho[i,j,k] for i,j,k in indx]) 3481 rhoMax = np.max(rhoList) 3482 rMI = indx[np.argmax(rhoList)] 3483 print rMI,rhoMax 3488 rhoMask = ma.array(rho,mask=(rho<contLevel)) 3489 rMI = findRoll(rhoMask,mapHalf) 3490 rho = np.roll(np.roll(np.roll(rho,rMI[0],axis=0),rMI[1],axis=1),rMI[2],axis=2) 3491 rMM = mapHalf-steps 3492 rMP = mapHalf+steps 3493 3494 3495 rho = np.roll(np.roll(np.roll(rho,-rMI[2],axis=2),-rMI[1],axis=1),-rMI[0],axis=0) 3484 3496 break 3485 # steps = 1./np.array(rho.shape)3486 # rhoXYZ = indx*steps3487 3497 print 'search Fourier map' 3488 3498
Note: See TracChangeset
for help on using the changeset viewer.