openghg_inversions.rhime.co2.co2_o2_runner#

Advanced replay seam for prepared CO2/O2 scientific inputs.

openghg_inversions.rhime.co2.co2_o2_runner.run_rhime_co2_o2_from_prepared_inputs(*, prepared_inputs: Co2O2PreparedInputs, independent_error_sd: DataArray, state_activity: StateActivity | None = None, sampler: RhimeSampler | None = None) InferenceData#

Build and sample the CO2/O2 model from prepared scientific inputs.

This advanced replay seam begins after channel preparation. The public run_rhime_co2_o2 name is reserved for the future complete production recipe, including acquisition, preparation, materialization, and outputs.

The fixed independent channel error is required and remains labelled. Run policy, such as the UOB prototype’s one ppm value for both channels, belongs to the caller rather than the model API.

Parameters:
  • prepared_inputs – Validated preparation handoff containing joint observations and affine intercept on ("observation",), separate channel sensitivities on their native observation axes and the retained state axis, a dense joint aggregation covariance, retained prior, ratio provenance, units, labels, and scientific provenance.

  • independent_error_sd – Positive finite fixed standard deviations on ("observation",). Labels and observation_units must match prepared_inputs.observations exactly. These values remain fixed data and are not an inferred mismatch amplitude.

  • state_activity – Optional labelled active/fixed policy on the retained state dimension. Omitted states use the model’s structural activity policy.

  • sampler – Optional RHIME sampler configuration. The accepted CO2/O2 NumPyro defaults are used when omitted.

Returns:

Restored inference data with observed concentrations in observed_data["y"], fixed independent standard deviations in constant_data["fixed_independent_error_sd"], labelled coordinates, data-dependent concentration units, scientific-role annotations, and JSON model metadata.

Raises:

ValueError – If the fixed independent standard deviation is not a finite positive real numeric vector or fails the model’s observation-label/unit contract. Label, state, covariance, and activity errors from model construction are also propagated.