Table of contents
CSPICE_DAFUS unpacks an array summary into its double precision and
integer components.
Given:
sum an array summary.
help, sum
DOUBLE = Array[N]
This identifies the contents and location of a single array
within a DAF.
nd the number of double precision components in the summary.
help, nd
LONG = Scalar
ni the number of integer components in the summary.
help, ni
LONG = Scalar
the call:
cspice_dafus, sum, nd, ni, dc, ic
returns:
dc the double precision components of the summary.
help, dc
DOUBLE = Array[nd]
ic the integer components of the summary.
help, ic
LONG = Array[ni]
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) Find a segment for the Pluto barycenter, with coverage for
a specified epoch, in a JPL planetary SPK file, and display
the segment's information.
Use the meta-kernel shown below to load the required SPICE
kernels.
KPL/MK
File name: dafus_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
naif0010.tls Leapseconds
\begindata
KERNELS_TO_LOAD = ( 'de421.bsp',
'naif0010.tls' )
\begintext
End of meta-kernel
Example code begins here.
PRO dafus_ex1
;;
;; Local constants
;;
META = 'dafus_ex1.tm'
ND = 2
NI = 6
;;
;; Load a meta-kernel that specifies a planetary SPK file
;; and leapseconds kernel. The contents of this meta-kernel
;; are displayed above.
;;
cspice_furnsh, META
;;
;; Get the NAIF ID code for the Pluto system barycenter.
;; This is a built-in ID code, so something's seriously
;; wrong if we can't find the code.
;;
cspice_bodn2c, 'PLUTO BARYCENTER', idcode, found
if ( ~found ) then begin
cspice_kclear
print, 'SPICE(BUG)'
return
endif
;;
;; Pick a request time; convert to seconds past J2000 TDB.
;;
reqtim = '2011 FEB 18 UTC'
cspice_str2et, reqtim, et
;;
;; Find a loaded segment for the specified body and time.
;;
cspice_spksfs, idcode, et, handle, descr, segid, found
if ( ~found ) then begin
cspice_kclear
print, 'Body : ', idcode
print, 'Time : ', et
print, 'No descriptor found for the body at time.'
return
endif else begin
;;
;; Display the DAF file handle.
;;
print, format='(A, I10)', 'DAF handle: ', handle
;;
;; Display the segment ID.
;;
;;
;; Unpack the descriptor. Display the contents.
;;
cspice_dafus, descr, ND, NI, dc, ic
print, format='(A, A)', 'Segment ID: ',segid
print, format='(A, I10)', 'Body ID code: ',ic[0]
print, format='(A, I10)', 'Center ID code: ',ic[1]
print, format='(A, I10)', 'Frame ID code: ',ic[2]
print, format='(A, I10)', 'SPK data type: ',ic[3]
print, format='(A, e24.17)', 'Start time (TDB): ',dc[0]
print, format='(A, e24.17)', 'Stop time (TDB): ',dc[1]
print
endelse
;;
;; 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:
DAF handle: 1
Segment ID: DE-0421LE-0421
Body ID code: 9
Center ID code: 0
Frame ID code: 1
SPK data type: 2
Start time (TDB): -3.16919520000000000e+09
Stop time (TDB): 1.69685280000000000e+09
The components of array summaries are packed into double
precision arrays.
The total size of the summary is
(ni - 1)
nd + -------- + 1
2
double precision words (where nd, ni are nonnegative).
1) If `nd' is zero or negative, no double precision components
are returned.
2) If `ni' is zero or negative, no integer components are returned.
3) If the total size of the summary is greater than 125 double
precision words, some components may not be returned.
4) If any of the input arguments, `sum', `nd' or `ni', is
undefined, an error is signaled by the IDL error handling
system.
5) If any of the input arguments, `sum', `nd' or `ni', is not of
the expected type, or it does not have the expected dimensions
and size, an error is signaled by the Icy interface.
6) If any of the output arguments, `dc' or `ic', is not a named
variable, an error is signaled by the Icy interface.
None.
None.
DAF.REQ
None.
J. Diaz del Rio (ODC Space)
E.D. Wright (JPL)
-Icy Version 1.0.1, 31-MAY-2021 (JDR)
Edited the header to comply with NAIF standard. Added example's
problem statement.
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, 24-OCT-2012 (EDW)
unpack DAF summary
|