MoonRaker / pvlib-python

A set of documented functions for simulating the performance of photovoltaic energy systems.
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

combine liujordan_* into a single liujordan function? #19

Closed wholmgren closed 8 years ago

wholmgren commented 8 years ago

What's the advantage of separate liujordan_dni, liujordan_dhi, and liujordan_ghi functions? Seems to me that something like this would be more efficient and easier to understand...

def liujordan(zenith, cloud_prct, dni_extra=1367.0, pressure=101325.):

    tao = atmosphere.transmittance(zenith, cloud_prct)
    airmass_relative = atmosphere.relativeairmass(zenith)
    airmass = atmosphere.absoluteairmass(airmass_relative, pressure=pressure)

    dni = dni_extra*tao**airmass
    dhi = 0.3 * (1.0 - tao**airmass) * dni_extra * np.cos(np.radians(zenith))
    ghi = dhi + dni*np.cos(np.radians(zenith))

    return pd.DataFrame({'ghi': ghi, 'dni': dni, 'dhi': dhi})
MoonRaker commented 8 years ago

None really. I'll combine them into one.