openghg_inversions.rhime.co2.co2_runner#
Readable prepared-input runner for the CO2 RHIME recipe.
- openghg_inversions.rhime.co2.co2_runner.co2_model_input_names(prepared_inputs: RhimePreparedInputs, *, aggregation_error_mode: Literal['auto', 'none', 'dense', 'low_rank', 'diagonal'], preserve_prepared_fixed_mismatch: bool) tuple[str, ...]#
Declare prepared arrays consumed by the selected CO2 components.
- Parameters:
prepared_inputs – Prepared RHIME artifact containing the candidate inversion inputs.
aggregation_error_mode – Aggregation-error representation selected for the likelihood.
preserve_prepared_fixed_mismatch – Include a prepared fixed mismatch field when present.
- Returns:
Names of the arrays to materialize for model construction.
- Raises:
ValueError – If a required prepared input is absent.
- openghg_inversions.rhime.co2.co2_runner.run_rhime_co2(*, prepared_inputs: RhimePreparedInputs, sigma_alignment: SigmaAlignment | None = None, sigma_prior: dict[str, Any] | None = None, fixed_model_mismatch: float | DataArray | None = None, sampler: RhimeSampler | None = None, aggregation_error_mode: Literal['auto', 'none', 'dense', 'low_rank', 'diagonal'] = 'dense', no_model_error: bool = False) InferenceData#
Materialize, build, and sample the CO2 coherent-reduction model.
This callable is the public production replay seam for an already validated
RhimePreparedInputsartifact. It alone unpacks the prepared dataset and constructs the complete retained prior; the model builder receives named scientific values.fixed_model_mismatch=Nonepreserves a prepared fixed-mismatch field if present, otherwise omits the term. An explicit scalar or labelled vector overrides prepared data. By default, inferred model error varies by site over one shared time period. An explicitsigma_alignmentoverrides that alignment;no_model_error=Truedisables inferred model error. The Verification Games fixed-likelihood harness passes 1 ppm and disables inferred model error.- Parameters:
prepared_inputs – Validated coherent-reduction inputs for the CO2 recipe.
sigma_alignment – Optional grouping policy for inferred additive model error. The default is derived from the prepared site indicator.
sigma_prior – Optional prior arguments for inferred additive model error.
fixed_model_mismatch – Optional known scalar or labelled mismatch standard deviation. When omitted, a prepared value is preserved.
sampler – Optional RHIME sampler configuration.
aggregation_error_mode – Prepared aggregation-error representation to use in the likelihood.
no_model_error – If true, omit inferred additive model error.
- Returns:
Sampled inference data annotated with the CO2 variable-role and model manifests.
- Raises:
ValueError – If model-error options contradict
no_model_error, or prepared inputs are missing, inconsistent, or fail model construction.