Changeset 527


Ignore:
Timestamp:
Apr 3, 2012 1:26:28 PM (12 years ago)
Author:
vondreele
Message:

more on map peak fitting
add a global for htmlFirstUse
fix periodic table display in unix/linux
fix setting of atom type in linux

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIElemGUI.py

    r484 r527  
    1010########### SVN repository information ###################
    1111import wx
     12import os
    1213import wx.lib.colourselect as wscs
    1314class PickElement(wx.Dialog):
     
    1920              style=wx.DEFAULT_DIALOG_STYLE, title='Pick Element')
    2021        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))
    2226       
    2327        i=0
     
    2832                color=E[6]
    2933            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)
    3135            i+=1
    3236
     
    3842        if oneOnly:
    3943            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)
    4145#            El.SetLabel(name)
    4246            El.Bind(wx.EVT_BUTTON, self.OnElButton)
    4347        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),
    4549                style=wx.CB_READONLY, value=name[0])
    4650            El.Bind(wx.EVT_COMBOBOX,self.OnElButton)
     
    5054
    5155    def OnElButton(self, event):
    52         El = event.GetEventObject().GetLabel()
     56        El = event.GetEventObject().GetValue()
    5357        self.Elem = El
    5458        self.EndModal(wx.ID_OK)       
  • trunk/GSASIIgrid.py

    r524 r527  
    9999def ShowHelp(helpType,frame):
    100100    '''Called to bring up a web page for documentation.'''
     101    global htmlFirstUse
    101102    # look up a definition for help info from dict
    102103    helplink = helpLocDict.get(helpType)
  • trunk/GSASIIphsGUI.py

    r526 r527  
    34613461   
    34623462    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           
    34633470        generalData = data['General']
    34643471        phaseName = generalData['Name']
     
    34713478            contLevel = mapData['cutOff']*mapData['rhoMax']/100.
    34723479            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,])
    34733483        except KeyError:
    34743484            print '**** ERROR - Fourier map not defined'
     
    34763486        peaks = []
    34773487        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)
    34843496            break
    3485 #            steps = 1./np.array(rho.shape)
    3486 #            rhoXYZ = indx*steps
    34873497        print 'search Fourier map'
    34883498       
Note: See TracChangeset for help on using the changeset viewer.