An ELF's raw weight is 1 on its own pixels and falls linearly to 0 at width metres from them (distance to the nearest pixel of the ELF). Weights are then normalised to sum to 1 at each pixel, so a pixel on a boundary between two ELFs is 50/50 and one width inside an ELF uses that ELF only.

ELFblendWeights(elfRas, template, pixelID, ids, width)

Arguments

elfRas

sim$rasterToMatchLargeELF: ELFind per pixel, as a categorical raster (or the id).

template

sim$flammableRTM; pixelID indexes its cells, so elfRas must share its grid.

pixelID

integer; the cells to weight.

ids

character; the ELFs, in the order of the rows of studyAreaWithSpreadParams.

width

numeric; metres.

Value

matrix, one row per pixelID, one column per ELF (ids), rows summing to 1 (or 0 where no ELF is within width). attr(, "key") records ids and pixelID.