trgsep_c |

Table of contents## Proceduretrgsep_c ( Separation quantity from observer ) SpiceDouble trgsep_c ( SpiceDouble et, ConstSpiceChar * targ1, ConstSpiceChar * shape1, ConstSpiceChar * frame1, ConstSpiceChar * targ2, ConstSpiceChar * shape2, ConstSpiceChar * frame2, ConstSpiceChar * obsrvr, ConstSpiceChar * abcorr ) ## AbstractCompute the angular separation in radians between two spherical or point objects. ## Required_ReadingABCORR ## KeywordsANGLE GEOMETRY ## Brief_I/OVARIABLE I/O DESCRIPTION -------- --- -------------------------------------------------- et I Ephemeris seconds past J2000 TDB. targ1 I First target body name. shape1 I First target body shape. frame1 I Reference frame of first target. targ2 I Second target body name. shape2 I First target body shape. frame2 I Reference frame of second target. obsrvr I Observing body name. abcorr I Aberration corrections flag. The function returns the angular separation between two targets, `targ1' and `targ2', as seen from an observer `obsrvr', possibly corrected for aberration corrections. ## Detailed_Inputet is the time in ephemeris seconds past J2000 TDB at which the separation is to be measured. targ1 is the string naming the first body of interest. You can also supply the integer ID code for the object as an integer string. For example both "MOON" and "301" are legitimate strings that indicate the moon is the target body. shape1 is the string naming the geometric model used to represent the shape of the `targ1' body. Models supported by this routine: "SPHERE" Treat the body as a sphere with radius equal to the maximum value of BODYnnn_RADII. "POINT" Treat the body as a point; radius has value zero. The `shape1' string lacks sensitivity to case, leading and trailing blanks. frame1 is the string naming the body-fixed reference frame corresponding to `targ1'. ## Detailed_OutputThe function returns the angular separation between two targets, `targ1' and `targ2', as seen from an observer `obsrvr' expressed in radians. The observer is the angle's vertex. The angular separation between the targets may be measured between the centers or figures (limbs) of the targets, depending on whether the target shapes are modeled as spheres or points. If the target shape is either a spheroid or an ellipsoid, the radius used to compute the limb will be the largest of the radii of the target's tri-axial ellipsoid model. If the targets are modeled as points the result ranges from 0 to Pi radians or 180 degrees. If the target shapes are modeled as spheres or ellipsoids, the function returns a negative value when the bodies overlap (occult). Note that in this situation the function returns 0 when the limbs of the bodies start or finish the overlap. The positions of the targets may optionally be corrected for light time and stellar aberration. ## ParametersNone. ## Exceptions1) If the three objects `targ1', `targ2' and `obsrvr' are not distinct, an error is signaled by a routine in the call tree of this routine. 2) If the object names for `targ1', `targ2' or `obsrvr' cannot resolve to a NAIF body ID, an error is signaled by a routine in the call tree of this routine. 3) If the reference frame associated with `targ1', `frame1', is not centered on `targ1', or if the reference frame associated with `targ2', `frame2', is not centered on `targ2', an error is signaled by a routine in the call tree of this routine. This restriction does not apply to shapes "SPHERE" and "POINT", for which the frame input is ignored. 4) If the frame name for `frame1' or `frame2' cannot resolve to a NAIF frame ID, an error is signaled by a routine in the call tree of this routine. 5) If the body shape for `targ1', `shape1', or the body shape for `targ2', `shape2', is not recognized, an error is signaled by a routine in the call tree of this routine. 6) If the requested aberration correction `abcorr' is not recognized, an error is signaled by a routine in the call tree of this routine. 7) If either one or both targets' shape is modeled as sphere, and the required PCK data has not been loaded, an error is signaled by a routine in the call tree of this routine. 8) If the ephemeris data required to perform the needed state look-ups are not loaded, an error is signaled by a routine in the call tree of this routine. 9) If the observer `obsrvr' is located within either one of the targets, an error is signaled by a routine in the call tree of this routine. 10) If an error is signaled, the function returns a meaningless result. 11) If any of the `targ1', `shape1', `frame1', `targ2', `shape2', `frame2', `obsrvr' or `abcorr' input string pointers is null, the error SPICE(NULLPOINTER) is signaled. The function returns the value 0.0. 12) If any of the `targ1', `shape1', `frame1', `targ2', `shape2', `frame2', `obsrvr' or `abcorr' input strings has zero length, the error SPICE(EMPTYSTRING) is signaled. The function returns the value 0.0. ## FilesAppropriate SPICE kernels must be loaded by the calling program before this routine is called. The following data are required: - An SPK file (or files) containing ephemeris data sufficient to compute the position of each of the targets with respect to the observer. If aberration corrections are used, the states of target and observer relative to the solar system barycenter must be calculable from the available ephemeris data. - A PCK file containing the targets' tri-axial ellipsoid model, if the targets are modeled as spheres. - If non-inertial reference frames are used, then PCK files, frame kernels, C-kernels, and SCLK kernels may be needed. ## ParticularsThis routine determines the apparent separation between the two objects as observed from a third. The value reported is corrected for light time. Moreover, if at the time this routine is called, stellar aberration corrections are enabled, this correction will also be applied to the apparent positions of the centers of the two objects. Please refer to the Aberration Corrections Required Reading (abcorr.req) for detailed information describing the nature and calculation of the applied corrections. ## ExamplesThe numerical results shown for this example may differ across platforms. The results depend on the SPICE kernels used as input, the compiler and supporting libraries, and the machine specific arithmetic implementation. 1) Calculate the apparent angular separation of the Earth and Moon as observed from the Sun at a TDB time known as a time of maximum separation. Calculate and output the separation modeling the Earth and Moon as point bodies and as spheres. Provide the result in degrees. Use the meta-kernel shown below to load the required SPICE kernels. KPL/MK File name: trgsep_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 pck00009.tpc Planet orientation and radii naif0009.tls Leapseconds \begindata KERNELS_TO_LOAD = ( 'de421.bsp', 'pck00009.tpc', 'naif0009.tls' ) \begintext End of meta-kernel Example code begins here. /. Program trgsep_ex1 ./ #include <stdio.h> #include "SpiceUsr.h" int main( ) { /. Local variables. ./ SpiceChar * tdbstr; SpiceChar * obsrvr; SpiceChar * abcorr; SpiceDouble et; SpiceDouble value; SpiceChar frame [2][33] = { "IAU_MOON","IAU_EARTH" }; SpiceChar targ [2][33] = { "MOON","EARTH" }; SpiceChar shape [2][33] = { "POINT","SPHERE" }; /. Load the kernels. ./ furnsh_c ( "trgsep_ex1.tm" ); tdbstr = "2007-JAN-11 11:21:20.213872 (TDB)"; obsrvr = "SUN"; abcorr = "LT+S"; str2et_c ( tdbstr, &et ); value = ## RestrictionsNone. ## Literature_ReferencesNone. ## Author_and_InstitutionM. Costa Sitja (JPL) J. Diaz del Rio (ODC Space) ## Version-CSPICE Version 1.0.0, 07-AUG-2021 (MCS) (JDR) ## Index_Entriescompute the angular separation between two target bodies |

Fri Dec 31 18:41:14 2021