sun.angle {oce} | R Documentation |
Solar angle as function of space and time.
sun.angle(t, lat, lon)
t |
Time, a POSIXt object (must be in GMT). |
lat |
latitude in degrees north |
lon |
longitude in degrees east |
Based on NASA-provided fortran program, in turn (according to comments in the code) based on "The Astromincal Almanac".
A data frame containing az, el, soldia, and soldst.
Dan Kelley
Uses on Fortran code retrieved from ftp://climate1.gsfc.nasa.gov/wiscombe/Solar_Rad/SunAngles/sunae.f on 2008-11-1.
t0 <- as.POSIXct("2008-01-01 00:00:01", tz="UTC") t1 <- as.POSIXct("2009-01-01 00:00:01", tz="UTC") t <- seq(from=t0, to=t1, length.out=365) lat <- rep(0, 365) lon <- rep(0, 365) a <- sun.angle(t, lat, lon) par(mfrow=c(2,1)) plot(t, a$az, type='l', ylab="Azimuth [deg]") plot(t, a$el, type='l', ylab="Elevation [deg]")