Waterbodies Seasonal Animations
Products used: DE Africa Waterbodies; DE Africa WOfS; GeoMADs; CHIRPS
Keywords: data used; waterbodies, data used; wofs_ls_summary_annual, data used; CHIRPS, data used; sentinel-2 geomedian, data used; landsat 5 & 7 geomedian, data used; landsat 8 & 9 geomedian
Background
The Digital Earth Africa Continental Waterbodies Monitoring Service identifies more than 700,000 water bodies from over three decades of satellite observations. This service maps persistent and seasonal water bodies and the change in their water surface area over time. Mapped water bodies may include, but are not limited to, lakes, ponds, man-made reservoirs, wetlands, and segments of some river systems. For more information on the waterbodies monitoring service, refer to the Datasets notebook.
Often, it makes sense to visualise changes in waterbodies through time using animations. Animations are a form of exploratory analysis that can help illustrate repeating seasonal patterns. This notebook demonstrates how to generate animations for the time series component of waterbodies alongside summary data from Water Observations from Space, rainfall data, and true-colour imagery.
This notebook demonstrates the creation of animations for waterbodies over seasons, so that seasonal patterns can be identified and interpreted.
Disclaimer: DE Africa Waterbodies Surface Area Change measures the wet surface area of waterbodies as estimated from satellites. This product does not measure depth, volume, purpose of the waterbody, nor the source of the water.
Description
This notebook demonstrates the generation of two animations for inspecting changes in water extent, drawing on the DE Africa Waterbodies service.
Steps taken are:
Loading and preparing monthly time series, rolling GeoMAD, and rainfall data.
Creating an animation that shows monthly and seasonal changes in water extent for a selected waterbody.
Getting started
To run this analysis, run all the cells in the notebook, starting with the “Load packages” cell.
Load packages
Import Python packages that are used for the analysis.
[1]:
import matplotlib.pyplot as plt
import datacube
import matplotlib.dates as mdates
import numpy as np
import matplotlib.animation as animation
from deafrica_tools.plotting import display_map
from IPython.display import HTML
from deafrica_tools.spatial import xr_rasterize
from deafrica_tools.waterbodies import (
get_geohashes,
get_waterbodies,
get_waterbody,
get_time_series,
display_time_series,
)
[2]:
dc = datacube.Datacube(app="Waterbody-anim")
Analysis parameters
Next, an animation showing monthly progression of water extent will be produced.
The default waterbody is Mtera Reservoir in Tanzania. This is a hydroelectric dam so water extent is somewhat under the influence of human decision-making.
[3]:
# Set the central latitude and longitude
lat = -7.05
lon = 35.83
# Set the buffer to load around the central coordinates
buffer = 0.3
# Compute the bounding box coordinates
xlim = (lon - buffer, lon + buffer)
ylim = (lat + buffer, lat - buffer)
# Preview area on a map
display_map(xlim, ylim)
[3]:
Select waterbody
We use the same procedure as above to load available polygons within a specified area and select the waterbody of interest.
[4]:
# Create a bounding box from study area coordinates
bbox = (xlim[0], ylim[1], xlim[1], ylim[0])
# Select all water bodies located within the bounding box
polygons = get_waterbodies(bbox, crs="EPSG:4326")
# Explore the waterbody polygons located within the bounding box
polygons.explore()
[4]:
Inspect time series
The time series for the Mtera Reservoir shows some seasonal variation in water extent, often with with very large filling events followed by progressive contraction of water extent.
This time series is taken directly from the Waterbodies database and is linked to the waterbody geohash; in this case ky9rzpq3c0
as we see when hovering over the polygon in the explorer above. More information on the Waterbodies service and time series can be found in the Datasets notebook and in the documentation.
[5]:
selected_waterbody_geohash = "ky9rzpq3c0"
selected_waterbody = get_waterbody(selected_waterbody_geohash)
# Get time series for the selected water body
selected_waterbody_timeseries = get_time_series(waterbody=selected_waterbody)
display_time_series(selected_waterbody_timeseries)