NOMBRE

s.surf.rst- interpola una capa raster con valores en punto flotante a partir de datos de sites utilizando splines regularizados con un parámetro de tensión. Realiza también un análisis topográfico de la capa resultante (este programa sustituye a s.surf.tps)

USO:

s.surf.rst
s.surf.rst help
s.surf.rst [-d] [-t] input = name [elev = name] [field=val] [slope = name] [aspect = name] [pcurv = name] [tcurv = name] [mcurv = name] [maskmap = name] [dmin = val] [zmult = val] [tension = val] [smooth = val] [smatt=val] [segmax = val] [npmin = val] [theta = val] [scalex = val] [devi = name] [treefile = name] [overfile = name]

DESCRIPCION

s.surf.rst
Este programa interpola los valores de zi a partir de datos puntuales (elevaciones, observatorios climáticos, muestras de suelo, etc.) contenidos en un fichero de sites que se suministra como input. El mapa raster que contiene la superficie se almacena como elev . El usuario puede seleccionar cual de los atributos de los sites se interpolará mediante el parámetro field.

Opcionalmente pueden calcularse parámetros topográficos como la pendiente, orientación, curvatura en el perfil (medida en la dirección de máxima pendiente), curvatura tangencial (medida en la dirección de las curvas de nivel o curvatura media (parámetros slope, aspect, pcurv, tcurv, mcurv respectivamente). Si se utiliza la opción -d se calculan las derivadas parciales fx, fy, fxx, fyy, fxy en lugar de pendiente, orientación, curvatura en el perfil y curvatura tangencial.

El usuario puede definir una máscara mediante el parámetro maskmap. La interpolación se limita a las celdillas con valores distintos de cero o nulo en dicha máscara. La muestra de puntos se verifica para eliminar aquellos puntos que están más cerca que un umbral dmin. El parámetro  zmult permite reescalar los valores de z.

Splines regularizados con tensión y suavizado se utilizan para la interpolación y aproximación. El parámetro tension determina el carácter de la superficie resultante que varía entre thin plate y membrana. La opción experimental -t permite utilizar "dnorm independent tension", (ver notas). Para datos ruidosos puede definirse una constante de suavizado (smooth) o una variable de suavizado dando al parámetro smatt  el número de orden que contiene esta variable. Si la superficie se suaviza podemos obtener una mapa de sites (devi) con las desviaciones de la superficie resultante respecto a lo datos originales.

Si el número de puntos es mayor que segmax, se utiliza un procedimiento de segmentación. La región se divide en segmentos rectangulares cada uno de los cuales tiene menos de segmented processing is used. The region is split into rectangular segments, each having less than segmax points and interpolation is performed on each segment of the region. To ensure smooth connection of segments the interpolation function for each segment is computed using the points in given segment and the points in its neighborhood which are in the rectangular window surrounding the given segment. The number of points taken for interpolation is controlled by npmin, the value of which must be larger than segmax. User can choose to output vector files treefile and overfile which represent the quad tree used for segmentation and overlapping neighborhoods from which additional points for interpolation on each segment were taken. Anisotropic surfaces can be interpolated setting anisotropy angle theta and scaling factor scalex. The program writes several important values to history file of raster map elev. If the input data have time stamp, the program creates time stamp for all output files.

Es conveniente ejecutar g.region antes para ajustar la región y la resolución para la interpolación.

OPCIONES

El programa puede ejecutarse de forma interactiva o no. Se hará no interactivo si el usuario especifica los siguientes argumentos en la linea de comandos:

s.surf.rst [-d] [-t] input = name elev = name [field=val] [ slope = name] [ aspect = name] [ pcurv = name] [ tcurv = name] [ mcurv = name] [ maskmap = name] [ dmin = val] [ zmult = val] [ tension = val] [ smooth = val] [smatt=val] [ segmax = val] [ npmin = val] [ theta = val ] [ scalex = val ] [ devi = name] [ treefile = name] [= name]

Alternativamete, el usuario puede teclear sólo s.surf.rst sin argumentos y esperar a que el programa le pregunte por el conjunto de opciones  y parámetros.

Opciones

-d Output partial derivatives instead of aspect, slope and curvatures.
-t Use dnorm independent tension (experimental)

Parámetros:

input = name
Use the existing site file name as input.

elev = name
Output elevation values to raster file name.

field=val
decimal attribute to use for elevation (1=first) options (1-100), default is 1.

slope = name
Output slope or dx values to raster file name.

aspect = name
Output aspect or dy values to raster file name.

pcurv = name
Output profile curvature or dxx values to raster file name.

tcurv = name
Output tangential curvature or dyy values to raster file name.

mcurv = name
Output mean curvature or dxy values to raster file name.

maskmap = name
Use the existing raster file name as a mask.

dmin = val
Set min distance between points to val. Default value is set to 0.5 grid cell size.

zmult = val
Convert z-values using conversion factor val. Default value is 1.

tension =val
Set tension to val. Default value is 40.

smooth = val
Set smoothing parameter to val. Default value is 0.1.

smatt=val
order of floating point attribute to use for variable smoothing parameter

segmax = val
Set max number of points per segment to val. Default value is 40.

npmin = val
Set min number of points for interpolation to val. Default value is 200, for data with heterogeneous spatial distribution higher value is suggested (see notes).

theta = val
Set anisotropy angle in degrees (measured from East counterclockwise) to val.

scalex = val
Set anisotropy scaling factor to val. Values 0 and 1 give no anisotropy.

devi = name
Output deviations to a site file name.

treefile = name
Output quad tree used for segmentation to vector file name

overfile = name
Output overlapping neighborhoods used for segmentation to vector file name.

NOTAS

s.surf.rst utiliza regularized spline with tensionfor interpolation from point data. Point data should be in a new site format , that means format x|y|%z1 %z2 ...%zi..., instead of the old format which confused categories with values (x|y|#z). If program detects the old format it will allow users to have the site file rewritten to a new format automatically.

The implementation has a segmentation procedure based on quadtrees which enhances the efficiency for large data sets. The GRASS5.0 version has enhanced segmentation which takes more points for the large segments, to reduce the potential for visibility of segmentens in areas with sparse data.

Special color tables are created by the program for output raster files.

Topographic parameters are computed directly from the interpolation function so that the important relationships between these parameters are preserved. The equations for computation of these parameters and their interpretation are described in (Mitasova and Hofierka 1993 ). Slopes and aspect are computed in degrees (0-90 and 1-360 respectively). The aspect raster file has value 0 assigned to flat areas (with slope less than 0.1%) and to singular points with undefined aspect. Aspect points downslope and is 90 to the North, 180 to the West, 270 to the South and 360 to the East, the values increase counterclockwise. Curvatures are positive for convex and negative for concave areas. Singular points with undefined curvatures have assigned zero values.

Tension and smoothing allow user to tune the surface character. For most landscape scale applications the default should work fine.The program gives warning when significant overshoots appear in the resulting surface and higher tension or smoothing should be used.
While it is possible to automatize the selection of suitable tension and smoothing, it has not been done yet, so here are some hints which may help to choose the proper parameters if the results look "weird". It is useful to know that the method is scale dependent and the tension works as a rescaling parameter (high tension "increases the distances between the points" and reduces the range of impact of each point, low tension "decreases the distance" and the points influence each other over longer range). Surface with tension set too high behaves like a membrane (rubber sheet stretched over the data points) with peak or pit ("crater") in each given point and everywhere else the surface goes rapidly to trend. If digitized contours are used as input data, high tension can cause artificial waves along contours. Lower tension and higher smoothing is suggested for such a case.
Surface with tension set too low behaves like a stiff steel plate and overshoots can appear in areas with rapid change of gradient and segmentation can be visible. Increase tension should solve the problems.

There are two options how tension can be applied in relation to dnorm (dnorm rescales the coordinates depending on the average data density so that the size of segments with segmax=40 points is around 1 - this ensures the numerical stability of the computation):

1. Default (used also in s.surf.tps): the given tension is applied to normalized data (x/dnorm..), that means that the distances are multiplied (rescaled) by tension/dnorm. If density of points is changed, e.g., by using higher dmin, the dnorm changes and tension needs to be changed too to get the same result. Because the tension is applied to normalized data its suitable value is usually within the 10-100 range and does not depend on the actual scale (distances) of the original data (which can be km for regional applications or cm for field experiments).
2. Flag -t (experimental for s.surf.rst): The given tension is applied to un-normalized data (rescaled tension = tension*dnorm/1000 is applied to normalized data (x/dnorm) and therefore dnorm cancels out) so here tension truly works as a rescaling parameter. For regional applications with distances between points in km the suitable tension can be 0.1 or smaller, for detailed field scale analysis with distances in cm it can be 500 or more. To help select how much the data need to be rescaled the program writes dnorm and rescaled tension=tension*dnorm/1000 at the beginning of the program run. This rescaled tension should be around 20-30. If it is lower or higher, the given tension parameter should be changed accordingly.

The default is a recommended choice, however for the applications where the user needs to change density of data and preserve the interpolation character the -t flag can be helpful.

Anisotropic data (e.g. geologic phenomena) can be interpolated using theta and scalex defining orientation and ratio of the perpendicular axes put on the longest/shortest side of the feature, respectively. Theta is measured in degrees from East, counterclockwise. Scalex is a ratio of axes sizes. Setting scalex in the range 0-1, you will get pattern prolonged in the direction defined by theta. Scalex value 0.5 means that your feature is approximatelly 2 times longer in the direction of theta than in the perpendicular direction. Scalex value 2 means that axes ratio is reverse and you will get pattern perpendicular to the previous example. Please note that anisotropy option has not been extensively tested and may include bugs - if there are problems, please report to GRASS bugtracker (accessible from http://grass.itc.it/).

For data with values changing over several magnitudes (sometimes the concentration or density data) it is suggested to interpolate the log of the values rather than the original ones.

The program checks the numerical stability of the algorithm by computing the values in given points. The root mean square deviation (rms) between interpolated and given values is written into the history file of raster map elev. For computation with smoothing set to 0. the rms should be 0. Significant increase in tension is suggested if the rms is unexpectedly high for this case. With smoothing parameter greater than zero the surface will not pass exactly through the data points and the higher the parameter the closer the surface will be to the trend. The rms then represents a measure of smoothing effect on data. More detailed analysis of smoothing effects can be performed using the output deviations option and running s.univar on the site file with deviations.

The program writes the values of parameters used in computation into the comment part of history file elev 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), rescaling parameter used for normalization (dnorm), which influences the tension.

Si el número de puntos no es lo suficientemente grande (menos de 800), el usuario puede evitar que se produzca segmentación dando al parámetro segmax un valor alto segmax=700.

El programa advierte si el usuario intenta interpolar fuera del rectángulo definido por los valores mínimos y máximos de las coordenadas de los puntos, en este caso se sugiere hacer un zoom a la región donde se concentran los puntos de muestreo.

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 s.surf.rst (e.g. using r.mask.points).

Ejemplos de aplicación:

 http://skagit.meas.ncsu.edu/~helena/gmslab/viz/
and http://skagit.meas.ncsu.edu/~helena/gmslab/

VER:

r.slope.aspect, r.surf.idw , r.surf.idw2 , r.surf.contour , s.surf.idw , v.to.sites , g.region , r.mask , v.surf.rst , r.resamp.rst

AUTORES

Original version of program (in FORTRAN) and GRASS enhancements:
Lubos Mitas, NCSA, University of Illinois at Urbana-Champaign, Illinois, USA
Helena Mitasova, Department of Geography, University of Illinois at Urbana-Champaign, Champaign, Illinois, USA

Modified program (translated to C, adapted for GRASS, new segmentation procedure):
Irina Kosinovsky, US Army CERL, Champaign, Illinois, USA
Dave Gerdes, US Army CERL, Champaign, Illinois, USA

Modifications for new sites format and timestamping:
Darrel McCauley, Purdue University, West Laffayette, Indiana, USA

REFERENCIAS


Hofierka J., Parajka J., Mitasova H., Mitas L., 2002, Multivariate Interpolation of Precipitation Using Regularized Spline with Tension. Transactions in GIS  6(2), pp. 135-150.

Mitas, L., Mitasova, H., 1999, Spatial Interpolation. In: P.Longley, M.F. Goodchild, D.J. Maguire, D.W.Rhind (Eds.), Geographical Information Systems: Principles, Techniques, Management and Applications, Wiley, pp.481-492

Mitasova H., Mitas L., Brown W.M., D.P. Gerdes, I. Kosinovsky, Baker, T.1995, Modeling spatially and temporally distributed phenomena: New methods and tools for GRASS GIS. International Journal of GIS, 9 (4), special issue on Integrating GIS and Environmental modeling, 433-446.

Mitasova H. and Mitas L. 1993 : Interpolation by Regularized Spline with Tension: I. Theory and Implementation, Mathematical Geology 25, 641-655.

Mitasova H. and Hofierka J. 1993 : Interpolation by Regularized Spline with Tension: II. Application to Terrain Modeling and Surface Geometry Analysis, Mathematical Geology 25, 657-667.

Mitasova, H., 1992 : New capabilities for interpolation and topographic analysis in GRASS, GRASSclippings 6, No.2 (summer), p.13.

Mitas, L., Mitasova H., 1988 : General variational approach to the interpolation problem, Computers and Mathematics with Applications 16, p. 983

Talmi, A. and Gilat, G., 1977 : Method for Smooth Approximation of Data, Journal of Computational Physics, 23, p.93-123.

Wahba, G., 1990, : Spline Models for Observational Data, CNMS-NSF Regional Conference series in applied mathematics, 59, SIAM, Philadelphia, Pennsylvania.

Updated April 2, 2002 by Jaro Hofierka and Helena Mitasova

Last changed: $Date: 2003/02/05 12:46:03 $