Skip to contents

Creates a properly formatted input parameters data frame for ZooMSS model simulations, combining temporal parameters with environmental time series data.

Usage

createInputParams(time, sst, chl, cellID = NULL)

Arguments

time

Numeric vector of time values in years (must be increasing and uniform, can start at any value)

sst

Numeric vector of sea surface temperature values in deg C

chl

Numeric vector of chlorophyll concentration values in mg/m^3

cellID

Optional numeric vector of cell identifiers for spatial data (default: NULL)

Value

Data frame with columns: time, time_step, sst, chl, and cellID (if provided)

Details

Create ZooMSS Input Parameters Object

This function combines environmental time series (SST and chlorophyll) with time data to create the input_params object required by zoomss_model(). The function performs validation checks using assertthat to ensure:

  • All input vectors are numeric and of equal length

  • SST values are within reasonable ocean range (-2 to 35 deg C)

  • Chlorophyll values are positive and within typical range (0 to 50 mg/m^3)

  • Time values are increasing and reasonable

Examples

if (FALSE) { # \dontrun{
# Create simple environmental time series
time_vec <- seq(0, 10, 0.01)  # 10 years with 0.01 year time steps
sst_vec <- 15 + 3*sin(2*pi*time_vec/1)  # annual cycle
chl_vec <- 0.5 + 0.2*cos(2*pi*time_vec/1)  # annual cycle

# Create input parameters object
input_params <- createInputParams(time_vec, sst_vec, chl_vec)

# Use with ZooMSS model
results <- zoomss_model(input_params, Groups, isave = 50)
} # }