PlotBasinSummary {HYPEtools} | R Documentation |
Plot a summary of model results for a single sub-basin
Description
Plot a standard suite of plots summarizing properties of a sub-basin including upstream area and model performance for discharge and concentrations of nutrients, sediment, and tracers.
Usage
PlotBasinSummary(
x,
filename,
driver = c("default", "pdf", "png", "screen"),
panels = 1,
gd = NULL,
bd = NULL,
gcl = NULL,
psd = NULL,
subid = NULL,
desc = NULL,
timestep = attr(x, "timestep"),
hype.vars = "all",
from = 1,
to = nrow(x),
log = FALSE,
xscale = "gauss",
start.mon = 10,
name = "",
ylab.t1 = "Conc."
)
Arguments
x |
Data frame, with column-wise daily time series of HYPE variables. Date-times in
|
filename |
String, file name for plotting to file device, see argument |
driver |
String, device driver name, one of |
panels |
Integer, either |
gd |
A data frame, containing 'SUBID', 'MAINDOWN', and 'AREA' columns, e.g. an imported 'GeoData.txt' file. Only needed with bar chart panels, see Details. |
bd |
A data frame, containing 'BRANCHID' and 'SOURCEID' columns, e.g. an imported 'BranchData.txt' file. Optional argument. Only needed with bar chart panels, see Details. |
gcl |
Data frame containing columns with SLCs and corresponding land use and soil class IDs, typically a 'GeoClass.txt'
file imported with |
psd |
A data frame with HYPE point source specifications, typically a 'PointSourceData.txt' file imported with
|
subid |
Integer, SUBID of sub-basin for which results are plotted. If |
desc |
List for use with |
timestep |
Character string, timestep of |
hype.vars |
Either a keyword string or a character vector of HYPE output variables. User-specified selection of HYPE variables
to plot. Default ( |
from , to |
Integer or date string of format \
interpreted as row indices of |
log |
Logical, log scaling discharge and concentrations. |
xscale |
Character string, keyword for x-axis scaling. Either |
start.mon |
Integer between 1 and 12, starting month of the hydrological year. For regime plots, see also
|
name |
Character or expression string. Site name to plot besides bar chart panels. Only relevant with |
ylab.t1 |
String or |
Details
PlotBasinSummary
plots a multi-panel plot with a number of plots to evaluate model properties and performances for a
chosen sub-basin. Performance plots include discharge, HYPE-modeled nutrient species for nitrogen (total, inorganic, organic)
and phosphorus (total, particulate, soluble), and HYPE modeled suspended and total sediment concentrations.
Plotted panels show:
Summarized catchment characteristics as bar charts: Upstream-averaged land use, soil, and crop group fractions; modeled nutrient loads in sub-basin outlet, and summed upstream gross loads from point sources and rural households (if necessary variables available, omitted otherwise).
Goodness-of-fit measures for discharge and concentrations: KGE (Kling-Gupta Efficiency), NSE (Nash-Sutcliffe Efficiency), PBIAS (Percentage Bias, aka relative error), MAE (Mean Absolute Error), r (Pearson product-moment correlation coefficient), VE (Volumetric Efficiency).
Simulation-observation relationships for discharge and concentrations: Simulated and observed concentration-discharge relationships, relationship between observed and simulated nutrient, sediment, and tracer concentrations.
Duration curves for flow and concentrations: Pairwise simulated and observed curves.
Annual regimes for flow and concentrations: Pairwise simulated and observed regime plots at monthly aggregation, with number of observations for concentration regimes.
Corresponding plots for IN/TN and SP/TP ratios.
Per default, the function plots from available model variables in an imported HYPE basin output file, and missing variables will be
automatically omitted. Variable selection can be additionally fine-tuned using argument hype.vars
.
Argument panels
allows to choose if bar chart panels should be plotted. This can be time-consuming for sites with many upstream
sub-basins and might not necessary e.g. during calibration. If 1
(default), all panels are plotted. If set to 2
, bar
charts will be excluded. If 3
, only bar charts will be plotted. Arguments gd
, bd
, gcl
, psd
, subid
,
and desc
are only needed for bar chart plotting.
Below a complete list of HYPE variables known to the function in HYPE info.txt format, ready to copy-paste into an info.txt file. For a detailed description of the variables, see the HYPE online documentation.
basinoutput variable cout rout ccin rein ccon reon cctn retn ccsp resp ccpp repp cctp retp ctnl ctpl ccss ress ccts rets cct1 ret1
#' Device dimensions are hard-coded to a width of 13 inches and height depending on the number of plotted time series. When plotting
to a screen device, a maximum height of 10 inches is enforced in order to prevent automatic resizing with slow redrawing.
PlotBasinOutput
throws a warning if the plot height exceeds 10 inches, which can lead to overlapping plot elements. On screens with
less than 10 inch screen height, redrawing is inhibited, which can lead to an empty plot. The recommended solution for both effects
is to plot to pdf or png file devices instead.
Value
Returns a multi-panel plot in a new graphics device.
See Also
PlotBasinOutput
, BarplotUpstreamClasses
, PlotSimObsRegime
, PlotAnnualRegime
,
PlotDurationCurve
, ReadBasinOutput
Examples
# Source data, HYPE basin output with a number of result variables
te1 <- ReadBasinOutput(filename = system.file("demo_model", "results", "0003587.txt",
package = "HYPEtools"))
te2 <- ReadGeoData(filename = system.file("demo_model", "GeoData.txt", package = "HYPEtools"))
## Not run:
# Plot basin summary for discharge on screen device
PlotBasinSummary(x = te1, gd = te2, driver = "screen", panels = 2)
## End(Not run)