pvlib.iotools.read_pvgis_tmy#
- pvlib.iotools.read_pvgis_tmy(filename, pvgis_format=None, map_variables=True)[source]#
Read a TMY file downloaded from PVGIS.
Changed in version 0.13.0: The function now returns two items
(data,meta)
. Previous versions of this function returned four elements(data,months_selected,inputs,meta)
. Theinputs
dictionary andmonths_selected
are now included inmeta
, which has changed structure to accommodate it.- Parameters:
filename (str, pathlib.Path, or file-like buffer) – Name, path, or buffer of file downloaded from PVGIS.
pvgis_format (str, optional) – Format of PVGIS file or buffer. Equivalent to the
outputformat
parameter in the PVGIS TMY API. Iffilename
is a file andpvgis_format
is not specified then the file extension will be used to determine the PVGIS format to parse. Iffilename
is a buffer, thenpvgis_format
is required and must be in['csv', 'epw', 'json']
.map_variables (bool, default True) – When true, renames columns of the Dataframe to pvlib variable names where applicable. See variable
VARIABLE_MAP
.
- Returns:
data (pandas.DataFrame) – the weather data
metadata (list or dict) – file metadata
- Raises:
ValueError – if
pvgis_format
is not specified and the file extension is neither.csv
,.json
, nor.epw
, or ifpvgis_format
is provided as input but isn’t in['csv', 'epw', 'json']
TypeError – if
pvgis_format
is not specified andfilename
is a buffer
See also