Repository navigation
Regional settings for prepInputsDisturbanceYear(): polygonsBefore, prescribed, harvest, unknownYear, withType - #1
Merged
Conversation
…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
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.
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()(anddisturbancesByYear()where they apply), each defaulting to the current rule:polygonsBefore(defaultagreeFrom, 1972): before it an NFDB polygon counts even where Pre-CanLaD sees nothing.1950counts 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(defaultFALSE): keep prescribed burns in NFDB and NBAC. From 1985 they still count only where a Landsat record sees them.harvest(defaultNULL, all Landsat harvest records insources): any of"CanLaD","NTEMS","PreCanLaD", or a layer of harvest years that replaces them: polygons (SpatVectororsf, e.g. BC cutblocks, year inharvestField, default"HARVEST_YEAR") or aSpatRasterof years.unknownYear(default 1955): the year of Pre-CanLaD's unknown-year (999) disturbances.withType(defaultFALSE): a second layer,type(1 fire, 2 harvest; fire when both in the last year). With a 30 mrasterToMatchthis 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 defaultpolygonsBeforegives 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