R6 Class for Dynamic TOPMODEL
dynatop$new()Creates a dynatop class object from the a list based model description as generated by dynatopGIS.
dynatop$new(geo, param, delta = 1e-13)geoa data.frame describing the HRUs geography or path to a gpkg file that can read to create one
parama data.frame describing the parameters for each HRU class or path to a jsonfile that can read to create one
deltaerror allowed in checking redistribution sums
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.
dynatop$initialise()Initialises a dynatop object in the simplest way possible.
dynatop$sim()Simulate the dynatop model
dynatop$sim(
obs_data,
output_defn,
keep_states = NULL,
output_dir = NULL,
sub_step = NULL,
n_thread = 1
)obs_datadata.frame of observations
output_defndefinition of the outputs from the model
keep_statesa vector of POSIXct objects (e.g. from xts) giving the time stamp at which the states should be kept
output_dirthe directory to write output to
sub_stepsimulation timestep in seconds, default value of NULL results in data time step
n_threadnumber of parallel threads to use in execution
## the vignettes contains further details of the method calls.
mdlFile <- system.file("extdata","mdl","test_mdl.gpkg",package="dynatop",mustWork=TRUE)
paramFile <- system.file("extdata","mdl","test_mdl_param.json",package="dynatop",mustWork=TRUE)
obsFile <- system.file("extdata","mdl","SwindaleObs.csv",package="dynatop",mustWork=TRUE)
## create and initialise model
dyn <- dynatop$new(mdlFile,paramFile)
dyn$initialise() ## this initialisation isn't good - see the vignette
## define an output definition
defn <- data.frame(name="outlet",hru=1,scale=1,flux="q_sf")
## read in observed
obs <- read_obs(obsFile)
## simulate
# \donttest{
out <- dyn$sim(obs,defn)
#> Number of threads 1
# }