Table of contents
CSPICE_LSPCN computes L_s, the planetocentric longitude of the sun,
as seen from a specified body.
Given:
body the name of the central body, typically a planet.
help, body
STRING = Scalar
et the epoch at which the longitude of the sun (L_s) is to be
computed.
help, et
DOUBLE = Scalar
`et' is expressed as seconds past J2000 TDB (Barycentric
Dynamical Time).
abcorr indicates the aberration corrections to be applied when
computing the longitude of the sun.
help, abcorr
STRING = Scalar
`abcorr' may be any of the following.
'NONE' Apply no correction.
'LT' Correct the position of the sun,
relative to the central body, for
planetary (light time) aberration.
'LT+S' Correct the position of the sun,
relative to the central body, for
planetary and stellar aberrations.
the call:
lspcn = cspice_lspcn( body, et, abcorr )
returns:
lspcn the planetocentric longitude of the Sun, often called "L_s," for
the specified body at the specified time.
help, lspcn
DOUBLE = Scalar
This is the longitude of the body-Sun vector in a right-handed
frame whose basis vectors are defined as follows:
- The positive `z' direction is given by the instantaneous
angular velocity vector of the orbit of the body about
the Sun.
- The positive `x' direction is that of the cross product of
the instantaneous north spin axis of the body with the
positive `z' direction.
- The positive Y direction is z x x.
Units are radians; the range is 0 to 2*pi. Longitudes are
positive to the east.
None.
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 planetocentric longitude of the Sun as seen from
the Earth on 21 March 2006. The result should be approximately
0, as the date corresponds to the Spring equinox.
Use the meta-kernel shown below to load the required SPICE
kernels.
KPL/MK
File name: lspcn_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
pck00010.tpc Planet orientation and
radii
naif0011.tls Leapseconds
\begindata
KERNELS_TO_LOAD = ( 'de421.bsp',
'pck00010.tpc',
'naif0011.tls' )
\begintext
End of meta-kernel
Example code begins here.
PRO lspcn_ex1
;;
;; Load kernels.
;;
cspice_furnsh, 'lspcn_ex1.tm'
cspice_str2et, '21 march 2006', et
lspcn = cspice_lspcn( 'earth', et, 'none' ) * cspice_dpr()
print, lspcn
;;
;; 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:
0.23645270
The direction of the vernal equinox for the central body is
determined from the instantaneous equatorial and orbital planes
of the central body. This equinox definition is specified in
reference [1]. The "instantaneous orbital plane" is interpreted
in this routine as the plane normal to the cross product of the
position and velocity of the central body relative to the sun.
The geometric state of the central body relative to the sun is
used for this normal vector computation. The "instantaneous
equatorial plane" is normal to the central body's north pole
at the requested epoch. The pole direction is determined from
rotational elements loaded via a PCK file.
The result returned by this routine will depend on the
ephemeris data and rotational elements used. The result may
differ from that given in any particular version of the
Astronomical Almanac, due to differences in these input data,
and due to differences in precision of the computations.
1) If the input body name cannot be translated to an ID code,
and if the name is not a string representation of an integer
(for example, '399'), the error SPICE(NOTRANSLATION) is
signaled by a routine in the call tree of this routine.
2) If no SPK (ephemeris) file has been loaded prior to calling
this routine, or if the SPK data has insufficient coverage, an
error is signaled by a routine in the call tree of this
routine.
3) If a PCK file containing rotational elements for the central
body has not been loaded prior to calling this routine, an
error is signaled by a routine in the call tree of this
routine.
4) If the instantaneous angular velocity and spin axis of `body'
are parallel, an error is signaled by a
routine in the call tree of this routine.
5) If any of the input arguments, `body', `et' or `abcorr', is
undefined, an error is signaled by the IDL error handling
system.
6) If any of the input arguments, `body', `et' 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.
Appropriate 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 geometric state of the central body relative to
the sun at `et' must be loaded before this routine is called. If
light time correction is used, data must be available that
enable computation of the state the sun relative to the solar
system barycenter at the light-time corrected epoch. If
stellar aberration correction is used, data must be available
that enable computation of the state the central body relative
to the solar system barycenter at `et'.
- A PCK file containing rotational elements for the central body
must be loaded before this routine is called.
None.
ICY.REQ
NAIF_IDS.REQ
PCK.REQ
SPK.REQ
TIME.REQ
[1] "The Astronomical Almanac for the Year 2005," page L9,
United States Naval Observatory, U.S. Government Printing
Office, Washington, D.C., 2004.
J. Diaz del Rio (ODC Space)
E.D. Wright (JPL)
-Icy Version 1.0.2, 25-AUG-2021 (JDR)
Edited the header to comply with NAIF standard. Added example's problem
statement. Added call to kclear in code example.
Added -Parameters, -Particulars, -Exceptions, -Files, -Restrictions,
-Literature_References and -Author_and_Institution sections; and
extended -Required_Reading.
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.1, 26-JAN-2017 (EDW)
Edited Example to correspond to Mice version.
-Icy Version 1.0.0, 16-JUN-2003 (EDW)
planetocentric longitude of sun
compute L_s
compute Ls
compute L_sub_s
|