Skip to contents

This function creates NetCDF files for model inputs and saves the geometry of the spatial units used in the simulations. It processes the input data frame, merges output files, and writes the results to the specified version directory. If S3 storage is configured and enabled, the created NetCDF files and geometry archive will be automatically uploaded to S3.

Usage

create_database_inputs(
  inputs,
  geometry = attr(inputs, "geometry"),
  force = FALSE,
  to_S3 = TRUE,
  path_local_db = getDataPath("Database", cfg = cfg_package),
  clean_local_db = TRUE,
  cfg_package,
  cfg
)

Arguments

inputs

data.frame Input data frame containing simulation parameters.

geometry

sf::sf Geometry of the spatial units used in the simulations.

force

logical Whether to force the creation of the uptakes data from the raw data.

to_S3

logical Whether to upload the created files to S3 if S3 storage is enabled.

path_local_db

character Local path to save the database files before uploading to S3.

clean_local_db

logical Whether to delete local files after successful upload to S3.

cfg_package

list Configuration parameters for the package.

cfg

a config object. Configuration to use. See loadConfig for details

Details

S3 Storage

If S3 storage is enabled in the configuration (cfg$s3$enabled = TRUE), the function will automatically upload:

  • NetCDF files to s3://bucket/Runs/version/filename.nc

  • Geometry archive to s3://bucket/Runs/version/geometry.zip

S3 configuration should be set in config.yml:


s3:
  enabled: true
  endpoint: "https://minio.example.com"
  access_key: "your_access_key"
  secret_key: "your_secret_key"
  bucket: "your_bucket"