예제 #1
0
def image_file(path="ask",
               zscript='self[1:]',
               xscript='[0,1]',
               yscript='c(0)',
               **kwargs):
    """
    Loads an data file and plots it with color. Data file must have columns of the
    same length!

    zscript determines how to get data from the columns
    xscript and yscript determine the x and y arrays used for setting the axes bounds

    **kwargs are sent to image_data()
    """
    if kwargs.has_key('delimiter'): delimiter = kwargs.pop('delimiter')
    else: delimiter = None

    d = _data.load(paths=path, delimiter=delimiter)
    if d == None or len(d) == 0: return

    # allows the user to overwrite the defaults
    default_kwargs = dict(xlabel=str(xscript),
                          ylabel=str(yscript),
                          title=d.path,
                          clabel=str(zscript))
    default_kwargs.update(kwargs)

    # get the data
    X = d(xscript)
    Y = d(yscript)
    Z = _n.array(d(zscript))
    Z = Z.transpose()

    # plot!
    image_data(Z, X, Y, **default_kwargs)
예제 #2
0
def image_file(path="ask", zscript='self[1:]', xscript='[0,1]', yscript='c(0)', **kwargs):
    """
    Loads an data file and plots it with color. Data file must have columns of the
    same length!

    zscript determines how to get data from the columns
    xscript and yscript determine the x and y arrays used for setting the axes bounds

    **kwargs are sent to image_data()
    """
    if kwargs.has_key('delimiter'): delimiter = kwargs.pop('delimiter')
    else:                           delimiter = None

    d = _data.load(paths=path, delimiter = delimiter)
    if d is None or len(d) == 0: return

    # allows the user to overwrite the defaults
    default_kwargs = dict(xlabel = str(xscript),
                          ylabel = str(yscript),
                          title  = d.path,
                          clabel = str(zscript))
    default_kwargs.update(kwargs)


    # get the data
    X = d(xscript)
    Y = d(yscript)
    Z = _n.array(d(zscript))
    Z = Z.transpose()

    # plot!
    image_data(Z, X, Y, **default_kwargs)
예제 #3
0
def image_file(path='ask',
               zscript='self[1:]',
               xscript='[0,1]',
               yscript='d[0]',
               g=None,
               **kwargs):
    """
    Loads an data file and plots it with color. Data file must have columns of the
    same length!

    Parameters
    ----------
    path='ask'
        Path to data file.
    zscript='self[1:]' 
        Determines how to get data from the columns
    xscript='[0,1]', yscript='d[0]' 
        Determine the x and y arrays used for setting the axes bounds
    g=None   
        Optional dictionary of globals for the scripts

    See spinmob.plot.image.data() for additional optional keyword arguments.
    See spinmob.data.databox.execute_script() for more information about scripts.
    """
    if 'delimiter' in kwargs: delimiter = kwargs.pop('delimiter')
    else: delimiter = None

    d = _data.load(paths=path, delimiter=delimiter)
    if d is None or len(d) == 0: return

    # allows the user to overwrite the defaults
    default_kwargs = dict(xlabel=str(xscript),
                          ylabel=str(yscript),
                          title=d.path,
                          clabel=str(zscript))
    default_kwargs.update(kwargs)

    # get the data
    X = d(xscript, g)
    Y = d(yscript, g)
    Z = _n.array(d(zscript, g))
    Z = Z.transpose()

    # plot!
    image_data(Z, X, Y, **default_kwargs)
예제 #4
0
def image_file(path=None, zscript='self[1:]', xscript='[0,1]', yscript='d[0]', g=None, **kwargs):
    """
    Loads an data file and plots it with color. Data file must have columns of the
    same length!

    Parameters
    ----------
    path=None
        Path to data file.
    zscript='self[1:]' 
        Determines how to get data from the columns
    xscript='[0,1]', yscript='d[0]' 
        Determine the x and y arrays used for setting the axes bounds
    g=None   
        Optional dictionary of globals for the scripts

    See spinmob.plot.image.data() for additional optional keyword arguments.
    See spinmob.data.databox.execute_script() for more information about scripts.
    """
    if 'delimiter' in kwargs: delimiter = kwargs.pop('delimiter')
    else:                           delimiter = None

    d = _data.load(paths=path, delimiter = delimiter)
    if d is None or len(d) == 0: return

    # allows the user to overwrite the defaults
    default_kwargs = dict(xlabel = str(xscript),
                          ylabel = str(yscript),
                          title  = d.path,
                          clabel = str(zscript))
    default_kwargs.update(kwargs)


    # get the data
    X = d(xscript, g)
    Y = d(yscript, g)
    Z = _n.array(d(zscript, g))
#    Z = Z.transpose()

    # plot!
    image_data(Z, X, Y, **default_kwargs)