| 
funcutils.pySubroutines that tabulate a function's values. Convenience functions that evaluate a python function on a grid of
points and tabulate the output to be used with Gnuplot. 
        
            | Imported modules |  |  
        | import Gnuplot import Numeric
 import utils
 
 |  
            | Functions |  |  
        | GridFunc compute_Data
 compute_GridData
 tabulate_function
 
 |  
            |  | GridFunc |  
        | 
GridFunc (
        f,
        xvals,
        yvals,
        **keyw,
        )
For backwards compatibility: |  
            |  | compute_Data |  
        | 
compute_Data (
        xvals,
        f,
        ufunc=0,
        **keyw,
        )
Evaluate a function of 1 variable and store the results in a Data.    Computes a function f of one variable on a set of specified points
    using tabulate_function, then store the results into aDataso
    that it can be plotted.  After calculation, the data are written
    to a file; no copy is kept in memory.  Note that this is quite
    different thanFunc(which tells gnuplot to evaluate the
    function).     Arguments:
        xvalsa 1-d array with dimension numx        fthe function to plot--a callable object for which
            f(x) returns a number.        ufunc=<bool>evaluate fas a ufunc?     Other keyword arguments are passed through to the Data
    constructor.     fshould be a callable object taking one argument.f(x)will
    be computed at all values in xvals.     If called with ufunc=1, thenfshould be a function that is
    composed entirely of ufuncs, and it will be passed thexvalsandyvalsas rectangular matrices.     Thus if you have a function f, a vectorxvals, and a Gnuplot
    instance calledg, you can plot the function by typingg.splot(compute_Data(xvals, f)). |  
            |  | compute_GridData |  
        | 
compute_GridData (
        xvals,
        yvals,
        f,
        ufunc=0,
        **keyw,
        )
Evaluate a function of 2 variables and store the results in a GridData.    Computes a function fof two variables on a rectangular grid
    usingtabulate_function, then store the results into aGridDataso that it can be plotted.  After calculation the data
    are written to a file; no copy is kept in memory.  Note that this
    is quite different thanFunc(which tells gnuplot to evaluate
    the function).     Arguments:
        xvalsa 1-d array with dimension numx        yvalsa 1-d array with dimension numy        fthe function to plot--a callable object for which
            f(x,y)returns a number.        ufunc=<bool>evaluate fas a ufunc?      Other keyword arguments are passed to the GridDataconstructor.     fshould be a callable object taking two arguments.f(x,y)will be computed at all grid points obtained by
    combining elements fromxvalsandyvals.     If called with ufunc=1, thenfshould be a function that is
    composed entirely of ufuncs, and it will be passed thexvalsandyvalsas rectangular matrices.     Thus if you have a function fand two vectorsxvalsandyvalsand a Gnuplot instance calledg, you can plot the
    function by typingg.splot(compute_GridData(f, xvals, yvals)). |  
            |  | tabulate_function |  
        | 
tabulate_function (
        f,
        xvals,
        yvals=None,
        typecode=None,
        ufunc=0,
        )
Evaluate and tabulate a function on a 1- or 2-D grid of points.    f should be a function taking one or two floating-point
    parameters.     If f takes one parameter, then xvals should be a 1-D array and
    yvals should be None.  The return value is a Numeric array
    [f(x[0]), f(x[1]), ..., f(x[-1])].     If f takes two parameters, then xvalsandyvalsshould each be
    1-D arrays listing the values of x and y at whichfshould be
    tabulated.  The return value is a matrix M whereM[i,j] =
    f(xvals[i],yvals[j]), which can for example be used in theGridDataconstructor.     If ufunc=0, thenfis evaluated at each point using a Python
    loop.  This can be slow if the number of points is large.  If
    speed is an issue, you should writefin terms of Numeric ufuncs
    and use theufunc=1feature described next.     If called with ufunc=1, thenfshould be a function that is
    composed entirely of ufuncs (i.e., a function that can operate
    element-by-element on whole matrices).  It will be passed the
    xvals and yvals as rectangular matrices. |  |