Table of contents
CSPICE_DSKSRF finds the set of surface ID codes for all surfaces
associated with a given body in a specified DSK file.
Given:
dskfnm the name of a DSK file.
help, dskfnm
STRING = Scalar
This file will be opened for read access by this routine.
bodyid the integer ID code of a body for which topographic data are
present in the specified DSK file.
help, bodyid
LONG = Scalar
srfids an initialized SPICE set data structure.
help, srfids
STRUCT = cspice_celli(N)
`srfids' optionally may contain a set of surface ID codes
on input; on output, the ID codes already present in
`srfids' will be combined with surface ID code set found
for the body designated by `bodyid' in the file `dskfnm'.
If `srfids' contains no data on input, its size and
cardinality still must be initialized.
The user must create `srfids' using cspice_celli. (Note:
a set is a type of cell).
the call:
cspice_dsksrf, dskfnm, bodyid, srfids
returns:
srfids a SPICE set data structure that contains the union of its
contents upon input with the set of ID codes of the surfaces
associated with the body designated by `bodyid', for which
segments were found in the indicated DSK file.
help, srfids
STRUCT = cspice_celli(N)
The elements of SPICE sets are unique; each ID code in
`srfids' appears only once, even if the DSK file contains
multiple segments for that ID code.
See the -Examples section below for a complete example
program showing how to retrieve body and surface ID codes
from a DSK file.
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) Examine a DSK file and identify the set of central bodies
associated with the segments in the file. For each body, find
the set of surfaces associated with that body.
Example code begins here.
PRO dsksrf_ex1
MAXID = 1000L
;;
;; Local variables
;;
dsk = ''
;;
;; Prompt for the name of the DSK file.
;;
read, dsk, PROMPT='Enter name of DSK file > '
;;
;; Find the set of objects in the dsk file.
;;
bodids = cspice_celli(MAXID)
srfids = cspice_celli(MAXID)
cspice_dskobj, dsk, bodids
for i=0, cspice_card( bodids ) - 1 do begin
obj = bodids.base[ bodids.data + i ]
print, 'Body ID: ' , obj
;;
;; Get the surface IDs for the Ith body.
;;
cspice_dsksrf, dsk, obj, srfids
for i=0, cspice_card( srfids ) - 1 do begin
srf = srfids.base[ srfids.data + i ]
print, ' Surface ID: ' , srf
endfor
endfor
END
When this program was executed on a Mac/Intel/IDL8.x/64-bit
platform, using the DSK file named phobos512.bds, the output
was:
Enter name of DSK file > phobos512.bds
Body ID: 401
Surface ID: 401
This routine provides an API via which applications can determine
the set of surfaces associated with a given body in a specified
DSK file. This routine is normally used together with cspice_dskobj.
1) If the input file has transfer format, the error
SPICE(INVALIDFORMAT) is signaled by a routine in the call tree
of this routine.
2) If the input file is not a transfer file but has architecture
other than DAS, the error SPICE(INVALIDARCHTYPE) is signaled
by a routine in the call tree of this routine.
3) If the input file is a binary DAS file of type other than DSK,
the error SPICE(INVALIDFILETYPE) is signaled by a routine in
the call tree of this routine.
4) If the DSK file cannot be opened or read, an error is signaled
by a routine in the call tree of this routine.
5) If the size of the output set argument `srfids' is insufficient
to contain the actual number of ID codes of surfaces covered by
the indicated DSK file, the error SPICE(CELLTOOSMALL) is
signaled by a routine in the call tree of this routine.
6) If any of the input arguments, `dskfnm', `bodyid' or `srfids',
is undefined, an error is signaled by the IDL error handling
system.
7) If any of the input arguments, `dskfnm', `bodyid' or `srfids',
is not of the expected type, or it does not have the expected
dimensions and size, an error is signaled by the Icy
interface.
See the description of the argument `dskfnm' above.
1) If an error occurs while this routine is updating the set
`srfids', the set may be corrupted.
CELLS.REQ
DAS.REQ
DSK.REQ
ICY.REQ
NAIF_IDS.REQ
SETS.REQ
None.
J. Diaz del Rio (ODC Space)
M. Liukis (JPL)
E.D. Wright (JPL)
-Icy Version 1.1.0, 24-AUG-2021 (JDR)
Changed the input argument name "dsk" to "dskfnm" for consistency
with other routines.
Edited the header to comply with NAIF standard. Updated
code example to prompt for the input DSK file.
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, 14-DEC-2016 (ML) (EDW)
find id codes of surfaces in DSK file
|