Masks ineligible pixels out of the fire-return-interval raster, tabulates pixels per FRI zone, and converts that to an expected number of fires per year per zone.
landmine_ignition_budget(
fireReturnInterval,
flammableMap,
kBest,
biggestPossibleFireSizeHa,
studyArea = NULL
)SpatRaster whose pixel values are the target fire return
interval. Zero-valued and non-flammable pixels are set to NA.
SpatRaster; pixels that are NA or 0 are non-flammable.
numeric, the fitted truncated-Pareto shape for the fire-size distribution.
numeric, the distribution's upper bound, in hectares.
optional SpatVector/sf polygon of the area the fire model can
actually burn. Supply this. See Details.
A list with:
fireReturnIntervalthe masked raster.
fireReturnIntervalsByPolygonNumericFRI per zone, ascending, with a trailing NA.
numFiresPerYearexpected fires per year per zone, named by FRI, in the same order.
The budget is (zone area / mean fire size) / FRI, so the expected area burned per year in a
zone equals area / FRI by construction – provided each fire ignites in the zone, reaches
its drawn size, and burns inside the zone.
This function creates an ordering contract that the reburn loop then consumes
positionally. Downstream, numFiresThisPeriod[.GRP] indexes the per-zone fire counts by
the group position of a polygonNumeric-keyed table, which is valid only because:
terra::freq() returns rows sorted ascending by value;
the value = NA row is appended last;
dividing by the NA return interval makes that entry's value NA, so a later
na.omit() drops it – an NA name alone would not.
Break any one and zones are handed each other's fire counts, with no error. All three are pinned by tests here, at the point where the contract is created.
studyArea is not optional in practiceLandMine masks both its rate-of-spread map and spreadProb to sim$studyArea, so a fire
ignited outside that polygon burns its own start cell and can spread no further. The fire
return interval raster is not similarly masked and routinely overhangs the polygon, so
without studyArea those pixels inflate each zone's area and therefore its expected fires
per year – and, because the start-cell pool is built from this same raster, they are drawn
as ignition points too.
On WesternAlbertaUpland this allocated 2,918 fires per year against a correct 2,015 – 31% of every year's ignitions aimed at ground the model cannot burn. One zone, 99.95% outside the polygon, was over-allocated by a factor of 2,008 (45.6 fires per year against 0.023).
Non-flammable pixels are masked out of the raster before tabulation, so the budget is a
flammable-area budget and matches how achieved FRI is measured in
landmine_fri_summary(). It also means such pixels can never be ignition locations, since
the start-cell pool is built from this same masked raster.