Changeset 4355 for trunk


Ignore:
Timestamp:
Mar 10, 2020 10:53:50 AM (4 years ago)
Author:
vondreele
Message:

Add RMCProfile-III tutorial to list in G2ctrlGUI so it shows up in Help
change PlotXYZvect so it shows quaternions 3D vectors colored according to the rotation component (0-90 deg)

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIctrlGUI.py

    r4352 r4355  
    53155315    ['RMCProfile-II', 'RMCProfile-II.htm','RMC Modeling with RMCProfile-II',
    53165316     '''Big box modelling for real and reciprocal space diffraction data for SrTiO3'''],
     5317    ['RMCProfile-III', 'RMCProfile-III.htm','RMC Modeling with RMCProfile-III',
     5318     '''Combined x-ray/neutron big box modelling for real and reciprocal space diffraction data for GaPO4'''],
    53175319
    53185320    ['Stacking Fault Modeling'],
  • trunk/GSASIIphsGUI.py

    r4351 r4355  
    25852585                    X = Vects['Ovec'].T[0]
    25862586                    Y = Vects['Ovec'].T[1]
    2587                     Z = Vects['Ovec'].T[2]                   
    2588                     G2plt.PlotXYZvect(G2frame,X,Y,Z,r'X-axis',r'Y-axis',r'Z-axis',
     2587                    Z = Vects['Ovec'].T[2]
     2588                    R = Tilts['Otilts']
     2589                    G2plt.PlotXYZvect(G2frame,X,Y,Z,R,r'X-axis',r'Y-axis',r'Z-axis',
    25892590                        Title=r'%s Octahedral tilt vectors'%Oatoms,PlotName='Oct %s tilts for %s'%(bName,pName))
    25902591                    print(' %s-%s bond distance: %.3f(%d)'%(Oatoms,Tatoms,Bmean,Bstd*1000))
     
    26122613                    Y = Vects['Tvec'].T[1]
    26132614                    Z = Vects['Tvec'].T[2]
    2614                     G2plt.PlotXYZvect(G2frame,X,Y,Z,r'X-axis',r'Y-axis',r'Z-axis',
     2615                    R = Tilts['Ttilts']
     2616                    G2plt.PlotXYZvect(G2frame,X,Y,Z,R,r'X-axis',r'Y-axis',r'Z-axis',
    26152617                        Title=r'%s Tetrahedral tilt vectors'%Oatoms,PlotName='Tet %s tilts for %s'%(bName,pName))
    26162618                    print(' %s-%s bond distance: %.3f(%d)'%(Oatoms,Tatoms,Bmean,Bstd*1000))
  • trunk/GSASIIplot.py

    r4347 r4355  
    3333:func:`PlotXY`                Simple plot of xy data
    3434:func:`PlotXYZ`               Simple contour plot of xyz data
    35 :func:`PlotXYZvect`           Scatter Plot for 3D cartesian vectors
     35:func:`PlotXYZvect`           Quiver Plot for 3D cartesian vectors
    3636:func:`Plot3Dxyz`             Surface Plot for 3D vectors
    3737:func:`PlotAAProb`            Protein "quality" plot
     
    51735173################################################################################
    51745174       
    5175 def PlotXYZvect(G2frame,X,Y,Z,labelX=r'X',labelY=r'Y',labelZ=r'Z',Title='',PlotName=None):
     5175def PlotXYZvect(G2frame,X,Y,Z,R,labelX=r'X',labelY=r'Y',labelZ=r'Z',Title='',PlotName=None):
     5176    ''' To plot a quiver of quaternion vectors colored by the rotation
     5177    :param wx.Frame G2frame: The main GSAS-II tree "window"
     5178    :param list X,Y,Z: list of X,Y,Z arrays
     5179    :param list R: a list of rotations (0-90) for each X,Y,Z in degrees
     5180    :param str labelX,labelY,labelZ: labels for X,Y,Z-axes
     5181    :param str Title: plot title
     5182    :param str PlotName: plot tab name
     5183    '''
    51765184   
    5177 #    def OnPageChanged(event):
    5178 #        PlotText = G2frame.G2plotNB.nb.GetPageText(G2frame.G2plotNB.nb.GetSelection())
    5179 #        if PlotText == PlotName:
    5180 #            PlotXYZvect(G2frame,X,Y,Z,labelX,labelY,labelZ,Title,PlotText)       
    5181        
    51825185    def OnMotion(event):
    51835186        G2frame.G2plotNB.status.SetStatusText('',1)
     
    51885191    new,plotNum,Page,Plot,lim = G2frame.G2plotNB.FindPlotTab(PlotName,'3d')
    51895192    if new:
    5190 #        G2frame.G2plotNB.Bind(wx.aui.EVT_AUINOTEBOOK_PAGE_CHANGED,OnPageChanged)
    51915193        Page.canvas.mpl_connect('motion_notify_event', OnMotion)
    51925194    G2frame.G2plotNB.status.SetStatusText('',1)
    51935195    Page.Choice = None
    51945196    np.seterr(all='ignore')
    5195     Plot.scatter(X,Y,Z,marker='x')
     5197    mpl.rcParams['image.cmap'] = G2frame.ContourColor
     5198    mcolors = mpl.cm.ScalarMappable()       #wants only default as defined in previous line!!
     5199    X0 = Y0 = Z0 = np.zeros_like(X)
     5200    icolor = R/90.
     5201    Plot.quiver(X0,Y0,Z0,X,Y,Z,color=mcolors.cmap(icolor),arrow_length_ratio=0.05)
    51965202    xyzlim = np.array([Plot.get_xlim3d(),Plot.get_ylim3d(),Plot.get_zlim3d()]).T
    51975203    XYZlim = [min(xyzlim[0]),max(xyzlim[1])]
     5204    XYZlim = [-1.,1.]
    51985205    Plot.set_xlim3d(XYZlim)
    51995206    Plot.set_ylim3d(XYZlim)
     
    52045211    Plot.set_zlabel(labelZ,fontsize=14)
    52055212    Plot.set_title(Title)
     5213    Page.figure.colorbar(mcolors,shrink=0.75,label='Rotation',boundaries=range(91))
    52065214    Page.canvas.draw()
    52075215       
Note: See TracChangeset for help on using the changeset viewer.