Changeset 1981 for trunk/GSASIIplot.py


Ignore:
Timestamp:
Sep 29, 2015 3:04:45 PM (8 years ago)
Author:
vondreele
Message:

fixes to modulation plots & 3D & 4D Fourier map processing

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIplot.py

    r1979 r1981  
    6464npatan2d = lambda x,y: 180.*np.arctan2(x,y)/np.pi
    6565GkDelta = unichr(0x0394)
     66Gkrho = unichr(0x03C1)
    6667   
    6768class G2PlotMpl(wx.Panel):   
     
    29912992
    29922993def ModulationPlot(G2frame,data,atom,ax,off=0):
    2993     global Off,Atom,Ax
     2994    global Off,Atom,Ax,Slab,Off
    29942995    Off = off
    29952996    Atom = atom
    29962997    Ax = ax
     2998   
    29972999    def OnMotion(event):
    29983000        xpos = event.xdata
    29993001        if xpos:                                        #avoid out of frame mouse position
    30003002            ypos = event.ydata
     3003            ix = int(round(xpos*10))
     3004            iy = int(round((Slab.shape[0]-1)*(ypos+0.5-Off*0.005)))
    30013005            Page.canvas.SetCursor(wx.CROSS_CURSOR)
    30023006            try:
    3003                 G2frame.G2plotNB.status.SetStatusText('t =%9.3f %s =%9.3f'%(xpos,GkDelta+Ax,ypos),1)                   
     3007                G2frame.G2plotNB.status.SetStatusText('t =%9.3f %s =%9.3f %s=%9.3f'%(xpos,GkDelta+Ax,ypos,Gkrho,Slab[iy,ix]/8.),1)                   
     3008#                GSASIIpath.IPyBreak()                 
    30043009            except TypeError:
    30053010                G2frame.G2plotNB.status.SetStatusText('Select '+Title+' pattern first',1)
     
    30463051    Page.keyPress = OnPlotKeyPress
    30473052    Map = General['4DmapData']
    3048     MapType = Map['MapType']
     3053    MapType = mapData['MapType']
    30493054    rhoSize = np.array(Map['rho'].shape)
    30503055    atxyz = np.array(atom[cx:cx+3])
     
    30673072                scof.append(spos[0][:3])
    30683073                ccof.append(spos[0][3:])
    3069         wave += G2mth.posFourier(tau,np.array(scof),np.array(ccof),1)  #hmm, why -1 work for Na2CO3?
     3074        wave += G2mth.posFourier(tau,np.array(scof),np.array(ccof),1)
    30703075    if mapData['Flip']:
    30713076        Title = 'Charge flip'
     
    30933098    Plot.set_ylabel(r'$\mathsf{\Delta}$%s'%(Ax))
    30943099    Slab = np.hstack((slab,slab,slab))
    3095     Plot.contour(Slab[:,:21],20,extent=(0.,2.,-.5+Off*.005,.5+Off*.005))
     3100    acolor = mpl.cm.get_cmap('RdYlGn')
     3101    if 'delt' in MapType:
     3102        Plot.contour(Slab[:,:21],20,extent=(0.,2.,-.5+Off*.005,.5+Off*.005),cmap=acolor)
     3103    else:
     3104        Plot.contour(Slab[:,:21],20,extent=(0.,2.,-.5+Off*.005,.5+Off*.005))
    30963105    Page.canvas.draw()
    30973106   
Note: See TracChangeset for help on using the changeset viewer.