Market Aggregates
Example
from datetime import datetime
import matplotlib.pyplot as plt
from jua import JuaClient
from jua.market_aggregates import AggregateVariables, ModelRuns
from jua.types import MarketZones
from jua.weather import Models
client = JuaClient()
# Create an energy market for specific zones
germany = client.market_aggregates.get_market(market_zone=MarketZones.DE)
# Select two EPT-2 forecasts and two ECMWF IFS forecasts to compare
model_runs = [
ModelRuns(
Models.EPT2,
[
datetime(2025, 9, 29, 0),
datetime(2025, 9, 29, 6),
]
),
ModelRuns(
Models.ECMWF_IFS_SINGLE,
[
datetime(2025, 9, 29, 0),
datetime(2025, 9, 29, 6),
]
),
]
# Retrieve the 2-day 10m wind market aggregates for Germany
# An xarray.Dataset is returned, containing the market aggregates
# for each model run
wind_data = germany.compare_runs(
agg_variable=AggregateVariables.WIND_SPEED_AT_HEIGHT_LEVEL_10M,
model_runs=model_runs,
max_lead_time=48,
)
# Plot the 4 market aggregates using matplotlib
fig, ax = plt.subplots(figsize=(15, 5))
wind_data["wind_speed_at_height_level_10m"].plot(ax=ax, x="time", hue="model_run")
ax.set_title("10m Wind Market Aggregates: Germany")
plt.show()
Documentation
Aggregate Variables
Energy Market
Market Zones
Model Runs
Country Aggregates
Last updated