Table of contents
CSPICE_SPKCLS closes an SPK file opened for a write.
Given:
handle the handle of the SPK file that is to be closed.
help, handle
LONG = Scalar
the call:
cspice_spkcls, handle
closes the file attached to `handle'.
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) This example demonstrates how to create an SPK type 8 kernel
containing only one segment, given a time-ordered set of
discrete states and epochs.
Example code begins here.
PRO spkcls_ex1
;;
;; Define the segment identifier parameters.
;;
BODY = 3
CENTER = 10
REF = 'J2000'
POLY_DEG = 3
SPK8 = 'spkcls_ex1.bsp'
N_DISCRETE = 9
;;
;; A set of epochs.
;;
DISCRETEEPOCHS = [ 100.d, 200.d, 300.d, 400.d, 500.d, $
600.d, 700.d, 800.d, 900.d $
]
;;
;; An array of discrete states to write to the SPK segment.
;;
DISCRETESTATES = [ $
[ 101.d, 201.d, 301.d, 401.d, 501.d, 601.d ], $
[ 102.d, 202.d, 302.d, 402.d, 502.d, 602.d ], $
[ 103.d, 203.d, 303.d, 403.d, 503.d, 603.d ], $
[ 104.d, 204.d, 304.d, 404.d, 504.d, 604.d ], $
[ 105.d, 205.d, 305.d, 405.d, 505.d, 605.d ], $
[ 106.d, 206.d, 306.d, 406.d, 506.d, 606.d ], $
[ 107.d, 207.d, 307.d, 407.d, 507.d, 607.d ], $
[ 108.d, 208.d, 308.d, 408.d, 508.d, 608.d ], $
[ 109.d, 209.d, 309.d, 409.d, 509.d, 609.d ] $
]
;;
;; Create a segment identifier.
;;
segid = 'SPK type 8 test segment'
;;
;; Open a new SPK file.
;;
cspice_spkopn, SPK8, 'Type 8 SPK internal file name.', 4, handle
step = DISCRETEEPOCHS[1] - DISCRETEEPOCHS[0]
;;
;; Create a type 8 segment.
;;
cspice_spkw08, handle, $
BODY, $
CENTER, $
REF, $
DISCRETEEPOCHS[0], $
DISCRETEEPOCHS[N_DISCRETE-1], $
segid, $
POLY_DEG, $
N_DISCRETE, $
DISCRETESTATES, $
DISCRETEEPOCHS[0], $
step
;;
;; Close the SPK file.
;;
cspice_spkcls, handle
END
When this program is executed, no output is presented on
screen. After run completion, a new SPK type 8 exists in
the output directory.
Close the SPK file attached to `handle'. The close operation tests the
file to ensure the presence of data segments.
A cspice_spkcls call should balance each call to cspice_spkopn.
1) If there are no segments in the file, the error
SPICE(NOSEGMENTSFOUND) is signaled by a routine in the call
tree of this routine.
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 argument `handle'.
None.
ICY.REQ
SPK.REQ
None.
J. Diaz del Rio (ODC Space)
E.D. Wright (JPL)
-Icy Version 1.0.1, 01-JUN-2021 (JDR)
Edited the header to comply with NAIF standard. Added
complete code example, based on the cspice_spkw08 example.
Added -Parameters, -Exceptions, -Files, -Restrictions,
-Literature_References and -Author_and_Institution sections, and
completed -Particulars section.
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, 16-JUN-2003 (EDW)
close an SPK file
|