libera_utils.scene_identification.scene_id.CalculationSpec#

class libera_utils.scene_identification.scene_id.CalculationSpec(output_var: str, function: Callable, input_vars: list[str], output_datatype: type, dependent_calculations: list[str] | None = None)#

Bases: object

Specification for calculating a derived variable.

Defines the parameters needed to calculate a derived variable from input data, including the calculation function, required inputs, and any dependencies on other calculated variables.

Variables:
  • output_var (str) – Name of the output variable to be created

  • function (Callable) – The function to call for calculation

  • input_vars (list of str) – List of input variable names required by the function

  • output_datatype (type) – Expected data type of the output (e.g., float, int)

  • dependent_calculations (list of str or None, optional) – List of other calculated variables that must be computed first, or None if no dependencies exist. Default is None.

Examples

>>> spec = CalculationSpec(
...     output_var="Cloud_Fraction",
...     function=calculate_cloud_fraction,
...     input_vars=["clear_area"],
...     output_datatype=float
... )
__init__(output_var: str, function: Callable, input_vars: list[str], output_datatype: type, dependent_calculations: list[str] | None = None) → None#

Attributes

dependent_calculations: list[str] | None = None#