BSO works structurally differently
than the other models in this package. It stochastically simulates a
multitude of individuals instead of only returning a result for one
representative beetle. Additionally, it requires an hourly onset to
function. This is why the BSO-specific phenology function
bso_phenology()
exists. While it is still possible to
combine the diapause and the mortality submodels with other models, this
is not the case for the onset and development submodels.
library(barrks)
library(tidyverse)
library(terra)
# function to unify the appearance of raster plots
my_rst_plot <- function(rst) {
plot(rst, mar = c(0.2, 0.1, 2, 5),
axes = FALSE, box = TRUE, nr = 1,
cex.main = 1.9, plg = list(cex = 1.8))
}
pheno_bso <- bso_phenology('bso', barrks_data())
As bso_phenology()
returns a more detailed result than
phenology()
, a few more functions are available for
illustration. The stage diagram illustrates the share of the total
individuals at a specific developmental stage.
The flight diagram shows the relative flight activity at a specific date.
With bso_translate_phenology()
it is possible to
translate the BSO-specific phenology to a form that corresponds to the
output of phenology()
. This makes it possible to use
functions that are available to analyse phenology objects.
pheno_translated <- bso_translate_phenology(pheno_bso)
dates <- c('2015-04-15', '2015-06-15', '2015-08-15', '2015-10-15')
get_generations_rst(pheno_translated, dates) %>% my_rst_plot()