regrid
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.
The following parameters must be edited:
Name of input data file.
Name of output data file.
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.
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.
Interpolation method (default is linear). See Matlab help on function interp1 or griddata for more information.
The column number for x-data in the input file.
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.
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.
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.
Pierre Jaccard, Geophysical Institute, University of Bergen, 1999