libera_utils.footprint_matching.aggregation.aggregate#
- libera_utils.footprint_matching.aggregation.aggregate(strategy: str, values: ndarray, weights: ndarray, **kwargs: Any) AggregationResult#
Run a named aggregation strategy and wrap it with sample bookkeeping.
Looks
strategyup in the registry, invokes it on(values, weights), and packages the result in anAggregationResultwith the number of samples that contributed.- Parameters:
strategy (str) – Registered strategy name (a key of
_STRATEGIES).values (np.ndarray) – Per-cell data values and PSF weights (any shape; flattened internally by the strategies via the usable-mask helper).
weights (np.ndarray) – Per-cell data values and PSF weights (any shape; flattened internally by the strategies via the usable-mask helper).
**kwargs – Extra strategy arguments (
n_categoriesfor the mode strategies).
- Return type:
- Raises:
ValueError – If
strategyis not registered.