fill_dvpartenv: Fill an R Environment with Streamflow Partitioning using...

Description Usage Arguments Value Author(s) See Also Examples

Description

Compute streamflow partitioning for a succession of USGS streamgage identification numbers in an R environment from fill_dvenv and populates (fills) with output from dvpart as another R environment.

Usage

1
2
fill_dvpartenv(sites=NULL, dvenv=NULL, envir=NULL, cdas=NULL,
                           fillgaps=FALSE, silent=FALSE, ...)

Arguments

sites

An optional, likely partial, list of sites within dvenv for population into envir. This option means that a massive environment of daily values can be retained in the user's space but streamflow partitioning analyses can be restricted to a smaller subset of sites. If sites=NULL, then internally all of the sites within dvenv will be processed, and this would be almost universally the way to use this function;

dvenv

An R environment previously populated by fill_dvenv;

envir

A user created (usually) R environment by new.env();

cdas

Contributing drainage areas of the sites. The vector lengths are expected to be the same. If cdas=NULL, then NAs are set with length equal to that of sites. These will become the cda argument of dvpart;

fillgaps

A logical to trigger the record gap infiller within dvpart to log-linearly prorate raw streamflow (Flow) across record gaps, then perform streamflow separation, and then pack the separated streamflows back onto the input that still retains gaps in record. This gap filler does not actually then appear to create synthetic flow record—this is a very important point;

silent

Suppress informative calls to message(); and

...

Additional arguments to pass to control akqdecay.

Value

This function is used for its side effects on the envir argument but does return a count of the sites processed by dvpart.

Author(s)

W.H. Asquith

See Also

dvpart, fill_dvenv

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
## Not run: 
# See fill_dvenv() Examples for the creation of wolf.env used here.
# Six USGS streamgages of the Wolf River in Tennessee
wolfriver <- c("07030392", "07030500", "07031650",
               "07031660", "07031700", "07031740")
wolf.env <- new.env() # the standard declaration of an environment
fill_dvenv(wolfriver, envir=wolf.env) # wolf.env now filled with six tables.

cdas <- sites_to_SpatialPointsDataFrame(wolfriver)$CDA

partwolf.env <- new.env() # the standard declaration of an environment
fill_dvpartenv(dvenv=wolf.env, envir=partwolf.env, cdas=cdas, fillgaps=FALSE)
# It is advised to pay attention to the messages about the gaps in the records
# from the above call. Only 07030392 appears to have "complete" record

# Now, let us trigger the gap filler and the messages disappear.
fill_dvpartenv(dvenv=wolf.env, envir=partwolf.env, cdas=cdas, fillgaps=TRUE)

# Now just to finish out a demonstration, serialize the data frames
wolfdf <- akq_table(partwolf.env, type="other") # and then write to
akq_write(wolfdf, file="wolf_baseflows.txt") # the file system. 
## End(Not run)

wasquith-usgs/akqdecay documentation built on Nov. 9, 2020, 1:13 p.m.