Table of contents
CSPICE_WNINSD inserts an interval into a double
precision window.
Given:
left,
right the scalar, double precision left and right endpoints of the
interval to be inserted.
help, left
DOUBLE = Scalar
help, right
DOUBLE = Scalar
window the scalar window on input, 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:
cspice_wninsd, left, right, window
returns:
window the scalar output of `window', following insertion of the
interval from `left' to `right'.
help, window
STRUCT = cspice_celld(2*N)
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) Create an empty window structure based on a cell containing a
double precision 6-vector and insert three intervals into that
window. Output the window's array contents.
Example code begins here.
PRO wninsd_ex1
;;
;; Create a cell containing a double
;; precision 6-vector.
;;
win1 = cspice_celld( 6 )
;;
;; Define a window with three intervals.
;;
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 cardinality (number of elements in the
;; double precision data array) of `win1'?
;;
cardinality = win1.card
;;
;; Directly check the window's array contents.
;; The struct field `base' stores the array data
;; beginning at the offset value stored in field `data'.
;;
for i = 0, cardinality-1 do begin
print, (win1.base)[win1.data + i]
endfor
END
When this program was executed on a Mac/Intel/IDL8.x/64-bit
platform, the output was:
1.0000000
3.0000000
7.0000000
11.000000
23.000000
27.000000
This routine inserts the interval from `left' to `right' into the
input window. If the new interval overlaps any of the intervals
in the window, the intervals are merged. Thus, the cardinality
of the input window can actually decrease as the result of an
insertion. However, because inserting an interval that is
disjoint from the other intervals in the window can increase the
cardinality of the window, the routine signals an error.
1) If `left' is greater than `right', the error SPICE(BADENDPOINTS)
is signaled by a routine in the call tree of this routine.
2) If the insertion of the interval causes an excess of elements,
the error SPICE(WINDOWEXCESS) is signaled by a routine in the
call tree of this routine.
3) The cardinality of the input `window' must be even. Left
endpoints of stored intervals must be strictly greater than
preceding right endpoints. Right endpoints must be greater
than or equal to corresponding left endpoints. Invalid window
data are not diagnosed by this routine and may lead to
unpredictable results.
4) If any of the input arguments, `left', `right' or `window', is
undefined, an error is signaled by the IDL error handling
system.
5) If any of the input arguments, `left', `right' or `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
WINDOWS.REQ
None.
J. Diaz del Rio (ODC Space)
E.D. Wright (JPL)
-Icy Version 1.0.2, 07-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.
Removed irrelevant information related to other unary window
routines and note on creation of window structures (already in
-I/O section) from -Particulars section.
-Icy Version 1.0.1, 03-DEC-2007 (EDW)
Correct Required Reading citation cell.req to cells.req.
Corrected typo in Example code comments, "three" intervals
rather than "four."
-Icy Version 1.0.0, 08-AUG-2004 (EDW)
insert an interval into a d.p. window
|