From 47b5af8cdc8d322c4e32347517f2851431c2ab07 Mon Sep 17 00:00:00 2001 From: Eliot McIntire Date: Mon, 16 Nov 2026 12:30:41 -0700 Subject: [PATCH 1/3] Hindcast youngAge is the spread fit's: fireSenseUtils::youngAgeAtYear() with the data year's time since disturbance and the fires after it Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_014G18Mik3fH4z5M5CyMSUS6 --- NEWS.md | 2 + fireSense_dataPrepPredict.R | 56 ++++++++++++++++++++++- tests/testthat/test-latestVegetation.R | 61 ++++++++++++++++++++++++-- tests/testthat/test-metadata.R | 2 + 4 files changed, 117 insertions(+), 4 deletions(-) diff --git a/NEWS.md b/NEWS.md index 2fcc016..36f2a03 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,5 +1,7 @@ # fireSense_dataPrepPredict (development version) +* A hindcast of year Y built `youngAge` differently from the spread fit: it used the cohort ages and the data year's time since disturbance as they were, and did not see a fire between the data year and Y (youngAge was 2.8% of burned pixels in ELF 6.6.2 in 2010, 1.5% in the fit). It now calls `fireSenseUtils::youngAgeAtYear()`, the function `fireSense_dataPrepFit` uses: the data year's time since disturbance aged to Y, and every fire after it, read from `historicalFireRaster`, else `firePolysForAge`, else `firePolys` (new inputs `firePolysForAge` and `historicalFireRaster`, from `fireSense_dataPrepFit`; with none of them it warns by message and ages only). Hindcast spread covariates, and so their cache keys, change. Forecasts (a module simulates `cohortData`) are unchanged. Needs fireSenseUtils >= 0.2.3.9142 (the current floor). + * New parameters `replaySave` (default `FALSE`) and `replayFrom` (default `NA`): no change unless set. `replaySave = TRUE` writes, once after the first covariate build, the spread-prediction inputs that do not depend on the spread parameters to `outputPath(sim)` through SpaDES.core's `outputs()` (its `save` event): `fireSense_SpreadCovariates`, `flammableRTM`, `rasterToMatch`, `rasterToMatchELF`, `rasterToMatchLargeELF`, `studyAreaWithSpreadParams`, `nonEscapedFireSizesHa`, `ignitionFirePoints` and `firePolys` (those present), as `replay__year