Description Usage Arguments Examples
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
).
1 | get_moon(datetime, lon, lat, exp_hrs = 6)
|
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- |
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))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.