CSPICE_SPKSSB returns the geometric state (position and
velocity) of a target body relative to the solar system
For important details concerning this module's function, please refer to
the CSPICE routine spkssb_c.
targ the string name or ID of the target body (the
et the double precision ephemeris time (ET) epoch
for the observation of interest
ref the string name of the reference frame in
which to output the state 6-vector
cspice_spkssb, targ, et, ref, starg
starg a double precision 6-vector containing the position
and velocity of 'targ' relative to the Solar System
Barycenter at time 'et'.
Note: The state vector returned by cspice_spkssb represents the
geometric state of the target from the Solar System Barycenter.
The routine applies no corrections to account for stellar
aberration or the finite speed of light.
Any numerical results shown for this example may differ between
platforms as the results depend on the SPICE kernels used as input
and the machine specific arithmetic implementation.
;; Load a set of kernels: an SPK file, a PCK
;; file and a leapseconds file. Use a meta
;; kernel for convenience.
;; Define parameters for a state lookup:
;; Return the state vector of Mars (499)
;; and Earth (399) with respect to the Solar System
;; Barycenter in the J2000 frame at epoch
;; July 4, 2003 11:00 AM PST.
targ1 = 499
epoch = 'July 4, 2003 11:00 AM PST'
frame = 'J2000'
targ2 = 399
;; Convert the epoch to ephemeris time.
cspice_str2et, epoch, et
;; Look-up the states for the defined parameters.
cspice_spkssb, targ1, et, frame, state1
cspice_spkssb, targ2, et, frame, state2
;; What measure of distance separates the two bodies
;; at epoch.
dist = cspice_vdist( state1[0:2], state2[0:2] )
print, 'The absolute distance (KM) : ', dist
print, 'between Mars and Earth at epoch : ', epoch
The absolute distance (KM) : 80854820.
between Mars and Earth at epoch : July 4, 2003 11:00 AM PST
Note, an cspice_spkgeo call equivalent to the two cspice_spkssb
cspice_spkgeo, targ1, et, frame, targ2, state, ltime
dist = norm( state[0:2] )
-Icy Version 1.0.0, 16-JUN-2003, EDW (JPL)
state relative to solar system barycenter