Procedural
Plain functions
Call each model directly with pandas Series or NumPy arrays. Full control, nothing hidden.
# sun position, then POA irradiance
sp = pvlib.solarposition.get_solarposition(
times, 33.45, -111.98)
poa = pvlib.irradiance.get_total_irradiance(
30, 180, sp.apparent_zenith,
sp.azimuth, dni, ghi, dhi,
model="perez", dni_extra=dni_extra)
Object oriented
Location and PVSystem
Keep site and hardware parameters on objects, then call methods that pass them along for you.
site = pvlib.location.Location(
33.45, -111.98, tz="US/Arizona")
sp = site.get_solarposition(times)
system = pvlib.pvsystem.PVSystem(
surface_tilt=30, surface_azimuth=180,
module_parameters=mod,
inverter_parameters=inv)
End to end
ModelChain
Infers suitable models from your system parameters and runs from weather, from POA or from effective irradiance.
mc = pvlib.modelchain.ModelChain(
system, site, aoi_model="physical")
mc.run_model(weather)
mc.results.ac # AC power
mc.results.cell_temperature