Index of Functions: A  B  C  D  E  F  G  H  I  J  K  L  M  N  O  P  Q  R  S  T  U  V  W  X 
Index Page
cspice_spkapp

Table of contents
Abstract
I/O
Parameters
Examples
Particulars
Exceptions
Files
Restrictions
Required_Reading
Literature_References
Author_and_Institution
Version
Index_Entries


Abstract


   Deprecated: This routine is supported for purposes of backward
   compatibility only.

   CSPICE_SPKAPP returns the state 6-vector of a target
   body relative to an observer, optionally corrected for
   light time and stellar aberration, given the geometric
   state 6-vector of the observer relative to the Solar System
   Barycenter. The routine signals an error if the input vector
   is not a 6-vector.

I/O


   Given:

      targ     the NAIF ID code for a target body.

               help, targ
                  LONG = Scalar

               The target and observer define a state vector whose position
               component points from the observer to the target.

      et       the ephemeris time, expressed as seconds past J2000 TDB, at
               which the state of the target body relative to the observer is
               to be computed.

               help, et
                  DOUBLE = Scalar

               `et' refers to time at the observer's location.

      ref      the inertial reference frame with respect to which the
               observer's state `sobs' is expressed.

               help, ref
                  STRING = Scalar

               `ref' must be recognized by the SPICE Toolkit. The acceptable
               frames are listed in the Frames Required Reading, as well as in
               the SPICELIB routine CHGIRF.

               Case and blanks are not significant in the string `ref'.

      sobs     the geometric (uncorrected) state of the observer relative to
               the solar system barycenter at epoch `et'.

               help, sobs
                  DOUBLE = Array[6]

               `sobs' is a 6-vector: the first three components of `sobs'
               represent a Cartesian position vector; the last three components
               represent the corresponding velocity vector. `sobs' is expressed
               relative to the inertial reference frame designated by `ref'.

               Units are always km and km/sec.

      abcorr   indicates the aberration corrections to be applied to the state
               of the target body to account for one-way light time and stellar
               aberration.

               help, abcorr
                  STRING = Scalar

               See the discussion in the -Particulars section for
               recommendations on how to choose aberration corrections.

               `abcorr' may be any of the following:

                  'NONE'     Apply no correction. Return the
                             geometric state of the target body
                             relative to the observer.

               The following values of `abcorr' apply to the
               "reception" case in which photons depart from the
               target's location at the light-time corrected epoch
               et-ltime and *arrive* at the observer's location at `et':

                  'LT'       Correct for one-way light time (also
                             called "planetary aberration") using a
                             Newtonian formulation. This correction
                             yields the state of the target at the
                             moment it emitted photons arriving at
                             the observer at `et'.

                             The light time correction involves
                             iterative solution of the light time
                             equation (see -Particulars for details).
                             The solution invoked by the 'LT' option
                             uses one iteration.

                  'LT+S'     Correct for one-way light time and
                             stellar aberration using a Newtonian
                             formulation. This option modifies the
                             state obtained with the 'LT' option to
                             account for the observer's velocity
                             relative to the solar system
                             barycenter. The result is the apparent
                             state of the target---the position and
                             velocity of the target as seen by the
                             observer.

                  'CN'       Converged Newtonian light time
                             correction. In solving the light time
                             equation, the 'CN' correction iterates
                             until the solution converges (three
                             iterations on all supported platforms).
                             Whether the 'CN+S' solution is
                             substantially more accurate than the
                             'LT' solution depends on the geometry
                             of the participating objects and on the
                             accuracy of the input data. In all
                             cases this routine will execute more
                             slowly when a converged solution is
                             computed. See the -Particulars section
                             of cspice_spkezr for a discussion of precision
                             of light time corrections.

                  'CN+S'     Converged Newtonian light time
                             correction and stellar aberration
                             correction.


               The following values of `abcorr' apply to the
               "transmission" case in which photons *depart* from
               the observer's location at `et' and arrive at the
               target's location at the light-time corrected epoch
               et+ltime:

                  'XLT'      "Transmission" case: correct for
                             one-way light time using a Newtonian
                             formulation. This correction yields the
                             state of the target at the moment it
                             receives photons emitted from the
                             observer's location at `et'.

                  'XLT+S'    "Transmission" case: correct for
                             one-way light time and stellar
                             aberration using a Newtonian
                             formulation  This option modifies the
                             state obtained with the 'XLT' option to
                             account for the observer's velocity
                             relative to the solar system
                             barycenter. The position component of
                             the computed target state indicates the
                             direction that photons emitted from the
                             observer's location must be "aimed" to
                             hit the target.

                  'XCN'      "Transmission" case: converged
                             Newtonian light time correction.

                  'XCN+S'    "Transmission" case: converged
                             Newtonian light time correction and
                             stellar aberration correction.

               Neither special nor general relativistic effects are
               accounted for in the aberration corrections applied
               by this routine.

               Case and blanks are not significant in the string
               `abcorr'.

   the call:

      cspice_spkapp, targ, et, ref, sobs, abcorr, starg, ltime

   returns:

      starg    a Cartesian state vector representing the position and velocity
               of the target body relative to the specified observer.

               help, starg
                  DOUBLE = Array[6]

               `starg' is corrected for the specified aberrations, and is
               expressed with respect to the specified inertial reference
               frame. The first three components of `starg' represent the x-,
               y- and z-components of the target's position; last three
               components form the corresponding velocity vector.

               The position component of `starg' points from the
               observer's location at `et' to the aberration-corrected
               location of the target. Note that the sense of the
               position vector is independent of the direction of
               radiation travel implied by the aberration
               correction.

               The velocity component of `starg' is obtained by
               evaluating the target's geometric state at the light
               time corrected epoch, so for aberration-corrected
               states, the velocity is not precisely equal to the
               time derivative of the position.

               Units are always km and km/sec.

      ltime    the one-way light time between the observer and target in
               seconds.

               help, ltime
                  DOUBLE = Scalar

               If the target state is corrected for aberrations, then `ltime'
               is the one-way light time between the observer and the light
               time corrected target location.

Parameters


   None.

Examples


   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.

   1) Compute the position and velocity of Mars relative to the Moon,
      corrected for one-way light time and stellar aberration, given
      the geometric state of the Moon relative to the Solar System
      Barycenter.

      Use the meta-kernel shown below to load the required SPICE
      kernels.


         KPL/MK

         File name: spkapp_ex1.tm

         This meta-kernel is intended to support operation of SPICE
         example programs. The kernels shown here should not be
         assumed to contain adequate or correct versions of data
         required by SPICE-based user applications.

         In order for an application to use this meta-kernel, the
         kernels referenced here must be present in the user's
         current working directory.

         The names and contents of the kernels referenced
         by this meta-kernel are as follows:

            File name                     Contents
            ---------                     --------
            de421.bsp                     Planetary ephemeris
            naif0009.tls                  Leapseconds

         \begindata

            KERNELS_TO_LOAD = ( 'de421.bsp',
                                'naif0009.tls'  )

         \begintext

         End of meta-kernel


      Example code begins here.


      PRO spkapp_ex1

         ;;
         ;; Define the needed parameters.
         ;;
         MARS   = 499
         MOON   = 301
         EPOCH  = 'Jan 1 2004 5:00 PM'
         REF    = 'J2000'
         ABCORR = 'LT+S'

         ;;
         ;; Load the kernels.
         ;;
         cspice_furnsh, 'spkapp_ex1.tm'

         ;;
         ;; Convert the time string to ephemeris time J2000.
         ;;
         cspice_str2et, EPOCH, et

         ;;
         ;; Compute the geometric state of the Moon wrt the
         ;; the Solar System barycenter.
         ;;
         cspice_spkssb, MOON, et, REF, state

         ;;
         ;; Apply an aberration correction for a position vector
         ;; of the MOON as seen from Mars.
         ;;
         cspice_spkapp, MARS, et, REF, state, ABCORR, state_vec, ltime

         print, 'State vector of    : ' + string(MARS)
         print, '...as seen from    : ' + string(MOON)
         print, '...in frame        : ' + REF
         print, '...at time         : ' + EPOCH
         print, '...with correction : ' + ABCORR
         print, FORMAT='(A,3F15.4)', '...R equals    (km): ', state_vec[0:2]
         print, FORMAT='(A,3F15.4)', '...V equals  (km/s): ', state_vec[3:5]

         ;;
         ;; It's always good form to unload kernels after use,
         ;; particularly in IDL due to data persistence.
         ;;
         cspice_kclear

      END


      When this program was executed on a Mac/Intel/IDL8.x/64-bit
      platform, the output was:


      State vector of    :      499
      ...as seen from    :      301
      ...in frame        : J2000
      ...at time         : Jan 1 2004 5:00 PM
      ...with correction : LT+S
      ...R equals    (km):  164534472.3125  25121994.3686  11145412.8385
      ...V equals  (km/s):         12.3120        19.8884         9.4068


      Note that this code example could be replaced by the following
      cspice_spkezr call:

         cspice_spkezr, 'MARS', et, REF, ABCORR, 'MOON', state_vec, ltime

Particulars


   Note: NAIF recommends the use of cspice_spkezr instead of cspice_spkapp
   to calculate observer to target state vectors.

   Please refer to the Aberation Corrections Required Reading (abcorr.req)
   for detailed information describing the nature and calculation of the
   applied corrections.

Exceptions


   1)  If the value of `abcorr' is not recognized, the error
       SPICE(SPKINVALIDOPTION) is signaled by a routine in the call
       tree of this routine.

   2)  If the reference frame requested is not a recognized
       inertial reference frame, the error SPICE(BADFRAME)
       is signaled by a routine in the call tree of this routine.

   3)  If the state of the target relative to the solar system
       barycenter cannot be computed, an error is signaled by a
       routine in the call tree of this routine.

   4)  If any of the input arguments, `targ', `et', `ref', `sobs' or
       `abcorr', is undefined, an error is signaled by the IDL error
       handling system.

   5)  If any of the input arguments, `targ', `et', `ref', `sobs' or
       `abcorr', is not of the expected type, or it does not have the
       expected dimensions and size, an error is signaled by the Icy
       interface.

   6)  If any of the output arguments, `starg' or `ltime', is not a
       named variable, an error is signaled by the Icy interface.

Files


   This routine computes states using SPK files that have been
   loaded into the SPICE system, normally via the kernel loading
   interface routine cspice_furnsh. Application programs typically load
   kernels once before this routine is called, for example during
   program initialization; kernels need not be loaded repeatedly.
   See the routine cspice_furnsh and the SPK and KERNEL Required Reading
   for further information on loading (and unloading) kernels.

   If any of the ephemeris data used to compute `starg' are expressed
   relative to a non-inertial frame in the SPK files providing those
   data, additional kernels may be needed to enable the reference
   frame transformations required to compute the state. Normally
   these additional kernels are PCK files or frame kernels. Any
   such kernels must already be loaded at the time this routine is
   called.

Restrictions


   1)  The kernel files to be used by cspice_spkapp must be loaded
       (normally by the Icy kernel loader cspice_furnsh) before
       this routine is called.

   2)  Unlike most other SPK state computation routines, this
       routine requires that the input state be relative to an
       inertial reference frame. Non-inertial frames are not
       supported by this routine.

   3)  In a future version of this routine, the implementation
       of the aberration corrections may be enhanced to improve
       accuracy.

Required_Reading


   ICY.REQ
   ABCORR.REQ
   SPK.REQ
   NAIF_IDS.REQ
   FRAMES.REQ
   TIME.REQ

Literature_References


   None.

Author_and_Institution


   N.J. Bachman        (JPL)
   J. Diaz del Rio     (ODC Space)
   B.V. Semenov        (JPL)
   E.D. Wright         (JPL)

Version


   -Icy Version 1.0.6, 26-OCT-2021 (JDR)

       Edited the header to comply with NAIF standard. Added example's
       problem statement and meta-kernel. Reformatted example's output
       and added call to cspice_kclear.

       Added -Parameters, -Exceptions, -Files, -Restrictions,
       -Literature_References and -Author_and_Institution sections.

       Removed reference to the routine's corresponding CSPICE header from
       -Abstract section.

       Added arguments' type and size information in the -I/O section.

   -Icy Version 1.0.5, 22-DEC-2015 (EDW)

       Corrected typo in -Version section. The 07-NOV-2013
       version entry lacked a version ID.

       Particulars updated to refer to Aberration Corrections
       Required Reading document.

   -Icy Version 1.0.4, 10-JUL-2014 (NJB) (EDW)

       Discussion of light time corrections was updated. Assertions
       that converged light time corrections are unlikely to be
       useful were removed.

   -Icy Version 1.0.3, 07-NOV-2013 (EDW)

       Improvement of -I/O section descriptions. Added aberration
       algorithm explanation to -Particulars section.

   -Icy Version 1.0.2, 18-MAY-2010 (BVS)

       Index lines now state that this routine is deprecated.

   -Icy Version 1.0.1, 23-SEP-2008 (EDW)

       Eliminated error in English.

   -Icy Version 1.0.0, 16-JUN-2003 (EDW)

Index_Entries


   DEPRECATED low-level aberration correction
   DEPRECATED apparent state from SPK file
   DEPRECATED get apparent state



Fri Dec 31 18:43:07 2021