This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def sun_position ( date, hour, longitude, latitude ): | |
""" | |
Calculates the position of the sun given a position and time. | |
Basically, all you need to know is here: | |
http://answers.google.com/answers/threadview/id/782886.html | |
""" | |
import time | |
from math import sin, cos, degrees, radians, acos | |
doy = int ( time.strftime( "%j", time.strptime( date, "%Y-%m-%d" ) ) ) |