Preprocessing¶
rucola._preprocessing.winsorize_outliers(values)
¶
Trim daily values above P_out = q_0.75 + 3·IQR per station.
Implements Eq. 1 from González-Rouco et al. (2001). The extreme value is
replaced by P_out rather than removed, preserving the event while reducing
its influence on non-resistant statistics. Requires station_id and
value columns.
Source code in src/rucola/_preprocessing.py
rucola._preprocessing.compute_annual_totals(values, min_coverage=0.8)
¶
Aggregate daily values to annual totals (e.g. precipitation).
Years with fewer than min_coverage × 365 valid observations are set to
null. Returns one row per (station_id, year) with a date column set to
Jan 1 of each year, making the result directly compatible with Rucola.
Source code in src/rucola/_preprocessing.py
rucola._preprocessing.compute_annual_means(values, min_coverage=0.8)
¶
Aggregate daily values to annual means (e.g. temperature).
Years with fewer than min_coverage × 365 valid observations are set to
null. Returns one row per (station_id, year) compatible with Rucola.