View source: R/calc_solar_insolation.R
calc_zenith_angle | R Documentation |
Calculate zenith angle as in http://education.gsfc.nasa.gov/experimental/July61999siteupdate/inv99Project.Site/Pages/solar.insolation.html
calc_zenith_angle(
latitude,
declination.angle,
hour.angle,
format = c("degrees", "radians")
)
latitude |
numeric value or vector indicating the site latitude in
decimal degrees (never radians or deg-min-sec, no matter what |
declination.angle |
numeric value or vector, in the units specified by
|
hour.angle |
numeric value or vector, in the units specified by
|
format |
The format of both the output. May be "degrees" or "radians". |
zendf <- data.frame(
lat=rep(c(0,20,40,60), each=24*4),
jday=rep(rep(c(1,101,201,301), each=24), times=4),
hour=rep(c(0:12,13.5:23.5), times=4*4))
zendf <- transform(zendf,
dec=streamMetabolizer:::calc_declination_angle(jday),
hragl=streamMetabolizer:::calc_hour_angle(hour))
zendf <- transform(zendf,
zen=streamMetabolizer:::calc_zenith_angle(lat, dec, hragl))
## Not run:
library(ggplot2)
ggplot(unitted::v(zendf), aes(x=hour, y=zen, color=jday, group=jday)) +
geom_line() + facet_wrap(~lat) +
ggtitle('zenith angles by latitude (panels) and day of year (colors)')
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.