| landscape_OCN {OCNet} | R Documentation |
Generate 3D landscape from an Optimal Channel Network
Description
Function that calculates the elevation field generated by the OCN and the partition of the domain into different catchments.
Usage
landscape_OCN(OCN, slope0 = 1, zMin = 0, optimizeDZ = FALSE,
optimMethod = "BFGS", optimControl = list(maxit = 100 *
length(OCN$FD$outlet), trace = 1), displayUpdates = 0)
Arguments
OCN |
A |
slope0 |
slope of the outlet pixel (in elevation units/planar units). |
zMin |
Elevation of the lowest pixel (in elevation units). |
optimizeDZ |
If |
optimMethod |
Optimization method used by function |
optimControl |
List of control parameters used by function |
displayUpdates |
State if updates are printed on the console while
Note that the display of updates during optimization of elevations (when |
Details
The function features an algorithm (which can be activated via the optional input optimizeDZ) that, given the network
configuration and a slope0 value, finds the elevation of OCN$nOutlet - 1 outlets relative to the elevation of the first
outlet in vectors outletSide, outletPos such that the sum of the absolute differences elevation of neighboring pixels
belonging to different catchments is minimized. Such objective function is minimized by means of function optim.
The absolute elevation of the outlet pixels (and, consequently, of the whole lattice) is finally attributed by imposing
OCN$FD$Z >= zMin. Note that, due to the high dimensionality of the problem, convergence of the
optimization algorithm is not guaranteed for large OCN$nOutlet (say, OCN$nOutlet > 10).
Value
A river object that contains all objects contained in OCN, in addition to the objects listed below.
A new sublist CM, containing variables at the catchment aggregation levels, is created.
FD$slope |
Vector (of length |
FD$leng |
Vector (of length |
FD$toCM |
Vector (of length |
FD$XDraw |
When |
FD$YDraw |
When |
FD$Z |
Vector (of length |
CM$A |
Vector (of length |
CM$W |
Adjacency matrix ( |
CM$XContour (CM$Y_contour) |
List with number of objects equal to |
CM$XContourDraw (CM$YContourDraw) |
List with number of objects equal to |
OptList |
List of output parameters produced by the optimization function |
Finally, slope0 and zMin are passed to the river as they were included in the input.
Examples
# 1) draw 2D elevation map of a 20x20 OCN with default options
OCN2 <- landscape_OCN(OCN_20)
## Not run:
# 2) generate a 100x50 OCN; assume that the pixel resolution is 200 m
# (the total catchment area is 20 km2)
set.seed(1)
OCN <- create_OCN(100, 50, cellsize = 200,
displayUpdates = 0) # this takes about 40 s
# use landscape_OCN to derive the 3D landscape subsumed by the OCN
# by assuming that the elevation and slope at the outlet are 200 m
# and 0.0075, respectively
OCN <- landscape_OCN(OCN, zMin = 200, slope0 = 0.0075)
# draw 2D and 3D representations of the landscape
draw_elev2D_OCN(OCN)
draw_elev3D_OCN(OCN)
draw_elev3Drgl_OCN(OCN)
## End(Not run)
## Not run:
# 3) generate a 100x50 OCN with 4 outlets
set.seed(1)
OCN <- create_OCN(100, 50, cellsize = 200,
nOutlet = 4, displayUpdates = 0) # this takes about 40 s
# use landscape_OCN and optimize elevation of outlets
OCN <- landscape_OCN(OCN, slope0 = 0.0075,
optimizeDZ = TRUE)
# display elevation of outlets and 2D elevation map
OCN$FD$Z[OCN$FD$outlet]
draw_elev2D_OCN(OCN)
## End(Not run)