openghg_inversions.boundary_sensitivity#
Prepare labelled, backend-neutral boundary-condition sensitivities.
- class openghg_inversions.boundary_sensitivity.BoundaryAlignment(data: DataArray)#
Bases:
objectResolved alignment of sampled boundary states to fitted periods.
- Parameters:
data – Prepared
H_bcwith abc_regionMultiIndex whose levels arebc_curtainandbc_period, plus one observation axis.- Raises:
ValueError – If the resolved boundary-state labels are invalid.
- 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_regionand an observation dimension namedtimeornmeasure.frequency – Optional fitted boundary-period frequency.
Nonecreates 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_bcand 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_bcrows are explicitly scaled and carry transform provenance.