Learn R Programming

RchivalTag (version 0.1.9)

get_DayTimeLimits: Estimating the timing of sunrise, sunset, astronomical and nautical twilight events

Description

Estimating the timing of sunrise, sunset, astronomical and nautical twilight events in POSIXct-format based on geolocations and a similar time vector. The function is a simplified call of the sunriset and crepuscule functions of the maptools-package that are based on algorithms provided by the National Oceanic & Atmospheric Administration (NOAA).

Usage

get_DayTimeLimits(pos)

Value

The input data.frame

pos extended by the time vectors sunrise, sunset, dawn.naut, dawn.ast, dusk.naut and dusk.ast.

Arguments

pos

a data.frame with the columns datetime (a time vector in POSIXct-format), Lon and Lat.

Author

Robert K. Bauer

References

Meeus, J. (1991) Astronomical Algorithms. Willmann-Bell, Inc.

See Also

sunriset, crepuscule, classify_DayTime

Examples

Run this code

#### example 1) estimate current times of dawn, sunrise, dusk and sunset in Mainz, Germany:
pos <- data.frame(Lat=8.2667, Lon=50)
pos$datetime <- strptime(Sys.Date(),"%Y-%m-%d")
get_DayTimeLimits(pos)

#### example 1b) classify current ime of the day in Mainz, Germany:
classify_DayTime(get_DayTimeLimits(pos))


Run the code above in your browser using DataLab