Table of contents
CSPICE_DASCLS closes a DAS file.
Given:
handle scalar integer file handle of an open DAS file.
help, handle
LONG = Scalar
the call:
cspice_dascls, handle
returns:
None.
All parameters described here are declared in the Icy
include file IcyDAS.pro. See that file for parameter values.
SPICE_DAS_FTSIZE
is the maximum number of DAS files that can be
open at any one time.
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) Dump several parameters from the first DLA segment of
a DSK file. The segment is assumed to be of type 2.
Example code begins here.
PRO dascls_ex1
;;
;; Local variables
;;
dsk = ''
;;
;; Prompt for the name of the file to search.
;;
read, dsk, PROMPT='Enter name of DSK file > '
;;
;; Open the DSK file for read access. We use the
;; DAS-level interface for this function.
;;
cspice_dasopr, dsk, handle
;;
;; Begin a forward search through the kernel. In
;; this example, it's a very short search.
;;
cspice_dlabfs, handle, dladsc, found
if ( ~found ) then begin
message, 'SPICE(NOSEGMENT): No segment found in file '+ dsk
endif
while ( found ) do begin
;;
;; If we made it this far, DLADSC is the
;; DLA descriptor of the first segment.
;; Read and display type 2 bookkeeping data.
;;
cspice_dskb02, handle, dladsc, nv, np, nvxtot, $
vtxbds, voxsiz, voxori, vgrext, $
cgscal, vtxnpl, voxnpt, voxnpl
print, FORMAT='(A,I8)', $
'Number of vertices: ', nv
print, FORMAT='(A,I8)', $
'Number of plates: ', np
print, FORMAT='(A,I8)', $
'Number of voxels: ', nvxtot
print, FORMAT='(A,2F12.6)', $
'Vertex bounds in X direction (km): ', vtxbds[*,0]
print, FORMAT='(A,2F12.6)', $
'Vertex bounds in Y direction (km): ', vtxbds[*,1]
print, FORMAT='(A,2F12.6)', $
'Vertex bounds in Z direction (km): ', vtxbds[*,2]
print, FORMAT='(A,F12.6)', $
'Voxel edge length (km): ', voxsiz
print, FORMAT='(A,3F12.6)', $
'Voxel grid origin (km): ', voxori
print, FORMAT='(A,3I12)', $
'Voxel grid extents: ', vgrext
print, FORMAT='(A,I8)', $
'Coarse voxel grid scale: ', cgscal
print, FORMAT='(A,I8)', $
'Size of vertex-plate list: ', vtxnpl
print, FORMAT='(A,I8)', $
'Size of voxel-plate pointer array: ', voxnpt
print, FORMAT='(A,I8)', $
'Size of voxel-plate list: ', voxnpl
print
;;
;; Search for the segment after that described by 'dladsc'.
;; 'found' returns as false if no such segment located.
;;
cspice_dlafns, handle, dladsc, nxtdsc, found
dladsc = nxtdsc
endwhile
;;
;; Close the kernel. This frees program and system resources.
;;
cspice_dascls, handle
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
Number of vertices: 1579014
Number of plates: 3145728
Number of voxels: 11914500
Vertex bounds in X direction (km): -13.440030 12.762800
Vertex bounds in Y direction (km): -11.520650 12.061140
Vertex bounds in Z direction (km): -9.570780 10.055000
Voxel edge length (km): 0.104248
Voxel grid origin (km): -14.073520 -11.988554 -9.903588
Voxel grid extents: 260 235 195
Coarse voxel grid scale: 5
Size of vertex-plate list: 11010050
Size of voxel-plate pointer array: 1151500
Size of voxel-plate list: 6419540
This routine provides the primary recommended method of closing an
open DAS file.
1) If `handle' is not the handle of an open DAS file, no error
is signaled.
2) If the input argument `handle' is undefined, an error is
signaled by the IDL error handling system.
3) If the input argument `handle' 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 input argument `handle' in -I/O.
None.
ICY.REQ
DAS.REQ
None.
J. Diaz del Rio (ODC Space)
E.D. Wright (JPL)
-Icy Version 1.0.1, 13-AUG-2021 (JDR)
Edited the -Examples section to comply with NAIF standard. Added
complete code example based on example in cspice_dskb02.
Added -Parameters, -Exceptions, -Files, -Restrictions,
-Literature_References and -Author_and_Institution sections.
Added das.req to the list of required readings.
Removed reference to the routine's corresponding CSPICE header from
-Abstract section.
Added argument's type and size information in the -I/O section.
-Icy Version 1.0.0, 07-DEC-2011 (EDW)
close a DAS file
|