| dynatop | R Documentation |
R6 Class for Dynamic TOPMODEL
R6 Class for Dynamic TOPMODEL
new()Creates a dynatop class object from the a list based model description as generated by dynatopGIS.
dynatop$new(model, map = NULL, use_states = FALSE, delta = 1e-13)
modela dynamic TOPMODEL list object
mapfile name of the map layers for the model
use_stateslogical if states should be imported
deltaerror term in checking redistribution sums
drop_maplogical if the map should be dropped
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 consistency of states and parameters. Sums of the redistribution matrices are checked to be in the range 1 +/- delta.
invisible(self) suitable for chaining
add_data()Adds observed data to a dynatop object
dynatop$add_data(obs_data)
obs_dataan xts object of observed data
This function makes some basic consistency checks on the observations to ensure they have uniform timestep and all required series are present.
invisible(self) suitable for chaining
clear_data()Clears all forcing and simulation data except current states
dynatop$clear_data()
invisible(self) suitable for chaining
initialise()Initialises a dynatop object in the simplest way possible.
dynatop$initialise( vtol = sqrt(.Machine$double.eps), ftol = sqrt(.Machine$double.eps), max_it = 1000 )
vtoltolerance for the solution for the saturated zone storage (as volume)
ftoltolerance for the solution of the saturated zone storage (as difference of function from 0)
max_itmaximum number of iterations to use in the solution of the saturated zone
invisible(self) suitable for chaining
sim()Simulate the hillslope and channel components of a dynatop object
dynatop$sim( output_defn, keep_states = NULL, sub_step = NULL, vtol = 0.001, ftol = sqrt(.Machine$double.eps), max_it = 1000 )
output_defna description of the output series
keep_statesa vector of POSIXct objects (e.g. from xts) giving the time stamp at which the states should be kept
sub_stepsimulation timestep in seconds, default value of NULL results in data time step
vtoltolerance on width of bounds in the numeric search for surface and saturated zone solutions (as volume)
ftol- not currently used
max_itmaximum number of iterations to use in the solution of the saturated zone
Saving the states at every timestep and keeping the mass balance can generate very large data sets!!
invisible(self) for chaining
get_output()Return channel inflow as an xts series or list of xts series
dynatop$get_output(name = colnames(private$time_series$output))
nameone or more output series to return
plot_output()Plot the channel inflow
dynatop$plot_output(name = colnames(private$time_series$output))
nameof series to plot
get_obs_data()Get the observed data
dynatop$get_obs_data()
get_model()Return the model
dynatop$get_model()
get_mass_errors()Return the model
dynatop$get_mass_errors()
get_states()Return states
dynatop$get_states(record = FALSE)
recordlogical TRUE if the record should be returned. Otherwise the current states returned
plot_state()Plot a current state of the system
dynatop$plot_state(state = c("s_sf", "s_rz", "s_uz", "s_sz"))statethe name of the state to be plotted
clone()The objects of this class are cloneable with this method.
dynatop$clone(deep = FALSE)
deepWhether to make a deep clone.
## the vignettes contains further details of the method calls.
data("Swindale") ## example data
mdl <- Swindale$model
mdl$map <- system.file("extdata","Swindale.tif",package="dynatop",mustWork=TRUE)
ctch_mdl <- dynatop$new(mdl$hru,map=mdl$map) ## create with model
ctch_mdl$add_data(Swindale$obs) ## add observations
ctch_mdl$initialise() ## initialise model
ctch_mdl$sim(Swindale$model$output_flux) ## simulate model
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.