osmose.calibration.larva_recal

SP1b — mean-neutral recalibration of cod larval mortality for the SP1 spatial term.

Pure 1-D root finder: coarse grid scan over [0, d0] -> sign-change feasibility gate -> bisection. Engine-free (the caller injects run_mean_on); see the SP1b design spec.

Functions

e_clip_first_guess(field_path, spawn_path, d0)

Analytical first-guess rate d1 = clip(d0 + ln E[clip], 0, d0), and E[clip].

mean_cod(cfg, *[, seed])

Mean cod biomass over years index [3:15] (finite & >0), matching the SP1 diagnostic.

solve_larva_rate(baseline, run_mean_on, *, ...)

Find the larva rate whose SP1-on mean cod biomass matches baseline within tol.

sp1_on_config(base_cfg, field_path, *[, ...])

SP1-on config: SP1 flags + determinism keys + recalibrated cod larva rate.

with_determinism(cfg)

Return a copy of cfg with the two fixed-seed keys set (required for a reproducible solve; the runtime numba single-thread pin is set separately by the caller).

Classes

RecalResult(rate, baseline, mean_on, ...)