Skip to content

Weather Variables

Weather Stations

Five population-weighted stations across Spain, selected to represent major demand centers:

StationLatitudeLongitudeWeightZone
Madrid-Barajas40.47-3.560.35Center/West
Barcelona-El Prat41.302.080.25East
Valencia-Airport39.49-0.470.15East
Bilbao-Airport43.30-2.910.13North
Sevilla-Airport37.42-5.900.12South

Weights reflect approximate metropolitan population distribution. The population-weighted average approximates the national demand-temperature relationship.

Hourly Variables (Open-Meteo)

VariableColumnUnitDescription
Temperaturetemp_c°C2m air temperature
Wind Speedwind_speed_kmhkm/h10m wind speed
Precipitationprecipitation_mmmmHourly precipitation
Sunshinesunshine_hourshoursSunshine duration (converted from seconds)
Cloud Covercloud_cover_pct%Total cloud cover
Direct Radiationdirect_radiation_wm2W/m²Direct normal irradiance
Diffuse Radiationdiffuse_radiation_wm2W/m²Diffuse horizontal irradiance

Derived Weather Features

The feature engineering pipeline computes these from raw weather data:

FeatureFormulaPurpose
heating_degree_daysmax(0, 18 - temp_c)Heating demand proxy
cooling_degree_daysmax(0, temp_c - 24)Cooling demand proxy
cold_x_demandmax(0, 15 - temp_c) × demandCold-demand interaction
wind_x_wind_sharewind_speed × wind_shareWind generation interaction
cloud_x_solarcloud_cover × solar_shareCloud-solar interaction
ghi_wm2direct + diffuse radiationGlobal horizontal irradiance
clear_sky_indexGHI / theoretical_maxSolar clarity (0-1.5)

Data Integration

Hourly Open-Meteo data is the sole weather source. The AEMET daily collector was removed in v4.1 when Open-Meteo hourly data was fully integrated. The combine_first strategy prevents partial updates from overwriting existing data.