CSPICE_STELAB returns apparent position of an object corrected for
For important details concerning this module's function, please refer to
the CSPICE routine stelab_c.
pobj a double precision 3-vector representing position in kilometers
of an object with respect to the observer, possibly corrected for
vobs a double precision 3-vector representing velocity in km/sec
of the observer with respect to the Solar System barycenter
cspice_stelab, pobj, vobs, appobj
appobj a double precision 3-vector representing apparent position
of the object relative to the observer, corrected for
'appobj' may overwrite 'pobj'
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.
;; Assign an observer, Earth, target, Moon, time of interest and
;; reference frame for returned vectors.
IDOBS = 399
IDTARG = 301
UTC = 'July 4 2004'
FRAME = 'J2000'
;; Load the needed kernels.
;; Convert the time string to ephemeris time, J2000.
cspice_str2et, UTC, et
;; Get the state of the observer with respect to the solar
;; system barycenter.
cspice_spkssb, IDOBS, et, FRAME, sobs
;; Get the light-time corrected state of the target body as
;; seen by the observer.
cspice_spkapp, IDTARG, et, FRAME, sobs, 'LT', starg, ltime
;; Output the uncorrected vector.
print, 'Uncorrected state vector'
print, 'position: ', starg[0:2]
print, 'velocity: ', starg[3:5]
;; Apply the correction for stellar aberration to the
;; light-time corrected state of the target body.
cspice_stelab, starg[0:2], starg[3:5], cortarg
;; Output the corrected position vector and the apparent difference from
;; the uncorrected vector.
print, 'Corrected position vector'
print, ' ', cortarg
print, 'Apparent difference'
print, ' ', starg[0:2] - cortarg
;; Unload the kernels to restore the kernel pool state.
Uncorrected state vector
position: 201738.72 -260893.15 -147722.59
velocity: 0.92472710 0.53237961 0.21766975
Corrected position vector
201739.80 -260892.47 -147722.31
-1.0857825 -0.67906376 -0.28351892
-Icy Version 1.0.0, 16-JUN-2003, EDW (JPL)