Changeset 2425


Ignore:
Timestamp:
Aug 15, 2016 1:21:20 PM (6 years ago)
Author:
vondreele
Message:

tidy up GetTthAzmDsp?
add comments to plotXY & plotXYZ

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIimage.py

    r2421 r2425  
    379379    tilt = data['tilt']
    380380    dist = data['distance']/cosd(tilt)
    381     x0 = data['distance']*tand(tilt)
     381    x0 = dist*tand(tilt)
    382382    phi = data['rotation']
    383383    dep = data['DetDepth']
    384     LRazim = data['LRazimuth']
    385384    azmthoff = data['azmthOff']
    386385    dx = np.array(x-cent[0],dtype=np.float32)
    387386    dy = np.array(y-cent[1],dtype=np.float32)
    388     D = ((dx-x0)**2+dy**2+data['distance']**2)      #sample to pixel distance
     387    D = ((dx-x0)**2+dy**2+dist**2)      #sample to pixel distance
    389388    X = np.array(([dx,dy,np.zeros_like(dx)]),dtype=np.float32).T
    390389    X = np.dot(X,makeMat(phi,2))
     
    397396    dsp = wave/(2.*npsind(tth/2.))
    398397    azm = (npatan2d(dy,dx)+azmthoff+720.)%360.
    399     G = D/data['distance']**2       #for geometric correction = 1/cos(2theta)^2 if tilt=0.
     398    G = D/dist**2       #for geometric correction = 1/cos(2theta)^2 if tilt=0.
    400399    return np.array([tth,azm,G,dsp])
    401400   
  • trunk/GSASIIplot.py

    r2422 r2425  
    24352435################################################################################
    24362436           
    2437 def PlotXY(G2frame,XY,XY2=None,labelX=None,labelY=None,newPlot=False,
     2437def PlotXY(G2frame,XY,XY2=None,labelX='X',labelY='Y',newPlot=False,
    24382438    Title='',lines=False,names=[],names2=[]):
    24392439    '''simple plot of xy data
     2440   
     2441    :param wx.Frame G2frame: The main GSAS-II tree "window"
     2442    :param list XY: a list of X,Y array pairs; len(X) = len(Y)
     2443    :param list XY2: a secondary list of X,Y pairs
     2444    :param str labelX: label for X-axis
     2445    :param str labelY: label for Y-axis
     2446    :param bool newPlot: =True if new plot is to be made
     2447    :param str Title: title for plot
     2448    :param bool lines: = True if lines desired for XY plot; XY2 always plotted as lines
     2449    :param list of str names: legend names for each XY plot
     2450    :param list of str names2: legend names for each XY2 plot
     2451    :return nothing
     2452   
    24402453    '''
    24412454    def OnKeyPress(event):
     
    25002513    G2frame.G2plotNB.status.DestroyChildren()
    25012514    Plot.set_title(Title)
    2502     if labelX:
    2503         Plot.set_xlabel(r''+labelX,fontsize=14)
    2504     else:
    2505         Plot.set_xlabel(r'X',fontsize=14)
    2506     if labelY:
    2507         Plot.set_ylabel(r''+labelY,fontsize=14)
    2508     else:
    2509         Plot.set_ylabel(r'Y',fontsize=14)
     2515    Plot.set_xlabel(r''+labelX,fontsize=14)
     2516    Plot.set_ylabel(r''+labelY,fontsize=14)
    25102517    colors=['b','g','r','c','m','k']
    25112518    Page.keyPress = OnKeyPress
     
    25502557################################################################################
    25512558           
    2552 def PlotXYZ(G2frame,XY,Z,labelX=None,labelY=None,newPlot=False,Title=''):
     2559def PlotXYZ(G2frame,XY,Z,labelX='X',labelY='Y',newPlot=False,Title=''):
    25532560    '''simple contour plot of xyz data
     2561   
     2562    :param wx.Frame G2frame: The main GSAS-II tree "window"
     2563    :param list XY: a list of X,Y arrays
     2564    :param list Z: a list of Z values for each X,Y pair
     2565    :param str labelX: label for X-axis
     2566    :param str labelY: label for Y-axis
     2567    :param bool newPlot: =True if new plot is to be made
     2568    :param str Title: title for plot
     2569    :return nothing
     2570   
    25542571    '''
    25552572    def OnKeyPress(event):
Note: See TracChangeset for help on using the changeset viewer.