hyet_split uses a predefined vector with monthly values of fixed critical time duration of no precipitation to split an hyetograph to independent rainstorms. Returns an error if hyet is not a valid hyetograph.

hyet_split(hyet, time_step, ts_unit, crit_dur = rep(6, 12))

Arguments

hyet

an hyetograph from hyet_create function.

time_step

a numeric value that represents the time-step.

ts_unit

a character string specifying the time unit. Valid values are "mins" and "hours".

crit_dur

a vector of 12 numeric values in hours. This vector represents the monthly critical time duration of no precipitation that is used to separate the hyetograph to independent rainstorms. Default value for all months is six hours.

Value

a grouped dataframe with independent rainstorms.

References

Restrepo-Posada, Pedro J., and Peter S. Eagleson. "Identification of independent rainstorms." Journal of Hydrology 55.1-4 (1982): 303-319.

Examples

# create time series with 1 hours time step time_step <- 30 ts_unit <- "mins" len <- 90 crit_dur = rep(6,12) hyet <- tibble::tibble( date = seq( from = as.POSIXct(0, origin = "2018-01-01"), length.out = len, by = paste(time_step, ts_unit) ), prec = runif(len, 1, 5) ) hyet$prec[10:23] <- 0 hyet$prec[41:54] <- 0 # split hyetograph to storms storms <- hyet %>% hyet_split(time_step, ts_unit, crit_dur)