bluegreencity-ki

Seasonal Weather Criterion

Overview

The seasonal_weather criterion attaches per-tree annual DWD-derived weather context to every tree without contributing to the rule-based drought-risk score. It is a neutral feature carrier for the AutoML workflow and provides six seasonal variables for the active feature_reference_year:

Since issue #213 (plan block F, 2026-08-30), the values are spatially resolved per tree (nearest 1 km DWD grid cell) instead of a single city-wide value. Because the criterion is configured with weight 0.0, it does not change the static drought-risk result. Its purpose is to make the weather context available per tree in pipeline outputs and downstream ML datasets.

Implementation Details

Location:

Processing steps:

  1. Resolve the active feature reference year (automatic “last complete year” policy, plan F.3 / decision D16).
  2. Load the per-tree seasonal weather CSV.
  3. Select the rows for the active year.
  4. Look up each tree’s own row by tree_id; trees missing from the CSV keep NaN (no city-wide fallback).
  5. Return a neutral criterion score using project.neutral_score.

If the CSV is missing or the target year does not exist in the file, the criterion returns neutral scores and NaN extras.

Data Sources

The build script resolves the nearest 1 km grid cell for every tree (cKDTree in UTM 32N) and aggregates per tree and year:

Only years with a complete May–October season (184 days) are written, so the maximum year in the CSV is the last complete weather year. The script is incremental: re-running it only adds years that are not in the output yet.

Typical configuration:

inputs:
  seasonal_weather:
    path: "data/derived/ml/tree_seasonal_weather.csv"

criteria:
  - name: "seasonal_weather"
    weight: 0.0
    params:
      path: "data/derived/ml/tree_seasonal_weather.csv"

Outputs

Per-tree outputs in extras:

Metadata includes:

Important interpretation notes: