How the site forecasts are constructed
There are usually multiple forecasting models running for every site. These can use different weather models, they can be ML or physical models, they can use lagged measured values as input, etc.
A site’s forecast is constructed by using the individual model outputs (forecasts) for different time horizons based on some priority scheme we apply.
For example, in the dashboard screenshot below, there are four physical models running with different weather models as input.
The forecast we deliver for the specific site is made of the green model forecasts for the first leading period, the blue model forecasts for the period after that, and the red model forecasts for the rest of the forecasting horizon.
If a model fails to generate any forecasts, the next model(s) in the priority list will be used to deliver the missing forecasts.
See how to get a specific model output.
How to query the latest forecast
To query the most recently updated forecast you need to provide the ID of the site.
import requests
api_key = "Your API key"
site_id = "a923653c-26f1-1b29-955d-ffde5d182276"
url = f"https://api.rebase.energy/platform/v2/sites/{site_id}/forecast"
headers = {"Authorization": api_key, "Content-Type": "application/json"}
response = requests.get(url, headers=headers)
response.raise_for_status()
response = response.json()
{
"valid_time": [
"2024-10-22T00:00:00Z",
"2024-10-22T00:15:00Z",
"2024-10-22T00:30:00Z",
"2024-10-22T00:45:00Z",
"2024-10-22T01:00:00Z"
],
"forecast": [
0.0,
0.0,
0.0,
0.0,
0.0
],
"model_name": [
"Solar_MetOfficeGlobalHiRes_Physical",
"Solar_MetOfficeGlobalHiRes_Physical",
"Solar_MetOfficeGlobalHiRes_Physical",
"Solar_MetOfficeGlobalHiRes_Physical",
"Solar_MetOfficeGlobalHiRes_Physical"
],
"model_version": [
1,
1,
1,
1,
1
],
"update_time": [
"2024-10-22T06:15:00Z",
"2024-10-22T06:15:00Z",
"2024-10-22T06:15:00Z",
"2024-10-22T06:15:00Z",
"2024-10-22T06:15:00Z"
]
}
The response is a serialized table with the following columns:
valid_time
: It contains the target times, i.e. the periods which are forecasted.
forecast
: It contains the forecast values.
model_name
: It contains the names of the models which create the forecasts.
model_version
: It contains the versions of the models which create the forecasts.
update_time
: It contains the issue/update time, i.e. the time when the forecasts were updated.
Change time zone
The default time zone is UTC
. You can specify a different time zone in the requests parameters.
Get latest forecast in different time zone
import requests
api_key = "Your API key"
site_id = "a923653c-26f1-1b29-955d-ffde5d182276"
tz = "CET"
url = f"https://api.rebase.energy/platform/v2/sites/{site_id}/forecast"
headers = {"Authorization": api_key, "Content-Type": "application/json"}
params={"tz": tz}
response = requests.get(url, headers=headers, params=params)
response.raise_for_status()
response = response.json()
{
"valid_time": [
"2024-10-22T00:00:00+02:00",
"2024-10-22T00:15:00+02:00",
"2024-10-22T00:30:00+02:00",
"2024-10-22T00:45:00+02:00",
"2024-10-22T01:00:00+02:00"
],
"forecast": [
0.0,
0.0,
0.0,
0.0,
0.0
],
"model_name": [
"Solar_MetOfficeGlobalHiRes_Physical",
"Solar_MetOfficeGlobalHiRes_Physical",
"Solar_MetOfficeGlobalHiRes_Physical",
"Solar_MetOfficeGlobalHiRes_Physical",
"Solar_MetOfficeGlobalHiRes_Physical"
],
"model_version": [
1,
1,
1,
1,
1
],
"update_time": [
"2024-10-22T02:00:00+02:00",
"2024-10-22T02:00:00+02:00",
"2024-10-22T02:00:00+02:00",
"2024-10-22T02:00:00+02:00",
"2024-10-22T02:00:00+02:00"
]
}