Skip to content

Snow-departure vignette for the Kootenay Lake region (v0.2.1)#57

Merged
NewGraphEnvironment merged 5 commits into
mainfrom
56-kootenay-lake-vignette
May 5, 2026
Merged

Snow-departure vignette for the Kootenay Lake region (v0.2.1)#57
NewGraphEnvironment merged 5 commits into
mainfrom
56-kootenay-lake-vignette

Conversation

@NewGraphEnvironment
Copy link
Copy Markdown
Owner

Summary

New vignettes/kootenay-lake.Rmd covering the southern Kootenays — KOTL + LARL + DUNC + SLOC, ~24,200 km². The "keep + expand" resolution of #49: drop the legacy single-WSG KOTL vignette (already removed in v0.1.4), replace it with a regional vignette that mirrors the FWCP Peace pattern, and use the v0.2.0 snow vars to tell the snow story for a region with a sharp east-west precipitation gradient. Closes #56.

Headline scientific findings (regional, 2015-2025 vs 1951-1980)

The Kootenay Lake Region story is meaningfully different from the FWCP Peace just to the north:

Variable Peace v0.2.0 Kootenay v0.2.1
Annual SWE -10% -23%
Annual snowfall -6% (~stable) -15%
DOY-50 freshet shift ~7 days earlier 12.6 days earlier
Annual precipitation ~stable, n.s. -7%, p = 0.02
Cumulative warming +2.0 °C +1.8 °C

Two distinct mechanisms:

  1. The Kootenays sit warmer at the relevant elevations than the Peace, so the snow-vs-rain threshold (Knowles et al. 2006: significant fraction declines occur where winter wet-day Tmin > -5 °C) is being crossed in the calendar. Total annual snowfall is dropping, not just snowmelt timing shifting. In Peace the snowpack story was "redistribution"; in the Kootenays it's "less snow and earlier melt."
  2. Precipitation itself is declining (-7%, p = 0.02). Combined with rising VPD, this is a "warmer and drier" story rather than the Peace's "warmer with mostly-stable precip."

What's in this PR

  • data-raw/example_aoi_kootenay_lake.R — builds the AOI from union of 4 WSGs via bcdata. Output inst/extdata/example_aoi_kootenay_lake.gpkg.
  • data-raw/example_context_kootenay_lake.R — bundled context layers (12 towns including Trail/Rossland/Red Mountain via LARL, plus Nelson, Castlegar, Kaslo, Nakusp, Slocan, New Denver, Argenta, Crawford Bay, Kimberley, Cranbrook). Found and fixed a latent bug in the inherited Peace pattern: Village (1) feature_type filter was missing, so smaller communities (Kaslo, Nakusp, Slocan, New Denver) were being dropped. Output inst/extdata/context_kootenay_lake.gpkg.
  • data-raw/kootenay_lake_vignette_data.R — regional + per-ecoregion + per-WSG precompute. The per-WSG list is new (peace-fwcp.Rmd doesn't have one); 4 facets is small enough to show directly. Output inst/vignette-data/kootenay_lake.rds (404 KB) + kootenay_lake_departure_tmean.tif (3 KB).
  • vignettes/kootenay-lake.Rmd — full regional vignette mirroring peace-fwcp.Rmd structure with three Kootenay-specific additions: per-WSG facet plots inside Per-Ecoregion Variation, Snowpack interpretation reflecting the snow-vs-rain threshold finding, Watershed Groups Across Ecoregions section sized for 4 WSGs (vs Peace's 16). Bibliography reuses vignettes/references.bib from Snowpack-departure methodology lit review: rag-build + 11 papers + citation map #54 — Najafi et al. 2017 covers the Columbia basin so no new lit review needed.
  • data-raw/qa_snow_validation_kootenay_lake.R — ASWS QA at 5 sites in the AOI. Notable findings:
    • 74 paired station-years; pooled correlation r = 0.90 (much better than Peace's 0.51 — ERA5-Land tracks year-to-year SWE variability tightly at high-elevation Selkirk/Purcell stations)
    • Mean bias -54% — uniformly negative across both usable sites (Moyie Mountain Purcells -40%, Redfish Creek Selkirks alpine -63%)
    • Bias is stable at Moyie (p = 0.15); marginal drift at Redfish (p = 0.07, ~12 mm/yr widening). Vignette methodology paragraph carries the caveat.
  • README — links both vignettes side-by-side.

Test plan

  • devtools::test() clean (166 PASS, 0 FAIL)
  • Vignette renders in 6.8 s; 12 csl-entries in References section
  • Both gpkg files build and validate; bbox 49°N-51°N / 118.5°W-115.5°W
  • All 12 town names found (caught + fixed the Village (1) filter)
  • Precompute produces all 15 vars × regional + 4 ecoregions + 4 WSGs
  • ASWS QA scatter is sensible
  • Post-merge: pkgdown CI green
  • Post-merge: kootenay-lake article visible on pkgdown site

Out of scope

  • Rockies / Elk Valley (BULL, ELKR) — different climatic regime, different reporting context (FWCP East Kootenay).
  • Anadromous salmon framing — Lower Columbia is dam-fragmented; vignette uses resident-salmonid framing (bull trout, Gerrard rainbow, mountain whitefish, kokanee) and freshet-shapes-channel framing.
  • Removing existing KOTL bundled polygons — they stay for the README quick-start (single-watershed small/fast example).
  • New methodology / lit review — reuses v0.2.0 stack and Snowpack-departure methodology lit review: rag-build + 11 papers + citation map #54's 11-paper bibliography.
  • Updating README quick-start to use the new 4-WSG AOI — would bloat the example. Quick-start stays on example_aoi_kotl.gpkg.

Notes

This vignette is the second of the planned three reporting climate-departure appendices in this package family (cf #47). Ports directly to a hypothetical fish_passage_kootenay_2025 reporting context, mirroring how peace-fwcp ports to fish_passage_peace_reporting_2025.

Fixes #56
Relates to NewGraphEnvironment/sred-2025-2026#23

🤖 Generated with Claude Code

NewGraphEnvironment and others added 5 commits May 4, 2026 22:05
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Mirrors the FWCP Peace pattern at smaller scale:

  data-raw/example_aoi_kootenay_lake.R - unions four BC FWA watershed
    groups (KOTL + LARL + DUNC + SLOC) via bcdata. Output is
    inst/extdata/example_aoi_kootenay_lake.gpkg, ~24,200 km^2,
    bbox 49N-51N / 118.5W-115.5W. Anchored on Kootenay Lake;
    LARL captures Trail/Rossland/Red Mountain at the south end.

  data-raw/example_context_kootenay_lake.R - bundled context layers
    via fresh (fwapg). 12 towns (Nelson, Castlegar, Trail, Rossland,
    Kaslo, Nakusp, Slocan, New Denver, Argenta, Crawford Bay,
    Kimberley, Cranbrook), 24 lakes >200 ha (vs Peace's 1000 ha
    threshold - smaller AOI supports more detail), named rivers,
    stream segments order>=5, highways, the 4 WSGs as polygons,
    4 ecoregions clipped to AOI (TOP, SBF, NCM, PTR). Geometries
    simplified at 50 m tolerance (vs Peace's 200 m). Output
    inst/extdata/context_kootenay_lake.gpkg is 2.2 MB.

Existing KOTL bundled assets (example_aoi_kotl.gpkg etc.) stay in
place for the README quick-start - new AOI lives alongside under
the kootenay_lake_* namespace, doesn't replace.

Caught and fixed an inherited filter bug: Kaslo / Nakusp / Slocan /
New Denver are stored in the GNS as feature_type 'Village (1)' not
'Village'. Added 'Village (1)' to the SELECT filter. The Peace
script's town list happened to not have any feature_type=='Village'
entries so the bug was latent.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Phase 2 - data-raw/kootenay_lake_vignette_data.R precomputes the
heavy data via cd_extract -> cd_baseline -> cd_anomaly -> cd_trend ->
cd_compare for the regional + per-ecoregion + per-WSG breakdowns,
plus the spatial-pattern tmean departure raster, plus the WSG x
ecoregion overlap (4 WSGs x 4 ecoregions = 12 non-zero cells, small
enough to inline into the rds). Output: inst/vignette-data/
kootenay_lake.rds (404 KB) + kootenay_lake_departure_tmean.tif
(3 KB). Mirrors data-raw/peace_fwcp_vignette_data.R with the per-WSG
list added.

Phase 3 - vignettes/kootenay-lake.Rmd cloned from peace-fwcp.Rmd
and adapted to the Kootenay context. Section structure mirrors the
Peace vignette: Area of Interest, Connect to the Data Catalog,
Extract Climate Time Series, Trends, Daytime Highs and Overnight
Lows, Snowpack (seasonal table + 4 annual time-series + per-WSG
facets - new), Recent vs Pre-warming, Spatial Pattern,
Per-Ecoregion Variation (with Snow per ecoregion + Snow per
watershed group sub-sections), Watershed Groups Across Ecoregions,
Interpretation, References. Bibliography reuses
vignettes/references.bib (11 entries from #54).

Headline numbers (regional, 2015-2025 vs 1951-1980 baseline):

  Annual SWE       -23%   (Peace was -10%)
  Annual snowfall  -15%   (Peace was -6%)
  Annual snowmelt  -16%   (Peace was -7%)
  DOY-50 shift     -12.6 days earlier
  Annual prcp      -7%    SIGNIFICANT (Peace was roughly stable)

The Kootenay story differs sharply from Peace - in Peace, snow was
"redistributed" (less summer, more spring melt) on flat snowfall;
in the Kootenays, total annual snowfall is also down, consistent
with Knowles 2006's threshold finding that significant
snowfall-fraction declines occur where winter wet-day Tmin > -5C
(Kootenays sit in that regime; Peace doesn't). And precipitation
itself is declining here, not flat - making this a "warmer AND
drier" story rather than the Peace's "warmer with mostly-stable
precipitation."

Phase 4 - Watershed Groups Across Ecoregions section adapted for
the 4-WSG AOI. WSG x ecoregion overlap table built from the rds
inline (no separate commentary CSV needed - 4 rows is small).
KOTL/DUNC/SLOC are essentially within Northern Columbia Mountains;
LARL is the only WSG that meaningfully splits across two ecoregions
(NCM + Selkirk-Bitterroot Foothills).

Render: 6.8 s. 12 csl-entries in References. 166 tests pass.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
74 paired station-years across 3 usable Kootenay ASWS sites
(Moyie Mountain 1835m Purcells, Redfish Creek 2100m Selkirks
alpine, Farron 1230m insufficient years). Pooled r=0.90 (vs
Peace's 0.51 — much better correlation). Mean bias -54% (vs
Peace's -36% — sharper). Bias stable at Moyie (p=0.15);
marginal drift at Redfish (p=0.07, ~12 mm/yr widening).

Vignette methodology paragraph updated with the actual Kootenay
numbers replacing the generic 'should carry over' placeholder.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
pkgdown auto-discovers vignettes from vignettes/ so no _pkgdown.yml
change needed. Render order will follow file alphabetical
(kootenay-lake before peace-fwcp); leaving as-is for now —
explicit articles ordering can be added later if motivated.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@NewGraphEnvironment NewGraphEnvironment merged commit a86c387 into main May 5, 2026
1 check passed
@NewGraphEnvironment NewGraphEnvironment deleted the 56-kootenay-lake-vignette branch May 5, 2026 05:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Snow-departure vignette for the Kootenay Lake region (KOTL + LARL + DUNC + SLOC)

1 participant