Heat-grid anomaly toggle: "vs 1991–2020 normal"#1
Open
Ashwask wants to merge 1 commit into
Open
Conversation
Adds a "vs normal" mode to the 0.25° heat grid so each cell answers "is this hotter or cooler than normal for this month?" — not just the absolute reading. Inspired by anomaly-vs-baseline framing on climate.thisindianlife.today. Frontend (index.html): - Absolute °C / vs normal toggle on the Live Map sidebar - Diverging blue→red anomaly scale (ColorBrewer RdBu) + swappable legend - renderGridLayer(mode) recolors the grid; popups show today's temp, the cell's monthly normal, and the signed anomaly - Loads india_grid_normals.json; degrades gracefully (toggle hidden) when absent Data builder (build_grid_normals.py): - Static 1991–2020 monthly climatology per grid cell from Open-Meteo's archive (ERA5). Archive calls are weighted ~50 units/point, so the free tier can't fetch all 4,647 cells directly — fetches a coarse 1.0° lattice and IDW-interpolates to the 0.25° grid. - Waits out hourly/daily rate limits, resumable via JSONL partial. - Run once; not part of the 3-hourly refresh cron. Note: india_grid_normals.json is generated separately and lands in a follow-up commit on this branch once the rate-limited fetch completes. Docs: README (feature, builder, static data file, run step) + NOTICE (ERA5). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
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.
What
Adds an Absolute °C / vs normal toggle to the 0.25° heat grid. In vs normal mode each cell is colored by its anomaly — today's temperature minus the cell's 1991–2020 monthly normal (WMO-standard 30-year baseline) — on a diverging blue→red scale (blue = cooler than normal, red = hotter).
Why
We show absolute temperature everywhere, so a user can't tell whether 38 °C in Delhi in June is normal or alarming. The comparison site climate.thisindianlife.today gets its whole value from anomaly-vs-baseline framing ("the wobble is weather, the drift is climate"). This brings that "is this unusual?" lens to our live spatial map while keeping the real-time grid as our differentiator.
Changes
Frontend —
index.htmlANOM_BANDS/colorForAnomaly, ColorBrewer RdBu) + a swappable legend.renderGridLayer(mode)recolors the grid in place; popups now show today's temp, the cell's monthly normal, and the signed anomaly (e.g.+2.3 °C vs Jun normal).Data builder —
build_grid_normals.py(new, static / one-time)temperature_2m_mean).Docs — README (feature, builder, static data file, local run step) + NOTICE (ERA5/Copernicus attribution).
Follow-up in this PR
india_grid_normals.json(the generated baseline) is not in this commit yet — the Open-Meteo daily quota is exhausted, so the rate-limited fetch resumes after the daily reset and the data file will be pushed to this branch when complete. Until then the toggle is gracefully hidden, and the absolute map is unchanged. Do not merge until the data file lands.Verification done
node --check); builder parses clean.🤖 Generated with Claude Code