pvlib.iotools.get_pvgis_hourly#
- pvlib.iotools.get_pvgis_hourly(latitude, longitude, start=None, end=None, raddatabase=None, components=True, surface_tilt=0, surface_azimuth=0, outputformat='json', usehorizon=True, userhorizon=None, pvcalculation=False, peakpower=None, pvtechchoice='crystSi', mountingplace='free', loss=0, trackingtype=0, optimal_surface_tilt=False, optimalangles=False, url='https://re.jrc.ec.europa.eu/api/', map_variables=True, timeout=30)[source]#
Get hourly solar irradiation and modeled PV power output from PVGIS.
PVGIS data is freely available at 1.
- 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 (
intordatetime like, default:None) – First year of the radiation time series. Defaults to first year available.end (
intordatetime like, default:None) – Last year of the radiation time series. Defaults to last year available.raddatabase (
str, default:None) – Name of radiation database. Options depend on location, see 3.components (
bool, default:True) – Output solar radiation components (beam, diffuse, and reflected). Otherwise only global irradiance is returned.surface_tilt (
float, default:0) – Tilt angle from horizontal plane. Ignored for two-axis tracking.surface_azimuth (
float, default:0) – Orientation (azimuth angle) of the (fixed) plane. 0=south, 90=west, -90: east. Ignored for tracking systems.usehorizon (
bool, default:True) – Include effects of horizonuserhorizon (
listoffloat, default:None) – 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 4pvcalculation (
bool, default:False) – Return estimate of hourly PV production.peakpower (
float, default:None) – Nominal power of PV system in kW. Required if pvcalculation=True.pvtechchoice (
{'crystSi', 'CIS', 'CdTe', 'Unknown'}, default:'crystSi') – PV technology.mountingplace (
{'free', 'building'}, default:free) – Type of mounting for PV system. Options of ‘free’ for free-standing and ‘building’ for building-integrated.loss (
float, default:0) – Sum of PV system losses in percent. Required if pvcalculation=Truetrackingtype (
{0, 1, 2, 3, 4, 5}, default:0) – Type of suntracking. 0=fixed, 1=single horizontal axis aligned north-south, 2=two-axis tracking, 3=vertical axis tracking, 4=single horizontal axis aligned east-west, 5=single inclined axis aligned north-south.optimal_surface_tilt (
bool, default:False) – Calculate the optimum tilt angle. Ignored for two-axis trackingoptimalangles (
bool, default:False) – Calculate the optimum tilt and azimuth angles. Ignored for two-axis tracking.outputformat (
str, default:'json') – Must be in['json', 'csv']. See PVGIS hourly data documentation 2 for more info.url (
str, default:pvlib.iotools.pvgis.URL) – Base url of PVGIS API.seriescalcis appended to get hourly data endpoint. Note, a specific PVGIS version can be specified, e.g., https://re.jrc.ec.europa.eu/api/v5_2/map_variables (
bool, default:True) – When true, renames columns of the Dataframe to pvlib variable names where applicable. See variableVARIABLE_MAP.timeout (
int, default:30) – Time in seconds to wait for server response before timeout
- Returns
data (
pandas.DataFrame) – Time-series of hourly data, see Notes for fieldsinputs (
dict) – Dictionary of the request input parametersmetadata (
dict) – Dictionary containing metadata
- 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
Hint
PVGIS provides access to a number of different solar radiation datasets, including satellite-based (SARAH, SARAH2, and NSRDB PSM3) and re-analysis products (ERA5). Each data source has a different geographical coverage and time stamp convention, e.g., SARAH and SARAH2 provide instantaneous values, whereas values from ERA5 are averages for the hour.
Notes
data includes the following fields:
raw, mapped
Format
Description
Mapped field names are returned when the map_variables argument is True
P†
float
PV system power (W)
G(i), poa_global‡
float
Global irradiance on inclined plane (W/m^2)
Gb(i), poa_direct‡
float
Beam (direct) irradiance on inclined plane (W/m^2)
Gd(i), poa_sky_diffuse‡
float
Diffuse irradiance on inclined plane (W/m^2)
Gr(i), poa_ground_diffuse‡
float
Reflected irradiance on inclined plane (W/m^2)
H_sun, solar_elevation
float
Sun height/elevation (degrees)
T2m, temp_air
float
Air temperature at 2 m (degrees Celsius)
WS10m, wind_speed
float
Wind speed at 10 m (m/s)
Int
int
Solar radiation reconstructed (1/0)
†P (PV system power) is only returned when pvcalculation=True.
‡Gb(i), Gd(i), and Gr(i) are returned when components=True, otherwise the sum of the three components, G(i), is returned.
Examples
>>> # Retrieve two years of irradiance data from PVGIS: >>> data, meta, inputs = pvlib.iotools.get_pvgis_hourly( >>> latitude=45, longitude=8, start=2015, end=2016)
References