Title: | Utilities for Mountain Pine Beetle Simulation Modelling |
---|---|
Description: | Utilities for mountain pine beetle (MPB) simulation modelling. |
Authors: | Eliot J B McIntire [aut, cre] , Alex M Chubaty [aut] |
Maintainer: | Eliot J B McIntire <[email protected]> |
License: | GPL-3 |
Version: | 0.1.3.9002 |
Built: | 2024-09-15 06:02:58 UTC |
Source: | https://github.com/PredictiveEcology/mpbutils |
This is for converting forecasted abundance stacks in a list of simList objects into a list of binary stacks (presence/absence)
This is for converting forecasted abundance stack in a simList object into a binary stack (presence/absence)
The mask will occur with values of NA or values of 0.
binaryStacks( sims, thresholdAttackTreesMinDetectable = 1.4, thresholdPineProportion = 0.3, stackName = "predictedStack", propPineRasName = "propPineRas" ) binaryStack( stk, propPineRas, thresholdAttackTreesMinDetectable = 1.4, thresholdPineProportion = 0.3 ) maskWPine(ras, propPineRas, thresholdPineProportion)
binaryStacks( sims, thresholdAttackTreesMinDetectable = 1.4, thresholdPineProportion = 0.3, stackName = "predictedStack", propPineRasName = "propPineRas" ) binaryStack( stk, propPineRas, thresholdAttackTreesMinDetectable = 1.4, thresholdPineProportion = 0.3 ) maskWPine(ras, propPineRas, thresholdPineProportion)
sims |
a list of simLists |
thresholdAttackTreesMinDetectable |
A scalar that delineates presence from an absense. Default is 1.4, which was derived from initial efforts to find a single value that works in all years. |
thresholdPineProportion |
A scalar. Values on the propPineRas that are below this threshold will be masked out, i.e., set to NA. |
stackName |
Character string. The name of the stack inside the simLists to use |
propPineRasName |
Character string. The name of the RasterLayer inside the simLists to use for proportion Pine. |
stk |
A stack of abundance |
propPineRas |
A RasterLayer that has values between 0 and 1, representing the proportion of pine cover in the pixel. |
ras |
A RasterLayer of abundance |
Cleans the predicted raster
cleanUpPredictionRas( rasLog, propPineRas, thresholdAttackTreesMinDetectable = 1.4, thresholdPineProportion = 0.3 )
cleanUpPredictionRas( rasLog, propPineRas, thresholdAttackTreesMinDetectable = 1.4, thresholdPineProportion = 0.3 )
rasLog |
A RasterLayer of predicted mass attack, on a log scale |
propPineRas |
A RasterLayer of proportion pine cover. |
thresholdAttackTreesMinDetectable |
A scalar. This will have come from
an |
thresholdPineProportion |
A scalar. The proportion of pine |
years |
A scalar indicating how many years are included in the |
A RasterLayer
with ever
Calculate cumulative sum of a stack, with optional log
cumulativeMap(stk, log = TRUE)
cumulativeMap(stk, log = TRUE)
stk |
a RasterStack |
log |
Logical. Will take |
From Cooke and Carroll (2017).
growthFunction(x, s, dataset, growthData)
growthFunction(x, s, dataset, growthData)
x |
beetle density |
s |
climate suitability factor |
dataset |
dataset name used for fitting:
one of |
growthData |
MPB red top growth data with which to fit. |
This is a 2-dimensional t-distribution that can be used for dispersal of natural entities. It has many characteristics (see Clark et al 1999)
kernel_twoDT(dist, mu, p) kernel_twoDT_mean(mu, m)
kernel_twoDT(dist, mu, p) kernel_twoDT_mean(mu, m)
dist |
A vector of distances |
mu |
The first parameter of the 2Dt kernel. This represents about 0.9 of the mean dispersal distance |
p |
The second parameter of the 2Dt kernel. This changes the shape. |
A vector of probabilities
Clark, J. S., M. Silman, R. Kern, E. Macklin, and J. HilleRisLambers. 1999. Seed dispersal near and far: patterns across temperate and tropical forests. Ecology 80:1475–1494.
Create study area based o ecoregion selection
mpbStudyArea(ecoregions = c(112, 120, 122, 124, 126), targetCRS, cPath, dPath)
mpbStudyArea(ecoregions = c(112, 120, 122, 124, 126), targetCRS, cPath, dPath)
ecoregions |
numeric vector indicating which ecoregions to be included as part of the study area. Derived from http://sis.agr.gc.ca/cansis/nsdb/ecostrat/region/ecoregion_shp.zip. |
targetCRS |
target CRS string to use for reprojecting ecodistrict (study area) polygons. |
cPath |
cache path |
dPath |
destination path |
an sf
object
From Cooke & Carroll (2017).
xt(xtminus1, cs, dataset, massAttacksMap, growthData)
xt(xtminus1, cs, dataset, massAttacksMap, growthData)
xtminus1 |
previous year's attack density |
cs |
climate suitability factor |
dataset |
dataset name used for fitting:
one of |
massAttacksMap |
|
growthData |
MPB red top growth data with which to fit. |