Decrease stage values in river cells if they are implausible with respect to water always flowing downhill.
BumpRiverStage(r, outlets, min.drop = 1e-06)
'RasterLayer'. Numeric cell values representing river stages.
'SpatialPoints*', 'SpatialLines*', 'SpatialPolygons*' or 'Extent'.
Designates the location of discharge outlets.
The rasterize
function is used to locate outlet cells in the raster grid r
.
'numeric' number. Minimum drop in stage between adjacent river cells.
An object of class 'RasterLayer' with cell values representing the vertical change in stream stage.
These changes can be added to r
to ensure that water always flows downhill.
The Lee algorithm (Lee, 1961) is used to identify flow paths among the modeled river cells. An analysis of river cell stage values along a flow path identifies any problematic cells that are obstructing downhill surface-water flow. Stage values for these problematic cells are then lowered to an acceptable elevation.
Lee, C.Y., 1961, An algorithm for path connections and its applications: IRE Transactions on Electronic Computers, v. EC-10, no. 2, p. 346--365.