Skip to contents

Calculate explicitly defined SST variability metrics

Usage

calculate_metrics(
  rast_obj,
  lyr = seq_len(terra::nlyr(rast_obj)),
  metric,
  baseline = NULL,
  trend_units = c("year", "day")
)

Arguments

rast_obj

A terra::SpatRaster with one valid date per selected layer.

lyr

Layer names or indices selecting the SST time series.

metric

One of "SSTA", "SST_SD", "SST_Trend", "SST_Variance", "SST_Seasonality", "SST_Interannual_Amplitude", or "SST_Skewness".

baseline

Optional inclusive year range used by "SSTA". If omitted, all selected years define the monthly climatology.

trend_units

Units for the trend slope: "year" or "day".

Value

A terra::SpatRaster. Annual metrics contain one layer per year; SSTA retains the input dates; other metrics return one summary layer.