Dev.to AI 🤖 Ai 👁 0 📖 2 min read

What Will Your City Feel Like in 2050? I Built a Climate Detective With 40 Years of NASA Data

Every summer feels hotter than the last. Everyone says it. But when someone asks "was this heatwave actually abnormal?" — nobody has an answer. Memory is unreliable, anecdotes aren't evidence, and the satellite data that

Every summer feels hotter than the last. Everyone says it. But when someone asks "was this heatwave actually abnormal?" — nobody has an answer. Memory is unreliable, anecdotes aren't evidence, and the satellite data that could answer the question sits locked in scientific formats nobody outside academia can touch.

I built TerraDetective AI to make 40 years of real NASA climate data answer plain questions for anyone, anywhere.

What it does

Warming trend, with receipts. Pick any location and get the 40-year temperature trend — not just "+0.10°C/decade" but the 95% confidence interval and p-value alongside it. If the trend isn't statistically significant, it says so. A claim like "warming is happening" should be able to survive being questioned, so I made it question itself.

Was This Normal? Pick a month and year — say July 2024 — and get an anomaly verdict: how many degrees above the baseline, the z-score, the percentile, and a "1-in-N-year event" framing. Was it hot, or was it historically hot? Now you can say which.

Danger Days. A per-decade chart of days above a dangerous-heat threshold, built from daily maximum temperatures. This is the one that hits hardest — you can watch the decade bars climb.

Future Twin City. My favorite feature. It finds which city today has the climate your city is projected to have in 2050. When I ran Karachi, it came back with Riyadh, Saudi Arabia. That one sentence communicates climate change better than a hundred charts.

Plus: a click-to-pick Leaflet map, shareable case links (coordinates in the URL, auto-runs on load), server-side NASA caching with a visible "cached" badge, and a downloadable detective case file.

Honesty by design

A few things I deliberately put in writing, because climate tools live or die on trust:

  • The data is MERRA-2 reanalysis — model-assimilated, not direct thermometer readings. The README says this plainly. It's excellent for trends, and I don't pretend it's something else.
  • When NASA is unreachable, the API returns a clean 502 instead of inventing data.
  • Every number carries its uncertainty. Confidence intervals aren't a bonus feature; they're the point.

How it works

NASA POWER API for the climate record, a pure-Python statistics layer (Student-t confidence intervals implemented from scratch — zero heavy deps, Vercel-safe), FastAPI backend, Leaflet for the map. Popular cities are pre-cached at startup so the first visit is instant; repeat analyses return in milliseconds with a badge that says they're cached.

The story

Built for NASA Space Apps. The local angle is real: South Asia is on the front line of dangerous heat, and "Karachi 2050 ≈ today's Riyadh" isn't an abstraction for the people who'll live it. I wanted a tool that gives a Karachi shopkeeper the same evidence a climate scientist has — just without the PhD.

Try it

Live: https://terradetective-ai.vercel.app
GitHub: https://github.com/rossycoder/terradetective-ai

Run your city. Check "Was This Normal?" for the hottest month you remember. If the verdict surprises you — or if the twin city for your hometown hits you in the gut the way Karachi–Riyadh hit me — tell me about it in the comments.

📰 Read the original article on Dev.to AI

Originally published by Dev.to AI. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.