Calculates day length (in hours) and the solar elevation above the ecliptic plane based upon latitude and a day of year, and year values. according to H.Glarner (http://herbert.gandraxa.com/length_of_day.xml)

daylength(doy, latitude)

Arguments

doy

a vector with doy values 1 - 365(6)

latitude

a given latitude

Value

a daylength vector

Details

Due to heterogeneous date formats with years normalized to 365 days I do not apply a leap year correction.

Examples


if (FALSE) {
# calcualte the hours of sunlight and solar elevation on day of year 1
length_of_day = daylength(1, 51, 2000)
print(length_of_day)
}