Index of Functions: A  B  C  D  E  F  G  H  I  J  K  L  M  N  O  P  Q  R  S  T  U  V  W  X 
Index Page
cspice_radrec

Table of contents
Abstract
I/O
Parameters
Examples
Particulars
Exceptions
Files
Restrictions
Required_Reading
Literature_References
Author_and_Institution
Version
Index_Entries


Abstract


   CSPICE_RADREC converts the right ascension, declination
   coordinates of a location to rectangular (Cartesian)
   coordinates. All coordinates are expressed as double
   precision values.

I/O


   Given:

      range    a double precision scalar or N-vector describing distance of the
               point from the origin.

               help, range
                  DOUBLE = Scalar   or   DOUBLE = Array[N]

               Output units are the same as the units associated with `range'.

      ra       a double precision scalar or N-vector describing right ascension
               of the input point: the angular distance measured toward the
               east from the prime meridian to the meridian containing the
               input point.

               help, ra
                  DOUBLE = Scalar   or   DOUBLE = Array[N]

               The direction of increasing right ascension is from the +X axis
               towards the +Y axis.

               The range (i.e., the set of allowed values) of
               `ra' is unrestricted. Units are radians.

      dec      a double precision scalar or N-vector describing declination of
               the point.

               help, dec
                  DOUBLE = Scalar   or   DOUBLE = Array[N]

               This is the angular distance from the XY plane to the point.

               The range of `dec' is unrestricted. Units are radians.

   the call:

      cspice_radrec, range, ra, dec, rectan

   returns:

      rectan   a double precision 3-vector or 3xN array containing the
               rectangular coordinates of the position or set of positions.

               help, rectan
                  DOUBLE = Array[3]   or   DOUBLE = Array[3,N]

               `rectan' returns with the same measure of vectorization (N)
               as `range', `ra', and `dec'.

Parameters


   None.

Examples


   Any numerical results shown for these examples may differ between
   platforms as the results depend on the SPICE kernels used as input
   and the machine specific arithmetic implementation.

   1) Convert to the J2000 frame the right ascension and declination
      of an object initially expressed with respect to the B1950
      reference frame.


      Example code begins here.


      PRO radrec_ex1

         ;;
         ;; Set the initial right ascension and declination
         ;; coordinates of the object, given with respect
         ;; to the B1950 reference frame.
         ;;
         rab  = 135.88680896D0
         decb =  17.50151037D0

         ;;
         ;; Convert `rab' and `decb' to a 3-vector expressed in
         ;; the B1950 frame.
         ;;
         cspice_radrec, 1.D0, rab * cspice_rpd(), decb * cspice_rpd(), v1950

         ;;
         ;; We use the Icy routine cspice_pxform to obtain the
         ;; transformation  matrix for converting vectors between
         ;; the B1950 and J2000 reference frames.  Since
         ;; both frames are inertial, the input time value we
         ;; supply to cspice_pxform is arbitrary.  We choose zero
         ;; seconds past the J2000 epoch.
         ;;
         cspice_pxform, 'B1950', 'J2000', 0.D0, mtrans

         ;;
         ;; Transform the vector to the J2000 frame.
         ;;
         cspice_mxv, mtrans, v1950, v2000

         ;;
         ;; Find the right ascension and declination of the
         ;; j2000-relative vector.
         ;;
         cspice_recrad, v2000, r, raj, decj

         ;;
         ;; Output the results.
         ;;
         print, 'Right ascension (B1950 frame): ', rab
         print, 'Declination (B1950 frame)    : ', decb

         print, 'Right ascension (J2000 frame): ', raj * cspice_dpr()
         print, 'Declination (J2000 frame)    : ', decj * cspice_dpr()

      END


      When this program was executed on a Mac/Intel/IDL8.x/64-bit
      platform, the output was:


      Right ascension (B1950 frame):        135.88681
      Declination (B1950 frame)    :        17.501510
      Right ascension (J2000 frame):        136.58768
      Declination (J2000 frame)    :        17.300443


   2) Define a set of 15 right ascension-declination data pairs for
      the Earth's pole at different ephemeris epochs, convert them
      to rectangular coordinates and compute the angular separation
      between these coordinates and the IAU_EARTH pole given by a
      PCK kernel.

      Use the PCK kernel below to load the required triaxial
      ellipsoidal shape model and orientation data for the Earth.

         pck00010.tpc


      Example code begins here.


      PRO radrec_ex2

         ;;
         ;; Local parameters.
         ;;
         NCOORD =   15L

         ;;
         ;; Define a set of 15 right ascension-declination
         ;; coordinate pairs (in degrees) for the Earth's pole
         ;; and the array of corresponding ephemeris times in
         ;; J2000 TDB seconds.
         ;;
         ra     = [ 180.003739D0, 180.003205D0, 180.002671D0,                $
                    180.002137D0, 180.001602D0, 180.001068D0,                $
                    180.000534D0, 360.D0,       359.999466D0,                $
                    359.998932D0, 359.998397D0, 359.997863D0,                $
                    359.997329D0, 359.996795D0, 359.996261D0 ]

         dec    = [  89.996751D0,  89.997215D0,  89.997679D0,                $
                     89.998143D0,  89.998608D0,  89.999072D0,                $
                     89.999536D0,  90.D0,        89.999536D0,                $
                     89.999072D0,  89.998607D0,  89.998143D0,                $
                     89.997679D0,  89.997215D0,  89.996751D0 ]

         et     = [ -18408539.52023917D0, -15778739.49107254D0,              $
                    -13148939.4619059D0,  -10519139.43273926D0,              $
                     -7889339.40357262D0,  -5259539.37440598D0,              $
                     -2629739.34523934D0,        60.68392730D0,              $
                      2629860.71309394D0,   5259660.74226063D0,              $
                      7889460.77142727D0,  10519260.80059391D0,              $
                     13149060.82976055D0,  15778860.85892719D0,              $
                     18408660.88809383D0 ]

         z      = [ 0.D0, 0.D0, 1.D0 ]

         ;;
         ;; Load a PCK kernel.
         ;;
         cspice_furnsh, 'pck00010.tpc'

         ;;
         ;; Print the banner out.
         ;;
         print, format='(A)', '       et           Angular difference'
         print, format='(A)', '------------------  ------------------'

         for i=0L, NCOORD-1L do begin

            ;;
            ;; Convert the right ascension and declination
            ;; coordinates (in degrees) to rectangular.
            ;;
            cspice_radrec, 1.D0, ra[i] * cspice_rpd(),                       $
                           dec[i] * cspice_rpd(), v2000

            ;;
            ;; Retrieve the transformation matrix from the J2000
            ;; frame to the IAU_EARTH frame.
            ;;
            cspice_pxform, 'J2000', 'IAU_EARTH', et[i], mtrans

            ;;
            ;; Rotate the `v2000' vector into IAU_EARTH. This vector
            ;; should equal (round-off) the Z direction unit vector.
            ;;
            cspice_mxv, mtrans, v2000, pole

            ;;
            ;; Output the ephemeris time and the angular separation
            ;; between the rotated vector and the Z direction unit
            ;; vector.
            ;;
            print, format='(F18.8,2X,F18.16)',                               $
                           et[i], cspice_vsep( pole, z ) * cspice_dpr()

         endfor

      END


      When this program was executed on a Mac/Intel/IDL8.x/64-bit
      platform, the output was:


             et           Angular difference
      ------------------  ------------------
      -18408539.52023917  0.0000001559918278
      -15778739.49107254  0.0000000106799881
      -13148939.46190590  0.0000001773517911
      -10519139.43273926  0.0000003440236194
       -7889339.40357262  0.0000004893045693
       -5259539.37440598  0.0000003226327536
       -2629739.34523934  0.0000001559609507
             60.68392730  0.0000000107108706
        2629860.71309394  0.0000001773826862
        5259660.74226063  0.0000003440544891
        7889460.77142727  0.0000004892736740
       10519260.80059391  0.0000003226018712
       13149060.82976055  0.0000001559300556
       15778860.85892719  0.0000000107417474
       18408660.88809383  0.0000001774135760


Particulars


   This routine converts the right ascension, declination, and range
   of a point into the associated rectangular coordinates.

   The input is defined by a distance from a central reference point,
   an angle from a reference meridian, and an angle above the equator
   of a sphere centered at the central reference point.

Exceptions


   1)  If any of the input arguments, `range', `ra' or `dec', is
       undefined, an error is signaled by the IDL error handling
       system.

   2)  If any of the input arguments, `range', `ra' or `dec', is not
       of the expected type, or it does not have the expected
       dimensions and size, an error is signaled by the Icy
       interface.

   3)  If the input vectorizable arguments `range', `ra' and `dec' do
       not have the same measure of vectorization (N), an error is
       signaled by the Icy interface.

   4)  If the output argument `rectan' is not a named variable, an
       error is signaled by the Icy interface.

Files


   None.

Restrictions


   None.

Required_Reading


   ICY.REQ

Literature_References


   [1]  L. Taff, "Celestial Mechanics, A Computational Guide for the
        Practitioner," Wiley, 1985

Author_and_Institution


   J. Diaz del Rio     (ODC Space)
   E.D. Wright         (JPL)

Version


   -Icy Version 1.0.3, 10-AUG-2021 (JDR)

       Edited the header to comply with NAIF standard. Added complete
       code examples.

       Added -Parameters, -Exceptions, -Files, -Restrictions,
       -Literature_References and -Author_and_Institution sections, and
       completed -Particulars section.

       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.2, 05-FEB-2008 (EDW)

       Edited -I/O section, replaced comment

          "returns with the same order"

       with

          "returns with the same measure of vectorization"

   -Icy Version 1.0.1, 09-DEC-2005 (EDW)

       Added -Examples section.

   -Icy Version 1.0.0, 16-JUN-2003 (EDW)

Index_Entries


   range ra and dec to rectangular coordinates
   right_ascension and declination to rectangular



Fri Dec 31 18:43:06 2021