Vignette: tmax/tmin section + map clipping + critical-look interpretation fixes (#39)#41
Merged
Merged
Conversation
Per planning-archive skill convention: - Moved completed #36 PWF from planning/active/ to planning/archive/2026-04-issue-36-edh-migration/ with a README summarising outcome and key findings for future sessions. - Replaced planning/active/ with fresh task_plan.md, findings.md, progress.md for #39 (vignette tmax/tmin + map clipping). The pre-existing planning/completed/ dir holds 21 legacy files from earlier issues; migrating those to the archive/ convention is a separate cleanup, not in scope here. Relates to #39 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Two improvements in one pass:
1. Tightened maps. All context layers (towns, lakes, rivers, streams,
highways) are now clipped to the AOI watershed group via st_intersection
in the load-context chunk; the two spatial-departure rasters are masked
to the AOI so cells outside the watershed render transparent. Replaces
the previous bbox-based view that showed features extending past the
WSG boundary.
2. New "Day-Night Asymmetry" section between Seasonal Patterns and
Precipitation/Soil Moisture. Three figures showcase the tmax/tmin
data now on STAC:
- tmax annual anomaly time series
- tmin annual anomaly time series
- diurnal range (tmax - tmin) trend
Ecological framing covers ET intensification from warmer nights,
weakened cold-air pooling and pest-overwintering implications, and
the stream thermal regime consequence for salmon-bearing watersheds.
Code-checked. Two minor doc-quality fixes from review applied:
- Per-layer st_agr("constant") instead of broad suppressWarnings()
so genuine geometry warnings still surface
- Added fig.cap to plot-tmax and plot-tmin so they're cross-referenceable
Vignette renders cleanly; HTML size 2.69 MB.
Relates to #39
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Iteration after looking at the actual KOTL trend data: - Narrative now matches the data. The textbook day-night asymmetry does not show at this watershed (diurnal range trend is -0.06 C over 75 years, well within noise). Pivoted the section to focus on the strongest signal that DOES show: summer daytime maximum has warmed 2.8 C since 1951. - Interpretation rewritten. Previous text claimed precipitation trends are weak — the data show -10.7% over 75 years at p = 0.015, a real significant decline. Soils are drying because precipitation is down AND warmer temperatures drive higher evapotranspiration; both compound. - Salmonid not salmon, with explicit note that anadromous runs to Kootenay Lake are blocked by lower-Columbia dams. Resident salmonids and First Nations reintroduction efforts are the ecological hook for summer thermal stress. Other improvements: - cd_compare now demonstrated with method="pct_change" for precipitation and soil moisture, alongside the absolute mean_diff. - kableExtra scroll_box wraps the long tables (catalog, baseline, compare, all-trends) so they don't dominate vertical layout. Added kableExtra to DESCRIPTION Suggests. - Bookdown section numbering disabled per request — section titles read as prose, not numbered chapters. - README quick-start fixed: was referencing example_aoi.gpkg (does not exist) and example_catalog.json arg (no longer needed — cd_catalog() defaults to the live S3 catalog). Replaced "Vignette coming soon" link with the live pkgdown article. Relates to #39 Relates to NewGraphEnvironment/sred#23 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.
Summary
cd_compare(method = "pct_change")for variables where percent change is more interpretable than absolute (prcp, soil_moisture).Test plan
rmarkdown::render()(HTML 2.7 MB)cd_trend()output for KOTL (slopes, p-values, % changes match)cd_compare(method = "pct_change")returns expected percent valuesdevtools::check()(will run on PR CI)What is NOT in this PR
R/function signaturesEcological framing notes
Fixes #39
Relates to #36
Relates to NewGraphEnvironment/sred-2025-2026#23
🤖 Generated with Claude Code