pvlib.iotools.get_solargis#
- pvlib.iotools.get_solargis(latitude, longitude, start, end, variables, api_key, time_resolution, timestamp_type='center', tz='GMT+00', terrain_shading=True, url='https://solargis.info/ws/rest/datadelivery/request', map_variables=True, timeout=30)[source]#
Retrieve irradiance time series data from Solargis.
The Solargis 1 API is described in 2.
- Parameters
latitude (float) – In decimal degrees, between -90 and 90, north is positive (ISO 19115)
longitude (float) – In decimal degrees, between -180 and 180, east is positive (ISO 19115)
start (datetime-like) – Start date of time series.
end (datetime-like) – End date of time series.
variables (list) – List of variables to request, see 2 for options.
api_key (str) – API key.
time_resolution (str, {'PT05M', 'PT10M', 'PT15M', 'PT30', 'PT1H', 'P1D', 'P1M', 'P1Y'}) – Time resolution as an integer number of minutes (e.g. 5, 60) or an ISO 8601 duration string (e.g. “PT05M”, “PT60M”, “P1M”).
timestamp_type ({'start', 'center', 'end'}, default: 'center') – Labeling of time stamps of the return data.
tz (str, default : 'GMT+00') – Timezone of start and end in the format “GMT+hh” or “GMT-hh”.
terrain_shading (boolean, default: True) – Whether to account for horizon shading.
url (str, default :
pvlib.iotools.solargis.URL
) – Base url of Solargis API.map_variables (boolean, default: True) – When true, renames columns of the Dataframe to pvlib variable names where applicable. See variable
VARIABLE_MAP
.timeout (int or float, default: 30) – Time in seconds to wait for server response before timeout
- Returns
data (DataFrame) – DataFrame containing time series data.
meta (dict) – Dictionary containing metadata.
- Raises
requests.HTTPError – A message from the Solargis server if the request is rejected
Notes
Each XML request is limited to retrieving 31 days of data.
The variable units depends on the time frequency, e.g., the unit for sub-hourly irradiance data is \(W/m^2\), for hourly data it is \(Wh/m^2\), and for daily data it is \(kWh/m^2\).
References
Examples
>>> # Retrieve two days of irradiance data from Solargis >>> data, meta = response = pvlib.iotools.get_solargis( >>> latitude=48.61259, longitude=20.827079, >>> start='2022-01-01', end='2022-01-02', >>> variables=['GHI', 'DNI'], time_resolution='PT05M', api_key='demo')