Spatiotemporal change detection (Capstone 4 week)
Track 4 culminates here: bringing time into the analysis. Multi-frame change detection lets you see plumes evolving, deforestation progressing, or coastlines shifting. The capstone is a real-time satellite tracker.
If you photograph the same coral reef every week for a year, how can a computer tell you what's changing?
Spatiotemporal change detection is how. Stack the frames, subtract baselines, threshold the difference, label the changes. This week the math is universal — and the applications are everywhere.
Learning objectives
- Stack multiple raster frames in time
- Compute pixel-wise differences between frames
- Apply threshold + morphology to identify change regions
- Combine optical and thermal change indicators
Primer
Static analysis answers "what is here." Temporal analysis answers "what changed." For space GIS, the second question is often the more interesting one: did a plume appear?, did the landscape recover from a launch event?, did a sea-launch platform move? All of these reduce to comparing imagery at multiple times.
Stacking
The starting point is a stack: multiple frames of raster imagery, all aligned to the same projected grid. Source frames are rarely already aligned — they come at different times, sometimes from different orbits, and need resampling to a common reference grid. The standard tool is rasterio.warp.reproject() or, more conveniently, satpy.Scene.resample() when working with satellite NetCDFs.
import xarray as xr
# Each frame's brightness_temp variable, time-indexed
frames = [xr.open_dataset(f).rename({'Rad': f'frame_{i}'}) for i, f in enumerate(file_list)]
stack = xr.concat([f.rename(t_var='time') for f in frames], dim='time')
# stack now has dims (time, y, x) — 3-D
Per-pixel difference
The simplest change detection: subtract one frame from another. Positive values are pixels that got hotter; negative values are pixels that got cooler. For consecutive Band 7 frames during a launch, you'll see a small positive cluster (the plume forming) and then a small negative cluster (the plume fading).
diff = stack['frame_1'] - stack['frame_0'] # element-wise raster math
hot = diff > 30 # Boolean mask of pixels that gained >30 K
Morphology to clean noisy masks
Raw difference masks are noisy — single-pixel hits from sensor noise, edge artifacts from imperfect georegistration. Morphological operations clean this up:
- Erosion — remove single-pixel hits by requiring contiguous neighbors.
scipy.ndimage.binary_erosion. - Dilation — grow valid regions to fill small gaps.
scipy.ndimage.binary_dilation. - Opening (erosion + dilation) — removes small features while preserving large ones. Good for noise removal.
- Closing (dilation + erosion) — fills small holes in larger features. Good for plume mask consolidation.
Connected components
After cleaning, label connected regions. Each connected hotspot cluster is a distinct "blob" — likely a single plume (or single false-positive source). scipy.ndimage.label assigns each blob a unique integer ID. You can then compute per-blob properties (area, centroid, bounding box, mean brightness) and filter blobs that meet plume-like criteria.
from scipy.ndimage import label, center_of_mass
mask = hot.values
labeled, n_blobs = label(mask)
centroids = center_of_mass(mask, labeled, range(1, n_blobs + 1))
areas = [(labeled == i).sum() for i in range(1, n_blobs + 1)]
Multi-sensor change detection
Combining sensors makes detection more robust. A plume that appears in BOTH Band 7 thermal AND visible Band 2 is more likely a real launch (or a wildfire) than a Band-7-only signal (which could be a calibration artifact). Common multi-sensor combinations:
- Band 7 + Band 2 — both for confirmation that a hotspot is also bright in visible (real combustion).
- Band 7 + Band 14 — split-window difference distinguishes plume (sub-pixel) from extended cloud.
- Optical + SAR — for change detection of ground infrastructure (new buildings, pad construction) where clouds would block optical.
The capstone
Week 20's lab is the start of Capstone 4: Real-Time Satellite Tracker. Build a Cesium-based web app that shows ISS + Starlink visible passes for a user-supplied lat/lon, with click-to-inspect orbital elements and 24-hour replay. The full rubric is on the capstone page; finishing it earns the Certified Mission GIS Engineer credential. Track 5 (Space GIS Architect) goes deeper into production-grade and expert-tier topics from here.
Connecting to Hawaiʻi: Change detection for Kīlauea + reefs
The Hawaiian Volcano Observatory has been doing change detection on Kīlauea for decades — every lava flow, every collapse, every uplift gets quantified by comparing satellite imagery before and after. The same technique watches coral bleaching across Kāneʻohe Bay, watches forest regrowth after fires across Hawaiʻi Island, watches coastline retreat from sea-level rise on every island. Change detection is how we measure what we care about, over time.
Hands-on lab: Real-Time Satellite Tracker (capstone start)
Build a Cesium-based web app that shows ISS + Starlink visible passes for a user-supplied lat/lon. Click-to-inspect orbital elements. 24h replay. This is the deliverable for Capstone 4.
Quiz — click an answer to check it
No grade, no shame. Tap any option; you'll see if it's right plus the answer if not. The point is to notice what you already know and what's still settling.
- Aligning multiple frames to a common grid for time-series analysis
- Concatenating files
- Compression
- Format conversion
- A change raster (positive = increase, negative = decrease)
- Always zero
- RGB
- A vector
- Clean up noisy detection masks
- Compute NDVI
- Reproject
- Compress
- They see different physics — together more robust to false positives
- Required by spec
- It's cheaper
- Doesn't matter
- Differences along a dimension (e.g. time)
- Compresses
- Rasterizes
- Filters by extent
Reflection
Take five minutes with this. Write your answer somewhere. Carry it into next week.