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.

Map of the Whoosh high-speed railway running about 142 km from Halim in Jakarta, south-east to Padalarang and Tegalluar in Bandung, with kilometer marks every 20 km and other railways in light grey. A blue stretch at km 12.5 to 16 marks where a Bandung-bound train was caught leaving Halim, and an orange stretch at km 82.5 to 85 marks where a Jakarta-bound train was caught at cruising speed.
Figure 1. The Whoosh route. The colored stretches are where I caught trains (more on them below): blue is just after Halim, where the train is still accelerating, and orange is in the middle part of the line, where it is cruising at high speed.

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).

Grid of Sentinel-2 image chips from 31 August 2026, two columns and four rows. Left column: near Halim, a dense neighborhood beside a wide elevated toll road, with a Bandung-bound train at 169 km/h. Right column: the middle of the line, a viaduct crossing green fields, with a Jakarta-bound train at 305 km/h. The top row is true color. The three rows below show the blue, green and red bands minus the yearly median: the background is flat grey and the train is a faint bright streak inside yellow corner marks, sitting slightly further along the track in each band.
Figure 2. 31 August 2026, near Halim (left) and mid-line (right). Top: true color as recorded. Below: blue, green and red minus the median. The train is the bright streak inside the yellow corners. Note how removing the median highlights the train compared to the original true-color image.

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.

Three horizontal strips of the same 1.2 km stretch of track on 12 October 2025, straightened so the track runs left to right with Jakarta on the left. Top: the true color image, where the train shows as a short streak that is red at its left end, then yellow and white, then cyan and blue at the right end. Middle: the yearly median, showing the empty track. Bottom: the difference between the two, where everything static is grey and only the colorful train remains.
Figure 3. The Jakarta-bound train on 12 October 2025, visible as a rainbow streak even in true color. The track is straightened, with Jakarta to the left.

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.

Animation cycling through three frames of the same stretch of track on 14 March 2026: the blue band at 0 seconds, the green band at 0.527 seconds and the red band at 1.005 seconds. Each frame shows a true color strip and the band minus its median, where the train is a bright bar that steps toward Jakarta, about 90 meters in total over the one second.
Figure 4. The fastest train I found, 14 March 2026, in blue (0 s), green (0.527 s) and red (1.005 s).

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!

Two charts. Left: brightness along the track for the blue, green and red bands, each showing a raised plateau about 200 meters long where the train is; the green plateau sits about 42 meters toward Jakarta from the blue one, and the red plateau about 90 meters. Right: the shift of each band plotted against its acquisition time, 0 meters at 0 seconds, minus 42 meters at 0.527 seconds and minus 90 meters at 1.005 seconds, with a straight line through them labeled slope 89.8 meters per second, 323 kilometers per hour.
Figure 5. Left: the train's brightness along the track in each band. Right: shift against time; the slope is the speed.

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.

Chart of speed against date from July 2025 to October 2026 for 18 sightings, each with a thick 68 percent and a thin 95 percent error bar. Orange points, the Jakarta-bound train mid-line, sit between 226 and 323 kilometers per hour, below a dotted line at the 350 kilometer per hour top operating speed. Blue points, the Bandung-bound train leaving Halim, sit between 91 and 233 kilometers per hour with wider error bars.
Figure 6. The speed of every sighting. Thick bars: 68% range; thin lines: 95% range.

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.

Chart with one row per Sentinel-2 date, 16 dates from July 2025 to October 2026, and kilometers along the line from Halim to Tegalluar on the horizontal axis. Grey bars show where the track was clear of clouds. Blue right-pointing arrows near km 12 to 16 mark the Bandung-bound train with its speed, and orange left-pointing arrows near km 82 to 85 mark the Jakarta-bound train, with the fastest at 323 kilometers per hour on 14 March 2026.
Figure 7. The 16 passes with a train. Grey bars: where the track was clear; arrows: each train, its direction and speed.

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).

Two stacked charts of position along the line against date. Top: the Jakarta-bound train mid-line; bottom: the Bandung-bound train leaving Halim. Hollow grey dots show where each train was seen at that day's overpass time, connected by a line to a filled dot showing where it would have been at 10:19:54. Labels give meters ahead or behind the median position: most are within about 1 kilometer, with outliers of 2.2 kilometers ahead on 5 October 2026 and 2.2 kilometers behind on 8 August 2026.
Figure 8. Where each train was at 10:19:54 UTC+7. Hollow dots: where it was seen; filled dots: moved to the common time using its own speed.

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: