From 89bf887ee504757fdc899d95d566c445d1c89177 Mon Sep 17 00:00:00 2001 From: Jon Seymour Date: Mon, 3 Nov 2014 15:00:30 +1100 Subject: [PATCH] fix: for consistency, implement CalcSunrise in terms of CalcDawn. Signed-off-by: Jon Seymour --- astrotime.go | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/astrotime.go b/astrotime.go index 9b47b1e..e60f442 100755 --- a/astrotime.go +++ b/astrotime.go @@ -335,10 +335,7 @@ func CalcDawn(t time.Time, latitude float64, longitude float64, solarElevation f // CalcSunrise calculates the sunrise, in local time, on the day t at the // location specified in longitude and latitude. func CalcSunrise(t time.Time, latitude float64, longitude float64) time.Time { - jd := CalcJD(t) - sunriseUTC := time.Duration(math.Floor(calcSunriseUTC(jd, latitude, longitude, SUNRISE)*60) * 1e9) - loc, _ := time.LoadLocation("UTC") - return time.Date(t.Year(), t.Month(), t.Day(), 0, 0, 0, 0, loc).Add(sunriseUTC).In(t.Location()) + return CalcDawn(t, latitude, longitude, SUNRISE) } // Calculates the refractive correction for the specified solar elevation.