Skip to content

Regional settings for prepInputsDisturbanceYear(): polygonsBefore, prescribed, harvest, unknownYear, withType - #1

Merged
eliotmcintire merged 2 commits into
developmentfrom
julie-args
Dec 2, 2026
Merged

eliotmcintire merged 2 commits into
developmentfrom
julie-args

Conversation

@eliotmcintire

Copy link
Copy Markdown
Contributor

Regions can now set how stand-age resets are decided, without changing anyone else's results. This adds the settings Julie Turner's test in the southern interior BC mountains asked for, so her caribou tool and our models can use one function.

Affects: nothing unless the new arguments are set; the defaults give the current rule.

Technical details

New arguments to prepInputsDisturbanceYear() (and disturbancesByYear() where they apply), each defaulting to the current rule:

  • polygonsBefore (default agreeFrom, 1972): before it an NFDB polygon counts even where Pre-CanLaD sees nothing. 1950 counts Pre-CanLaD alone from 1950, as in BC, where 1950-1971 NFDB outlines without Pre-CanLaD were mostly older forest by VRI age (41% fitted the fire, against 81%).
  • prescribed (default FALSE): keep prescribed burns in NFDB and NBAC. From 1985 they still count only where a Landsat record sees them.
  • harvest (default NULL, all Landsat harvest records in sources): any of "CanLaD", "NTEMS", "PreCanLaD", or a layer of harvest years that replaces them: polygons (SpatVector or sf, e.g. BC cutblocks, year in harvestField, default "HARVEST_YEAR") or a SpatRaster of years.
  • unknownYear (default 1955): the year of Pre-CanLaD's unknown-year (999) disturbances.
  • withType (default FALSE): a second layer, type (1 fire, 2 harvest; fire when both in the last year). With a 30 m rasterToMatch this is the 30 m year-and-type output Julie asked for; coarsening stays a separate step.

Julie's BC rule: sources = "all", polygonAgreement = FALSE, polygonsBefore = 1950, prescribed = TRUE, harvest = <BC cutblocks>. It is in the help page with her reasons.

Tests: new expectations for each argument in tests/testthat/test-disturbanceYear.R (70 pass, 0 fail), including that the default polygonsBefore gives the same result as before. A check of the defaults on real data (ELF 4.3, 2020 ages, against current LandR's "all" map) will follow in a comment.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Lx3DXfVqAugcusGHygZGJ3

…ribed, harvest, unknownYear, withType)

From Julie Turner's test of the LandR#301 rule in the southern interior BC
mountains, where NFDB-NBAC agreement adds back mostly unburned forest and
1950-1971 NFDB outlines without Pre-CanLaD are mostly older forest. Each
defaults to the current rule. Her BC rule: sources = "all",
polygonAgreement = FALSE, polygonsBefore = 1950, prescribed = TRUE,
harvest = BC cutblocks.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Lx3DXfVqAugcusGHygZGJ3
@eliotmcintire eliotmcintire added the enhancement New feature or request label Dec 2, 2026
@eliotmcintire
eliotmcintire merged commit 1109f11 into development Dec 2, 2026
26 of 28 checks passed
@eliotmcintire
eliotmcintire deleted the julie-args branch December 2, 2026 20:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant