dfi_n: Calculation of DFI (or BFI) with block length n or 1:n

View source: R/dfi_n.R

dfi_nR Documentation

Calculation of DFI (or BFI) with block length n or 1:n

Description

Common baseflow separation separates quick- and baseflow with a block length of n = 5 with dfi_n(q_obs, n = 5). To generate multiple hydrograph separations for the DFI index n vary between 1 and nmax (e.g. 60, 90 or 120 days). To do this the function could be used with a n as a vector instead of a single integer (e.g. dfi_n(q_obs, n = 1:60)) Note, separation with n=0 is not possible. The DFI of n=1 is not 1 as due to the algorithm some streamflow peaks are separated from delayed flow.

Usage

dfi_n(q, n = 5, desc = TRUE, add_zero = TRUE)

Arguments

q

vector with streamflow series

n

block length n. If n is a integer (vector of length one) a single delayed flow separation is performed. If n is a vector (with length > 1) multiple separations for all n values are calculated. To analyze later on the DFI curve it is recommended that n starts at 1 and is a continuous vector (e.g. 1,2,3,.... 58, 59, 60). But also variations like n = c(1,5,10,15,30) are possible.

desc

logical, if TRUE DFI values are converted to be monotonically descreasing with cummin()

add_zero

logical, default is TRUE. If TRUE, n=0 and dfi=1 is added to output data.frame. Note that the in a hydrograph separation with n=0 is by definition DFI = 1.

Value

A data.frame with two columns: n for block length and dfi with the DFI(n) values. If n is a single integer the function returns a single integer (i.e. one DFI(n) value).

Examples

# same as BFI calculation
bfi <- dfi_n(q_data$q_obs, n = 5)
bfi

# 60 different separations based on various block length n
dfi_n(q_data$q_obs, n = 1:60)

# only specific block lengths are used
dfi_n(q_data$q_obs, n = c(1:5,10,30,60,90), add_zero = FALSE)


modche/delayedflow documentation built on March 17, 2022, 5:28 p.m.