Skip to contents

For each day, HotSpots at or above the bleaching threshold are accumulated over the current day and previous 83 days, then divided by seven. A complete 84-day calendar window is required; missing dates or values make the affected output windows NA and are never treated as zero heat stress.

Usage

calculate_dhw(
  hs,
  anomaly = 1,
  window = 84L,
  filename = "",
  overwrite = FALSE,
  wopt = list()
)

Arguments

hs

A daily HotSpot terra::SpatRaster.

anomaly

Numeric HotSpot accumulation threshold. NOAA CRW uses 1.

window

Positive integer number of consecutive days. NOAA CRW uses 84.

filename

Optional output filename.

overwrite

Overwrite an existing filename.

wopt

Named list of write options passed to terra::writeRaster().

Value

A daily terra::SpatRaster of degree C-weeks. The first window - 1 layers are NA because a complete history is unavailable.