CSPICE_SPKGPS computes the geometric position 3vector
of a target body relative to an observing body.
For important details concerning this module's function, please refer to
the CSPICE routine spkgps_c.
Given:
targ the NAIF integer ID of the target body (the
observed body)
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 6vector.
obs the NAIF integer ID of the observer (the
observing body)
the call:
cspice_spkgps, targ, et, `ref', obs, pos, ltime
returns:
pos a double precision 3vector containing the
position of 'targ' with respect to 'obs'
as seen in the 'ref'
ltime a double precision scalar describing the
oneway light time between 'targ' and 'obs'
Please note, CSPICE documentation and source code
uniformly uses the variable name 'lt' to designate
the lighttime between an observer and target. IDL
uses "lt" as the lessthan numeric comparison
operator and so does not allow "lt" as a variable name.
Therefore, Icy documentation uses the name 'ltime'
for the lighttime value.
Note: The position vector returned by cspice_spkgps represents the
geometric position of the target from the observer. 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.
;;
cspice_furnsh, 'standard.tm'
;;
;; Define parameters for a position lookup:
;;
;; Return the position vector of Mars (499) as seen from
;; Earth (399) in the J2000 frame
;; using aberration correction LT+S (light time plus
;; stellar aberration) at the epoch
;; July 4, 2003 11:00 AM PST.
;;
target = 499
epoch = 'July 4, 2003 11:00 AM PST'
frame = 'J2000'
observer = 399
;;
;; Convert the epoch to ephemeris time.
;;
cspice_str2et, epoch, et
;;
;; Lookup the state for the defined parameters.
;;
cspice_spkgps, target, et, frame, observer, $
pos, ltime
;;
;; Output...
;;
print, 'The position of : ', target
print, 'As observed from : ', observer
print, 'In reference frame : ', frame
print, 'At epoch : ', epoch
print
print, 'R (kilometers) : ', pos
print
print, 'Light time (secs) between observer and target: ', ltime
IDL outputs:
The position of : 499
As observed from : 399
In reference frame : J2000
At epoch : July 4, 2003 11:00 AM PST
R (kilometers) : 73826216. 27128031. 18741974.
Light time (secs) between observer and target: 269.70265
None.
ICY.REQ
SPK.REQ
FRAMES.REQ
Icy Version 1.0.0, 16JUN2003, EDW (JPL)
geometric position of one body relative to another
