Jump to Project Write-Up
Realtime Data
Historical Data
Near Real Time Information
High Confidence (≥ 80)
Medium Confidence (60–79)
Low Confidence (40–59)
Very Low Confidence (< 40)

Project Write-Up

1. Overview

This project is a comprehensive real-time and historical wildfire monitoring application. It leverages NASA’s FIRMS satellite data to display current wildfire hotspots on an interactive map and historical events plotted from raw data stored in DynamoDB.

2. Tools & Technologies

3. Data Sources

4. Architecture & Steps

  1. Phase 1 - Frontend Setup: Use Leaflet to render a dark basemap and fetch the FIRMS CSV in the browser via PapaParse. Plot real-time markers color-coded by confidence.
  2. Phase 2 - Backend Ingestion: Write a Python Lambda that downloads FIRMS CSV every 30 minutes, parses records into DynamoDB, converting floats to Decimal to satisfy DynamoDB requirements.
  3. Phase 3 - Aggregation Endpoint: Create a second Lambda+API Gateway endpoint that queries DynamoDB, aggregates by day/week/month, and returns JSON with aggregated_series.
  4. Phase 4 - Historical Map & Charts: Frontend fetches aggregated data for Chart.js line charts and raw data for a second Leaflet map, plotting each historical event via a /prod/raw API endpoint.

5. Backend Code Example (Python Lambda)

import requests
import csv
import boto3
from decimal import Decimal
from io import StringIO

dynamodb = boto3.resource('dynamodb', region_name='us-east-2')
table = dynamodb.Table('WildfireData')

url = 'https://firms.modaps.eosdis.nasa.gov/...csv'
response = requests.get(url)
csv_file = StringIO(response.text)
reader = csv.DictReader(csv_file)
for record in reader:
    item = {
        'RecordID': f"{record['acq_date']}_{record['acq_time']}",
        'latitude': Decimal(record['latitude']),
        'longitude': Decimal(record['longitude']),
        'brightness': Decimal(record['brightness']),
        'confidence': Decimal(record['confidence']),
        'acq_date': record['acq_date'],
        'acq_time': record['acq_time']
    }
    table.put_item(Item=item)

6. Frontend Code Example

// Fetch raw historical data and plot on Leaflet
async function updateHistoricalMapRaw(start, end) {
  const response = await fetch(
    `/prod/raw?start_time=${start}&end_time=${end}`
  );
  const data = await response.json();
  rawData.forEach(r => {
    L.marker([+r.latitude, +r.longitude]).addTo(historicalMap)
      .bindPopup(`Brightness: ${r.brightness} Confidence: ${r.confidence}`);
  });
}

7. Usage & Deployment