Table of contents
CSPICE_WNCARD returns the cardinality (current number of intervals)
of a double precision window.
Given:
window a window containing zero or more intervals.
help, window
STRUCT = cspice_celld(2*N)
`window' must be created as a window structure via a
cspice_celld call.
the call:
wncard = cspice_wncard( window )
returns:
wncard the cardinality of (number of intervals in) the input window.
help, wncard
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) The window cardinality function cspice_wncard is typically used to
process each of the intervals of a window.
Given a double precision window, determine its cardinality
(number of intervals).
Example code begins here.
PRO wncard_ex1
;;
;; Create a cell containing a double
;; precision 8-vector.
;;
win1 = cspice_celld( 8 )
;;
;; Define a window with three intervals (six values).
;;
darray = [ [ 1.d, 3.0], [ 7.0, 11.0], [23.0, 27.0] ]
;;
;; Insert the window data to the cell.
;;
for i=0, 2 do begin
cspice_wninsd, darray[0,i], darray[1,i], win1
endfor
;;
;; What's the window cardinality of 'win1'?
;;
cardinality = cspice_wncard(win1)
;;
;; Print the window cardinality (this out to show "3" ).
;;
print, 'Number of intervals in the window: ', cardinality
END
When this program was executed on a Mac/Intel/IDL8.x/64-bit
platform, the output was:
Number of intervals in the window: 3
This function returns the value of cspice_card(window)/2.
1) If the number of elements in `window' is not even, the error
SPICE(INVALIDSIZE) is signaled by a routine in the call tree
of this routine.
2) If the input argument `window' is undefined, an error is
signaled by the IDL error handling system.
3) If the input argument `window' is not of the expected type, or
it does not have the expected dimensions and size, an error is
signaled by the Icy interface.
None.
None.
ICY.REQ
CELLS.REQ
None.
J. Diaz del Rio (ODC Space)
E.D. Wright (JPL)
-Icy Version 1.0.2, 10-AUG-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.1, 23-SEP-2008 (EDW)
Eliminated error in English.
Corrected typo in 'window' -I/O description.
-Icy Version 1.0.0, 03-DEC-2007 (EDW)
cardinality of a d.p. window
|