Skip to contents

Function to calculate hotspots

The function computes the Degree Heating Weeks (DHW) metric, which accumulates heat stress over a specified rolling window (defaulting to 84 days). The function operates by applying a rolling sum on the input hotspots raster data. For each pixel, if the daily hotspot values are greater than or equal to 1, they are summed over the rolling window and divided by 7 to calculate weekly averages using zoo::rollapply. The function returns a raster object with the calculated DHW values, which represent accumulated heat stress.

See vignette for further details

Usage

calculate_dhw(hotspots, window = 84)

Arguments

hotspots

hotspots

window

number of days to sum hotspots, default = 84 (12 weeks)

Value

degree heating weeks (terra::rast format)