Skip to contents

This function runs selected parts of the NOAA Coral Reef Watch calculation chain: monthly climatology, MMM, daily climatology, SST anomaly, signed HotSpot, 84-day DHW, single-day Bleaching Alert Area, and its 7-day maximum composite. Intermediate dependencies are calculated automatically but are returned and written only when requested in products.

Usage

create_climatology(
  sst_file,
  anomaly = 1,
  window = 84L,
  quiet = FALSE,
  return = FALSE,
  products = NULL,
  save_output = NULL,
  overwrite = TRUE,
  wopt = list(),
  climatology = NULL,
  encoding = c("native", "noaa"),
  ...
)

Arguments

sst_file

A daily SST terra::SpatRaster, or a path readable by terra::rast().

anomaly

HotSpot threshold accumulated by DHW. NOAA CRW uses 1.

window

Rolling calendar-day window used by DHW. NOAA CRW uses 84.

quiet

Suppress progress messages.

return

Retained for backward compatibility. The result is always returned because historical package usage relies on that behavior.

products

Products to return. Available values are "sst", "mm", "mmm", "climatology", "anomaly", "hotspots", "dhw", and "baa", and "baa_7d". NULL retains the historical default of all products except BAA products.

save_output

Optional output path prefix. Only requested products are written, using <save_output>_<product>.tif.

overwrite

Overwrite existing output rasters.

wopt

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

climatology

Optional 12-layer NOAA-style monthly climatology, or path to one. It must be ordered January to December and use the SST grid.

encoding

Output encoding. "native" retains full calculation precision. "noaa" rounds requested outputs to NOAA's published precision and uses NOAA-compatible integer storage when writing files; see encode_noaa().

...

Reserved for backward compatibility.

Value

A named list containing only the requested products.