Overview
Coral reefs are shaped not only by what we can measure on the reef itself, but by the environmental conditions surrounding it. This example shows how to connect MERMAID ecological data with environmental covariates, combining hard coral cover from MERMAID's benthic protocols with satellite-derived heat stress to explore their relationship across reefs in East Africa, represented here by surveys from Kenya and Tanzania.
These environmental covariates come from the newly released MERMAID covariates platform, a centralized, regularly updated catalogue of remote-sensing datasets — climate, environmental, and social — normalized so they can be paired directly with MERMAID survey locations. You can browse the full catalogue at mermaid.prescient.earth, and access the data programmatically through the mermaidrcovariates package, a companion to the mermaidr package, used throughout this example.
The heat stress metric used throughout is Degree Heating Weeks (DHW). DHW measures accumulated heat stress rather than temperature at a single moment: it sums how far sea surface temperature has risen above the highest monthly mean expected at a location over the preceding 12 weeks, so one DHW is equivalent to one week at 1 °C above that threshold. NOAA Coral Reef Watch treats 4 DHW as the point at which significant bleaching becomes likely (Bleaching Alert Level 1) and 8 DHW as the point at which severe bleaching and mortality become likely (Alert Level 2). These two values are used as thresholds throughout the analysis.
Accessing covariates with mermaidrcovariates
The mermaidrcovariates package provides access to a range of environmental covariates for MERMAID survey locations. The list_covariates() function lists what is available, and get_zonal_statistics() extracts a chosen covariate — here, DHW — for each survey location. In this example we extract DHW for the 30 days prior to each survey, but the same approach works over any window.
The extraction returns one value per day per survey — a short time series for each sample event rather than a single number. We collapse that series to a single value per survey by taking the maximum rather than the mean, because bleaching is driven by peak accumulated stress: averaging across the month would dilute a short, severe event into an unremarkable number.
Coral cover versus heat stress
Bringing coral cover and heat stress together shows how the two relate across surveys. Splitting the data by year helps separate chronic patterns from individual heat stress events, and only years in which at least one survey exceeded 4 DHW are shown. In the figure below, each point is one survey; the shaded bands mark the NOAA bleaching alert levels described above — green below 4 DHW, amber from 4 to 8, and red above 8.
Mapping survey sites by heat stress
The same surveys can also be mapped in space, using the DHW banding from the figure above. In the full resource the map is interactive, with a dropdown that filters to a single survey year — useful because many sites were surveyed repeatedly and would otherwise plot on top of one another. The image below is a saved static version of that interactive map.
Reference
NOAA Coral Reef Watch. Degree Heating Weeks and Bleaching Alert Levels. https://coralreefwatch.noaa.gov/.