Learn R Programming

GeoLight (version 2.0.0)

twilight: Times of Sunrise and Sunset

Description

Estimate time of sunrsie or sunset for a given day and location

Usage

twilight(tm, lon, lat, rise, zenith = 96, iters = 3)

Arguments

tm
vector of approximate times of twilight.
lon
vector of longitudes.
lat
vector of latitudes.
rise
logical vector indicating whether to compute rise or set.
zenith
the solar zenith angle that defines twilight.
iters
number of iteratve refinements made to the initial approximation.

Value

a vector of twilight times.

Details

twilight uses an iterative algorithm to estimate times of sunrise and sunset.

Note that these functions return the twilight that occurs on the same date GMT as tm, and so sunset may occur before sunrise, depending upon latitude.

Solar declination and equation of time vary slowly over the day, and so the values of the Solar declination and equation of time at sunrise/sunset are well approximated by their values at 6AM/6PM local time. The sun's hour angle and hence sunrise/sunset for the required zenith can then be caclulates from these approximations. The calculation is then repeated using the approximate sunrise/sunset times to derive more accurate values of the Solar declination and equation of time and hence better approximations of sunrise/sunset. The process is repreated and is accurate to less than 2 seconds within 2 or 3 iterations.

sunrise and sunset are simple wrappers for twilight.