osmose.java_background_staging

Stage a background-species (simulation.nbackground > 0) config to run on the Java 4.4.1 jar.

OSMOSE 4.4.1 can run a config with background predators (Baltic: GreySeal, Cormorant), but only with keys the OSMOPY configs don’t ship: an inline species.biomass.spN time-series, the background species in the predation-accessibility + catchability/discards matrices, explicit movement maps, simulation.nschool.spN, output.diet.stage.threshold.spN, and output.cutoff.enabled=false (a 4.4.1 OutputRegion.include OOB with nbackground>0). This module materialises all of that on a STAGED copy of the config (never data/) so the UI Java path can run such configs.

Scope is Baltic-specific: the accessibility + diet-stage tables are hand-authored for GreySeal/Cormorant (validated in sub-project A). background_staging_supported gates other configs.

This module must NOT import osmose.runner or ui.pages.run (write_temp_config) — the orchestrator takes an ALREADY-STAGED dir; the caller stages first. (Else: runner -> this -> ui.run -> runner import cycle.)

Functions

augment_accessibility(csv_path, predators)

Add background predators as columns (authored prey access) + apex prey rows (0), in place.

background_staging_supported(config)

True iff every background species in config has a hand-authored staging table entry.

inline_biomass_series(nc_path, varname)

Per-step domain-total biomass (length = n time steps) for a background species' NetCDF var.

stage_background_for_java(stage_dir, raw_config)

Materialise the 4.4.1 background-species keys/matrices into an already-staged config dir.