DesHydro: Design hydrograph extraction

View source: R/All.R

DesHydroR Documentation

Design hydrograph extraction

Description

Extracts a mean hydrograph from a flow series

Usage

DesHydro(
  x,
  qu = 0.8,
  n = 10,
  thr = 0.975,
  xst = NULL,
  xend = NULL,
  RetAll = FALSE,
  Smooth = 1
)

Arguments

x

a numeric vector. The flow series of interest

qu

the quantile of flow which separates peaks and truncates either side of the peak to form the event hydrograph. The default is 0.8

n

number of event hydrographs from which to derive the mean hydrograph. Default is 10. Depending on the length of x, there may be less than 10

thr

threshold above which event peaks are selected. The default is 0.975

xst

an integer to truncate the x axis of the plot and resulting design hydrograph. The first point of the design hydrograph

xend

an integer to truncate the x axis of the plot and resulting design hydrograph. The last point of the design hydrograph

RetAll

logical argument with a default of false. If TRUE, all the hydrographs from which the mean is derived are returned in a data.frame. If FALSE, the mean hydrograph is returned

Smooth

an integer (from 0 to 5). To smooth the design hydrograph. The default is 1 which provides the minimum level of smoothing. 0 is no smoothing and 5 is the highest

Details

All the peaks over a user defined threshold are identified and separated by a user defined value 'qu', which is a quantile of flow. The top n peaks are selected and the hydrographs extracted. Each hydrograph is centred on the peak and truncated either side, where the flow falls below the 'qu' quantile flow. All events are scaled to have a peak flow of one, and the mean of these is taken as the scaled design hydrograph. After an initial view of the hydrograph, it can be truncated using the 'xst' and 'xend' arguments. The default is to select 10 hydrographs for averaging, however, there may well be fewer if the sample is short.

Value

a numeric vector which is the mean of the top n peak events in the flow series. Also a plot of the n hydrographs and the design hydrograph. If the RetAll argument equals TRUE, a data.frame of the n hydrographs is returned instead.

Note

The smoothing is done by rolling average, where the the mean is of points from n to the left up to n to the right. The n is chosen by the Smooth argument.

Author(s)

Anthony Hammond

Examples

#Extract a design hydrograph from the Thames daily mean flow. Then print the resulting hydrograph
ThamesDesHydro <- DesHydro(ThamesPQ$Q)
ThamesDesHydro
#Do the same but truncate the design hydrograph and the plot from the first point to the 30th
DesHydro(ThamesPQ$Q, xst = 1, xend = 30)
#adjust the qu value to see the impact
ThamesDesHydro <- DesHydro(ThamesPQ$Q, qu = 0.7)
#Return all the hydrographs
ThamesHydros <- DesHydro(ThamesPQ$Q, xst = 1, xend = 30, RetAll = TRUE)
#view the first six rows of the hydrographs
head(ThamesHydros)

UKFE documentation built on Nov. 6, 2023, 1:07 a.m.

Related to DesHydro in UKFE...