pvlib.iotools.get_solcast_forecast#
- pvlib.iotools.get_solcast_forecast(latitude, longitude, api_key, map_variables=True, **kwargs)[source]#
Get irradiance and weather forecasts from the present time up to 14 days ahead.
- Parameters:
latitude (float) – in decimal degrees, between -90 and 90, north is positive
longitude (float) – in decimal degrees, between -180 and 180, east is positive
api_key (str) – To access Solcast data you will need an API key [1].
map_variables (bool, default: True) – When true, renames columns of the DataFrame to pvlib variable names where applicable. See variable
VARIABLE_MAP
. Time is the index shifted to the midpoint of each interval from Solcast’s “period end” convention.kwargs – Optional parameters passed to the API. See [2] for full list of parameters.
- Returns:
data (pandas.DataFrame) – Contains the values for the parameters requested. The times in the DataFrame index indicate the midpoint of each interval.
metadata (dict) – latitude and longitude of the request.
Examples
>>> df, meta = pvlib.iotools.solcast.get_solcast_forecast( >>> latitude=-33.856784, >>> longitude=151.215297, >>> api_key="your-key" >>> )
you can pass any of the parameters listed in the API docs, like asking for specific variables for a specific time horizon:
>>> df, meta = pvlib.iotools.solcast.get_solcast_forecast( >>> latitude=-33.856784, >>> longitude=151.215297, >>> output_parameters=['dni', 'clearsky_dni', 'snow_soiling_rooftop'], >>> hours=24, >>> api_key="your-key" >>> )
References