getMoonIllumination: Get Moon illumination

View source: R/getMoonIllumination.R

getMoonIlluminationR Documentation

Get Moon illumination

Description

Get Moon illumination

Usage

getMoonIllumination(date = Sys.Date(), keep = c("fraction", "phase", "angle"))

Arguments

date

: Single or multiple DateTime. Can be a Date (YYYY-MM-DD), a character in UTC (YYYY-MM-DD HH:mm:ss) or a POSIXct

keep

: character. Vector of variables to keep. See Details

Details

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).

Value

data.frame

See Also

getSunlightTimes, getMoonTimes, getMoonIllumination, getMoonPosition,getSunlightPosition

Examples


# 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)
      

suncalc documentation built on Sept. 29, 2022, 5:11 p.m.