contotbl
This Matlab script reads an ascii contour data file, keeping only specified x, y, z1, z2, ... data. These are interpolated onto a specified y-grid, which is common to each profile. The results are written in a new ascii data file, in table .
Columns in the contour data file do not need to be ordered as described below (i.e. x, y, z values may be located in different columns, and x column does not need to contain the least varying values). Reordering of data is carried by the script.
See below for a description of the invloved file formats.
The following parameters must be edited:
Name of input file containing contour data.
Name of output file for table data.
Number of column for x variable in contour file.
Number of column for y variable in contour file.
Vector of column numbers for z variables in contour file.
Common y-grid points for table .
Format for writting values in table file.
Separator between columns in output file.
The input contour is equivalent of as the one generated by the contour product of adcpsect: the first and second columns contain x and y data, while remaining columns contain z data for the different listed variables. Each line defines a grid point. This has the advantage that grid points do not need to be on a regularly spaced grid. Hence, a typical contour file will look like:
x(1) y(1,1) z1(1,1) z2(1,1) ... zQ(1,1)
x(1) y(1,2) z1(1,2) z2(1,2) ... zQ(1,2)
...
x(1) y(1,M(1)) z1(1,M(1)) z2(1,M(1)) ... zQ(1,M(1))
x(2) y(2,1) z1(2,1) z2(2,1) ... zQ(2,1)
...
x(N) y(N,M(N)) z1(N,M(N)) z2(N,M(N)) ... zQ(N,M(N))
In table , grid points must be regularly spaced. The first columns contains all different y values. All other data on the line are z values corresponding to the different x locations (normally sorted in ascending order). If several z variables were selected from the input contour file, these will appear in the same order for each x location. The corresponding table file from the previous example will look as follows:
y(1) z1(1,1) z2(1,1) ... zQ(1,1) z1(2,1) ... zQ(N,1)
...
y(M) z1(1,M) z2(1,M) ... zQ(1,M) z1(2,1) ... zQ(N,M)
Pierre Jaccard, Geophysical Institute, University of Bergen, 1999