Skip to contents

Compute the position of the sun, and local solar time using Meeus' formulae. Compute day and/or night length using different twilight definitions or arbitrary sun elevation angles. This package is part of the 'r4photobiology' suite, Aphalo, P. J. (2015) doi:10.19232/uv4pb.2015.1.14 . Algorithms from Meeus (1998, ISBN:0943396611).

Details

Please see the vignette 0: The R for Photobiology Suite for a description of the suite.

References

Aphalo, Pedro J. (2015) The r4photobiology suite. UV4Plants Bulletin, 2015:1, 21-29. doi:10.19232/uv4pb.2015.1.14 .

Author

Maintainer: Pedro J. Aphalo pedro.aphalo@helsinki.fi (ORCID)

Examples

# daylength
sunrise_time(lubridate::today(tzone = "EET"), tz = "EET",
             geocode = data.frame(lat = 60, lon = 25),
             unit.out = "hour")
#> [1] 7.520906
day_length(lubridate::today(tzone = "EET"), tz = "EET",
           geocode = data.frame(lat = 60, lon = 25),
           unit.out = "hour")
#> [1] 11.25674
sun_angles(lubridate::now(tzone = "EET"), tz = "EET",
           geocode = data.frame(lat = 60, lon = 25))
#> # A tibble: 1 × 12
#>   time                tz    solartime  longitude latitude address azimuth
#>   <dttm>              <chr> <solar_tm>     <dbl>    <dbl> <chr>     <dbl>
#> 1 2025-10-03 00:56:06 EET   23:46:58          25       60 NA         356.
#> # ℹ 5 more variables: elevation <dbl>, declination <dbl>, eq.of.time <dbl>,
#> #   hour.angle <dbl>, distance <dbl>