Description Usage Arguments Value Author(s) Examples
View source: R/utilSolarTime.R
Compute the hour of sunrise for given day and coordinates
1 2 | computeSunriseHourDoy(doy, latDeg, longDeg = NA,
timeZone = NA, isCorrectSolartime = TRUE)
|
doy |
integer vector with day of year [DoY, 1..366] |
latDeg |
Latitude in (decimal) degrees |
longDeg |
Longitude in (decimal) degrees (not required if solar time is sufficient) |
timeZone |
Time zone (in hours) ahead of UTC (Central Europe is +1) (not required if solar time is sufficient) |
isCorrectSolartime |
sunrise hour is computed first for solar time (where noon is exactly at 12:00) If TRUE (default) then sunrise hour is converted to local winter time, based on timeZone and longitude. |
numeric vector of length(doy) giving the time of sunrise in hours after midnight. Polar night is indicated by 12h, polar day by 0h.
Thomas Wutzler
1 2 3 4 5 6 7 8 9 10 11 12 | today <-
as.POSIXlt(Sys.Date())$yday
(sunrise <- computeSunriseHourDoy(today, latDeg = 51, isCorrectSolartime = FALSE))
(sunrise <- computeSunriseHourDoy(today, latDeg = 51, longDeg = 11.586, timeZone = +1))
# elevation near zero
computeSunPositionDoyHour(160, sunrise, latDeg = 51, isCorrectSolartime = FALSE)
#
doy <- 1:366
plot( computeSunriseHourDoy(doy, latDeg = 51, isCorrectSolartime = FALSE) ~ doy )
# north pole: daylength 0 and 24 hours
plot( computeSunriseHourDoy( doy, latDeg = +80, isCorrectSolartime = FALSE) ~ doy )
plot( computeSunriseHourDoy( doy, latDeg = -80, isCorrectSolartime = FALSE) ~ doy )
|
[1] 5.143506
[1] 5.400952
hour declination elevation azimuth
[1,] 5.400952 0.3978309 0.2120509 1.198385
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.