idlastro / Astronomical Utilities: HELIO

[Source code]

NAME
HELIO
PURPOSE
Compute (low-precision) heliocentric coordinates for the planets.
EXPLANATION
The mean orbital elements for epoch J2000 are used.   These are derived
from a 250 yr least squares fit of the DE 200 planetary ephemeris to a 
Keplerian orbit where each element is allowed to vary linearly with 
time.  For dates between 1800 and 2050, this solution fits the 
terrestrial planet orbits to ~25" or better, but achieves only ~600" 
for Saturn.   
Use PLANET_COORDS (which calls HELIO) to get celestial (RA, Dec)
coordinates of the planets
CALLING SEQUENCE
HELIO, JD, LIST, HRAD, HLONG, HLAT, [/RADIAN]
INPUTS
JD = Julian date, double precision scalar or vector
LIST = List of planets array.  May be a single number.
        1 = merc, 2 = venus, ... 9 = pluto.
OUTPUTS
HRAD = array of Heliocentric radii (A.U).
HLONG = array of Heliocentric (ecliptic) longitudes (degrees).
HLAT = array of Heliocentric latitudes (degrees).
      These output parameters will be dimensioned Nplanet by Ndate,
      where Nplanet is the number of elements of list, and Ndate is 
      the number of elements of JD.
OPTIONAL INPUT KEYWORD
/RADIAN - If set, then the output longitude and latitude are given in 
          radians.         
EXAMPLE
(1) Find the current heliocentric positions of all the planets
 IDL> GET_JULDATE, jd      ;Get current Julian date
 IDL> HELIO,jd,indgen(9)+1,hrad,hlong,hlat  ;Get radius, long, and lat
(2) Find heliocentric position of Mars on August 23, 2000 
  IDL> JDCNV, 2000,08,23,0,jd
  IDL> HELIO,JD,2,HRAD,HLONG,HLAT
           ===> hrad = 1.6407 AU hlong = 124.3197 hlat = 1.7853
  For comparison, the JPL ephemeris gives
                hrad = 1.6407 AU hlong = 124.2985 hlat = 1.7845
(3) Find the heliocentric positions of Mars and Venus for every day in
    November 2000
 IDL> JDCNV, 2000, 11, 1, 0, jd    ;Julian date of November 1, 2000
 IDL> helio, jd+indgen(30), [4,2], hrad,hlong,hlat   ;Mars=4, Venus=2 
            hrad, hlong, and hlat will be dimensioned [2,30]
            first column contains Mars data, second column Venus
COMMON BLOCKS
None 
ROUTINES USED
CIRRANGE - force angle between 0 and 2*!PI
NOTES
(1) The calling sequence for this procedure was changed in August 2000
(2) This program is based on the two-body model and thus neglects 
    interactions between the planets.   This is why the worst results
    are for Saturn.  Use the procedure JPLEPHINTERp for more accurate
    positions using the JPL ephemeris.   Also see 
    http://ssd.jpl.nasa.gov/cgi-bin/eph for a more accurate ephemeris 
    generator online.     
(3) The coordinates are given for equinox 2000 and *not* the equinox
    of the supplied date(s)
MODIFICATION HISTORY
R. Sterner.  20 Aug, 1986.
Code cleaned up a bit      W. Landsman             December 1992
Major rewrite, use modern orbital elements, vectorize, more accurate
  solution to Kepler's equation          W. Landsman August 2000
Wasn't working for planet vectors        W. Landsman August 2000
Work for more than 32767 positions       S. Leach Jan 2009