Solar elevation angle
Usage
sol_elevation(...)
# Default S3 method
sol_elevation(datetime, lon, lat, ...)
# S3 method for class 'weather_station'
sol_elevation(weather_station, ...)Details
The solar elevation angle (\(h\)) is the apparent angle of the sun above the horizon. It is calculated as: $$h = \arcsin(\sin(\phi) \cdot \sin(\delta) + \cos(\phi) \cdot \cos(\delta) \cdot \cos(H))$$ where: \(\phi\) is the latitude, \(\delta\) is the solar declination, and \(H\) is the hour angle.
Examples
# Calculate solar elevation angle
sol_elevation(as.POSIXlt("2022-06-21"), lon = 10, lat = 50)
#> [1] -16.56115