-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcalculate_dhw.Rd
23 lines (20 loc) · 977 Bytes
/
calculate_dhw.Rd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/calculate_dhw.R
\name{calculate_dhw}
\alias{calculate_dhw}
\title{Calculate DHW}
\usage{
calculate_dhw(hotspots, window = 84)
}
\arguments{
\item{hotspots}{hotspots}
\item{window}{number of days to sum hotspots, default = 84 (12 weeks)}
}
\value{
degree heating weeks (terra::rast format)
}
\description{
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
}