Satellite flood mapping with Sentinel-1 and Sentinel-2: the Valencia floods of October 2024
Map the Valencia DANA flash floods of 29 October 2024 in Python from free Sentinel-1 RTC radar and Sentinel-2 L2A imagery, then score the result against the Copernicus EMS EMSR773 delineation with a confusion matrix, F1 and IoU, and see what a flash flood leaves for satellites to find.
- Level
- Intermediate
- Tested with
- Python 3.12
- Source code
- Download scripts
Key takeaways
- A flash flood drains fast. The first Sentinel-1 pass available on the Planetary Computer came 64 hours after the rain began, by when most streets in L'Horta Sud were dry again.
- Sentinel-1 change detection was almost never wrong where it said 'flood' (precision 0.99 against Copernicus EMS) but found only 19% of the EMS flood footprint (F1 0.31): it saw standing water in the rice fields and the Turia new channel, and 0.5% of the flood traces in the towns.
- Adding Sentinel-2 from 31 October, 44 hours after the event, with MNDWI for water and a red/SWIR1 index for fresh mud, raised recall to 0.48 and F1 to 0.53 (IoU 0.36), at the cost of precision (0.59).
- Score a flood map with a confusion matrix in square kilometres and report F1 or IoU; overall accuracy (0.76 here) looks flattering because most of the domain is dry land that both maps agree on.
Before you start
- Comfortable with NumPy, rasterio and GeoPandas; the Sentinel-1 Pakistan floods tutorial covers decibels, speckle and Otsu thresholds in more depth
- Python 3.10+ with pystac-client, planetary-computer, rasterio, numpy, scipy, scikit-image, pandas, geopandas, matplotlib and requests
- An internet connection: imagery streams from the Microsoft Planetary Computer with no account or key, and the first run downloads about 40 MB of Copernicus EMS vectors
Short answer: to map a flood from satellites in Python, find the first Sentinel-1 radar pass after the event and a pass from before it on the same orbit, threshold the VV backscatter in decibels with Otsu’s method, and keep only pixels that turned dark. Then add a clear post-event Sentinel-2 image: MNDWI above zero for water and a jump in a red/SWIR1 index for fresh mud. Finally, rasterise an independent reference, such as the Copernicus EMS delineation, and count true and false positives in square kilometres to get precision, recall, F1 and IoU. For the Valencia flash flood, radar alone scored F1 0.31 and radar plus optical scored F1 0.53.
This is Part 2 of GIS for disaster emergency response. In Part 1 we built a first-hours situation map from open data. Here we map the flood ourselves and check our map against the official one.
On 29 October 2024 a DANA (a cut-off low) stalled over the Valencia region. Several hundred millimetres of rain fell on the hills west of the city in a few hours. The Poyo ravine and its neighbours burst their banks in the evening and sent a wall of water through Paiporta, Picanya, Massanassa, Catarroja, Sedaví and Alfafar towards the Albufera lagoon. More than 220 people died; the official count kept by the investigating court in Catarroja stands at 232 (CGPJ). The Copernicus Emergency Management Service was activated the same afternoon as EMSR773.
A flash flood is the hardest case for satellite mapping. The water came and went within hours to a day, and what remained in the towns was mud, wrecked cars and debris. This tutorial shows what free satellites can and cannot see in that situation, with numbers.
You will learn how to:
- download a Copernicus EMS delineation and read which image each polygon came from;
- find the earliest post-event Sentinel-1 pass with STAC, and understand why timing matters so much for a flash flood;
- map new water with Sentinel-1 RTC change detection, and test the rule on two dry dates;
- map water and fresh sediment with Sentinel-2 L2A, using the scene’s own cloud mask;
- score each map against the EMS reference with an agreement matrix, F1 and IoU, and split recall by EMS class.
All outputs below are real results from satellite_flood_mapping.py, run on 17 November 2026 with Python 3.12.0, pystac-client 0.9.1, rasterio 1.5.2, geopandas 1.2.0 and scikit-image 0.26.0. The full run takes under a minute once the EMS files are cached.
For the basics of radar flood mapping (decibels, speckle, the Lee filter and Otsu’s method) see Sentinel-1 SAR flood mapping in Python. Here we build on it.
Step 1: download the Copernicus EMS reference
Every Copernicus EMS activation has a public JSON description. It lists the areas of interest (AOIs), the products for each and the images they were made from. The first delineation for AOI01, “Valencia province”, is a shapefile bundle in a zip file. GeoPandas reads it straight from the zip.
EMS_API = "https://rapidmapping.emergency.copernicus.eu/backend/dashboard-api/public-activations/?code=EMSR773"act = requests.get(EMS_API, timeout=60).json()["results"][0]aoi1 = next(a for a in act["aois"] if a["number"] == 1)first = next(p for p in aoi1["products"] if p["type"] == "DEL" and p["monitoringNumber"] == 0)for img in first["images"]: print(f" {img['sensorName']:<12} {img['acquisitionTime']} ({img['resolutionClass']})")zip_path = DATA / Path(first["downloadPath"]).nameif not zip_path.exists(): zip_path.write_bytes(requests.get(first["downloadPath"], timeout=300).content)
def ems_layer(name: str) -> gpd.GeoDataFrame: return gpd.read_file(f"zip://{zip_path.resolve()}!{stem}_{name}_v1.shp").to_crs(CRS)
ems = ems_layer("observedEventA") # observed flood polygonsems_aoi = ems_layer("areaOfInterestA") # the area EMS actually mappedsources = gpd.read_file(DATA / "source.dbf").set_index("src_id")ems["source"] = ems.dmg_src_id.map(lambda i: f"{sources.source_nam[i]} {sources.src_date[i]}")The notation field says whether a polygon is Flooded area (water still visible) or Flood trace (dried out, but mud and debris show it was flooded). The dmg_src_id field links each polygon to the image it was drawn from.
EMSR773: Flood in Valencia Region, Spain | event 2024-10-29T14:30:00 UTC | activated 2024-10-29T16:40:00 UTCAOI 01 Valencia province: first delineation, delivered 2024-11-02T03:02 Sentinel-2 2024-10-31T10:51:00 (HR+) Landsat-8 2024-10-30T10:37:00 (HR+) Sentinel-1 2024-10-31T18:02:00 (HR+)study area 22.1 x 19.5 km; EMS observed flood inside it:notation sourceFlood trace Landsat-8 30/10/2024 63.5Flooded area Sentinel-1 31/10/2024 0.6 Sentinel-2 31/10/2024 34.7This table already tells the story. Inside our 22 × 20 km study area, almost two thirds of the EMS footprint, 63.5 km², is flood trace drawn from Landsat-8 the morning after. Only 35 km² was still visibly wet two days later, and that is mostly the rice fields around the Albufera. EMS analysts mapped the towns from mud, not water. Our satellites will have to do the same, or miss them.
Step 2: find the earliest Sentinel-1 pass after the event
Sentinel-1 sees through cloud, so it should be the first satellite to map a flood. But it only passes over a given place every few days, and in October 2024 only Sentinel-1A was operating. We search the Planetary Computer’s sentinel-1-rtc collection for October and early November.
catalog = pystac_client.Client.open(STAC_URL, modifier=planetary_computer.sign_inplace)s1_items = list(catalog.search(collections=["sentinel-1-rtc"], bbox=BBOX, datetime="2024-10-01/2024-11-10").items())passes = pd.DataFrame([{"date": i.datetime.strftime("%Y-%m-%d"), "time_utc": i.datetime.strftime("%H:%M"), "orbit": i.properties["sat:relative_orbit"], "direction": i.properties["sat:orbit_state"]} for i in s1_items]).drop_duplicates().sort_values(["date", "time_utc"]) date time_utc orbit direction2024-10-01 06:10 8 descending2024-10-02 17:55 30 ascending2024-10-07 18:03 103 ascending2024-10-08 06:02 110 descending2024-10-13 06:10 8 descending2024-10-14 17:55 30 ascending2024-10-19 18:03 103 ascending2024-10-20 06:02 110 descending2024-10-25 06:10 8 descending2024-10-26 17:55 30 ascending2024-11-01 06:02 110 descending2024-11-06 06:10 8 descending2024-11-07 17:55 30 ascendingfirst pass after the event: 2024-11-01 06:02 UTC, 64 hours after the rain beganLook at orbit 103. It passed on 7 and 19 October, so it should have passed again on 31 October at 18:02, and that is the Sentinel-1 scene EMS used. It is not in the Planetary Computer catalogue, so the first pass we can use is 1 November at 06:02 UTC on descending orbit 110, about 64 hours after the rain began. A pass on 20 October from the same orbit gives a clean “before” image, with the same viewing geometry. We also read 8 October as a control date, before any rain.
Rivers that flood over weeks, like the Indus in 2022, are still under water when the satellite comes. A flash flood is not. By 1 November most streets in Paiporta and Massanassa were drained, and the water that remained was in low, flat ground with nowhere to go: the rice paddies north of the Albufera, and the Turia new channel (the Plan Sur), which carried floodwater to the sea. Expect radar to map those well and the towns hardly at all. If you need the towns, use imagery from the first 12 to 24 hours, or map the mud.
Step 3: read Sentinel-1 onto one 10 m grid
Each Sentinel-1 date over Valencia is split across two frames, so we mosaic them. We stream each frame through a WarpedVRT onto a fixed 10 m grid in ETRS89 / UTM zone 30N (EPSG:25830), apply a Lee filter to the linear power, and convert to decibels. The filter’s equivalent number of looks comes from the STAC item rather than a guess.
ENL = post_item.properties["sar:looks_equivalent_number"]
def read_s1_db(date: str, pol: str = "vv") -> np.ndarray: """Mosaic every frame of one orbit on one date, Lee-filter in linear power, return dB.""" frames = [i for i in s1_items if i.datetime.strftime("%Y-%m-%d") == date and i.properties["sat:relative_orbit"] == S1_ORBIT] power = np.full((HEIGHT, WIDTH), np.nan, "float32") for it in frames: arr = warp(it.assets[pol].href) power = np.where(np.isfinite(power), power, arr) return 10 * np.log10(lee_filter(power))
vv = {d: read_s1_db(d) for d in (S1_CONTROL, S1_PRE, S1_POST)}2024-10-08: 100.0% valid, median -9.1 dB2024-10-20: 100.0% valid, median -9.4 dB2024-11-01: 100.0% valid, median -8.4 dBThe whole study area is covered on all three dates. The median brightens slightly after the flood, which is what wet soil does: water in the soil raises its dielectric constant and it reflects more radar energy.
Step 4: map new water by change detection
A pixel is new water if it is below the water threshold after the event, was above it before, and has darkened by at least 3 dB. The extra 3 dB rule stops pixels that sit just either side of the threshold from flickering in and out. We clean the result with a morphological opening and drop patches smaller than 0.2 hectares.
pre, post = vv[S1_PRE], vv[S1_POST]s1_valid = np.isfinite(pre) & np.isfinite(post)thr = threshold_otsu(post[s1_valid])DROP = -3.0
def s1_flood(before, after): return clean((after < thr) & (before >= thr) & (after - before < DROP))
s1_water_pre = clean(pre < thr)s1 = s1_flood(pre, post) & s1_validcontrol = s1_flood(vv[S1_CONTROL], pre) & s1_valid # the same rule on two dry datesOtsu threshold on 2024-11-01: -12.3 dB; change rule: below it, above it before, and -3 dB darkerwater on 2024-10-20: 76.2 km²new water on 2024-11-01: 24.2 km²same rule on two dry dates (2024-10-08 -> 2024-10-20): 4.37 km² flaggedThe control is the useful number here. Run between two dry dates, the same rule flags 4.37 km²: that is our false-alarm floor, from speckle, ploughing and changing crops. The flood pass flags 24.2 km², more than five times as much. Of that, 14.7 km² lies outside permanent water and is scored in Step 6.
The histogram on the left shows why the threshold, −12.3 dB, is higher than the −15 to −18 dB often quoted for open water. The land peak holds far more pixels than the water mode (the sea, the lagoon and the flooded paddies), so Otsu’s split sits on the lower flank of the land peak rather than in the middle of the valley. Some dark fields fall below it, which is why the change rule and the dry-date control matter. On the right, the flood is easy to see: a second hump of pixels that darkened by about 10 dB.
Step 5: add Sentinel-2 water and fresh sediment
Sentinel-2 cannot see through cloud, but it can see mud. Tile 30SYJ was imaged on 26 October (before) and 31 October at 10:51 UTC, 44 hours after the event. The western part of the 31 October scene is under cumulus, and the east has haze. We read five bands at 10 m and the scene classification layer (SCL), and we mask cloud, cloud shadow and saturated pixels on both dates.
def read_s2(item) -> dict: """Surface reflectance (0-1) at 10 m. Baseline 04.00+ scenes carry a +1000 offset.""" offset = 1000 if float(item.properties["s2:processing_baseline"]) >= 4 else 0 bands = {b: (warp(item.assets[b].href, Resampling.bilinear) - offset) / 10000 for b in ("B02", "B03", "B04", "B08", "B11")} bands["SCL"] = warp(item.assets["SCL"].href, Resampling.nearest, "uint8") return bands
def mndwi(b): return (b["B03"] - b["B11"]) / (b["B03"] + b["B11"])
def sediment(b): """Normalised difference of red and SWIR1: wet, fresh mud is bright in red and dark in SWIR1.""" return (b["B04"] - b["B11"]) / (b["B04"] + b["B11"])
s2_clear = ~np.isin(s2[S2_POST]["SCL"], S2_CLOUD) & ~np.isin(s2[S2_PRE]["SCL"], S2_CLOUD)permanent = (mndwi(s2[S2_PRE]) > 0) | (s2[S2_PRE]["SCL"] == 6) | s1_water_pres2_water = clean((mndwi(s2[S2_POST]) > 0) & ~permanent) & s2_cleard_sed = sediment(s2[S2_POST]) - sediment(s2[S2_PRE])s2_sed = clean((d_sed > 0.2) & ~s2_water & ~permanent) & s2_clearThe sediment index is simple. Fresh, wet mud from the ravines is reddish-brown and still holds water, so it is bright in red and dark in shortwave infrared. A rise of more than 0.2 in the red/SWIR1 normalised difference since 26 October marks ground that has been covered with it. Permanent water combines three sources (the pre-event MNDWI, the SCL water class and the pre-event radar water) so that the sea, the port, the lagoon and the river are left out of every score.
2024-10-26 30SYJ 10:51 UTC | tile cloud 21% | baseline 05.112024-10-31 30SYJ 10:51 UTC | tile cloud 56% | baseline 05.11post-event scene: 44 hours after the rain beganclear on both dates (SCL): 56.8% of the study areapermanent water (sea, port, Albufera, river): 94.4 km²new water, MNDWI > 0: 11.2 km²fresh sediment, red/SWIR1 index up by > 0.2: 28.8 km²Only 56.8% of the study area is clear on both dates. Any score that uses Sentinel-2 must be computed on those pixels only, otherwise cloud would count as “not flooded”.
Step 6: score the maps against Copernicus EMS
Now the honest part. We rasterise the EMS polygons (flooded area plus flood trace) onto the same grid and compare pixel by pixel. The evaluation domain is the EMS area of interest, minus permanent water, minus pixels without radar. The Sentinel-2 methods are scored only where Sentinel-2 was clear on both dates. We count each cell of the confusion matrix in square kilometres.
domain = in_aoi & s1_valid & ~permanentcombined = s1 | s2_water | s2_sed
def agreement(pred, ref, where) -> dict: tp = km2(pred & ref & where) fp = km2(pred & ~ref & where) fn = km2(~pred & ref & where) tn = km2(~pred & ~ref & where) return {"domain_km2": tp + fp + fn + tn, "ours_km2": tp + fp, "ems_km2": tp + fn, "TP": tp, "FP": fp, "FN": fn, "TN": tn, "precision": tp / (tp + fp), "recall": tp / (tp + fn), "F1": 2 * tp / (2 * tp + fp + fn), "IoU": tp / (tp + fp + fn), "overall": (tp + tn) / (tp + fp + fn + tn)}
methods = { "S1 change, all pixels": (s1, domain), "S1 change, S2-clear pixels": (s1, domain & s2_clear), "S2 water (MNDWI)": (s2_water, domain & s2_clear), "S2 water + sediment": (s2_water | s2_sed, domain & s2_clear), "S1 + S2 combined": (combined, domain & s2_clear),}metrics = pd.DataFrame({k: agreement(p, ems_any, w) for k, (p, w) in methods.items()}).T domain_km2 ours_km2 ems_km2 TP FP FNS1 change, all pixels 335.8 14.7 78.9 14.6 0.1 64.3S1 change, S2-clear pixels 182.3 9.1 50.0 9.1 0.1 40.9S2 water (MNDWI) 182.3 11.2 50.0 11.0 0.2 39.0S2 water + sediment 182.3 40.0 50.0 23.3 16.8 26.7S1 + S2 combined 182.3 40.6 50.0 23.8 16.8 26.2 precision recall F1 IoU overallS1 change, all pixels 0.991 0.185 0.311 0.184 0.808S1 change, S2-clear pixels 0.994 0.182 0.307 0.182 0.775S2 water (MNDWI) 0.984 0.220 0.360 0.219 0.785S2 water + sediment 0.581 0.465 0.517 0.348 0.761S1 + S2 combined 0.586 0.476 0.526 0.357 0.764Read it row by row:
- Sentinel-1 alone is precise and incomplete. Of 14.7 km² it mapped, 14.6 km² is inside the EMS footprint (precision 0.99). But it found only 18.5% of the 78.9 km² EMS mapped, so F1 is 0.31 and IoU 0.18.
- Sentinel-2 water behaves the same way: precision 0.98, recall 0.22. Water is water, whichever sensor sees it.
- Adding sediment more than doubles the true positives, from 11.0 to 23.3 km², and lifts F1 to 0.52. It also adds 16.6 km² of false positives, so precision falls to 0.58.
- Everything combined gives the best scores: F1 0.53, IoU 0.36.
- Overall accuracy stays between 0.76 and 0.81 whatever we do, because dry land that both maps agree on dominates the domain. Do not report it alone for a flood map.
ours flooded ours not floodedEMS flooded 23.8 26.2EMS not flooded 16.8 115.5Recall by EMS class
The table above mixes two different things. Splitting recall by the EMS notation shows where each method succeeds.
flooded area flood tracemethodS1 change, all pixels 0.715 0.005S1 change, S2-clear pixels 0.759 0.002S2 water (MNDWI) 0.914 0.004S2 water + sediment 0.939 0.318S1 + S2 combined 0.981 0.319Where EMS saw water, we found it: 72% with radar alone, 98% with both sensors. Where EMS saw only the traces of a flood that had passed, radar found 0.5%, which is no better than chance. The sediment index found 32% of the traces. That is the whole gap between F1 0.31 and F1 0.53.
A second reference: the very-high-resolution map of Horta Sud
EMS also mapped AOI03, Horta Sud, from WorldView-2 (0.5 m) and GeoEye-1 (2 m) images taken on 31 October. That is an independent check on the towns themselves.
VHR-mapped flood inside the study area: 16.8 km² (11.1 km² on S2-clear pixels)share caught: S1 1.0%, S1 + S2 combined 34.4% (S2-clear pixels)The same pattern: radar caught 1% of the flood mapped from half-metre imagery in the towns, and the combined map caught 34%.
The map makes the numbers concrete. The green band through the rice fields is where the methods agree. The large purple area through Picanya, Paiporta and the farmland west of Aldaia is flood trace that EMS drew from Landsat-8 on 30 October and that no index of ours picked up. The orange speckles in the south-west are mostly irrigated orchards and fields whose red/SWIR1 ratio changed for other reasons, including haze on 31 October. Notice too what is missing: the whole flood path from the Poyo ravine through Paiporta to Catarroja is almost free of green.
Step 7: save the flood map
The script writes the result as a single-band GeoTIFF with one class per source, and as polygons in a GeoPackage, so it can go straight into the next steps of the response. Where the sources overlap, radar water takes priority, then Sentinel-2 water, then sediment, which is why the GeoPackage holds less Sentinel-2 water than the Step 5 total.
classes = np.zeros((HEIGHT, WIDTH), "uint8")classes[s2_sed] = 3classes[s2_water] = 2classes[s1] = 1classes[~domain] = 255# ... write flood_valencia_2024.tif, then vectorise with rasterio.features.shapespolys.to_file(OUT / "flood_valencia_2024.gpkg", driver="GPKG")6,314 polygons: S1 water 2024-11-01 14.7 km², S2 sediment 2024-10-31 28.8 km², S2 water 2024-10-31 2.7 km²The script also writes metrics.json with every score, so you can track agreement as you change thresholds.
What this means for responders
Two days after a flash flood, free satellite imagery is reliable for where water is still standing: precision was 0.98 to 0.99 for both sensors. That matters for pumping, access and the rice fields. It is not reliable for where the flood went. For that, the Copernicus EMS products, which combine every available image and analyst judgement, were far more complete than any automatic method here. Use your own map to fill gaps and to update between EMS deliveries, and use the agreement matrix to tell users how far to trust it.
Limitations and how to improve them
- Timing beats method. The 31 October Sentinel-1 scene used by EMS is not on the Planetary Computer; download the GRD from the Copernicus Data Space Ecosystem and process it to RTC to gain 12 hours.
- The reference is not ground truth. EMS flood trace was drawn largely from 30 m Landsat-8, so its edges are coarser than our 10 m pixels.
- The rice paddies are flooded on purpose in autumn and winter, so some of the radar darkening around the Albufera may be farming rather than the storm.
- The sediment index is crude. Haze on 31 October and harvested fields cause false positives; a pre/post texture measure or a classifier trained on the AOI03 polygons would do better.
- Flooded streets look bright in radar, not dark, because of double bounce off walls. A backscatter-increase rule, like the amplitude change used in earthquake damage mapping with Sentinel-1, is worth testing in the towns.
- Terrain context helps. A height above nearest drainage mask, as in HAND flood mapping in Python, would remove most commission on higher ground.
Frequently asked questions
Why did Sentinel-1 miss most of the Valencia flood?
Because the water had gone. The first Sentinel-1 pass on the Planetary Computer was on 1 November at 06:02 UTC, 64 hours after the rain began. By then the towns of L’Horta Sud had drained and were covered in mud and debris, which does not look dark to radar. Sentinel-1 still found 72% of the area that Copernicus EMS mapped as standing water, with precision 0.99.
Can Sentinel-2 map flood mud and debris?
Partly. A rise in the normalised difference of red and SWIR1 between a pre-event and post-event scene marks fresh, wet mud. Here it found 32% of the EMS flood traces, against 0.5% for radar, but it also added 16.8 km² of false positives in farmland. It works only on cloud-free pixels, which were 56.8% of the study area on 31 October.
How do I compare my flood map with a Copernicus EMS map?
Download the EMS delineation vectors from the activation page, rasterise the observed event polygons onto your grid, remove permanent water and cloud from the comparison, and count true positives, false positives, false negatives and true negatives. Report precision, recall, F1 and IoU. Split recall by the EMS notation field (flooded area or flood trace) to see what kind of flood you are missing.
What is a good F1 score for a flood map?
There is no fixed bar; it depends on the event, the reference and the time between them. Against standing water alone, our methods were near-perfect here (precision 0.98 to 0.99, recall of EMS flooded area up to 0.98). Against a footprint that is mostly dried flood trace, F1 0.53 was the best we reached two days after a flash flood. Always report the confusion matrix in area units next to the score, and the time gap between your image and the reference.
Is Copernicus EMS data free to use?
Yes. Copernicus EMS products are free, full and open, under the Copernicus data policy (Regulation (EU) 2021/696), with ownership credited as © European Union, Copernicus Emergency Management Service. See the service’s terms and conditions.
Next steps
- Go back to Part 1, rapid situational mapping from open data, and add this flood layer to the situation map.
- Part 3 of the series uses a flood extent like this one to count the buildings and people exposed, and Part 4 removes flooded roads from the network to test access to hospitals.
- Revisit the radar basics in Sentinel-1 SAR flood mapping in Python, and compare speckle filters in SAR speckle filtering in Python.
- Learn the Sentinel-2 STAC workflow and water indices in Measuring Lake Mead’s shrinking shoreline with Sentinel-2 and STAC, and improve the cloud mask with Sentinel-2 cloud masking in Python.
- Add terrain with height above nearest drainage (HAND) flood mapping in Python.
- Learn more ways to score a map in land cover accuracy assessment in Python.
Data and licences
- Copernicus EMS Rapid Mapping, activation EMSR773 (AOI01 and AOI03 delineation products): © European Union, Copernicus Emergency Management Service. Free, full and open access under the Copernicus data policy; see the terms and conditions. Downloaded from the activation page on 17 November 2026.
- Sentinel-1 RTC: contains modified Copernicus Sentinel data 2024, processed by ESA; radiometric terrain correction by Catalyst/Microsoft. Licensed CC BY 4.0. Accessed from the Microsoft Planetary Computer on 17 November 2026.
- Sentinel-2 Level-2A: contains modified Copernicus Sentinel data 2024, free and open under the Copernicus Sentinel data terms. Accessed from the Microsoft Planetary Computer on 17 November 2026.
- Death toll: Consejo General del Poder Judicial, press release of the Catarroja investigating court (CGPJ), accessed 17 November 2026.
- References: Xu, H. (2006), “Modification of normalised difference water index (NDWI) to enhance open water features in remotely sensed imagery”, International Journal of Remote Sensing 27(14); Lee, J.-S. (1980), IEEE Transactions on Pattern Analysis and Machine Intelligence 2(2); Otsu, N. (1979), IEEE Transactions on Systems, Man, and Cybernetics 9(1).
- Code:
satellite_flood_mapping.py, tested with Python 3.12.0, pystac-client 0.9.1, planetary-computer 1.0.0, rasterio 1.5.2, geopandas 1.2.0, numpy 2.5.5 and scikit-image 0.26.0.
Key terms
- DANA
- Depresión aislada en niveles altos: an isolated upper-level low (a 'cut-off low') that can stall over warm Mediterranean water and release extreme rain.
- Copernicus EMS Rapid Mapping
- The European Union's on-demand emergency mapping service. After an activation it delivers flood delineation and damage grading maps, usually within hours to days.
- Flood trace
- An EMS class for ground that was flooded but has dried out by the time of the image, recognised from mud, debris and damaged vegetation.
- MNDWI
- Modified normalised difference water index, (green − SWIR1) / (green + SWIR1). Open water is usually above zero.
- F1 and IoU
- Agreement scores for a mapped class. F1 = 2TP / (2TP + FP + FN); IoU (intersection over union) = TP / (TP + FP + FN). Both ignore the true negatives.
Data for this tutorial
- Microsoft Planetary Computer · Sentinel-1 RTC and Sentinel-2 L2A as Cloud Optimised GeoTIFFs via STAC
- Copernicus EMS rapid mapping · Activation EMSR773 delineation vectors, used as the reference
- Copernicus Data Space Ecosystem · Sentinel-1 GRD scenes not mirrored on the Planetary Computer
Licences and formats for each source are listed in the GIS data sources catalogue.
Need this done on your own data? TechnicalGIS takes on consulting projects like this one, from a single analysis to a pipeline your team can rerun.