Skip to content

S8/S9 per parameter set; seeded fires as GeoTIFFs - #35

Merged
eliotmcintire merged 2 commits into
developmentfrom
seeded-fires-bySet
Dec 4, 2026
Merged

eliotmcintire merged 2 commits into
developmentfrom
seeded-fires-bySet

Conversation

@eliotmcintire

Copy link
Copy Markdown
Contributor

This lets us rank the parameter sets of a fit by how well each one sizes and shapes the observed fires it was given. It also writes the scored fires as maps (observed and simulated) to share with a collaborator, so another score can be compared on exactly the same data.

Affects: in-sample scores gain per-set S8/S9 columns in wave1_bySet.csv and a new seededFires/ folder of GeoTIFFs; per-set scoring now turns on by itself when the runs hold more than one set.

Reuses: escapeResultRows(), scoreS8(), scoreS9(), escapeStats, hindcastRun(), readHindcastSetFiles(), terra's cell/row/col helpers. A fresh-agent reuse review ran before opening; its three points are applied.

Technical details

elfOfSet() (R/bySet.R) subset only simYears and simSizes, so the seeded sizes and burn maps of S8/S9 still held every set. The burn maps also recorded neither the run's set nor which fire burned a cell.

  • readHindcastLocation() records burn$runIds (new burnRunIds(), from hindcast_reps.csv) and a fire column (the burn ID) in burn$sim. readHindcastSeeded() keeps fire in sizes, and gridOf() adds crs. Cached ELF reads rebuild once.
  • elfOfSet() subsets location$seeded$sizes and location$burn by the set's runs and renumbers burn runs 1..n. Burns without runIds are dropped, never scored as the set's.
  • scoreBySet() adds S8_*/S9_* columns with _runLo/_runHi, from the ELF rows of escapeResultRows().
  • New writeSeededFires(), called in writeOutputs, writes seededFires/<ELF>/<year>_<start>/observed.tif and predicted.tif, plus fires.csv.
    • Each map holds exactly the cells S9 scores: 1 burned, 0 burnable and not burned, NA not scored (so lakes are NA).
    • predicted.tif has one layer per run, named set<k>_rep<r>, holding only the fire grown from that start.
  • bySet defaults to NA, meaning on when some ELF has more than one paramSet. FireSenseTesting's global.R passes FALSE explicitly today; it needs NA after this merges.

Tests: new tests in test-byset.R (per-set subsetting, S8/S9 ranking of a perfect set over a random one, burnRunIds()) and test-escapes.R (writeSeededFires(): values, NA off scored cells, only the start's own fire, band names, window). seedToy() moved to helper-source.R. Full suite: 0 failed, 0 skipped.

🤖 Generated with Claude Code

eliotmcintire and others added 2 commits December 3, 2026 21:46
elfOfSet() subset only simYears/simSizes, so S8/S9 could not be scored per set. The reader now keeps run ids and fire ids of the burn maps; scoreBySet() adds the S8/S9 ELF rows per set; writeSeededFires() writes the scored observed and per-run fires as GeoTIFFs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…per folder

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@eliotmcintire eliotmcintire added enhancement New feature or request backwards compatible Does not break existing behaviour labels Dec 4, 2026
@eliotmcintire
eliotmcintire merged commit 8d476e1 into development Dec 4, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backwards compatible Does not break existing behaviour enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant