Lb_photovoltaics.pvwatts() function calculation in Ladybug PhotovoltaicsSurface component

Hi,
Hoping someone can point me in the right direction for the documentation.

I’m trying to get to the souce code behind the lb_photovoltaics.pvwatts() function in the PhotovoltaicsSurface component in version 0.0.67.

The code uses this function to get the average AC power in kwh (ACenergyPerHour) which it then converts to yearly and then divides by 365 to get average daily power output of the PV panel.

But the actual function isn’t accessible, it’s somewhere else and I tried looking in the SDK but didn’t find it.

This is the code snippet from the component:

for i,hoy in enumerate(HOYs):
    sunZenithD, sunAzimuthD, sunAltitudeD = lb_photovoltaics.NRELsunPosition(latitude, longitude, timeZone, years[i], months[i], days[i], hours[i]-1)
    Epoa, Eb, Ed_sky, Eground, AOI_R = lb_photovoltaics.POAirradiance(sunZenithD, sunAzimuthD, srfTiltD, srfAzimuthD, directNormalRadiation[i], diffuseHorizontalRadiation[i], albedoL[i])
    Tcell, Pdc_, Pac = lb_photovoltaics.pvwatts(nameplateDCpowerRating, DCtoACderateFactor, srfTiltD, sunZenithD, AOI_R, Epoa, Eb, Ed_sky, Eground, dryBulbTemperature[i], windSpeed[i], directNormalRadiation[i], diffuseHorizontalRadiation[i], PVmoduleSettings, elevationM)
    Epoa = Epoa/1000 # to kWh/m2
    ACenergyPerHour.append(Pac)
    DCenergyPerHour.append(Pdc_)

Any ideas?
Thanks

Probably @djordje can help with this. He is the one that developed those components.
-A.

1 Like

Hi @YafimSimanovsky ,
The source code is located inside the ‘Ladybug Ladybug’ component’s ‘Photovoltaics’ class.
In Ladybug 0.0.68 version, that’s 6454 line inside the ‘Ladybug Ladybug’ component.