An urban-heat monitoring programme tracks London's summer vegetation index from Sentinel-2 each year and quotes three figures per scene: the mean NDVI, the share of pixels that are dense vegetation, and the share that are essentially unvegetated. The 11 July 2025 scene is the cleanest of the summer, and the programme wants its three figures, computed from the clip as delivered, with the nodata excluded and the integer bands cast before the division.
From the two-band Sentinel-2 clip — band 1 red, band 2 near infrared, reflectance × 10,000 — compute
NDVI = (NIR − red) / (NIR + red)over every pixel where both bands are non-zero (0 is nodata), and report:
ndvi_mean — mean NDVI over those pixels, four decimalspct_dense_vegetation — share of those pixels with NDVI ≥ 0.5, percent, two decimalspct_unvegetated — share with NDVI ≤ 0.2, percent, two decimalsnodata_pixels — how many pixels were excludedThe bands are unsigned 16-bit integers. Subtracting them as integers wraps around; cast to float first.
These are where the teaching is. Read them twice.
Scene-level NDVI summaries are the unit of every urban-heat and drought monitoring series, and the float cast and the nodata mask are the two steps that make them comparable between years.
Work the problem in whatever tool you like, then enter the answers here.
ndvi_meanpct_dense_vegetationpct_unvegetatednodata_pixels4 scored, 0 informational
Mean NDVI over valid pixels
30%Share of dense vegetation
30%Share of unvegetated surface
20%Pixels excluded as nodata
20%