libera_utils.footprint_matching.aggregation.weighted_mode#

libera_utils.footprint_matching.aggregation.weighted_mode(values: ndarray, weights: ndarray, *, n_categories: int | None = None, **_: Any) → dict[str, Any]#

PSF-weighted mode argmax_c sum(w*[x==c]) for categorical variables.

Returns the dominant class plus the per-class PSF-weight fractions, which record the scene mix within the footprint (design doc section 2.8.1.4.3). The mode is NaN when the footprint had no usable categorical data.