Skip to contents

Daily SST is first averaged within every year-month in 1985–2012. A separate linear regression is then fitted to the annual monthly means for each calendar month, and evaluated at 1988.286. This is the NOAA Coral Reef Watch Version 3.1 climatology method.

Usage

calculate_monthly_mean(
  sst_file,
  midpoint = 1988.286,
  return = c("predict", "slope", "intercept"),
  filename = "",
  overwrite = FALSE,
  wopt = list()
)

Arguments

sst_file

A terra::SpatRaster containing daily SST with a valid, strictly increasing time dimension.

midpoint

Numeric year at which each monthly regression is evaluated. NOAA CRW uses 1988.286.

return

One of "predict", "slope", or "intercept".

filename

Optional output filename. When supplied, the result is written directly by terra instead of first being held in a temporary raster.

overwrite

Overwrite an existing filename.

wopt

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

Value

A 12-layer terra::SpatRaster, ordered January to December.