  1.  NAME

  regrid - Regrid one or two dimensional data

  2.  USAGE

  regrid

  3.  DESCRIPTION

  This Matlab script regrids columnar ascii data files. It can handle
  one, two or mixed data files.

  One dimensional data files contain the values of each variable in
  different columns. Two dimensional data files have the xyz , where
  several z values are allowed. Mixed dimensional files have the same
  as two dimensional ones, however several x columns are allowed.

  How the different columns are regridded is detected automatically by
  setting unused parameters to the empty array (see below).

  Input data do not nead to be sorted, may have bad data and duplicate
  grid points are allowed.

  The result is a columnar data file with the same  as the input file.
  However, columns of non-regridded variables are removed. The lines are
  sorted along increasing values of x_grid, and y_grid if any. Lines
  with missing data are not removed but flagged as bad.

  4.  PARAMETERS

  The following parameters must be edited:

     data_file
        Name of input data file.

     out_file
        Name of output data file.

     x_grid
        Name of a file containing the new x-grid values in the first
        column,or and array with [min max n] to specify a regular grid
        with n points from min to max (inclusive). This parameter is
        required.

     y_grid
        Name of a file containing the new y-grid values in the first
        column,or and array with [min max n] to specify a regular grid
        with n points from min to max (inclusive). If only one
        dimensional data are to be regridded,set this parameter to the
        empty array.

     method
        Interpolation method (default is linear). See Matlab help on
        function interp1 or griddata for more information.

     x_col
        The column number for x-data in the input file.

     y_col
        The column number for y-data in the input file.  If only one
        dimensionnal data are to be regridded,set this parameter to the
        empty array.

     cols_1d
        A vector with all column numbers to one dimensionnal variables
        to be regridded. If only two domensionnal data are to be
        regridded,set it to the empty array.

     cols_2d
        A vector with all column numbers to two dimensionnal variables
        to be regridded. If only one domensionnal data are to be
        regridded,set it to the empty array.

  5.  AUTHORS

  Pierre Jaccard, Geophysical Institute, University of Bergen, 1999

