Space-Apps-Project

FuegoData — Wildfire Hotspot Map & Burn Calendar

NASA Space Apps Challenge 2026 · Team UNDEFINED · Pilot region: Sierra de Chihuahua, Mexico

FuegoData is a geospatial wildfire intelligence platform that harmonizes MODIS (1 km) and VIIRS (375 m) satellite hotspots from NASA FIRMS into a consistent burn calendar, integrates field IoT telemetry (with automatic meteorological fallback), and estimates the probable origin of fire detections (Human, Lightning, Wildland, Undetermined).


1. The Problem

Satellite sensors MODIS (active since 2000) and VIIRS (active since 2012) differ in spatial resolution, thermal sensitivity, and overpass schedules. Comparing raw counts directly introduces artificial jumps across multi-decade records, making it difficult for brigades, researchers, and local communities to separate real wildfire anomalies from sensor changes—or to distinguish natural lightning fires from human-caused ignitions.


2. Solution Architecture

FuegoData couples satellite harmonization, edge IoT hardware, and probabilistic origin modeling:

  1. MODIS → VIIRS Harmonization (detection level, all of Mexico)
    • Each detection gets an in_calendar flag: Aqua MODIS before 2012-01-20, then S-NPP VIIRS 1.4 km / 30-min cells whose summed FRP ≥ a per-state threshold T*, fitted for count parity with Aqua on 2012–2019 and tested on 2020–2025 (see section 5).
    • Enables a continuous historical burn calendar (Years × Months) without the 2012 sensor jump: 5.4 M detections, 796,098 in the consistent series.
  2. Field IoT Stations + Automatic Fallback
    • Current prototype: ESP32 with a DHT11 (temperature & humidity), BMP280 (pressure), flame and sound sensors, posting to the API. Target design: solar power, wind/rain, AS3935 lightning detector, local screen and a 5-LED risk semaphore.
    • In areas without IoT coverage, the platform uses gridded weather from Open-Meteo.
  3. Risk Estimation (implemented) & Probable Origin (planned)
    • Implemented: a 72-hour LightGBM forecast (Chihuahua pilot) and a weekly 7/14/28-day risk model (section 5).
    • Planned, not implemented: combine thermal detections, lightning proximity, weather conditions (FWI), and land context to classify probable origin (Human, Lightning, Wildland, Undetermined) and flag potential irregular fire use for preventive inspection.
    • Note: Probabilistic estimates are intended to prioritize preventive inspections and do not constitute legal proof.

3. Current Implementation (web/)

The frontend is a static Next.js export (output: "export") ready for GitHub Pages, connected to a live FastAPI backend on AWS EC2 (https://13-217-192-184.sslip.io, HTTPS via Caddy) (no built-in demo data: if the API is unreachable, the site says so instead of showing invented values).

Tech Stack

Routes

Route Purpose
/ Live Wildfire Map (FireMapPage): Satellite/street basemap, time filters (24HRS, 7DAYS, ALL), on-demand layers (NASA FIRMS, historical monthly fires, model forecast probability, weather grid, IoT stations), burn calendar modal, CSV export, and slow-connection /lite detection.
/data Open data & CSV download center (DataDownloads).
/challenge Background on the MODIS/VIIRS discontinuity and wildfire detection challenge.
/how-it-works Detailed architecture, harmonization pipeline, and IoT + fallback design.
/about Platform overview and module breakdown (AboutTabs).
/team Team UNDEFINED and NASA Space Apps Challenge 2026 context.

Project Structure

Space-Apps-Project/
├── Imagen/                     # Source illustrations & visual assets
└── web/                        # Next.js static web application
    ├── app/
    │   ├── page.tsx            # Main interactive wildfire map (/)
    │   ├── data/page.tsx       # Data & CSV downloads (/data)
    │   ├── (landing)/          # Informational pages (/about, /challenge, /how-it-works, /team)
    │   ├── layout.tsx          # Root metadata & Titillium Web font
    │   └── globals.css         # Tailwind v4 & map/animation styles
    ├── components/
    │   ├── ChihuahuaOsmMap.tsx # Leaflet interactive map
    │   ├── LazyMap.tsx         # Client-side lazy map wrapper
    │   ├── SiteHeader.tsx      # Top navigation bar
    │   ├── HeroHarmonizationPreview.tsx
    │   ├── DataDownloads.tsx
    │   ├── AboutTabs.tsx
    │   └── ModelCard.tsx
    ├── lib/
    │   ├── api.ts              # Live API hooks (no invented fallback data)
    │   ├── fire-data.ts        # Types, risk scales, CSV/GeoJSON export
    │   ├── layers.ts           # Satellite, weather & historical layer definitions
    │   └── asset.ts            # Base-path helper for GitHub Pages
    └── next.config.ts          # output: "export", PAGES_BASE_PATH, unoptimized images

4. Local Development

Prerequisites

Run locally

cd web
bun install
bun run dev

Open http://localhost:3000 in your browser.

Estación IoT ESP32 (DHT11 + Sonido + Flama + Presión)

El sketch esp32/dht11_wifi/dht11_wifi.ino está incluido en .gitignore porque guarda credenciales estáticas directamente en el archivo (WIFI_SSID, WIFI_PASSWORD, SERVER_URL, STATION_TOKEN).


Environment Variables (web/.env.local)

Variable Description Default
NEXT_PUBLIC_API_URL Base URL of the API (AWS EC2) https://13-217-192-184.sslip.io
PAGES_BASE_PATH Optional base path when deploying to GitHub Pages (e.g. /Space-Apps-Project) ""

Available Scripts (inside web/)

bun run dev     # Start local development server
bun run build   # Generate static export (out/)
bun run start   # Serve production build
bun run lint    # Run ESLint

5. Harmonized hotspot series and weekly risk model

Added with AI assistance (see AI_DISCLOSURE.md). Uses NASA FIRMS data only.

harmonization/ builds one consistent hotspot series from the MODIS (Terra + Aqua) and VIIRS (Suomi-NPP) FIRMS archives for northern Chihuahua (2002 to 2026-07). All 481,029 rows are kept and one flag column, in_calendar, marks the 55,902 rows that form the consistent series for counts and the burn calendar (Aqua before 2012-01-20, then Suomi-NPP cells of at least 15 MW, which is about where MODIS detects half the fires). confidence and acq_date get the same type for both sensors, and MODIS brightness is mapped onto VIIRS (capped at 367 K). Validation: S-NPP monthly counts go from 11.7x Aqua to 0.91x (correlation 0.967 to 0.984), and the rule holds on held-out years (threshold fitted on 2012 to 2019, tested on 2020 to 2026). Known limits: about 10 % residual offset after 2012, the series ends 2026-07-31, parameters were fitted in this region only, night brightness is approximate. Details, validation tables and the check notebook: harmonization/README.md. The 40 MB output CSV (harmonization/harmonized_hotspots.csv) is stored in git; it can also be rebuilt with the script, and harmonization/s3_io.py can move files to the S3 bucket.

risk_model_weekly/ predicts the probability of at least one hotspot per 0.1 degree cell in the next 7, 14 or 28 days from that series (LightGBM, calibrated, time-based validation). On 2023-01 to 2026-07 (held out), the 7-day model reaches precision-recall AUC 0.118 against 0.070 for cell climatology, and finds 47 % of the burning cells in its top 5 % (climatology: 37 %); it beat climatology in all 18 yearly backtests. The 28-day model is only slightly better than climatology and the model over-predicts by about 18 % on 2023 to 2026. It is separate from ml/ (72 h, weather and NDVI) and is not connected to the backend or the web app. See risk_model_weekly/README.md.