def test_SunDeclination(): a = Astral() dt = datetime.datetime(2015, 10, 10, 1, 36, 0) jc = a._jday_to_jcentury(a._julianday(dt, -4)) declination = a._sun_declination(jc) assert float_almost_equal(declination, -6.525273018, 0.0001)
def test_SunriseHourAngle(): a = Astral() dt = datetime.date(2015, 1, 1) jc = a._jday_to_jcentury(a._julianday(dt, 1)) declination = a._sun_declination(jc) ha = math.degrees(a._hour_angle(52.169, declination, 90.833)) assert float_almost_equal(ha, 58.6102679, 0.1)