interpol | R Documentation |
The default simulation results of a water quality variable from DYRESM-CAEDYM are usually at irregular layer heights. This function convert it to a data frame with regular layer heights through interpolation.
interpol(layerHeights, var, min.depth, max.depth, by.value)
layerHeights |
layer heights, outputs from a DYRESM-CAEDYM model run, and can be generated with the 'ext_output' function. |
var |
simulation results of a water quality variable and can also be generated with the 'ext_output' function. |
min.depth , max.depth , by.value |
minimum and maximum layer depths within which interpolation will be conducted. by.value sets up the depth increments between two immediate layers. |
a matrix of interpolated values of the water quality variable(s).
# extract simulated temperature values from DYRESM-CAEDYM simulation file
var.values<-ext_output(dycd.output=system.file("extdata", "dysim.nc",
package = "dycdtools"),
var.extract=c("TEMP"))
for(i in seq_along(var.values)){
expres<-paste0(names(var.values)[i],"<-data.frame(var.values[[",i,"]])")
eval(parse(text=expres))
}
# interpolate temperature for depths from 0 to 13 m at increment of 0.5 m
temp.interpolated<-interpol(layerHeights = dyresmLAYER_HTS_Var,
var = dyresmTEMPTURE_Var,
min.dept = 0,
max.dept = 13,
by.value = 0.5)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.