using PVGIS API to obtain irradiance and meteorological data for solar installation simulat

279 views
Skip to first unread message

Mahé Vidot

unread,
Apr 3, 2023, 2:42:55 PM4/3/23
to pvlib-python
Hi,
I'm currently working on a solar PV and PVT installation simulator using Python and Flask, and I was wondering if I could get some help on using the PVGIS API to obtain certain data.

Specifically, I'm looking to obtain the following data using a single PVGIS API request :

-Irradiance data based on the location, tilt angle, and orientation of the panels.
-Annual energy production for the panels based on the above parameters, peak power, temperature coefficient, open circuit voltage, and short circuit current.
-Meteorological data such as temperature and wind speed (in order to correct the estimated production based on the temperature of the solar cells and the wind speed.)

Could you please let me know which endpoints and inputs parameters I should use to obtain these data ? 

Thank you so much for your help!
Mahé.

Will Hobbs

unread,
Apr 8, 2023, 10:33:17 AM4/8/23
to pvlib-python
You might start with the following in pvlib to get weather:

Then get plane of array irradiance:

Then to get dc power:

And finally ac power (and energy):

The PVWatts dc power model will not use open circuit voltage and short circuit current, but those parameters are necessarily required for a simple estimate of annual energy.

Will

Adam R. Jensen

unread,
Apr 10, 2023, 12:15:56 PM4/10/23
to pvlib-python
You can actually get a simple PV power estimation directly using the PVGIS API (same settings as the PVGIS online interface).

I've posted a short example below - you'll of course need to change the input parameters according to your scenario. The example below is for hourly data for 2015 and 2016, but a similar request could be made for TMY data (pvlib.iotools.get_pvgis_tmy).

import pvlib

data, inputs, meta = pvlib.iotools.get_pvgis_hourly(
    latitude=55.8,
    longitude=12.5,
    start=2015,
    end=2016,
    raddatabase=None,  # use default database
    components=True,
    surface_tilt=35,
    surface_azimuth=0,  # 0 is south
    usehorizon=True,
    pvcalculation=True,  # returns PV power output
    peakpower=1,  # Peak PV power in kW
    pvtechchoice='crystSi',
    mountingplace='free',
    loss=14,  # total losses in percentage
    trackingtype=0,
    optimal_surface_tilt=False,
    optimalangles=False,
    url='https://re.jrc.ec.europa.eu/api/v5_2/',  # use newest database (v5.2)
)
Reply all
Reply to author
Forward
0 new messages