Skip to content

Fire raster holds the latest fire at or before dataYear - #141

Merged
eliotmcintire merged 2 commits into
developmentfrom
fix/fire-year-latestYear
Oct 15, 2026
Merged

eliotmcintire merged 2 commits into
developmentfrom
fix/fire-year-latestYear

Conversation

@eliotmcintire

@eliotmcintire eliotmcintire commented Oct 15, 2026 •

Copy link
Copy Markdown
Collaborator

Stand ages inside old burns were wrong where a pixel burned twice: the later fire hid the earlier one, so for an earlier vegetation year the pixel kept its satellite age. The module now builds its fire map for the chosen vegetation year only.

Affects: stand age (and biomass re-estimated from it) inside reburned fire perimeters, for vegetation years earlier than the latest fire.

Depends-on: PredictiveEcology/LandR#275

Technical details

Defect: Biomass_borealDataPrep.R (the prepInputsFireYear() call in .inputObjects, ~line 1810) rasterized all fires with fun = max, so a pixel burned in 1980 and 2015 held 2015 and replaceAgeInFires(startTime = dataYear) skipped it for dataYear 1990. The same raster is used for the young-biomass override (~line 1415, non-NA test only), which was missing the same pixels and is now right without other changes; earliestFireYear is untouched.

Fix: pass latestYear = P(sim)$dataYear; reqdPkgs floor is LandR (>= 1.2.0.9057), the version LandR development (now 1.2.0.9056) will have once LandR#275 is merged and bumped. A firePerimeters supplied by another module is used as given.

Test: a static check that the fire call passes latestYear = P(sim)$dataYear (fails on development, passes on the branch); the raster behaviour is tested in LandR#275. Module suite (convertToPackage() + test_local(), scratch library phase4/lib with LandR from #275 installed as 1.2.0.9057): development 127 passed, 3 errors; branch 130 passed, 3 errors. The 3 errors are in test-estimateCoverModel.R (Copy not found) on both: the local harness does not attach reproducible, CI does, so they are not a module defect.

🤖 Generated with Claude Code

…275)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@eliotmcintire eliotmcintire added bug Something isn't working backwards compatible Existing code and results keep working unchanged labels Oct 15, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@eliotmcintire
eliotmcintire merged commit f4cfd73 into development Oct 15, 2026
6 checks passed
@eliotmcintire
eliotmcintire deleted the fix/fire-year-latestYear branch October 15, 2026 23:49
eliotmcintire added a commit that referenced this pull request Oct 16, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014G18Mik3fH4z5M5CyMSUS6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backwards compatible Existing code and results keep working unchanged bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant