pvlib.iotools.get_pvgis_tmy#
- pvlib.iotools.get_pvgis_tmy(latitude, longitude, outputformat='json', usehorizon=True, userhorizon=None, startyear=None, endyear=None, url='https://re.jrc.ec.europa.eu/api/', map_variables=None, timeout=30)[source]#
Get TMY data from PVGIS.
For more information see the PVGIS 1 TMY tool documentation 2.
- Parameters
latitude (
float) – Latitude in degrees northlongitude (
float) – Longitude in degrees eastoutputformat (
str, default'json') – Must be in['csv', 'basic', 'epw', 'json']. See PVGIS TMY tool documentation 2 for more info.usehorizon (
bool, defaultTrue) – include effects of horizonuserhorizon (
listoffloat, defaultNone) – optional user specified elevation of horizon in degrees, at equally spaced azimuth clockwise from north, only valid ifusehorizonis true, ifusehorizonis true butuserhorizonisNonethen PVGIS will calculate the horizon 3endyear (
int, defaultNone) – last year to calculate TMY, must be at least 10 years from first yearurl (
str, default:pvlib.iotools.pvgis.URL) – base url of PVGIS API, appendtmyto get TMY endpointmap_variables (
bool) – When true, renames columns of the Dataframe to pvlib variable names where applicable. See variable const:VARIABLE_MAP.timeout (
int, default30) – time in seconds to wait for server response before timeout
- Returns
data (
pandas.DataFrame) – the weather datamonths_selected (
list) – TMY year for each month,Nonefor basic and EPWinputs (
dict) – the inputs,Nonefor basic and EPW
Note
The PVGIS website uses 10 years of data to generate the TMY, whereas the API accessed by this function defaults to using all available years. This means that the TMY returned by this function may not be identical to the one generated by the website. To replicate the website requests, specify the corresponding 10 year period using
startyearandendyear. Specifyingendyearalso avoids the TMY changing when new data becomes available.- Raises
requests.HTTPError – if the request response status is
HTTP/1.1 400 BAD REQUEST, then the error message in the response will be raised as an exception, otherwise raise whateverHTTP/1.1error occurred
See also
References