spkltc_c |

## Procedurevoid spkltc_c ( SpiceInt targ, SpiceDouble et, ConstSpiceChar * ref, ConstSpiceChar * abcorr, ConstSpiceDouble stobs[6], SpiceDouble starg[6], SpiceDouble * lt, SpiceDouble * dlt ) ## AbstractReturn the state (position and velocity) of a target body relative to an observer, optionally corrected for light time, expressed relative to an inertial reference frame. ## Required_ReadingSPK ## KeywordsEPHEMERIS ## Brief_I/OVariable I/O Description -------- --- -------------------------------------------------- targ I Target body. et I Observer epoch. ref I Inertial reference frame of output state. abcorr I Aberration correction flag. stobs I State of the observer relative to the SSB. starg O State of target. lt O One way light time between observer and target. dlt O Derivative of light time with respect to time. ## 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 inertial reference frame with respect to which the input state `stobs' and the output state `starg' are expressed. `ref' must be recognized by the CSPICE Toolkit. The acceptable frames are listed in the Frames Required Reading, as well as in the CSPICE routine chgirf_. Case and blanks are not significant in the string `ref'. abcorr indicates the aberration corrections to be applied to the state of the target body to account for one-way light time. See the discussion in the Particulars section for recommendations on how to choose aberration corrections. If `abcorr' includes the stellar aberration correction symbol "+S", this flag is simply ignored. Aside from the possible presence of this symbol, `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 involves iterative solution of the light time equation (see Particulars for details). The solution invoked by the "LT" option uses one iteration. "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 spkezr_c for a discussion of precision of light time corrections. 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'. "XCN" "Transmission" case: converged Newtonian light time 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'. stobs is the geometric state of the observer relative to the solar system barycenter at `et'. The target and observer define a state vector whose position component points from the observer to the target. `stobs' is expressed relative to the reference frame designated by `ref'. ## 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 aberration, 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. Units are always km and km/sec. lt is the one-way light time between the observer and target in seconds. If the target state is corrected for light time, then `lt' is the one-way light time between the observer and the light time-corrected target location. dlt is the derivative with respect to barycentric dynamical time of the one way light time between target and observer: dlt = d(lt)/d(et) `dlt' can also be described as the rate of change of one way light time. `dlt' is unitless, since `lt' and `et' both have units of TDB seconds. If the observer and target are at the same position, then `dlt' is set to zero. ## ParametersNone. ## Exceptions1) For the convenience of the caller, the input aberration correction flag can call for stellar aberration correction via inclusion of the '+S' suffix. This portion of the aberration correction flag is ignored if present. 2) If `abcorr' calls for stellar aberration but not light time corrections, the error SPICE(NOTSUPPORTED) is signaled. 3) If `abcorr' calls for relativistic light time corrections, the error SPICE(NOTSUPPORTED) is signaled. 4) If the value of `abcorr' is not recognized, the error is diagnosed by routines in the call tree of this routine. 5) If the reference frame requested is not a recognized inertial reference frame, the error SPICE(BADFRAME) is signaled. 6) If the state of the target relative to the solar system barycenter cannot be computed, the error is diagnosed by routines in the call tree of this routine. 7) If the observer and target are at the same position, then `dlt' is set to zero. This situation could arise, for example, when the observer is Mars and the target is the Mars barycenter. 8) If a division by zero error would occur in the computation of `dlt', the error SPICE(DIVIDEBYZERO) is signaled. 9) The error SPICE(EMPTYSTRING) is signaled if either of the input strings `ref' or `abcorr' do not contain at least one character, since such an input string cannot be converted to a Fortran-style string. 10) The error SPICE(NULLPOINTER) is signaled if either of the input string pointers `ref' or `abcorr' are null. ## FilesThis routine computes states using SPK files that have been loaded into the SPICE system, normally via the kernel loading interface routine furnsh_c. 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 furnsh_c 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. ## ParticularsThis routine supports higher-level SPK API routines that can perform both light time and stellar aberration corrections. User applications normally will not need to call this routine directly. See the header of the routine spkezr_c for a detailed discussion of aberration corrections. ## Examples1) Look up a sequence of states of the Moon as seen from the Earth. Use light time corrections. Compute the first state for the epoch 2000 JAN 1 12:00:00 TDB; compute subsequent states at intervals of 1 hour. For each epoch, display the states, the one way light time between target and observer, and the rate of change of the one way light time. Use the following meta-kernel to specify the kernels to load: KPL/MK 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. \begindata KERNELS_TO_LOAD = ( 'de418.bsp', 'pck00008.tpc', 'naif0008.tls' ) \begintext The code example follows: #include <stdio.h> #include "SpiceUsr.h" int main() { /. Local constants The meta-kernel name shown here refers to a file whose contents are those shown above. This file and the kernels it references must exist in your current working directory. ./ #define META "example.mk" /. Use a time step of 1 hour; look up 100 states. ./ #define STEP 3600.0 #define MAXITR 5 /. Local variables ./ SpiceDouble dlt; SpiceDouble et; SpiceDouble et0; SpiceDouble lt; SpiceDouble state [6]; SpiceDouble stobs [6]; SpiceInt i; /. Load the SPK and LSK kernels via the meta-kernel. ./ furnsh_c ( META ); /. Convert the start time to seconds past J2000 TDB. ./ str2et_c ( "2000 JAN 1 12:00:00 TDB", &et0 ); /. Step through a series of epochs, looking up a state vector at each one. ./ for ( i = 0; i < MAXITR; i++ ) { et = et0 + i*STEP; /. Look up a state vector at epoch ET using the following inputs: Target: Moon (NAIF ID code 301) Reference frame: J2000 Aberration correction: Light time ('LT') Observer: Earth (NAIF ID code 399) Before we can execute this computation, we'll need the geometric state of the observer relative to the solar system barycenter at ET, expressed relative to the J2000 reference frame: ./ spkssb_c ( 399, et, "j2000", stobs ); ## Restrictions1) The kernel files to be used by ## Literature_ReferencesSPK Required Reading. ## Author_and_InstitutionN.J. Bachman (JPL) ## Version-CSPICE Version 1.0.1, 07-JUL-2014 (NJB) Discussion of light time corrections was updated. Assertions that converged light time corrections are unlikely to be useful were removed. -CSPICE Version 1.0.0, 11-JAN-2008 (NJB) ## Index_Entrieslow-level light time correction light-time corrected state from spk file get light-time corrected state |

Wed Apr 5 17:54:43 2017