Calculate the encounter and predation temperature scalar
Source:R/scale_temp_effect.R
scaled_temp_effect.RdEvaluate the temperature-dependent scalar applied to encounter and predation
processes at time t.
Arguments
- params
A
MizerParamsobject that has been prepared for therMizer, typically withupgradeTherParams().- t
Numeric time in the same units as the first dimension of
other_params(params)$ocean_temp. Iftfalls outside the supplied time series, the temperature series is recycled cyclically.
Details
The scalar is calculated separately for each realm, multiplied by the corresponding exposure and vertical migration weights, and then summed across realms. Values are set to 0 outside each species' thermal limits.
Examples
# \donttest{
params <- suppressMessages(
mizer::newMultispeciesParams(
data.frame(species = c("sp1", "sp2"), w_inf = c(100, 1000),
k_vb = c(0.3, 0.2), w_mat = c(10, 100),
beta = c(100, 100), sigma = c(2, 2)),
no_w = 16))
params <- suppressWarnings(suppressMessages(
upgradeTherParams(params,
temp_min = c(-2, 5), temp_max = c(12, 18),
ocean_temp_array = c("2000" = 5, "2001" = 6, "2002" = 7))))
# Returns a species x size matrix of temperature scalars
ste <- scaled_temp_effect(params, t = 2001)
dim(ste) # nrow = n_species, ncol = n_size_classes
#> [1] 2 16
# }