
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].
astro(lon, lat, astro.calc)EQUHOR(DEC, TAU, PHI)
FRAC(x)
LMST(MJDay, LAMBDA)
lunar(time)
mini.sun(time)
MJD(date)
POLAR(X, Y, Z)
astro
returns a list object with the components of the moon or sun's
position,
rho component
theta component - elevation
phi component - azimuth
vector of lon
gitudes
vector of lat
itudes
list object containing RA
right ascension
declination
TAU
PHI
number
modified julian day
LAMBDA
vector of date-times in POSIXct format
vector of date-times in POSIXct format
x-coordinate
y-coordinate
z-coordinate
Michael D. Sumner
Some of this could be faster (particularly the use of LMST in "astro" is not precalculated)
@BOOK{,
title = {Astronomy on the Personal Computer},
publisher = {Springer-Verlag, Berlin},
year = {1994},
author = {Oliver Montenbruck and Thomas Pfleger},
edition = {2 (translated from German by Storm Dunlop)},
}
See Also elevation
## 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)
elev.gmt <- mkElevationSeg(1, tm)
plot(tm, rtp$theta, main = "solar elevation mini.sun versus NOAA")
lines(tm, elev.gmt(1, 147, -42))
Run the code above in your browser using DataLab