How to use the pysolar.HourAngle function in pysolar

To help you get started, we’ve selected a few pysolar examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github nrcharles / solpy / solar.py View on Github external
S = radians(S)
    plane_azimuth=radians(plane_azimuth)

    n = d.timetuple().tm_yday

    #delta = declination of the sun
    delta = radians(-23.44) * cos((2*pi/365)*(n+10))

    # phi = latitude
    phi = radians(latitude)

    #omega = hour angle
    #crude hack
    offset = 12
    omega   = (d.hour+offset)*15*(pi/180)
    H = s.HourAngle(d,longitude)
    #print "%s,%s,%s" % ( H, degrees(omega), H+degrees(omega))
    #omega = - s.HourAngle(utc,longitude)
    #H = v - longitude - right_ascention

    #thetaZ = solar zenith
    thetaZ = arccos(sin(phi)*sin(delta)+cos(phi)*cos(delta)*cos(omega))
    Z = thetaZ

    solar_azimuth = azimuth(phi,delta,omega)

    #theta = incident angle
    theta = arccos(sin(S)*sin(Z)*cos(solar_azimuth-plane_azimuth) + \
            cos(S)*cos(Z))

    return theta, Z #, zenith

pysolar

Collection of Python libraries for simulating the irradiation of any point on earth by the sun

GPL-3.0
Latest version published 1 year ago

Package Health Score

54 / 100
Full package analysis