void spkssb_c ( SpiceInt targ,
ConstSpiceChar * ref,
SpiceDouble starg )
Return the state (position and velocity) of a target body
relative to the solar system barycenter.
Variable I/O Description
-------- --- --------------------------------------------------
targ I Target body.
et I Target epoch.
ref I Target reference frame.
starg O State of target.
targ is the standard NAIF ID code for a target body.
et is the epoch (ephemeris time) at which the state of the
target body is to be computed.
ref is the name of the reference frame to which the vectors
returned by the routine should be rotated. This may be
any frame supported by the CSPICE frame system,
including dynamic and other non-inertial frames.
starg contains the position and velocity of the target body,
relative to the solar system barycenter, at epoch 'et'.
These vectors are rotated into the specified reference
frame. Units are always km and km/sec.
1) If sufficient information has not been "loaded" via the
routine spklef_c or the PCK kernel loaders, the problem will
be diagnosed by a routine in the call tree of this routine.
2) The error SPICE(EMPTYSTRING) is signaled if the input
string 'ref' does not contain at least one character, since the
input string cannot be converted to a Fortran-style string
in this case.
3) The error SPICE(NULLPOINTER) is signaled if the input string
pointer 'ref' is null.
In order to compute the state of one body relative to another,
the states of the two bodies must be known relative to a third
body. One simple solution is to use the solar system barycenter
as the third body.
Ephemeris data from more than one segment may be required
to determine the state of a body relative to the barycenter.
spkssb_c reads as many segments as necessary, from as many
files as necessary, using files that have been loaded by
previous calls to spklef_c (load ephemeris file).
In the following code fragment, spkssb_c is used to display
the distance from Earth (Body 399) to Mars (body 499) at
a series of epochs.
#define EARTH 399
#define MARS 499
spklef_c ( "DE125.SPK", &handle );
while ( epoch <= end )
spkssb_c ( EARTH, epoch, "J2000", searth );
spkssb_c ( MARS, epoch, "J2000", smars );
printf ( "%f %22.15e\n", epoch, vdist_c( searth, smars ) );
epoch += delta;
1) The ephemeris files to be used by spkssb_c must be loaded
by spklef_c before spkssb_c is called.
NAIF Document 168.0, "S- and P- Kernel (SPK) Specification and
N.J. Bachman (JPL)
W.L. Taber (JPL)
I.M. Underwood (JPL)
-CSPICE Version 1.0.2, 20-NOV-2004 (NJB)
Updated description of input argument `ref' to indicate all
frames supported by CSPICE are allowed.
-CSPICE Version 1.0.1, 14-OCT-2003 (EDW)
Various minor corrections to the header.
-CSPICE Version 1.0.0, 23-JUN-1999 (NJB) (WLT) (IMU)
state relative to solar system barycenter