dynatop: R6 Class for Dynamic TOPMODEL

Description Methods

Description

R6 Class for Dynamic TOPMODEL

R6 Class for Dynamic TOPMODEL

Methods

Public methods


Method new()

Creates a dynatop class object from the a list based model description as generated by dynatopGIS.

Usage
dynatop$new(model, use_states = FALSE, verbose = FALSE, delta = 1e-13)
Arguments
model

a dynamic TOPMODEL list object

use_states

logical if states should be imported

verbose

if set prints out further information

delta

error term in checking redistribution sums

drop_map

logical if the map should be dropped

Details

This function makes some basic consistency checks on a list representing a dynamic TOPMODEL model. The checks performed and basic 'sanity' checks. They do not check for the logic of the parameter values nor the consistncy of states and parameters. Sums of the redistribution matrices are checked to be in the range 1 +/- delta.

Returns

invisible(self) suitable for chaining


Method add_data()

Adds observed data to a dynatop object

Usage
dynatop$add_data(obs_data)
Arguments
obs_data

an xts object of observed data

Details

This function makes some basic consistency checks on the observations to ensure they have uniform timestep and all required series are present.

Returns

invisible(self) suitable for chaining


Method clear_data()

Clears all forcing and simulation data except current states

Usage
dynatop$clear_data()
Returns

invisible(self) suitable for chaining


Method initialise()

Initialises a dynatop object in the simpliest way possible.

Usage
dynatop$initialise(initial_recharge)
Arguments
initial_recharge

Initial recharge to the saturated zone in steady state in m/s

Returns

invisible(self) suitable for chaining


Method sim_hillslope()

Simulate the hillslope output of a dynatop object

Usage
dynatop$sim_hillslope(keep_states = NULL, sub_step = NULL)
Arguments
keep_states

a vector of POSIXct objects (e.g. from xts) giving the time stamp at which the states should be kept

sub_step

simulation timestep in seconds, default value of NULL results in data time step

Details

Both saving the states at every timestep and keeping the mass balance can generate very large data sets!!


Method sim_channel()

Simulate the channel output of a dynatop object

Usage
dynatop$sim_channel()
Returns

invisible(self) for chaining


Method sim()

Simulate the hillslope and channel componets of a dynatop object

Usage
dynatop$sim(keep_states = NULL, sub_step = NULL)
Arguments
keep_states

a vector of POSIXct objects (e.g. from xts) giving the time stamp at which the states should be kept

sub_step

simulation timestep in seconds, default value of NULL results in data time step

mass_check

Flag indicating is a record of mass balance errors shuld be kept

use_R

shoudl the R version of the simulation code be used (default FALSE)

Details

Calls the sim_hillslope and sim_channel in sequence. Both saving the states at every timestep and keeping the mass balance can generate very large data sets!!

Returns

invisible(self) for chaining


Method get_channel_inflow()

Return channel inflow as an xts series

Usage
dynatop$get_channel_inflow(total = FALSE)
Arguments
total

logical if plot total inflow is to be plotted


Method plot_channel_inflow()

Plot the channel inflow

Usage
dynatop$plot_channel_inflow(total = FALSE)
Arguments
total

logical if plot total inflow is to be plotted


Method get_gauge_flow()

Return flow at the gauges as an xts series

Usage
dynatop$get_gauge_flow(gauge = colnames(private$time_series$gauge_flow))
Arguments
gauge

names of gauges to return (default is all gauges)


Method plot_gauge_flow()

Get the flow at gauges

Usage
dynatop$plot_gauge_flow(gauge = names(private$time_series$gauge_flow))
Arguments
gauge

names of gauges to return (default is all gauges)


Method get_obs_data()

Get the observed data

Usage
dynatop$get_obs_data()

Method get_model()

Return the model

Usage
dynatop$get_model()

Method get_mass_errors()

Return the model

Usage
dynatop$get_mass_errors()

Method get_states()

Return states

Usage
dynatop$get_states(record = FALSE)
Arguments
record

logical TRUE if the record should be returned. Otherwise surrent states returned


Method plot_state()

Plot a current state of the system

Usage
dynatop$plot_state(state, add_channel = TRUE)
Arguments
state

the name of the state to be plotted

add_channel

Logical indicating if the channel should be added to the plot


Method clone()

The objects of this class are cloneable with this method.

Usage
dynatop$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.


waternumbers/dynatop documentation built on April 8, 2021, 5:55 a.m.