quick_transfr: Transfer of observed discharge from gauged catchments to...

View source: R/quick_transfr.R

quick_transfrR Documentation

Transfer of observed discharge from gauged catchments to ungauged catchments

Description

Wrap up all the modelling steps into one function for a quick implementation of this R package.

Usage

quick_transfr(
  obs,
  sim,
  velocity = "loire2016",
  distance = "rghosh",
  gres = 5,
  weightO = 0.8,
  weightC = 0.2,
  power = 1,
  ndonors = 5,
  maxdist = 50000,
  flexible_donor = TRUE,
  cv = FALSE,
  save_donor = FALSE,
  warmup = 10,
  cooldown = 8,
  dosplit = TRUE,
  split = 30,
  parallel = FALSE,
  cores = NULL,
  verbose = TRUE
)

Arguments

obs

"transfR" object of the gauged catchments

sim

"transfR" object of the ungauged catchments

velocity

character string describing the method to estimate the streamflow velocity. See velocity for the available options (method argument)

distance

character string describing the method to compute the distance between catchments. See hdist for the available options (method argument)

gres

resolution of spatial discretisation (number of points by km²) for Ghosh distance. See hdist for more details

weightO

weight given to the distance between outlets if distance method is "combined". See hdist for more details

weightC

weight given to the distance between centroids if distance method is "combined". See hdist for more details

power

exponent applied in the inverse distance weighting strategy. See weightr for more details

ndonors

maximum number of catchments to be used to simulate discharge of an ungauged catchment. See weightr for more details

maxdist

maximum distance between a gauged and an ungauged catchment to allow the net rainfall to be transfered. This threshold is applied on the mdist distance matrix. If no units is provided, maxdist is assumed to be in [m]. See mixr for more details

flexible_donor

boolean indicating if the donor catchments can change during the simulation period according to the availability of discharge observations. See weightr for more details

cv

boolean indicating if cross validation evaluation should be done. If true, it will estimate the net rainfall of every gauged catchments (obs) as if they were ungauged (leave-one-out evaluation)

save_donor

boolean indicating if the net rainfall of each of the ndonors catchments should be stored in the sim object for further analysis. If true, it is adding three new space-time attributes in the sim object called "RnDonor", "Idonor" and "Wdonor" describing the net rainfall, the id and the weight of the donor catchments respectively. See mixr for more details

warmup

length of the warmup period. If no unit is provided, warmup is assumed to be in [days]. See inversion for more details

cooldown

length of the period removed at the end of the simulation. If no unit is provided, cooldown is assumed to be in [days]. See inversion for more details

dosplit

boolean, if true the inversion is performed by subperiods of length defined by split. See inversion for more details

split

length the subperiods if dosplit is true. If no unit is provided, split is assumed to be in [days]. See inversion for more details

parallel

logical indicating if the computation should be parallelised

cores

the number of cores to use for parallel execution if parallel is TRUE. If not specified, the number of cores is set to the value of parallel::detectCores()

verbose

boolean indicating if information messages should be written to the console

Details

The function applies sequentially the following functions: velocity, uh, lagtime, rapriori, inversion, hdist, mixr and convolution. Please refer to the help of each of these functions and to transfR-package for a general description of the modelling approach.

Value

The sim object incremented by the new computed attributes

See Also

velocity, uh, lagtime, rapriori, inversion, hdist, mixr, convolution

Examples

data(Oudon)
obs <- as_transfr(st = Oudon$obs[,,1:3], hl = Oudon$hl[1:3]) #gauged catchments
sim <- as_transfr(st = Oudon$obs[,,4:6], hl = Oudon$hl[4:6]) #catchments considered as ungauged
sim <- quick_transfr(obs, sim)

transfR documentation built on Oct. 2, 2023, 5:07 p.m.