← Back to the course

Code and data

Every figure and every measured number in the course is produced by the Python files below from free, public data. All searches end on 21 November 2026, so a re-run returns the same scenes. Nothing is downloaded whole: each scene is a cloud-optimised GeoTIFF, and only the small window needed is read.

Run it

pip install pystac-client planetary-computer rasterio matplotlib pyproj scipy numpy
python build_figures.py
python build_iceye_figs.py
python build_course_figs.py
python make_exercise_crops.py
python make_assessment_imgs.py
python build_unseen.py
python annotate_figs.py

Data

All via Microsoft Planetary Computer (planetarycomputer.microsoft.com), free to access. Contains modified Copernicus Sentinel data (2019–2020, 2026).

Lesson 13 adds one scene from the ICEYE Synthetic Aperture Radar (SAR) Open Dataset (© ICEYE) (registry.opendata.aws/iceye-opendata), licensed CC BY 4.0: ICEYE_U1X0DE_20260826T205215Z_10395144_X61_SLH, spotlight, Port of Hamburg, 26 August 2026. It is read straight from the public bucket, with no account. The ground range file carries rational polynomial coefficients (RPCs) instead of a map projection; the script warps it to UTM 32N at the scene’s reference height of 51 m and checks the result against Sentinel-1 by searching whole 10 m shifts for the best correlation (best: about 14 m; not corrected). It also reads the Sentinel-1 incidence angle and heading from the same-day GRD annotation. Outlines © OpenStreetMap contributors (ODbL).

The ship detector, in one paragraph

Water is any pixel whose 20th-percentile VV backscatter (gamma0) over nine dates (orbit 139, 1 Oct to 18 Nov 2026) is below −11 dB, cleaned with a morphological opening and kept only in large connected areas; it is then shrunk by 20 m, about one resolution cell, to keep most quay walls out (some still leak in; the course says so). A target is a group of at least four water pixels brighter than +3 dB gamma0 (an absolute threshold, not relative to the background); fragments within about 40 m are merged. Targets in consecutive images within 40 m of each other are treated as the same target. These are teaching choices, not an operational detector, and the course says where they fail.

Other data