pvlib.iotools.get_solcast_live#

pvlib.iotools.get_solcast_live(latitude, longitude, api_key, map_variables=True, **kwargs)[source]#

Get irradiance and weather estimated actuals for near real-time and past 7 days.

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) – containing 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_live(
>>>     latitude=-33.856784,
>>>     longitude=151.215297,
>>>    api_key="your-key"
>>> )

you can pass any of the parameters listed in the API docs, like

>>> df, meta = pvlib.iotools.solcast.get_solcast_live(
>>>     latitude=-33.856784,
>>>     longitude=151.215297,
>>>     terrain_shading=True,
>>>     output_parameters=['ghi', 'clearsky_ghi', 'snow_soiling_rooftop'],
>>>     api_key="your-key"
>>> )

use map_variables=False to avoid converting the data to PVLib’s conventions.

>>> df, meta = pvlib.iotools.solcast.get_solcast_live(
>>>     latitude=-33.856784,
>>>     longitude=151.215297,
>>>     map_variables=False,
>>>     api_key="your-key"
>>> )

References

1

Get an API Key

2

Solcast API Docs