find_area_threshold_OCN {OCNet} | R Documentation |
Find relationship between number of nodes and threshold area in an OCN
Description
Function that calculates relationship between threshold area and number of nodes at RN and AG level for a given OCN.
It can be used prior to application of aggregate_OCN
in order to derive the drainage area threshold
that corresponds to the desired number of nodes of the aggregated network.
It is intended for use with single outlet OCNs, although its use with multiple outlet OCNs is allowed (provided that max(thrValues) <= min(OCN$CM$A)
).
Usage
find_area_threshold_OCN(OCN, thrValues = seq(OCN$cellsize^2,
min(OCN$CM$A), OCN$cellsize^2), maxReachLength = Inf,
streamOrderType = "Strahler", displayUpdates = 0)
Arguments
OCN |
A |
thrValues |
Vector of values of threshold drainage area (in squared planar units) for which the respective number of nodes at the RN and AG levels are computed.
Note that it must be |
maxReachLength |
Maximum reach length allowed (in planar units). If the path length between a channel head and the downstream confluence
is higher than |
streamOrderType |
If |
displayUpdates |
If |
Value
A list whose objects are listed below.
thrValues |
Copy of the input vector with the same name. |
nNodesRN |
Vector (of the same length as |
nNodesAG |
Vector (of the same length as |
drainageDensity |
Vector (of the same length as |
streamOrder |
Vector (of the same length as |
Examples
# 1) derive relationship between threshold area and number of nodes
OCN <- landscape_OCN(OCN_20)
thr <- find_area_threshold_OCN(OCN)
# log-log plot of number of nodes at the AG level versus
# relative threshold area (as fraction of total drainage area)
old.par <- par(no.readonly = TRUE)
par(mai = c(1,1,1,1))
plot(thr$thrValues[thr$nNodesAG > 0]/OCN$CM$A,
thr$nNodesAG[thr$nNodesAG > 0], log = "xy",
xlab = "Relative area threshold", ylab = "Number of AG nodes")
par(old.par)