get_moon: Calculate moon exposure for a given time period

Description Usage Arguments Examples

Description

This function calculates the proportion of the moon's face that is illuminated, and whether the moon is above horizon at a given location, for a user-specified number of hours from a provided POSIXct object. Specifically, it sums the proportion illuminated at the midpoint of every hour, conditional on the moon being above local horizon. Thus, the returned value ranges from zero (new moon or moon not above horizon) to exp_hrs (full moon above horizon for the entire time from datetime to datetime + exp_hrs).

Usage

1
get_moon(datetime, lon, lat, exp_hrs = 6)

Arguments

datetime

POSIXct vector of datetimes from which moon exposure should be calculated

lon

numeric scalar of position longitude (decimal degrees; WGS84)

lat

numeric scalar of position latitude (decimal degrees; WGS84)

exp_hrs

integer of number of hours post-datetime to calculate exposure

Examples

1
2
3
4
get_moon(as.POSIXct(Sys.time()), -83, 34, 12)
# For fun, plot daily moon exposure for next lunar cycle
next_cycle <- as.POSIXct(seq.Date(Sys.Date(), by = 1, length.out = 28))
plot(next_cycle, get_moon(next_cycle, -83, 34, 24))

adamdsmith/nrsmisc documentation built on Aug. 13, 2019, 2:14 p.m.