Skip to contents

Invokes LANDIS-II once against the scenario in scenario_dir, blocks until completion, and verifies that the year-0 snapshot files emitted by the Output Biomass Community extension landed on disk.

Usage

run_calibration_spinup(
  scenario_dir,
  base_seed = 12345L,
  method = NULL,
  image = NULL,
  pull = FALSE,
  dedup = TRUE
)

Arguments

scenario_dir

Character. Spinup scenario directory (containing scenario.txt), typically the return of build_calibration_spinup_scenario().

base_seed

Integer. Random seed passed to LANDIS-II via the per-rep RandomNumberSeed rewrite.

method

Character. "docker" or "local". Default from getOption("landisutils.run.method").

image

Character or NULL. Docker image (Docker only).

pull

Logical. docker pull before running (Docker only). Default FALSE.

dedup

Logical. Collapse duplicate communities in the resulting snapshot via dedup_community_snapshot() before returning. Default TRUE. Biomass Succession emits one map code per PIXEL, so on a large landscape the snapshot is overwhelmingly duplicate rows and is liable to OOM the LANDIS-II initial-communities parser when read back (see that function). The collapse is state-preserving – every pixel keeps exactly its cohort list – so this is on by default; set FALSE only to inspect the raw writer output.

Value

Character scalar: absolute path to the year-0 snapshot CSV (<scenario_dir>/rep01/community-input-file-0.csv). The TIF (output-community-0.tif) lives alongside.

Details

Dispatches to landis_run_local() or landis_run_docker() based on method – both are synchronous and stop on a non-zero exit, so this wrapper only has to verify the expected files appeared.

Per LANDIS-II convention, scenarios are invoked from a numbered replicate sub-directory (rep01/); landis_replicate() materialises that with a base_seed-derived RandomNumberSeed, then the run happens inside it. Top-level scenario_dir stays clean (output files land under rep01/).