.TH r.resample.tps .SH NAME \fIr.resample.tps\fR - Reinterpolates and computes topographic analysis from input raster file to a new raster file (possibly with different resolution) using spline with tension and smoothing. .br \fI(GRASS Raster Program)\fR .SH SYNOPSIS .B r.resample.tps .br \fBr.resample.tps help\fR .br \fBr.resample.tps \fR [fB-r\fR] [fB-d\fR] \fBinput = name\fR \fBew_res = val\fR \fBns_res = val\fR \fBelev = name\fR [\fBslope = name\fR] [\fBaspect = name\fR] [\fBpcurv = name\fR] [\fBtcurv = name\fR] [\fBmcurv = name\fR] [\fBsmooth = name\fR] [\fBmaskmap = name\fR] [\fBoverlap = val\fR] [\fBzmult = val\fR] [\fBtension = val\fR] .SH DESCRIPTION \fIr.resample.tps\fR .br This program reinterpolates the values to a new raster file named \fIelev\fR from given raster file named \fIinput\fR. If \fI-r\fR flag is specified, all zero elevations in \fIinput\fR file are treated as elevations, otherwise they are ignored. Reinterpolation (resampling) is done to higher, same or lower resolution which is specified by parameters \fIew_res\fR and \fIns_res\fR. The output resolution can be the same if smoothing and/or topological parameters calculation are the goal. All resulting raster files are created for the given region (which might be different from the header of the input raster file) and new desired east-west and north-south resolutions. As an option, simultaneously with interpolation, topographic parameters slope, aspect, profile curvature (measured in the direction of steepest slope), tangential curvature (measured in the direction of a tangent to contour line) or mean curvature are computed and saved as raster files as specified by the options \fIslope, aspect, pcurv, tcurv, mcurv\fR respectively. If \fI-d\fR flag is set the program outputs partial derivatives fx,fy,fxx, fxy,fyy instead slope, aspect and curvatures. .LP For noisy data, it is possible to define spatially variable smoothing by prividing a raster file \fIsmooth\fR containing smoothing parameters. With the smoothing parameter set to zero (\fIsmooth\fR is not given or contains zero data), the resulting surface passes exactly through the data points. .LP User can define a raster file named \fImaskmap\fR, which will be used as a mask. The interpolation is skipped for cells which have zero value in mask. Zero values will be assigned to these cells in all output raster files. .LP Parameter \fIzmult\fR allows the user to rescale the z-values (useful, e.g., for transformation of elevations given in feet to meters, so that the proper values of slopes and curvatures can be computed). It also allows user to get higher vertical resolution for elevation (like centimeters instead of meters) .LP Regularized spline with tension is used for the interpolation. The \fItension\fR parameter tunes the character of the resulting surface from thin plate to membrane. Higher values of tension parameter reduce the overshoots that can appear in surfaces with rapid change of gradient (see suggested values for different types of surfaces given in notes). .LP .SH OPTIONS The user can run this program either interactively or non-interactively. The program will be run non-interactively if the user specifies program arguments and flag settings on the command line using the form: .LP .RS \fBr.resample.tps \fR [fB-r\fR] [fB-d\fR] \fBinput = name\fR \fBew_res = val\fR \fBns_res = val\fR \fBelev = name\fR [\fBslope = name\fR] [\fBaspect = name\fR] [\fBpcurv = name\fR] [\fBtcurv = name\fR] [\fBmcurv = name\fR] [\fBsmooth = name\fR] [\fBmaskmap = name\fR] [\fBoverlap = val\fR] [\fBzmult = val\fR] [\fBtension = val\fR] .RE .LP Alternatively, the user can simply type \fBr.resample.tps\fR on the command line without program arguments. In this case, the user will be prompted for parameter values and flag settings using the standard GRASS parser interface described in the manual entry for \fIparser\fR. .LP \fBParameters:\fR .IP \fB-r\fR 18 Indicates that zeroes in input map represent elevation. .IP \fB-d\fR 18 Output partial derivatives instead of aspect, slope and curvatures. .IP \fBinput\*=\fIname\fR 18 Use the existing site file \fIname\fR as input. .IP \fBew_res\*=\fIval\fR 18 Set desired east-west resolution to \fIval\fR .IP \fBns_res\*=\fIval\fR 18 Set desired north-south resolution to \fIval\fR .IP \fBelev\*=\fIname\fR 18 Output elevation values to raster file named \fIname\fR. .IP \fBslope\*=\fIname\fR 18 Output slope or fx values to raster file named \fIname\fR. .IP \fBaspect\*=\fIname\fR 18 Output aspect or fy values to raster file named \fIname\fR. .IP \fBpcurv\*=\fIname\fR 18 Output profile curvature or fxx values to raster file named \fIname\fR. .IP \fBtcurv\*=\fIname\fR 18 Output tangential curvature values or fyy to raster file named \fIname\fR. .IP \fBmcurv\*=\fIname\fR 18 Output mean curvature values or fxy to raster file named \fIname\fR. .IP \fBsmooth\*=\fIname\fR 18 Set smoothing parameter from file \fIname\fR . .IP \fBmaskmap\*=\fIname\fR 18 Use the existing raster file \fIname\fR as a mask. .IP \fBoverlap\*=\fIval\fR 18 Use overlap \fIval\fR cells to get additional points for interpolation for a given segment. Default value is 3. .IP \fBzmult\*=\fIval\fR 18 Convert z-values using conversion factor \fIval\fR. Default value is 1. .IP \fBtension\*=\fIval\fR 18 Set tension to \fIval\fR . .SH NOTES .I r.resample.tps uses regularized spline with tension for interpolation (as described in Mitasova and Mitas, 1993). Region is temporarily changed while writing output files with desired resolution. .LP Topographic parameters are computed the same way as in /fBs.surf.tps/fR. (See also Mitasova and Hofierka, 1993) .LP Raster file \fBsmooth\fR should contain variable smoothing parameters that can be derived from errors, slope, etc. using \fBr.mapcalc\fR. .LP The program gives warning when significant overshoots appear and higher tension should be used. However, with tension too high the resulting surface changes its behavior to membrane (rubber sheet stretched over the data points resulting in a peak or pit in each given point and everywhere else the surface goes rapidly to trend). Smoothing can also be used to reduce the overshoots if the resulting surface should be smooth. .LP When overshoots occure the resulting \fIelev\fR file will have "no data" in those places since the color table for the output \fIelev\fR file is the same as colortable for \fIinput\fR file. .LP The program checks the numerical stability of the algorithm by computation of values in given points, and prints the maximum difference found into the history file of raster map \fIelev\fR. Increase in tension is suggested if the difference is unacceptable. For computation with smoothing set to 0 this difference should be 0. With smoothing parameter greater than zero the surface will not pass through the data points and the higher the parameter the closer the surface will be to the trend. The maximum difference between the given and approximated value in this case reflects the smoothing effect on data. For theory on smoothing with splines and their statistical interpretation see Talmi and Gilat 1977, Wahba 1990, and Hutchinson 1992. .LP The program writes the values of parameters used in computation into the comment part of the history file \fIelev\fR as well as the following values which help to evaluate the results and choose the suitable parameters: minimum and maximum z values in the data file (zmin_data, zmax_data) and in the interpolated raster map (zmin_int, zmax_int), maximum difference between the given and interpolated z value in a given point (errtotal), rescaling parameter used for normalization (dnorm), which influences the tension (see Mitasova, 1992; Mitasova and Mitas, 1993). .LP The program gives a warning when the user wants to interpolate outside the region given by the header of the input raster file, zooming into the area where the points are is suggested in this case. .LP When a mask is used, the program takes all points in the given region for interpolation, including those in the area which is masked out, to ensure proper interpolation along the border of the mask. It therefore does not mask out the data points; if this is desirable, it must be done outside \fIr.resample.tps\fR. .SH "SEE ALSO" .I "g.region, r.resample, r.mapcalc, s.surf.tps, r.surf.contour, r.surf.idw, r.surf.idw2, r.surf.sor, s.surf.idw" .SH "AUTHOR" \fIOriginal version of program (in FORTRAN)\fR: .br Helena Mitasova, US Army CERL, Champaign, Illinois .br Lubos Mitas, NCSA, University of Illinois at Urbana Champaign, Illinois Institute of Physics, Bratislava, Czechoslovakia .LP \fIModified program (translated to C, adapted for GRASS , segmentation procedure)\fR: .br Irina Kosinovsky, US Army CERL .br Dave Gerdes, US Army CERL .br .SH "REFERENCES" .LP Hutchinson, M. K. and Gessler, P. E., 1993. Splines: More than just a smooth interpolator, \fIGeoderma\fR. .br .LP Mitasova, H. and Mitas, L., 1993. Interpolation by regularized spline with tension: I. Theory and implementation, \fIMathematical Geology\fR No.25 p.641-656. .br .LP Mitasova, H. and Hofierka, L., 1993. Interpolation by regularized spline with tension: II. Application to terrain modeling and surface geometry analysis, \fIMathematical Geology\fR No.25 p.657. .br .LP Mitasova, H., 1993. Surfaces and modeling, \fIGRASSclippings\fR, v.6, No.3 (winter), pp 16-18, No.4 (spring). .br .LP Talmi, A. and Gilat, G., 1977. Method for smooth approximation of data, \fIJournal of Computational Physics\fR, 23, pp 93-123. .br .LP Wahba, G., 1990. Spline models for observational data, CNMS-NSF Regional Conference series in applied mathematics, 59, SIAM, Philadelphia, Pennsylvania.