as.catchment_system: Creation of system of catchments

View source: R/catchment.R

as.catchment_systemR Documentation

Creation of system of catchments

Description

Creates system of catchments with reservoirs.

Usage

as.catchment_system(...)

Arguments

...

Objects of catchment class or a list with objects of catchment class (its names does not matter).

Details

An error occurs if a given downstream catchment is not available.

Examples

data_catch = data.frame(DTM = seq(as.Date("1982-11-01"), length.out = 7, by = "day"), PET = rep(0.5, 7), R = rep(24 * 3.6, 7), P = rep(1, 7))
res_data_c1 = data.frame(
    storage = c(1e7, 1e7, 1e7), area = c(1e4, 1e4, 1e4), part = c(0.25, 0.25, 0.5), branch_id = c("main", "lateral", "lateral"), id = c("M1", "L1", "L2"))
branches = list(main = list(down_id = NA), lateral = list(down_id = "main", connect_to_part = 0.8))
res_data_c2 = res_data_c1
res_data_c2$storage = res_data_c2$storage * 2

catch1 = as.catchment(id = "C1", down_id = "C2", data = data_catch, area = 100, res_data = res_data_c1, branches = branches, main_branch = "main")
catch2 = as.catchment(id = "C2", down_id = NA, data = data_catch, area = 200, res_data = res_data_c2, branches = branches, main_branch = "main")
catch_system = as.catchment_system(catch1, catch2)

tgmwri/wateres documentation built on Feb. 13, 2024, 10:25 p.m.