spkez |

## ProcedureSPKEZ ( S/P Kernel, easy reader ) SUBROUTINE SPKEZ ( TARG, ET, REF, ABCORR, OBS, STARG, LT ) ## AbstractReturn the state (position and velocity) of a target body relative to an observing body, optionally corrected for light time (planetary aberration) and stellar aberration. ## Required_ReadingSPK NAIF_IDS FRAMES TIME ## KeywordsEPHEMERIS ## DeclarationsIMPLICIT NONE INCLUDE 'frmtyp.inc' INCLUDE 'zzabcorr.inc' INCLUDE 'zzctr.inc' INTEGER TARG DOUBLE PRECISION ET CHARACTER*(*) REF CHARACTER*(*) ABCORR INTEGER OBS DOUBLE PRECISION STARG ( 6 ) DOUBLE PRECISION LT ## Brief_I/OVariable I/O Description -------- --- -------------------------------------------------- TARG I Target body. ET I Observer epoch. REF I Reference frame of output state vector. ABCORR I Aberration correction flag. OBS I Observing body. STARG O State of target. LT O One way light time between observer and target. ## Detailed_InputTARG is the NAIF ID code for a target body. The target and observer define a state vector whose position component points from the observer to the target. ET is 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. ET refers to time at the observer's location. REF is the name of the reference frame relative to which the output state vector should be expressed. This may be any frame supported by the SPICE system, including built-in frames (documented in the Frames Required Reading) and frames defined by a loaded frame kernel (FK). When REF designates a non-inertial frame, the orientation of the frame is evaluated at an epoch dependent on the selected aberration correction. See the description of the output state vector STARG for details. 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. 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-LT 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 uses an 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 below 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+LT: '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. OBS is the NAIF ID code for an observing body. ## Detailed_OutputSTARG is a Cartesian state vector representing the position and velocity of the target body relative to the specified observer. STARG is corrected for the specified aberrations, and is expressed with respect to the reference frame specified by REF. The first three components of STARG represent the x-, y- and z-components of the target's position; the 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 the derivative with respect to time of the position component of STARG. Units are always km and km/sec. Non-inertial frames are treated as follows: letting LTCENT be the one-way light time between the observer and the central body associated with the frame, the orientation of the frame is evaluated at ET-LTCENT, ET+LTCENT, or ET depending on whether the requested aberration correction is, respectively, for received radiation, transmitted radiation, or is omitted. LTCENT is computed using the method indicated by ABCORR. LT is the one-way light time between the observer and target in seconds. If the target state is corrected for aberrations, then LT is the one-way light time between the observer and the light time corrected target location. ## ParametersNone. ## Exceptions1) If the reference frame REF is not a recognized reference frame the error 'SPICE(UNKNOWNFRAME)' is signaled. 2) If the loaded kernels provide insufficient data to compute the requested state vector, the deficiency will be diagnosed by a routine in the call tree of this routine. 3) If an error occurs while reading an SPK or other kernel file, the error will be diagnosed by a routine in the call tree of this routine. 4) If any of the required attributes of the reference frame REF cannot be determined, 'SPICE(UNKNOWNFRAME2)' is signaled. ## FilesThis routine computes states using SPK files that have been loaded into the SPICE system, normally via the kernel loading interface routine FURNSH. See the routine FURNSH and the SPK and KERNEL Required Reading for further information on loading (and unloading) kernels. If the output state STARG is to be expressed relative to a non-inertial frame, or 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. ## ParticularsThis routine is part of the user interface to the SPICE ephemeris system. It allows you to retrieve state information for any ephemeris object relative to any other in a reference frame that is convenient for further computations. Aberration corrections ====================== In space science or engineering applications one frequently wishes to know where to point a remote sensing instrument, such as an optical camera or radio antenna, in order to observe or otherwise receive radiation from a target. This pointing problem is complicated by the finite speed of light: one needs to point to where the target appears to be as opposed to where it actually is at the epoch of observation. We use the adjectives "geometric," "uncorrected," or "true" to refer to an actual position or state of a target at a specified epoch. When a geometric position or state vector is modified to reflect how it appears to an observer, we describe that vector by any of the terms "apparent," "corrected," "aberration corrected," or "light time and stellar aberration corrected." The SPICE Toolkit can correct for two phenomena affecting the apparent location of an object: one-way light time (also called "planetary aberration") and stellar aberration. One-way light time ------------------ Correcting for one-way light time is done by computing, given an observer and observation epoch, where a target was when the observed photons departed the target's location. The vector from the observer to this computed target location is called a "light time corrected" vector. The light time correction depends on the motion of the target relative to the solar system barycenter, but it is independent of the velocity of the observer relative to the solar system barycenter. Relativistic effects such as light bending and gravitational delay are not accounted for in the light time correction performed by this routine. Stellar aberration ------------------ The velocity of the observer also affects the apparent location of a target: photons arriving at the observer are subject to a "raindrop effect" whereby their velocity relative to the observer is, using a Newtonian approximation, the photons' velocity relative to the solar system barycenter minus the velocity of the observer relative to the solar system barycenter. This effect is called "stellar aberration." Stellar aberration is independent of the velocity of the target. The stellar aberration formula used by this routine does not include (the much smaller) relativistic effects. Stellar aberration corrections are applied after light time corrections: the light time corrected target position vector is used as an input to the stellar aberration correction. When light time and stellar aberration corrections are both applied to a geometric position vector, the resulting position vector indicates where the target "appears to be" from the observer's location. As opposed to computing the apparent position of a target, one may wish to compute the pointing direction required for transmission of photons to the target. This also requires correction of the geometric target position for the effects of light time and stellar aberration, but in this case the corrections are computed for radiation traveling *from* the observer to the target. The "transmission" light time correction yields the target's location as it will be when photons emitted from the observer's location at ET arrive at the target. The transmission stellar aberration correction is the inverse of the traditional stellar aberration correction: it indicates the direction in which radiation should be emitted so that, using a Newtonian approximation, the sum of the velocity of the radiation relative to the observer and of the observer's velocity, relative to the solar system barycenter, yields a velocity vector that points in the direction of the light time corrected position of the target. One may object to using the term "observer" in the transmission case, in which radiation is emitted from the observer's location. The terminology was retained for consistency with earlier documentation. Below, we indicate the aberration corrections to use for some common applications: 1) Find the apparent direction of a target for a remote-sensing observation. Use 'LT+S' or 'CN+S: apply both light time and stellar aberration corrections. Note that using light time corrections alone ('LT' or 'CN') is generally not a good way to obtain an approximation to an apparent target vector: since light time and stellar aberration corrections often partially cancel each other, it may be more accurate to use no correction at all than to use light time alone. 2) Find the corrected pointing direction to radiate a signal to a target. This computation is often applicable for implementing communications sessions. Use 'XLT+S' or 'XCN+S: apply both light time and stellar aberration corrections for transmission. 3) Compute the apparent position of a target body relative to a star or other distant object. Use 'LT', 'CN', 'LT+S', or 'CN+S' as needed to match the correction applied to the position of the distant object. For example, if a star position is obtained from a catalog, the position vector may not be corrected for stellar aberration. In this case, to find the angular separation of the star and the limb of a planet, the vector from the observer to the planet should be corrected for light time but not stellar aberration. 4) Obtain an uncorrected state vector derived directly from data in an SPK file. Use 'NONE'. 5) Use a geometric state vector as a low-accuracy estimate of the apparent state for an application where execution speed is critical. Use 'NONE'. 6) While this routine cannot perform the relativistic aberration corrections required to compute states with the highest possible accuracy, it can supply the geometric states required as inputs to these computations. Use 'NONE', then apply relativistic aberration corrections (not available in the SPICE Toolkit). Below, we discuss in more detail how the aberration corrections applied by this routine are computed. Geometric case ============== ## Examples1) Load a planetary ephemeris SPK; then look up a series of geometric states of the moon relative to the earth, referenced to the J2000 frame. IMPLICIT NONE C C Local constants C CHARACTER*(*) FRAME PARAMETER ( FRAME = 'J2000' ) CHARACTER*(*) ABCORR PARAMETER ( ABCORR = 'NONE' ) C C The name of the SPK file shown here is fictitious; C you must supply the name of an SPK file available C on your own computer system. C CHARACTER*(*) SPK PARAMETER ( SPK = 'planet.bsp' ) C C ET0 represents the date 2000 Jan 1 12:00:00 TDB. C DOUBLE PRECISION ET0 PARAMETER ( ET0 = 0.0D0 ) C C Use a time step of 1 hour; look up 100 states. C DOUBLE PRECISION STEP PARAMETER ( STEP = 3600.0D0 ) INTEGER MAXITR PARAMETER ( MAXITR = 100 ) C C The NAIF IDs of the earth and moon are 399 and 301 C respectively. C INTEGER OBSRVR PARAMETER ( OBSRVR = 399 ) INTEGER TARGET PARAMETER ( TARGET = 301 ) C C Local variables C DOUBLE PRECISION ET DOUBLE PRECISION LT DOUBLE PRECISION STATE ( 6 ) INTEGER I C C Load the SPK file. C CALL FURNSH ( SPK ) C C Step through a series of epochs, looking up a C state vector at each one. C DO I = 1, MAXITR ET = ET0 + (I-1)*STEP CALL ## RestrictionsNone. ## Literature_ReferencesSPK Required Reading. ## Author_and_InstitutionC.H. Acton (JPL) W.L. Taber (JPL) N.J. Bachman (JPL) J.E. McLean (JPL) H.A. Neilan (JPL) B.V. Semenov (JPL) M.J. Spencer (JPL) I.M. Underwood (JPL) ## VersionSPICELIB Version 5.1.0, 03-JUL-2014 (NJB) (BVS) Discussion of light time corrections was updated. Assertions that converged light time corrections are unlikely to be useful were removed. Last update was 23-SEP-2013 (NJB) (BVS) Bug fix: replaced calls to ZZPRSCOR with calls to ZZVALCOR. The latter routine rejects all aberration corrections not supported by the SPK subsystem. Bug fix: added a check and an exception for the FOUND flag returned by FRINFO. Updated to save the input frame name and POOL state counter and to do frame name-ID conversion only if the counter has changed. Updated various in-line comments. SPICELIB Version 5.0.1, 18-MAY-2010 (BVS) Removed "C$" marker from text in the header. SPICELIB Version 5.0.0, 27-DEC-2007 (NJB) This routine was upgraded to more accurately compute aberration-corrected velocity, and in particular, make it more consistent with observer-target positions. When light time corrections are used, the derivative of light time with respect to time is now accounted for in the computation of observer-target velocities. When the reference frame associated with the output state is time-dependent, the derivative of light time with respect to time is now accounted for in the computation of the rate of change of orientation of the reference frame. When stellar aberration corrections are used, velocities now reflect the rate of range of the stellar aberration correction. SPICELIB Version 4.1.0, 05-JAN-2005 (NJB) Tests of routine FAILED() were added. Minor header error was corrected. SPICELIB Version 4.0.2, 20-OCT-2003 (EDW) Added mention that LT returns in seconds. SPICELIB Version 4.0.1, 29-JUL-2003 (NJB) (CHA) Various minor header changes were made to improve clarity. SPICELIB Version 4.0.0, 28-DEC-2001 (NJB) Updated to handle aberration corrections for transmission of radiation. Formerly, only the reception case was supported. The header was revised and expanded to explain the functionality of this routine in more detail. SPICELIB Version 3.1.0, 09-JUL-1996 (WLT) Corrected the description of LT in the Detailed Output section of the header. SPICELIB Version 3.0.0, 26-MAY-1995 (WLT) The routine was upgraded to support non-inertial frames. SPICELIB Version 2.1.1, 5-AUG-1994 (HAN) (MJS) Added code so that routine accepts lower case, mixed case and upper case versions of the string ABCORR. SPICELIB Version 2.0.1, 10-MAR-1992 (WLT) Comment section for permuted index source lines was added following the header. SPICELIB Version 2.0.0, 18-JUL-1991 (JEM) (NJB) The old |

Wed Apr 5 17:47:23 2017