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

Abstract
I/O
Examples
Particulars
Required Reading
Version
Index_Entries

Abstract


   CSPICE_OSCELT calculates the set of osculating conic 
   orbital elements corresponding to the state 6-vector
   (position, velocity) of a body at an epoch.

   For important details concerning this module's function, please refer to
   the CSPICE routine oscelt_c.

I/O

   
   Given:
   
      state  a double precision 6-vector or 6xN array
             for conversion to osculating elements
             
      et     the double precision scalar or N-vector of ephemeris 
             time epochs corresponding to each 'state'
      
      mu     the gravitational parameter of the reference
             body for 'state'
   
      Note the relation between the elements of 'et' and 'state
      is one-to-one and onto.

   the call:

      cspice_oscelt, state, et, mu, elts
   
   returns:

      elts   a double precision 8-vector or 8xN array to the 
             variable; the 8 components data items returned:
   
             elts[0] (elts[0,i]), contains rp, perifocal distance.
             elts[1] (elts[1,i]), contains ecc, eccentricity.
             elts[2] (elts[2,i]), contains inc, inclination.
             elts[3] (elts[3,i]), contains lnode, longitude of the 
                                  ascending node.
             elts[4] (elts[4,i]), contains argp, argument of periapsis.
             elts[5] (elts[5,i]), contains m0, mean anomaly at epoch.
             elts[6] (elts[6,i]), contains t0, epoch.
             elts[7] (elts[7,i]), contains mu, gravitational parameter.

Examples


   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.
   
      Example(1):
   
      ;; 
      ;; Determine the osculating elements of the moon wrt the
      ;; Earth at some arbitrary time in the J2000 inertial frame.
      ;;
      ;; Load the meta kernel listing the needed SPK, PCK, LSK
      ;; kernels.
      ;;
      cspice_furnsh, 'standard.tm'
   
      ;;
      ;; Convert the time string to ephemeris time
      ;;
      cspice_str2et, 'Dec 25, 2007', et
   
      ;;
      ;; Make the cspice_spkezr call to retrieve the state of the
      ;; moon wrt the Earth in J2000.
      ;;
      cspice_spkezr, 'Moon', et, 'J2000', 'LT+S', 'EARTH', state, ltime    
   
      ;;
      ;; cspice_oscelt requires body mass information, so load a
      ;; mass PCK kernel.
      ;;
      cspice_furnsh, '/kernels/gen/pck/masses3.tpc'
   
      ;;
      ;; Read the gravitational parameter for Earth.
      ;;
      cspice_bodvrd, 'EARTH', 'GM', 1, mu
   
      ;;
      ;; make the cspice_oscelt call to convert the state 6-vector
      ;; to the elts 8-vector. Note: the  cspice_bodvrd returns
      ;; data as arrays, so to access the gravitational parameter
      ;; (the only value in the array), we use mu[0].
      ;;
      cspice_oscelt, state, et, mu[0], elts
   
      ;;
      ;; Output the elts vector in a column format.
      ;;
      for i=0,7 do begin 
         print , format='(F24.8)', elts[i]
      endfor

      ;;
      ;; It's always good form to unload kernels after use,
      ;; particularly in IDL due to data persistence.
      ;;
      cspice_unload, "standard.tm"
   
   IDL outputs:

            360956.91440370
                 0.07820299
                 0.48717811
                 6.18584105
                 1.28603872
                 0.55386000
         251812864.18370920
            398600.44800000
   
      Example(2):
   
      ;;
      ;; Calculate the history of the Moon's orbit plane 
      ;; inclination with respect to the Earth in the 
      ;; J2000 frame at intervals of one month for a 
      ;; time interval of 14 years.
      ;;
      ;; Load the needed SPK , PCK and LSK kernels.
      ;;
      cspice_furnsh, 'standard.tm'
   
      ;;
      ;; cspice_oscelt also requires mass information, so load
      ;; a mass PCK.
      ;;
      cspice_furnsh, '/kernels/gen/pck/masses3.tpc'
      cspice_bodvrd, 'EARTH', 'GM', 1, mu
   
      ;;
      ;; The start epoch.
      ;;
      cspice_str2et, 'Jan 1, 2000 12:00:00', et0
   
      ;;
      ;; A step of one month - in seconds.
      ;;
      step = 30.d * cspice_spd()

      ;;
      ;; Define an array of ephemeris times, covering,
      ;; 14 years of months in steps of one month starting
      ;; approximately Feb 1, 2000.
      ;;   
      et = dindgen(14*12)*step + et0
   
      ;; Retrieve the state; convert to osculating elements.
      ;;
      cspice_spkezr, 'Moon', et, 'J2000', 'LT+S', 'EARTH', state, ltime
      cspice_oscelt, state, et, mu[0], elts
   
      ;;
      ;; Convert the ephemeris time of the state lookup to
      ;; calendar UTC, then print the calendar string and the
      ;; inclination in degrees of the Moon wrt Earth at the
      ;; time.
      ;;
      cspice_et2utc, et, 'C', 3, utcstr
      
      ;;
      ;; Convert the angular measures to degrees.
      ;;
      elts[2,*] = elts[2,*]*cspice_dpr()

      ;;
      ;; Output the epoch and corresponding inclination.
      ;;
      for i=0, n_elements( utcstr )-1 do begin
         print, utcstr[i], elts[2,i]
      endfor

      ;;
      ;; It's always good form to unload kernels after use,
      ;; particularly in IDL due to data persistence.
      ;;
      cspice_unload, "standard.tm"

   IDL outputs:

      ... a partial output ..

      2012 NOV 23 12:00:00.001       20.903479
      2012 DEC 23 12:00:00.000       20.902973
      2013 JAN 22 11:59:59.999       20.802204
      2013 FEB 21 11:59:59.999       20.565404
      2013 MAR 23 11:59:59.998       20.309740
      2013 APR 22 11:59:59.998       20.171117
      2013 MAY 22 11:59:59.999       20.162453
      2013 JUN 21 12:00:00.000       20.173366
      2013 JUL 21 12:00:00.000       20.082464
      2013 AUG 20 12:00:00.001       19.867300
      2013 SEP 19 12:00:00.002       19.628911

Particulars


   When called in a vectorized fashion, the order of 'state' (6xN)
   must equal that of 'et' (N-vector).
   
   Extract the element 8-vector corresponding to the ith 'et' (et[i])
   with the expression:
   
      elts_i = elts[*,i]

Required Reading


   ICY.REQ

Version


   -Icy Version 1.1.0, 16-MAY-2005, EDW (JPL)

       Added capability to process 6xN array 'state' and
       N-vector 'et' input returning a 8xN 'elts' array.

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

Index_Entries


   conic elements from state 
   osculating elements from state
   convert state to osculating elements




Wed Apr  5 17:58:02 2017