Table of contents
CSPICE_SPKUDS unpacks the contents of an SPK segment descriptor.
Given:
None.
the call:
cspice_spkuds, body, center, frame, type, first, last, baddrs, eaddrs
returns:
body the NAIF ID code for the body of the segment.
help, body
LONG = Scalar
center the center of motion for `body'.
help, center
LONG = Scalar
frame the SPICE integer code for the frame to which states for the
body are be referenced.
help, frame
LONG = Scalar
type the type of SPK segment.
help, type
LONG = Scalar
first the first epoch for which the segment has ephemeris data.
help, first
DOUBLE = Scalar
last the last epoch for which the segment has ephemeris data.
help, last
DOUBLE = Scalar
baddrs the starting address of the data associated with this
descriptor.
help, baddrs
LONG = Scalar
eaddrs the last address of the data associated with this descriptor.
help, eaddrs
LONG = Scalar
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) Read the segment descriptor for each segment in an SPK. Output
the SPK ID for the body and center for the segments.
Example code begins here.
PRO spkuds_ex1
;;
;; Local variables
;;
fname = ''
;;
;; Prompt for the name of the file to search.
;;
read, fname, PROMPT='Enter name of SPK file > '
;;
;; Open the SPK file for read.
;;
cspice_dafopr, fname, handle
;;
;; Begin a forward search.
;;
cspice_dafbfs, handle
;;
;; Find next array (segment) return true if successful.
;;
cspice_daffna, found
;;
;; Loop while found is TRUE
;;
WHILE ( found ) do begin
;;
;; Unpack the segment identifier.
;;
cspice_spkuds, body , center, frame, type, $
first, last , beg , final
;;
;; Output the results.
;;
cspice_bodc2n, body , bod_name, found
cspice_bodc2n, center, cent_name, found
print, 'Body ', body , ' ' + bod_name
print, 'Center ', center, ' ' + cent_name
;;
;; Determine if another segment exists.
;;
cspice_daffna, found
ENDWHILE
;;
;; Don't forget to close.
;;
cspice_spkcls, handle
END
When this program was executed on a Mac/Intel/IDL8.x/64-bit
platform, using the SPK file named de421.bsp, the output
was:
Enter name of SPK file > de421.bsp
Body 1 MERCURY BARYCENTER
Center 0 SOLAR SYSTEM BARYCENTER
Body 2 VENUS BARYCENTER
Center 0 SOLAR SYSTEM BARYCENTER
Body 3 EARTH BARYCENTER
Center 0 SOLAR SYSTEM BARYCENTER
Body 4 MARS BARYCENTER
Center 0 SOLAR SYSTEM BARYCENTER
Body 5 JUPITER BARYCENTER
Center 0 SOLAR SYSTEM BARYCENTER
Body 6 SATURN BARYCENTER
Center 0 SOLAR SYSTEM BARYCENTER
Body 7 URANUS BARYCENTER
Center 0 SOLAR SYSTEM BARYCENTER
Body 8 NEPTUNE BARYCENTER
Center 0 SOLAR SYSTEM BARYCENTER
Body 9 PLUTO BARYCENTER
Center 0 SOLAR SYSTEM BARYCENTER
Body 10 SUN
Center 0 SOLAR SYSTEM BARYCENTER
Body 301 MOON
Center 3 EARTH BARYCENTER
Body 399 EARTH
Center 3 EARTH BARYCENTER
Body 199 MERCURY
Center 1 MERCURY BARYCENTER
Body 299 VENUS
Center 2 VENUS BARYCENTER
Body 499 MARS
Center 4 MARS BARYCENTER
This routine extracts the contents of an SPK segment
descriptor into the components needed for reading and
evaluating the data stored in the segment. It serves
as a macro for expanding the SPK segment descriptor.
1) If any of the output arguments, `body', `center', `frame',
`type', `first', `last', `baddrs' or `eaddrs', is not a named
variable, an error is signaled by the Icy interface.
None.
None.
ICY.REQ
None.
J. Diaz del Rio (ODC Space)
E.D. Wright (JPL)
-Icy Version 1.1.0, 01-JUN-2021 (JDR)
Changed the output argument names "beg" and "final" to "baddrs" and
"eaddrs" for consistency with other routines.
Edited the header to comply with NAIF standard. Updated the version
information for version 1.0.0.
Added -Parameters, -Exceptions, -Files, -Restrictions,
-Literature_References and -Author_and_Institution sections.
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.0, 01-JAN-2017 (EDW)
unpack SPK segment descriptor
|