Description Usage Arguments Value Warning Note Author(s) References See Also Examples
This set of functions provides simple position calculations for the sun and moon, taken from Pascal routines published in Montenbruck and Pfleger (1994, Dunlop).
These are completely independent from the (specifically optimized) solar elevation calculations available via [elevation and solar].
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
lon |
vector of |
lat |
vector of |
astro.calc |
list object containing |
DEC |
declination |
TAU |
|
PHI |
|
x |
number |
MJDay |
modified julian day |
LAMBDA |
|
time |
vector of date-times in POSIXct format |
date |
vector of date-times in POSIXct format |
X |
x-coordinate |
Y |
y-coordinate |
Z |
z-coordinate |
astro
returns a list object with the components of the moon or sun's
position,
r |
rho component |
theta |
theta component - elevation |
phi |
phi component - azimuth |
Some of this could be faster (particularly the use of LMST in "astro" is not precalculated)
Thanks to Nick.Ellis@csiro.au for pointing out a mistake pre-0.0-27
Michael D. Sumner
1 2 3 4 5 6 7 |
See Also elevation
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | ## the moon
tm <- Sys.time() + seq(by = 3600, length = 100)
moon <- lunar(tm)
rtp <- astro(147, -42, moon)
op <- par(mfrow = c(2,1))
plot(tm, rtp$theta, main = "lunar elevation, Hobart")
plot(tm, rtp$phi, main = "lunar azimuth, Hobart")
par(op)
## the sun
tm <- Sys.time() + seq(by = 3600, length = 100)
sun <- mini.sun(tm)
rtp <- astro(147, -42, sun)
op <- par(mfrow = c(2,1))
plot(tm, rtp$theta, main = "solar elevation, Hobart")
plot(tm, rtp$phi, main = "solar azimuth, Hobart")
par(op)
## Not run:
elev.gmt <- mkElevationSeg(1, tm)
plot(tm, rtp$theta, main = "solar elevation mini.sun versus NOAA")
lines(tm, elev.gmt(1, 147, -42))
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.