Repository navigation
Option for fits to use the same fire-and-harvest ages as the simulation, including youngAge - #121
Merged
Merged
Conversation
…borealDataPrep With Biomass_borealDataPrep ageDisturbanceSources = "NFDB+NBAC+CanLaD", the per-year standAgeMaps reset age with LandR::prepInputsDisturbanceYear(), and a new disturbancePixelsByYear (fire and harvest by year) replaces firePolysForAge and historicalFireRaster for time since disturbance (youngAge). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Lx3DXfVqAugcusGHygZGJ3
…default "NFDB") Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Lx3DXfVqAugcusGHygZGJ3
…l" uses now Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Lx3DXfVqAugcusGHygZGJ3
… Biomass_borealDataPrep's A hindcast runs without Biomass_borealDataPrep, and simInit drops the parameters of a module that is not loaded, so reading params(sim)$Biomass_borealDataPrep gave a hindcast the default and a youngAge unlike the fit's. paramCheckOtherMods() stops when both modules are loaded and differ; set it in .globals. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Lx3DXfVqAugcusGHygZGJ3
eliotmcintire
added a commit
that referenced
this pull request
Nov 30, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Lx3DXhXsFis2pbqBTh2PPh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The vegetation that fire models are fitted on, and their "young stand" covariate, now come from the same fire and harvest history as the simulation's stand ages. Harvested stands count as young, and fire perimeters that didn't burn a pixel no longer make it young. This is opt in for now (
ageDisturbanceSources = "all", set in.globalsfor this module and Biomass_borealDataPrep); fits made with it differ from existing fits.Affects: fit inputs (each data year's stand ages,
youngAgeand non-forest time since disturbance) only withageDisturbanceSources = "all"; nothing changes with the default"NFDB".Depends-on: PredictiveEcology/LandR#299
Depends-on: PredictiveEcology/Biomass_borealDataPrep#159
Technical details
New parameter
ageDisturbanceSources(default"NFDB"), the same as Biomass_borealDataPrep's..inputObjectsreads it withSpaDES.core::paramCheckOtherMods(ifSetButDifferent = "error"), so the two must match when both are loaded. It is this module's own parameter because hindcasts run without Biomass_borealDataPrep, andsimInit()drops the parameters of a module that isn't loaded (checked:params(sim)$Biomass_borealDataPrepisNULLthen)..inputObjects: each data year'sstandAgeMapselement passesfirePerimeters = LandR::prepInputsDisturbanceYear(latestYear = dy)toprepInputsStandAgeMap(). That changes the nested Biomass_borealDataPrepcohortDatas.New input
disturbancePixelsByYear:prepInputsDisturbanceYear(byYear = TRUE)onrasterToMatchup tomax(fireYears).allFirePixelsByYear()returnsdisturbancePixelsByYearwhen present. Otherwise it useshistoricalFireRaster, thenfirePolysForAge, as before. This coversyoungAgein spread and ignition covariates.dataPrepBuild:makeTSD()gets the last disturbance year at each data year (disturbanceYearRaster()).LandR::lastDisturbanceYearandLandR::disturbancesByYearare in the cache keys.With
"NFDB", or without Biomass_borealDataPrep, nothing changes.Tests: new
test-disturbanceAgeSources.R(8 pass).test-metadata.R(15),test-annualYoungAge.R(21) andtest-dataPrepBuild.R(12) pass.Separate from #120 (start-year ages).
🤖 Generated with Claude Code
https://claude.ai/code/session_01Lx3DXfVqAugcusGHygZGJ3