  1.  NAME

  rel2abs - Convert relative into absolute currents

  2.  USAGE

  rel2abs [options] [file file ... ]

  3.  DESCRIPTION

  This utility converts relative currents into absolute ones. Ship
  velocities are read from a separate file specified with option -f. The
  latter is therefore required. If input files with relative currents
  are not specified, standard input is assumed. If the output file is
  not specified with option -o, standard output is assumed.

  Synchronization of data from both input datasets is done using data
  present in both files. Ship velocities do not need to be defined on
  the same grid points as relative currents, as they are interpolated
  automatically. This utility can handle bad data which are defined as
  1.0E38. Bad ship velocities are ignored.

  Both input datasets can contain more data as required, in which case
  velocities and synchronization data can be specified on the command
  line. On output, all columns from the file containing relative
  currents are output.

  On input, columns must be separated with white spaces. On output, data
  are written with %15.6f format and separated with a white space.

  A typical application is given as an example later in this document.

  4.  OPTIONS

  The following options are implemented:

     -c 'x,u,v'
        Specify the columns to read from the external file containing
        ship velocities, where x is the column for synchronization and
        interpolation of data, u and v are the column containing
        eastward and northward ship velocities, respectively.  Default
        is 1,2,3.  Column numbering starts from one.

     -f file
        Name of file containing ship velocities. This option is
        required.

     -o file
        Name of file for output data. If not specified, standard output
        is assumed.

     -C 'X,U,V'
        Specify the columns for corrections in the file containing
        relative currents, where X is the column for synchronization and
        interpolation of data, U and V are the column containing
        eastward and northward relative velocities, respectively.
        Default is 1,2,3.  Column numbering starts from one.

  5.  OUTPUT FILES

  The file specified with option -o contains the absolute current data.

  6.  EXAMPLES

  As an example, assume one wants to generate a file with relative and
  absolute currents for each ensemble time. Using the xtract(1) data
  extraction utility, create the contour file relative.con with the
  following columns:

  1. Time in decimal days

  2. Bin depths

  3. Relative U

  4. Relative V

  5. Relative U

  6. Relative V

  With the same extraction utility, create the file ship.dat with the
  ship velocities:

  1. Time in decimal days

  2. U ship absolute

  3. V ship absolute

  Finally, convert the last two columns in the first file into absolute
  currents by running:

  ______________________________________________________________________
            rel2abs -f ship.dat -c '1,2,3' -C '1,5,6' relative.con

  ______________________________________________________________________

  Synchronization and interpolation of ship velocities will be carried
  out along time (first column number in options -c and -C). The output
  has the same number of columns as in relative.dat, but with the last
  two columns being absolute currents corrected from ship velocities.

  7.  SEE ALSO

  xtract(1) columns(5)

  8.  AUTHOR

  Pierre Jaccard, Geophysical Institute, University of Bergen, 1999.

