Estimating Whoosh Train Speed from a Single Sentinel-2 Image
A few weeks ago I stumbled upon a LinkedIn post that tried to capture the motion of a spinning wind turbine from a single Sentinel-2 image. The trick is that Sentinel-2 does not record all of its bands at exactly the same moment, so anything that moves ends up in a slightly different place in each band. That got me curious to find out what else moves fast enough, and is big enough, for its movement to show up in a single Sentinel-2 image. In this post I try it on Indonesia’s Whoosh high-speed train, the train I often take to visit my hometown in Bandung.
Sentinel-2 Does Not Take All Its Bands at Once
Sentinel-2 is a push-broom scanner: it builds the image line by line as it flies forward at about 7 km/s. Each band has its own line of detectors, and these lines sit one behind the other along the flight direction. So a point on the ground is seen first by the blue detectors, then a moment later by green, then by red. The bands are aligned afterwards so the static ground lines up, but anything that moved in between does not.
| Band (10 m) | Delay after blue (s) |
|---|---|
| B02 (blue) | 0 |
| B08 (near-infrared) | 0.264 |
| B03 (green) | 0.527 |
| B04 (red) | 1.005 |
Delays from Binet et al. (2022), quoting the ESA handbook. The 20 m and 60 m bands have longer delays (up to 2.6 s), but their pixels are too coarse for this.
Why Whoosh?
With about 1 s between blue and red and 10 m pixels, an object has to move at least ~10 m/s (36 km/h) to shift by one pixel, and it has to be big and bright enough to see at all. Whoosh, the Jakarta–Bandung high-speed railway, fits nicely. It runs about 142 km from Halim (Jakarta) to Tegalluar (Bandung) at up to 350 km/h, mostly on viaducts, and each train is 209 m long and 3.36 m wide. Figure 1 shows the route, including the two stretches where I ended up catching trains.
The math is simply shift = speed × delay. At its top speed of 350 km/h (about 97 m/s), the Whoosh moves about 98 m between the blue and red bands: roughly 10 pixels, or almost half its own length. That should be easy to see. For comparison, the Jabodebek LRT, which I routinely take to commute, is half as long and rarely reaches its 80 km/h limit, so it would only show a pixel or two of colored fringe.
Catching the Bullet
The train is long, but at 3.36 m wide it covers only a third of a pixel, so in a single image it mostly blends into the viaduct. To make it stand out, I took all the clean Sentinel-2 images of the track in a year and computed the median of every pixel, which gives the typical look of the track. Subtracting that median from a single date removes everything that stays the same and highlights what changed, including moving targets like the train (Figure 2).
This helps a lot, but it is not a clean detector. The train is often only a few times brighter than the leftover noise, and the difference image also picks up every other change: cloud edges and shadows, haze, vegetation, and new construction along the track. So I found candidates semi-automatically and made the final call by eye.
One thing works in our favor: Sentinel-2 passes at almost the same time every visit (about 10:20 in the morning, UTC+7), and trains run on a timetable. So while a scheduled train is never in exactly the same pixels, it is always in roughly the same stretch of track. Once I found a train in one image, I knew which stretch to search in the others. That gave me two recurring sightings, the colored stretches in Figure 1: a Bandung-bound train about 12–16 km out of Halim, still accelerating, and a Jakarta-bound train around km 83–85 of 142, cruising through the middle part of the line.
On some dates the train is not clearly visible because of noise or atmospheric effects; for this small exercise I simply ignored those. On other dates, the train is so bright, probably from sunlight reflecting off its roof, that the motion shows clearly even in true color (Figure 3). The front of the train only exists in the red band, the last one recorded, and the back only in the blue band, so the train turns into a rainbow streak. That also means a single true-color image tells us which way the train is heading: always toward its red end. In Figure 3 the red end points left, toward Jakarta.
Estimating Speed
In the median-subtracted bands the train sits in a slightly different place in each one (Figure 4). This is exactly what I was hoping to see, and it is very satisfying to watch. The next logical step is to measure the speed.
To measure the shift, I straighten the track by sampling the image every 5 m along it, and take the train’s brightness profile in each band. Sliding the green and red profiles until they best match the blue one gives the shift of each band. The speed is then just the slope of shift against time (Figure 5). On this particular example, the shifts were 42 m and 90 m, which gives about 90 m/s, or 323 km/h which match the expected cruising speed of the train!
I skipped the near-infrared band: vegetation is so bright in near-infrared that the train barely shows there.
How precise is that? The biggest source of error is the background: leftover noise from haze, vegetation, buildings and the sensor itself can nudge the match. To estimate it, I pasted each train’s signal into difference images of the same stretch from other dates where no train was found nearby, added a small random misalignment between the bands (ESA guarantees they line up within 0.3 pixel), and measured the speed again a few hundred times. Because this repeats the whole measurement on real 10 m pixels, the effect of the coarse resolution is already part of the result. The spread gives about ±5–8 km/h for the clean mid-line sightings and up to ±25 km/h for the weaker ones near Halim (Figure 6).
These error bars leave out one thing: the band delays are not exactly the same everywhere in the image, but vary by up to about 2%. Since speed is shift divided by time, that could add a few km/h on top, up to about ±6 km/h for the fastest train.
The two trains separate nicely: the Jakarta-bound one cruises at about 290–323 km/h, while the Bandung-bound one is still speeding up out of Halim at about 130–230 km/h.
Is the Train in the Same Place Every Day?
Out of 68 Sentinel-2 passes in 2025–2026, I found a train in 16 (Figure 7). I only searched for these two trips, so this is not a full count of every train on the line.
To compare days fairly, we need to take into account that Sentinel-2 is not perfectly punctual either. Its overpass time varied by up to 26 s between dates, and at 300 km/h that is about 2 km of travel. Since we know each train’s speed, I moved every sighting to the same clock time, the average overpass time of 10:19:54 UTC+7, using position + speed × time difference (Figure 8).
After that correction, both trains are usually within about 1 km of their typical position, which is roughly 12 s for the cruising train and 22 s for the one leaving Halim. The biggest outliers were 5 October 2026, when the Jakarta-bound train was about 25 s early, and 8 August 2026, when the Bandung-bound train was about 45 s late.
Closing Thoughts
It is quite satisfying that a one-second quirk of the sensor is enough to clock a 300 km/h train to within a few km/h, all from free data. Whoosh is just one example, though. Anything that is big enough, bright enough and fast enough should leave the same colorful trail. What other movement do you think we could detect and measure this way?
Enjoy Reading This Article?
Here are some more articles you might like to read next: