low.spell.lengths: Calculate the length of all low flow spells

View source: R/low.spell.lengths.R

low.spell.lengthsR Documentation

Calculate the length of all low flow spells

Description

Returns the length (and start date) of all flow spells above (or below) a given percentile or user defined threshold.

Independence criteria allow short periods below the spell threshold to be ignored and flows below a threshold (e.g. zero flows) can be ignored when calculating percentile flows (useful in ephemeral rivers).

Usage

low.spell.lengths(flow.ts, quant = 0.1, threshold,
ind.days = 5, ignore.zeros = F, ctf.threshold = 0.1, inter.spell=FALSE)

Arguments

flow.ts

Dataframe with date and discharge data in columns named "Date" and "Q" respectively. Date must be in POSIX format (see ts.format).

quant

Percentile/quantile to use for defining event magnitude (default 0.9). A value of 0.9 is the upper 90th percentile (i.e. a volume exceeded 10% of the time).

threshold

A user supplied threshold for defining spells. This would typically be derived from hydraulic models or similar knowledge pertaining to a gauge site.

ind.days

Periods between spells of less than ind.days (default 5) are considered to be 'in spell' for the purpose of further calculations. A value of 0 means spells 1 day apart are considered indpedendent.

ignore.zeros

logical. If TRUE, days below a user defined cease-to-flow threshold (default 0.1) will be excluded when estimating the spell threshold for a given percentile. This is primarily of interest in highly ephemeral rivers, where flow may only occur for a small fraction of the time. In such cases, the inclusion of zeros will skew estimates of low flow events downwards, which may be undesirable.

ctf.threshold

values below this threshold are treated as zero for the purpose of percentile based calculations (see ignore zeros).

inter.spell

logical. If TRUE, the function returns the spell lengths and start dates for periods above (rather than below) the defined threshold.

Value

Returns a dataframe of spell lengths and their associated starting dates.

Note that spells will always end at NAs.

Author(s)

Nick Bond <n.bond@latrobe.edu.au>

Examples

data(Cooper)
Cooper<-ts.format(Cooper)

low.spell.lengths(Cooper, threshold=50000)


hydrostats documentation built on June 1, 2022, 9:06 a.m.