libera_utils.footprint_matching.types.VariableSpec#

class libera_utils.footprint_matching.types.VariableSpec(name: str, dtype: str, aggregation: str, modes: frozenset[OperationalMode], n_categories: int | None = None)#

Bases: object

Metadata describing a single output variable provided by a reader.

Used by the reader base class and the aggregation engine to know what data a reader supplies, how to aggregate it, and which products carry it.

Variables:
  • name (str) – Variable name used throughout the footprint matching pipeline (e.g., "Surface_Type", "Cloud_Optical_Thickness").

  • dtype (str) – NumPy dtype string for the variable’s data array (e.g., "int16").

  • aggregation (str) – PSF aggregation strategy name (e.g., "weighted_mean", "weighted_mode", "weighted_log_mean"). The strategy is resolved by the aggregation engine from the variables.yaml configuration.

  • modes (frozenset[OperationalMode]) – Every operational mode (product) that carries this variable. A variable belongs to a product exactly when mode in spec.modes, and a reader feeds a product when any of its variables names that product (readers/registry.py derives FMATCH_MODE_READERS from these sets).

  • n_categories (int or None) – For categorical variables only: number of distinct category values (e.g., 20 for IGBP surface type). None for continuous variables, and for a mode-aggregated code with no fixed count (e.g., the CERES FLASHFlux scene and ADM type codes), which the aggregation bins by the codes it sees.

Raises:
__init__(name: str, dtype: str, aggregation: str, modes: frozenset[OperationalMode], n_categories: int | None = None) → None#

Attributes

n_categories: int | None = None#