Skip to content

APR-170: Replace Google Earth Engine with STAC API for satellite LST#46

Merged
JacobSampson merged 1 commit into
mainfrom
APR-170/stac-replacement
Jun 6, 2026
Merged

APR-170: Replace Google Earth Engine with STAC API for satellite LST#46
JacobSampson merged 1 commit into
mainfrom
APR-170/stac-replacement

Conversation

@JacobSampson

Copy link
Copy Markdown
Contributor

Summary

  • Adds satellite_lst_stac.py: credential-free replacement for satellite_lst.py using Microsoft Planetary Computer (free SAS-signed URLs)
  • Fetches Landsat 8/9 C2 L2 thermal data via STAC with windowed rasterio reads (~9s latency)
  • Sentinel-2 NDCI also via Planetary Computer (free); Copernicus STAC as fallback (requires auth)
  • Heatmap generation via matplotlib returning PNG bytes (instead of GEE's signed URL)
  • Adds STAC dependencies: pystac-client, planetary-computer, rioxarray, rasterio, pyproj
  • 24 unit tests, all passing

Spike validation results

Spike Result
Landsat LST via STAC 19.6°C for Clearwater Lake, LC09 scene 2026-05-30, ~9s
Heatmap generation 8 KB PNG, same colour palette as GEE version
Sentinel-2 NDCI NDCI=0.085, S2A scene 2026-05-25, ~5s
ScienceBase pre-computed Inconclusive (503); documented for follow-up

Follow-up (separate tickets)

  • Wire satellite_lst_stac into app/pages/fishing.py replacing the GEE import
  • Adapt get_lst_heatmap_url() call → get_lst_heatmap() (returns PNG bytes; st.image() accepts bytes directly)
  • Evaluate retiring satellite_lst.py (GEE) or keeping as opt-in fallback

Test plan

  • All 24 unit tests pass (pytest tests/test_satellite_lst_stac.py)
  • Spike scripts validate against live STAC endpoints
  • Integration: wire into fishing.py and run Streamlit smoke test (tracked in follow-up)

Closes APR-170

🤖 Generated with Claude Code

- Add satellite_lst_stac.py: drop-in replacement using Microsoft
  Planetary Computer for Landsat thermal and Sentinel-2 NDCI data
- No credentials required for Landsat (free SAS-signed URLs)
- Sentinel-2 NDCI via Planetary Computer (free) or Copernicus (auth)
- Windowed rasterio reads for performance (~9s vs ~93s full scene)
- Heatmap generation via matplotlib (PNG bytes, not URL)
- Add pyproject.toml and requirements.txt deps: pystac-client,
  planetary-computer, rioxarray, rasterio, pyproj
- Spike validation: all 4 spikes pass (LST, heatmap, NDCI, ScienceBase eval)
- 24 unit tests covering bbox, cloud mask, band key detection, fallback paths
@codesandbox

codesandbox Bot commented Jun 6, 2026

Copy link
Copy Markdown

Review or Edit in CodeSandbox

Open the branch in Web EditorVS CodeInsiders

Open Preview

@JacobSampson JacobSampson merged commit 8efaedf into main Jun 6, 2026
4 checks passed
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.

1 participant