Changeset 750


Ignore:
Timestamp:
Sep 5, 2012 10:43:15 AM (10 years ago)
Author:
vondreele
Message:

put inverse checker back in SearchMap?
add atom rename facility
update of Map peaks when map/peaks are shifted by U/D/L/R key commands

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIImath.py

    r741 r750  
    934934        rho[rMM[0]:rMP[0],rMM[1]:rMP[1],rMM[2]:rMP[2]] = peakFunc(x1,rX,rY,rZ,rhoPeak,res,SGData['SGLaue'])
    935935        rho = np.roll(np.roll(np.roll(rho,-rMI[2],axis=2),-rMI[1],axis=1),-rMI[0],axis=0)
    936 #    if SGData['SGInv']:                 #check origin location & fix it if needed - centrosymmetric only
    937 #        Ocheck = np.zeros_like(rho)
    938 #        for ipeak in peaks:
    939 #            for opeak in peaks:           
    940 #                dx = ((opeak-ipeak)*incre)%incre
    941 #                if np.any(dx):      #avoid self vector
    942 #                    Ocheck[dx[0],dx[1],dx[2]] += 1
    943 #        dxMax = np.unravel_index(np.argmax(Ocheck),rho.shape)
    944 #        print 'Inversion at:',dxMax,' shift by ;',dxMax-mapHalf,' map size:',rho.shape
    945 #        rho = np.roll(np.roll(np.roll(rho,dxMax[2],axis=2),dxMax[1],axis=1),dxMax[0],axis=0)
    946 #        for peak in peaks:
    947 #            peak = (peak-(dxMax+mapHalf)/incre)%1.0
     936    if SGData['SGInv']:                 #check origin location & fix it if needed - centrosymmetric only
     937        Ocheck = np.zeros_like(rho)
     938        for ipeak in peaks:
     939            for opeak in peaks:           
     940                dx = ((opeak-ipeak)*incre)%incre
     941                if np.any(dx):      #avoid self vector
     942                    Ocheck[dx[0],dx[1],dx[2]] += 1
     943        dxMax = np.unravel_index(np.argmax(Ocheck),rho.shape)
     944        print ' Inversion at:',dxMax,' shift by ;',dxMax-mapHalf
     945        rho = np.roll(np.roll(np.roll(rho,dxMax[2],axis=2),dxMax[1],axis=1),dxMax[0],axis=0)
     946        for peak in peaks:
     947            peak = (peak-(dxMax+mapHalf)/incre)%1.0
    948948       
    949949    return np.array(peaks),np.array([mags,]).T,np.array([dzeros,]).T
  • trunk/GSASIIphsGUI.py

    r749 r750  
    13881388            generalData = data['General']
    13891389            colLabels = [Atoms.GetColLabelValue(c) for c in range(Atoms.GetNumberCols())]
    1390             choices = ['Type','x','y','z','frac','I/A','Uiso']
     1390            choices = ['Type','Name','x','y','z','frac','I/A','Uiso']
    13911391            dlg = wx.SingleChoiceDialog(G2frame,'Select','Atom parameter',choices)
    13921392            if dlg.ShowModal() == wx.ID_OK:
     
    14131413                    FillAtomsGrid()
    14141414                dlg.Destroy()
     1415            elif parm in ['Name',]:
     1416                dlg = wx.MessageDialog(G2frame,'Do you really want to rename the selected atoms?','Rename',
     1417                    wx.YES_NO | wx.ICON_QUESTION)
     1418                try:
     1419                    result = dlg.ShowModal()
     1420                    if result == wx.ID_YES:
     1421                        for r in indx:
     1422                            El = atomData[r][cid+1]
     1423                            if len(El) in [2,4]:
     1424                                atomData[r][cid] = El[:2]+'(%d)'%(r+1)
     1425                            else:
     1426                                atomData[r][cid] = El[:1]+'(%d)'%(r+1)
     1427                    FillAtomsGrid()
     1428                finally:
     1429                    dlg.Destroy()
     1430                   
    14151431            elif parm in ['I/A']:
    14161432                choices = ['Isotropic','Anisotropic']
     
    39663982            colLabels = ['mag','x','y','z','dzero']
    39673983            Types = 5*[wg.GRID_VALUE_FLOAT+':10,4',]
    3968             MapPeaksTable = G2gd.Table(mapPeaks,rowLabels=rowLabels,colLabels=colLabels,types=Types)
    3969             MapPeaks.SetTable(MapPeaksTable, True)
     3984            G2frame.MapPeaksTable = G2gd.Table(mapPeaks,rowLabels=rowLabels,colLabels=colLabels,types=Types)
     3985            MapPeaks.SetTable(G2frame.MapPeaksTable, True)
    39703986            MapPeaks.Bind(wg.EVT_GRID_LABEL_LEFT_CLICK, RowSelect)
    39713987            for r in range(MapPeaks.GetNumberRows()):
  • trunk/GSASIIplot.py

    r749 r750  
    24322432            SetMapRoll(dirDict[key])
    24332433            SetPeakRoll(dirDict[key])
     2434            SetMapPeaksText(mapPeaks)
    24342435        Draw()
    24352436           
     
    25312532                names = [child.GetName() for child in panel]
    25322533                panel[names.index('viewPoint')].SetValue('%.3f, %.3f, %.3f'%(VP[0],VP[1],VP[2]))
     2534               
     2535    def SetMapPeaksText(mapPeaks):
     2536        page = getSelection()
     2537        if page:
     2538            if G2frame.dataDisplay.GetPageText(page) == 'Map peaks':
     2539                G2frame.MapPeaksTable.SetData(mapPeaks)
     2540                panel = G2frame.dataDisplay.GetPage(page).GetChildren()
     2541                names = [child.GetName() for child in panel]
     2542                panel[names.index('grid window')].Refresh()
    25332543           
    25342544    def ClearSelectedAtoms():
     
    26102620            peak[1:4] += dxy
    26112621            peak[1:4] %= 1.
     2622            peak[4] = np.sqrt(np.sum(np.inner(Amat,peak[1:4])**2))
    26122623               
    26132624    def SetTranslation(newxy):
Note: See TracChangeset for help on using the changeset viewer.