Skip to content

Ledger row records each fuel's median non-zero value and sd - #144

Merged
eliotmcintire merged 4 commits into
developmentfrom
spreadFuelSummary
Nov 23, 2026
Merged

eliotmcintire merged 4 commits into
developmentfrom
spreadFuelSummary

Conversation

@eliotmcintire

@eliotmcintire eliotmcintire commented Nov 23, 2026 •

Copy link
Copy Markdown
Collaborator

The spread fit now also saves, for each fuel, how much of it is typically present where it occurs. With that, the ELF map can show how much each fuel changes the chance of fire spread, in the same units for every fuel.

Affects: new spread-fit ledger rows get two extra columns for fits that have fuel terms. Existing columns, fits and results are unchanged, and older rows still read.

Technical details

Defect: the ledger row (R/spreadFitLedgerRow.R) kept the covariate centres (covCentre_spread) but nothing about the size of the fuel covariates, so no one could turn a fuel coefficient into an effect from the row alone.

Fix: after covCentre_spread is computed (fireSense_spreadFit.R, spreadFitPrep), fireSenseUtils::spreadCovStats() gives the centres and the median non-zero value and sd of each fuel covariate, in one pass, (dom_agb_*, sec_agb_*, treedWetland_agb), on the same scale as the centres. They are new outputs covMedianNonZero_spread and covSD_spread and are written to the row as covMedianNonZero_spread and covSD_spread, exactly as the centres are (only when not NULL, so a fit with no fuel term writes none). reqdPkgs floor is fireSenseUtils >= 0.2.3.9191, the version after fireSenseUtils#260 merges (to be confirmed when it merges). Old rows without the columns read as before (an unrelated column is already NA when rows are bound, as covCentre_spread is for 7 of the 50 current rows).

Reuses: fireSenseUtils::spreadCovStats() (new in #260, built on the loop of spreadCovMeans() that spreadCovCentre() uses), the covCentre_spread output/column pattern, mec and mod$covsX1000 as for the centre; new: no function in this module (the calculation lives in fireSenseUtils, where the median and sd needed one place with the centre's scale).

Tests (test-fuelSummary.R, 3 new; test-metadata.R updated): the stored median and sd equal a hand calculation on the toy data (fuel cleared on young pixels, as in the fit), the row carries both and fireSenseUtils::spreadFuelEffect() reads it, a fit with no fuel term writes none, the outputs are declared. Module suite via convertToPackage() + test_local() (fireSenseUtils from the #260 branch, scratch library): branch 317 tests, 0 failed, 0 errors, 0 skipped (1484 expectations); base with the same new tests: 3 tests fail (7 expectations), the rest pass.

Version note: fireSenseUtils#261 is merged and development is 0.2.3.9190, so #260 becomes 0.2.3.9191 when merged. The floors in fireSense_spreadFit#144 and fireSense_spreadPredict#52 name 9191 as a placeholder until then.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Lx3DXhXsFis2pbqBTh2PPh

… (covMedianNonZero_spread, covSD_spread)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Lx3DXhXsFis2pbqBTh2PPh
@eliotmcintire eliotmcintire added the enhancement New feature or request label Nov 23, 2026
eliotmcintire and others added 3 commits November 22, 2026 20:34
…ovSD_spread

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Lx3DXhXsFis2pbqBTh2PPh
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Lx3DXhXsFis2pbqBTh2PPh
… is merged and bumped)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Lx3DXhXsFis2pbqBTh2PPh
@eliotmcintire
eliotmcintire merged commit 9219173 into development Nov 23, 2026
9 checks passed
@eliotmcintire
eliotmcintire deleted the spreadFuelSummary branch November 23, 2026 04:46
eliotmcintire added a commit that referenced this pull request Nov 23, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Lx3DXhXsFis2pbqBTh2PPh
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