pingswept/pysolar — pull request #19 by davidvhill (2014-12-06 17:48:34+00:00)
Title: Corrected broken imports in radiation.py for solar.GetDayOfYear()

Relocated solar.GetDayOfYear() to julian.py. Corrected all imports in the modules that use this function.

Full change log:
#util.py
Modified extraterrestrial_irrad() to only compute the day_ratio one time
Added import for julian
Modified calls for GetDayOfYear to use the julian module

#elevation.py
Removed unused 'math' import

#julian.py
Added GetDayOfYear function
Added import datetime

#radiation.py
Added import julian for GetDayOfYear
Removed old commented out relative import for solar

#solar.py
Modified calls for GetDayOfYear to use the julian module

#test code
import datetime
import Pysolar
from Pysolar import solar
lat = 42.3
lon = -71.4
d = datetime.datetime(2014, 12, 6, 17, 30, 26, 947600)
alt = Pysolar.GetAltitude(lat,lon, d)
azi = Pysolar.GetAzimuth(lat, lon, d)
solar.radiation.GetRadiationDirect(d, alt)
859.0461771527587