baseflow: Baseflow

View source: R/baseflow.R

baseflowR Documentation

Baseflow

Description

Given a complete (without missing values) series of streamflow, this function computes the baseflow using the filter proposed by Arnold and Allen (1999).

Usage

baseflow(x, ...)

## S3 method for class 'zoo'
baseflow(x, beta=0.925, from=start(x), to=end(x), date.fmt, tz, 
         na.fill=c("none", "linear", "spline"), out.type=c("last", "all"), 
         plot=TRUE, xcol="black", bfcol=c("blue", "darkcyan", "darkorange3"),
         pch=15, cex=0.3, ...)

Arguments

x

zoo or numeric object with streamflow records. The suggested time frequency should be hourly or daily, but the algorithm will work with any time frequency.

beta

numeric representing the filter parameter. Default value is 0.925 as recommended by Arnold and Allen (1999)

from

Character indicating the starting date for subsetting x. It has to be in the format indicated by date.fmt.
The default value corresponds to the date of the first element of x.

to

Character indicating the ending date for subsetting x. It has to be in the format indicated by date.fmt.
The default value corresponds to the date of the last element of x.

date.fmt

character indicating the format in which the dates are stored in from and to, e.g. %Y-%m-%d. See ‘Details’ section in strptime. By default, date.fmt is missing, and it is automatically set to %Y-%m-%d when time(x) is Date object, and set to %Y-%m-%d %H:%M:%S when x is a sub-daily zoo object.

tz

character, with the specification of the time zone used for from, to. System-specific (see time zones), but "" is the current time zone, and "GMT" is UTC (Universal Time, Coordinated). See Sys.timezone and as.POSIXct.

If tz is missing (the default), it is automatically set to the time zone used in time(x).

This argument can be used when working with sub-daily zoo objects to force using time zones other than the local time zone for from and to. It should be used with caution, being well aware of the time zone of the data. See examples.

na.fill

Character indicating how to fill any NA present in x. Valid values are:
-) remove => NAs are not plotted
-) linear => NAs are removed by linear interpolation, using na.approx
-) spline => NAs are removed by spline interpolation, using na.spline

out.type

Character indicating the type of result that is given by this function. Valid values are:
-) last => only the baseflow computed after the third pass of the filter is returned.
-) all => the 3 baseflows computed after each pass of the filter are returned in a matrix or zoo object.

plot

logical. Indicates if the baseflow should be plotted or not. If plotted, the original x values are plotted as well.

xcol

character, representing the color to be used for ploting the streamflow time series. Only used when plot=TRUE.

bfcol

character of lenght 3, representing the color(s) to be used for ploting the baseflow time series. The first, second and third element are used to represent the baseflow after the third, second and first pass of the filter, respectively. Only used when plot=TRUE.

pch

numeric, representing the symbols used for ploting the streamflow time series (both, the original series and the baseflow). Only used when plot=TRUE.

cex

a numerical vector giving the amount by which plotting characters and symbols should be scaled relative to the default. This works as a multiple of par("cex"). See plot.default. Only used when plot=TRUE.

...

further arguments passed to or from other methods. Not used yet.

Details

Although most procedures to separate baseflow from total streamflow are based on physical reasoning, some elements of all separation techniques are subjective.

The digital filter technique (Nathan and McMahon, 1990) implemented in this function was originally proposed by Lyne and Hollick (1979) for signal analysis and processing. Although this technique has no true physical meaning, it is objective and reproducible.

The equation of the filter is:

q(t) = Beta*q(t-1) + [ (1+Beta)/2 ]*[ Q(t) - Q(t-1) ]

where q(t) is the filtered surface runoff (quick response) at the time step t (one day), Q is the original streamflow, and Beta is the filter parameter (Beta=0.925). The value Beta=0.925 was obtained by Nathan and McMahon (1990) and Arnold et al. (1995) to give realistic results when compared to manual separation techniques.

Baseflow b(t) is then computed as:

b(t) = Q(t) - q(t)

The filter can be passed over the streamflow data three times (forward, backward, and forward), depending on the user' selected estimates of baseflow from pilot studies. In general, each pass will result in less baseflow as a percentage of total streamflow.

Value

If \code{out.type="last"}

(default value), only the baseflow computed after the third pass of the filter is returned.

If \code{out.type="all"}

the 3 baseflows computed after each pass of the filter are returned in a matrix or zoo object.

Author(s)

Mauricio Zambrano-Bigiarini, mzb.devel@gmail

References

Arnold, J. G., Allen, P. M., Muttiah, R., Bernhardt, G. (1995). Automated base flow separation and recession analysis techniques. Groundwater, 33(6), 1010–1018. doi:10.1111/j.1745-6584.1995.tb00046.x.

Arnold, J. G., Allen, P. M. (1999). Automated methods for estimating baseflow and ground water recharge from streamflow records. JAWRA Journal of the American Water Resources Association, 35(2), 411–424. doi:10.1111/j.1752-1688.1999.tb03599.x.

Lyne, V., Hollick, M. (1979). Stochastic time-variable rainfall-runoff modelling. Proceedings of the Hydrology and Water Resources Symposium, Perth, 10–12 September. Institution of Engineers National Conference Publication, No. 79/10, 89–92.

Nathan, R. J., & McMahon, T. A. (1990). Evaluation of automated techniques for base flow and recession analyses. Water resources research, 26(7), 1465–1473. doi:10.1029/WR026i007p01465.

See Also

plot_pq, hydroplot, fdc, fdcu

Examples

######################
## Ex1: Computing and plotting the baseflows for the full time period
##      of a given time series of streamflows.

## First, we load the daily Q time series for the Cauquenes en 
## El Arrayan catchment, where Q, [m3/s] are stored in the sixth column.
data(Cauquenes7336001)
q <- Cauquenes7336001[, 6]

## Computing the daily baseflow for the full time period
#baseflow(q) # it can not run due to NA values in 'x'

# filling the NA values using spline interpolation
baseflow(q, na.fill="spline") 

## Computing and plotting the daily baseflow for the full time period
baseflow(q, na.fill="spline", plot=TRUE)


######################
## Ex2: Computing and plotting the daily baseflow only for a 
##      specific time period, from April to December 2000.
baseflow(q, na.fill="spline", from="2000-04-01", to="2000-12-31")


######################
## Ex3: Computing and plotting the three daily baseflows (one for each pass 
##      of the filter) only for a specific time period, from April to December
##      2000.
baseflow(q, na.fill="spline", from="2000-04-01", to="2000-12-31", 
         out.type="all", plot=TRUE)

hzambran/hydroTSM documentation built on April 29, 2024, 3:12 a.m.