streamlines {RGeostats}R Documentation

Calculate the set of streamlines from Drop points in a Grid Db

Description

Calculate the set of streamlines from Drop points in a Grid Db

Usage

streamlines(dbgrid, dbpoint=NA, step = NA, niter = 100, flag.norm=FALSE,
            use.grad = FALSE, save.grad = FALSE, flag.draw = FALSE, ...,
            radix = "StreamLines", modify.target = db.locmod())

Arguments

dbgrid

The db-class structure containing the variable used as the elevation of a relief. Each streamline starts from a drop point and follows the steepest slope until it reaches the edge.

dbpoint

The db-class structure which contains the set of drop points. If not provided, each grid node of 'dbgrid' will be considered as a valid dropt point.

step

Value of the step when following the steepest gradient

niter

Maximum number of steps from the drop point to the end point. This is interrupted if the streamline hits the edge of the grid.

flag.norm

When TRUE, the gradients are normalized before usage: it means that they only provide the direction of the gradients, but not their amplitude.

use.grad

When TRUE, the Gradient components must be contained in the 'dbgrid'. These variables must correspond to the locator "G". If not present, an error is generated.

When FALSE, the Gradient components are calculated in this function.

save.grad

When TRUE, the Gradient components (if calculated by this function) are saved in the returned Db.

When FALSE, the Gradients components (if calculated by this function) are deleted at the end of the procedure.

flag.draw

Optional graphic representation.

...

Argument passed to the following function db.plot, lines and points.

radix

Radix of the name given to the variables storing the results in the target Db.

modify.target

Decides whether or not the newly created variables will have their locator defined or not. For more information, see db.locmod.

Details

Use the solution: set_keypair("Streamline",1) to specify the slipping ratio on the active samples of 'dbpoint' (default=1).

Value

The input db-class Grid structure is returned with several variables added.

The streamline information is provided typing get.keypair("Streamlines").

It corresponds to a matrix where the columns are:

Each streamline ends by a record where all variables are set to NA.

Examples

# Create a grid 100 x 100
grid  = db.create(nx=c(100,100))
# Create a K-Bessel Model
model = model.create(vartype=8,range=50,sill=1,param=2)
# Perform a non-conditional simulation on the grid
grid  = spde(,grid,model)
# Calculate the streamlines (for one node every 190) and represent them
set.keypair("Streamline_Skip",190)
a = streamlines(grid,flag.draw=TRUE,niter=100,step=10,
    title="Topography and Streamlines")
rm(grid,model,a)

[Package RGeostats version 14.0.10 Index]