View source: R/getMoonIllumination.R
getMoonIllumination | R Documentation |
Get Moon illumination
getMoonIllumination(date = Sys.Date(), keep = c("fraction", "phase", "angle"))
date |
: Single or multiple DateTime. Can be a |
keep |
: |
Returns an object with the following properties:
"fraction" : illuminated fraction of the moon; varies from 0.0 (new moon) to 1.0 (full moon)
"phase" : moon phase; varies from 0.0 to 1.0, described below
"angle" : midpoint angle in radians of the illuminated limb of the moon reckoned eastward from the north point of the disk; the moon is waxing if the angle is negative, and waning if positive
Moon phase value should be interpreted like this:
0 : New Moon
Waxing Crescent
0.25 : First Quarter
: Waxing Gibbous
0.5Full Moon
: Waning Gibbous
0.75Last Quarter
: Waning Crescent
By subtracting the parallacticAngle from the angle one can get the zenith angle of the moons bright limb (anticlockwise). The zenith angle can be used do draw the moon shape from the observers perspective (e.g. moon lying on its back).
data.frame
getSunlightTimes, getMoonTimes, getMoonIllumination, getMoonPosition,getSunlightPosition
# one date getMoonIllumination(date = Sys.Date()) # in character getMoonIllumination(date = c("2017-05-12", "2017-05-12 00:00:00"), keep = c("fraction", "phase")) # in POSIXct getMoonIllumination(date = as.POSIXct("2017-05-12 00:00:00", tz = "UTC")) getMoonIllumination(date = as.POSIXct("2017-05-12 02:00:00", tz = "CET")) date <- seq(ISOdate(2009,1,1), ISOdate(2010,1,1), "hours") date_cet <- date attr(date_cet, "tzone") <- "CET" res <- getMoonIllumination(date = date_cet)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.