openghg_inversions.boundary_sensitivity#

Prepare labelled, backend-neutral boundary-condition sensitivities.

class openghg_inversions.boundary_sensitivity.BoundaryAlignment(data: DataArray)#

Bases: object

Resolved alignment of sampled boundary states to fitted periods.

Parameters:

data – Prepared H_bc with a bc_region MultiIndex whose levels are bc_curtain and bc_period, plus one observation axis.

Raises:

ValueError – If the resolved boundary-state labels are invalid.

data: DataArray#
classmethod prepare(sensitivity: DataArray, *, frequency: str | None = None, anchor_time: str | datetime | datetime64 | Timestamp | None = None, observation_labels: DataArray | None = None) BoundaryAlignment#

Align and expand raw boundary sensitivity over fitted periods.

Parameters:
  • sensitivity – Boundary sensitivity with exactly bc_region and an observation dimension named time or nmeasure.

  • frequency – Optional fitted boundary-period frequency. None creates one period; "monthly" follows calendar months.

  • anchor_time – Optional anchor for fixed-duration periods.

  • observation_labels – Optional authoritative observation coordinate; values are selected and reordered to these exact labels.

Returns:

Prepared boundary sensitivity carrying resolved state invariants.

openghg_inversions.boundary_sensitivity.scale_satellite_boundary_sensitivity_to_column_signal(inputs: Dataset, *, sites: Sequence[str], platform: Sequence[str | None]) Dataset#

Scale satellite boundary sensitivity into corrected-column space.

Parameters:
  • inputs – Gathered inversion inputs containing H_bc and observation arrays. The dataset is borrowed and never mutated.

  • sites – Site labels in the same order as platform.

  • platform – Platform values aligned to sites.

Returns:

The unchanged borrowed dataset when scaling is inapplicable, otherwise a shallow copy whose satellite H_bc rows are explicitly scaled and carry transform provenance.