planet_coords: Calculate low precision Right Ascension and declination for...

Description Usage Arguments Details Value Author(s) References See Also Examples

Description

Calculate low precision Right Ascension and declination for the planets given a date

Usage

1
planet_coords(date, planet=planet, jd = FALSE)

Arguments

date

If jd=FALSE, then date is a 3-6 element vector containing year,month (1-12), day, and optionally hour, minute, & second. If jd=TRUE, then date is a vector of Julian dates.

planet

scalar string giving name of a planet, e.g. 'venus' (default = planet that computes coordinates for all planets except Earth)

jd

If =TRUE, then the date parameter should be supplied as one or more Julian dates (default = FALSE)

Details

For low precision, this routine uses function helio to get the heliocentric ecliptic coordinates of the planets at the given date, then converts these to geocentric ecliptic coordinates following Meeus (1991, p.209). These are then converted to Right Ascension and declination using the function euler. The function returns astrometric coordinates, i.e. no correction for aberration. The accuracy between the years 1800 and 2050 is better than 1 arcminute for the terrestial planets, but reaches 10 arcminutes for Saturn. Before 1850 or after 2050 the accuracy can get much worse.

The high precision option available in the IDL procedure based on JPL planetary ephemerides is not current available in the R astrolib package. The helio function is based on the two-body problem and neglects interactions between the planets. This is why the worst results are for Saturn.

Value

ra

Right Ascension of planet(s), J2000 degrees

dec

declination of planet(s), J2000 degrees

Author(s)

Written P.Plait & W. Landsman 2000

R adaptation by Arnab Chakraborty June 2013

References

Meeus, J. 1991, "Astronomical Algorithms"

See Also

helio euler juldate

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
# Find the RA, Dec of Venus on 1992 Dec 20
# Result: RA = 21 05  2.66  Dec = -18 51 45.7

planet_coords(c(1992,12,20))    # compute for all planets
adstring(ra[2],dec[2],1)        # Venus is second planet
# This position is 37" from the full DE406 ephemeris position of
# RA = 21 05  5.24        -18 51 43.1

# Plot the declination of Mars for every day in the year 2001

jd = jdcnv(2001,1,1,0)      # get Julian date of midnight on Jan 1
out = planet_coords(jd+seq(0,365), planet='mars')     
plot(jd+seq(0,365), out$dec, pch=20, xlab='Day of 2001', ylab='Declination of Mars (degrees)')

Example output

Called from: planet_coords(c(1992, 12, 20))
Error in stopifnot(length(ra_dec) == length(dec)) : object 'ra' not found
Calls: planet_coords -> adstring -> stopifnot
debug: x = rad * cos(lat) * cos(lon) - rade * cos(late) * cos(lone)
debug: y = rad * cos(lat) * sin(lon) - rade * cos(late) * sin(lone)
Error in rep(0, 6 - length(date)) : invalid 'times' argument
Calls: planet_coords -> planet_coords -> juldate
Error in xy.coords(x, y, xlabel, ylabel, log) : object 'out' not found
Calls: planet_coords -> plot -> plot.default -> xy.coords
debug: z = rad * sin(lat) - rade * sin(late)
debug: lambda = atan2(y, x) * radeg
debug: beta = atan2(z, sqrt(x * x + y * y)) * radeg
debug: tmp = euler(lambda, beta, 4)
Called from: euler(lambda, beta, 4)
debug: return(list(ao = ao, bo = bo))
debug: return(list(ra = tmp$ao, dec = tmp$bo))
$ra
         [,1]
[1,] 248.5639
[2,] 316.2609
[3,] 117.2738
[4,] 191.8385
[5,] 317.9323
[6,] 288.5635
[7,] 289.4143
[8,] 234.3115

$dec
           [,1]
[1,] -20.901785
[2,] -18.861782
[3,]  24.571676
[4,]  -3.718574
[5,] -17.250788
[6,] -22.753931
[7,] -21.560624
[8,]  -4.851693

astrolibR documentation built on May 2, 2019, 3:26 a.m.