33
4.18
EPHEMERIS
short int ephemeris (double tjd, body *cel_obj, short int origin,
double *pos, double *vel)
PURPOSE:
Retrieves the position and velocity of a body from a fundamental
ephemeris.
INPUT
ARGUMENTS:
tjd (double)
TDB Julian date.
*cel_obj (struct body)
Pointer to structure containing the designation of the body
of interest (defined in novas.h).
origin (int)
Origin code; solar system barycenter = 0,
center of mass of the Sun = 1.
OUTPUT
ARGUMENTS:
pos[3] (double)
Position vector of 'body' at tjd; equatorial rectangular
coordinates in AU referred to the mean equator and equinox
of J2000.0.
vel[3] (double)
Velocity vector of 'body' at tjd; equatorial rectangular
system referred to the mean equator and equinox of J2000.0,
in AU/Day.
RETURNED
VALUE:
(short int)
0 ... Everything OK.
1 ... Invalid value of 'origin'.
2 ... Invalid value of 'type' in 'cel_obj'.
3 ... Unable to allocate memory.
10+n ... where n is the error code from 'solarsystem'.
20+n ... where n is the error code from 'readeph'.
Discussion:
This function serves as the interface between NOVAS-C and ephemerides of solar
system bodies. The version of ephemeris that ships with NOVAS-C directly supports an
ephemeris of major solar system bodies (such as JPL's DE200, DE405, or DE406), and
the USNO minor planet ephemerides (USNO/AE98). The ephemeris of the major bodies
is accessed via a call to function solarsystem from within function ephemeris. The minor
planet ephemerides are accessed via a call to readeph. (Note: both the USNO minor
planet ephemerides and the JPL ephemerides are not part of NOVAS-C and must be
obtained elsewhere).
It is relatively easy to modify function ephemeris to support ephemerides other than
the two mentioned above. In function ephemeris, there is a
switch
structure controlled