NAME

     sample1d - Resampling of 1-D data sets


SYNOPSIS

     sample1d infile [ -A ] [ -C ] [ -H ] [ -Ixinc ] [ -L ]  [  -
     M[flag] ] [ -Nknotfile ] [ -Sxstart ] [ -Tx-col]


DESCRIPTION

     sample1d reads a multi-column ASCII data set from  file  [or
     standard  input]  and  resamples  the  timeseries/profile at
     locations where the user needs the values.   The  user  must
     provide  the column number of the independent (monotonically
     increasing or decreasing) variable.   Equidistant  or  arbi-
     trary  sampling  can be selected.  All columns are resampled
     based on the new sampling interval.   Several  interpolation
     schemes are available.

     infile
          This is a multi-column ASCII file with one column  con-
          taining  the  independent variable (which must be mono-
          tonically in/de-creasing)  and  the  remaining  columns
          holding  misc.  data  values.   If no file is provided,
          sample1d reads from standard input.


OPTIONS

     No space between the option flag and  the  associated  argu-
     ments.

     -A    Use Akima's spline for the interpolation  (Quasi  Her-
          mite spline that does not introduce artificial oscilla-
          tions near outliers/sharp gradients in the  data  file)
          [Default].

     -C    Use a natural Cubic spline interpolant.

     -H    Input file(s) has Header record(s).  Number of  header
          records  can  be  changed  by editing your .gmtdefaults
          file.  If used, GMT default is 1 header record.

     -I    xinc defines the sampling interval.  [Default  is  the
          separation  between  the first and second abcissa point
          in the infile]

     -L    Use a Linear interpolant.

     -M    Multiple segment file.  Segments are  separated  by  a
          record  whose  first  character  is  flag.  [Default is
          '>'].

     -N    knotfile is an optional ASCII file with  the  x  loca-
          tions where the data set will be resampled in the first
          column

     -S    For equidistant sampling, xstart indicates  the  loca-
          tion  of  the first output value. [Default is the smal-
          lest even multiple of xinc inside the range of infile]

     -T    Sets the column number  of  the  independent  variable
          [Default is 0 (first)].


EXAMPLES

     To  resample  the  file   profiles.tdgmb,   which   contains
     (time,distance,gravity,magnetics,bathymetry) records, at 1km
     equidistant intervals using Akima's spline, try

     sample1d profiles.tdgmb -I1 -A -T1 > profiles_equi_d.tdgmb

     To resample the file depths.dt at positions  listed  in  the
     file  grav_pos.dg,  using  a cubic spline for the interpola-
     tion, try

     sample1d depths.dt -Ngrav_pos.dg -C > new_depths.dt


SEE ALSO

     gmt, filter1d


REFERENCES

     Wessel, P., and W. H. F. Smith, 1995,  The  Generic  Mapping
     Tools  (GMT)  version  3.0  Technical  Reference & Cookbook,
     SOEST/NOAA.
     Wessel, P., and W. H. F. Smith, 1995,  New  Version  of  the
     Generic Mapping Tools Released, EOS Trans. AGU, 76, p. 329.
     Wessel, P., and W. H. F. Smith, 1995,  New  Version  of  the
     Generic           Mapping           Tools          Released,
     http://www.agu.org/eos_elec/95154e.html, Copyright  1995  by
     the American Geophysical Union.
     Wessel, P., and W. H. F. Smith, 1991,  Free  Software  Helps
     Map and Display Data, EOS Trans. AGU, 72, p. 441.