PVLIB API

Software for simulating photovoltaic solar energy systems.

This is a tutorial and API to the pvlib python library.

PV Modeling Steps

Solar Position

The first step to modeling a PV system is to get the solar position for the site. Use the PVLIB API by sending a GET request to /api/v1/pvlib/solarposition/, the response is JSON. The calculation requires the following parameters:

Note: the API uses pandas to parse dates and times, see the documentation for formats.

Example

Try the following: /api/v1/pvlib/solarposition/?lat=38&lon=-122&start=2018-01-01 7:00&end=2018-01-01 8:00&freq=T&tz=-8



Click on the map and enter the dates and frequency fields above, then click submit to see what your request looks like, a plot of azimuth vs. zenith, and a table of solar positions below:

Linke Turbidity

If you want to calculate clear sky irradiance you may need Linke Turbidity or AOD and precipitable water.

Example

Try the following: /api/v1/pvlib/linke-turbidity/?tl_lat=38&tl_lon=-122&tl_start=2018-01-01 7:00&tl_end=2018-01-01 8:00&tl_freq=T&tl_tz=-8



Enter the fields above and then click submit to see what your request looks like and a table of Linke Turbidity values below:

Air Mass

Air mass is a measure of the path length through the atmosphere measured in atmospheres. On the equator at solar noon on the equinox, when the sun is directly overhead, the air mass is 1 atmospere. The reference atmosphere, ASTM G173-03, has an air mass of 1.5 atmospheres, and is usually called AM1.5. It's equivalent to a spring noon in the southwest USA.

Example

You'll need to send a POST request with solar position data. Try this curl -H "Content-Type: application/json" -X POST /api/v1/pvlib/airmass/ -d '{"model":"kastenyoung1989","zenith_data":{"2019-01-01T09:00:00-0800":{"apparent_zenith":"75.64949399351546"},"2019-01-01T12:00:00-0800":{"apparent_zenith":"60.93578142843924"}}}'.



Enter the fields above and then click submit to see what your request looks like and a table of air mass data. values below: