libera_utils.footprint_matching.aggregation.stack_product_values#

libera_utils.footprint_matching.aggregation.stack_product_values(reader_cls: type[AncillaryReader], scalars: dict[str, float]) → dict[str, float | np.ndarray]#

Shape one footprint’s per-spec scalars from one source into its product variables.

Each of the reader’s stacks (reader_cls.product_stacks()) becomes one 1-D array holding its members’ scalars in coordinate order, the footprint’s row of a (time, dimension) product variable. Every scalar that is not a stack member is passed through as the 1-D product variable it already is.

Parameters:
Returns:

A float64 array of length len(stack.members) under each stack’s name, and every unstacked scalar under its own name. Names are bare, as in scalars.

Return type:

dict[str, float | np.ndarray]

Raises:

ValueError – If scalars lacks a member of one of the reader’s stacks, so a stacked variable would be missing a level.