phaseq_c |

## ProcedureSpiceDouble phaseq_c ( SpiceDouble et, ConstSpiceChar * target, ConstSpiceChar * illmn, ConstSpiceChar * obsrvr, ConstSpiceChar * abcorr ) ## AbstractCompute the apparent phase angle for a target, observer, illuminator set of ephemeris objects. ## Required_ReadingNone. ## KeywordsPHASE ANGLE EPHEMERIS GEOMETRY SEARCH ## Brief_I/OVARIABLE I/O DESCRIPTION -------- --- -------------------------------------------------- et I Ephemeris seconds past J2000 TDB. target I Target body name. illmn I Illuminating body name. obsrvr I Observer body. abcorr I Aberration correction flag. retval O Value of phase angle. ## Detailed_Inputet the time in ephemeris seconds past J2000 TDB at which to compute the phase angle. target the name of the target body. Optionally, you may supply a string containing the integer ID code for the object. For example both "MOON" and "301" are legitimate strings that indicate the Moon is the target body. Case and leading or trailing blanks are not significant in the string `target'. illmn the name of the illuminating body. Optionally, you may supply a string containing the integer ID code for the object. For example both "SUN" and "10" are legitimate strings that indicate the sun is the illuminating body. Case and leading or trailing blanks are not significant in the string `illmn'. In most cases, `illmn' is the sun. obsrvr the name of the observer body. Optionally, you may supply a string containing the integer ID code for the object. For example both "MOON" and "301" are legitimate strings that indicate the Moon is the observer body. Case and leading or trailing blanks are not significant in the string `obsrvr'. abcorr the string description of the aberration corrections to apply to the state evaluations to account for one-way light time and stellar aberration. This routine accepts only reception mode aberration corrections. See the header of spkezr_c for a detailed description of the aberration correction options. For convenience, the appropriate aberration options are listed below: "NONE" Apply no correction. Returns the "true" geometric state. "LT" "Reception" case: correct for one-way light time using a Newtonian formulation. 'LT+S' "Reception" case: correct for one-way light time and stellar aberration using a Newtonian formulation. "CN" "Reception" case: converged Newtonian light time correction. "CN+S" "Reception" case: converged Newtonian light time and stellar aberration corrections. Case and leading or trailing blanks are not significant in the string `abcorr'. ## Detailed_Outputphaseq is the optionally light-time corrected phase angle between `target' and `illmn' as observed from `obsrvr'. The range of `phaseq' is [0, pi] radians. ## ParametersNone. ## Exceptions1) The error SPICE(IDCODENOTFOUND) signals if the body name to SPICE ID look-up fails for any of the `target', `illmn', or `obsrvr' names. 2) The error SPICE(INVALIDOPTION) signals if the aberration correct, `abcorr', indicates a transmission based correction. 3) The error SPICE(BODIESNOTDISTINCT) signals if the `target', `illmn', and `obsrvr' are not unique. ## FilesNone. ## ParticularsThis routine returns the phase angle using the location of the bodies (if point objects) or the centers of the bodies (if finite bodies). ILLMN OBS ILLMN as seen ^ / from TARG at | / ET - LT. | / >|..../< phase angle | / . | / . | / . |v TARG as seen from OBS SEP . TARG at ET . / / v PI = SEP + PHASE so PHASE = PI - SEP ## ExamplesThe numerical results shown for these examples 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. Use the meta-kernel shown below to load the required SPICE kernels. KPL/MK File name: standard.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 Example: Determine the time intervals from December 1, 2006 UTC to January 31, 2007 UTC for which the sun-moon-earth configuration phase angle satisfies the relation conditions with respect to a reference value of .57598845 radians (the phase angle at January 1, 2007 00:00:00.000 UTC, 33.001707 degrees). Also determine the time intervals corresponding to the local maximum and minimum phase angles, and the absolute maximum and minimum phase angles during the search interval. The configuration defines the sun as the illuminator, the moon as the target, and the earth as the observer. #include <stdio.h> #include "SpiceUsr.h" #define TIMFMT "YYYY MON DD HR:MN:SC.###" #define NINTVL 5000 #define TIMLEN 41 #define NLOOPS 7 int main() { /. Local variables ./ SpiceChar begstr [ TIMLEN ]; SpiceChar endstr [ TIMLEN ]; SPICEDOUBLE_CELL ( cnfine, 2 ); SPICEDOUBLE_CELL ( result, NINTVL*2 ); SpiceDouble adjust; SpiceDouble et0; SpiceDouble et1; SpiceDouble phaseq; SpiceDouble refval; SpiceDouble start; SpiceDouble step; SpiceDouble stop; SpiceInt i; SpiceInt j; /. Define the values for target, observer, illuminator, and aberration correction. ./ ConstSpiceChar * target = "moon"; ConstSpiceChar * illmn = "sun"; ConstSpiceChar * abcorr = "lt+s"; ConstSpiceChar * obsrvr = "earth"; ConstSpiceChar * relate [NLOOPS] = { "=", "<", ">", "LOCMIN", "ABSMIN", "LOCMAX", "ABSMAX", }; /. Load kernels. ./ furnsh_c ( "standard.tm" ); /. Store the time bounds of our search interval in the confinement window. ./ str2et_c ( "2006 DEC 01", &et0 ); str2et_c ( "2007 JAN 31", &et1 ); wninsd_c ( et0, et1, &cnfine ); /. Search using a step size of 1 day (in units of seconds). The reference value is 0.57598845 radians. We're not using the adjustment feature, so we set ADJUST to zero. ./ step = spd_c(); refval = 0.57598845; adjust = 0.0; for ( j = 0; j < NLOOPS; j++ ) { printf ( "Relation condition: %s\n", relate[j] ); /. Perform the search. The SPICE window `result' contains the set of times when the condition is met. ./ gfpa_c ( target, illmn, abcorr, obsrvr, relate[j], refval, adjust, step, NINTVL, &cnfine, &result ); /. Display the results. ./ if ( wncard_c(&result) == 0 ) { printf ( "Result window is empty.\n\n" ); } else { for ( i = 0; i < wncard_c(&result); i++ ) { /. Fetch the endpoints of the Ith interval of the result window. ./ wnfetd_c ( &result, i, &start, &stop ); phaseq = ## RestrictionsNone. ## Literature_ReferencesNone. ## Author_and_InstitutionE.D. Wright (JPL) ## Version-CSPICE Version 1.0.1, 02-FEB-2017 (BVS) Shortened permutted index entry. -CSPICE Version 1.0.0, 08-MAR-2012 (EDW) ## Index_Entriescompute phase angle for arbitrary illumination source |

Wed Apr 5 17:54:40 2017