Learn R Programming

photobiology (version 0.9.13)

sun_angles: Solar angles

Description

This function returns the solar angles for a given time and location.

Usage

sun_angles(time = lubridate::now(), tz = lubridate::tz(time), geocode = data.frame(lon = 0, lat = 51.5, address = "Greenwich"), use.refraction = FALSE)
sun_elevation(time = lubridate::now(), tz = lubridate::tz(time), geocode = data.frame(lon = 0, lat = 51.5, address = "Greenwich"), use.refraction = FALSE)
sun_zenith_angle(time = lubridate::now(), tz = lubridate::tz(time), geocode = data.frame(lon = 0, lat = 51.5, address = "Greenwich"), use.refraction = FALSE)
sun_azimuth(time = lubridate::now(), tz = lubridate::tz(time), geocode = data.frame(lon = 0, lat = 51.5, address = "Greenwich"), use.refraction = FALSE)

Arguments

time
POSIXct Time, any valid time zone (TZ) is allowed, default is current time
tz
character string indicating time zone to be used in output.
geocode
data frame with variables lon and lat as numeric values (degrees).
use.refraction
logical Flag indicating whether to correct for fraction in the atmosphere

Value

A data.frame with variables time (in same TZ as input), TZ, solartime, longitude, latitude, address, azimuth, and elevation.

See Also

Other astronomy related functions: day_night, format.solar_time, is.solar_time, print.solar_time, solar_time

Examples

Run this code
library(lubridate)
sun_angles()
sun_angles(ymd_hms("2014-09-23 12:00:00"))
sun_angles(ymd_hms("2014-09-23 12:00:00"),
           geocode = data.frame(lat=60, lon=0))

Run the code above in your browser using DataLab