CSPICE_WNINSD inserts an interval into a double precision window. For important details concerning this module's function, please refer to the CSPICE routine wninsd_c.
Given: left, right the scalar, double precision left and right endpoints of the interval to be inserted. window the scalar window on input, containing zero or more intervals. 'window' must be created as a window structure via a cspice_celld call. the call: cspice_wninsd, left, right, window returns: windows the scalar output of 'window', following insertion of the interval from 'left' to 'right'.
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. ;; ;; Create a cell containing a double ;; precision 8-vector. ;; win1 = cspice_celld( 8 ) ;; ;; 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 IDL outputs: 1.0000000 3.0000000 7.0000000 11.000000 23.000000 27.000000
The user must create any needed window structures with cspice_celld prior to use regardless of whether the routine uses the window as input or returns it as output. 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. No other Icy unary window routine can increase the number of intervals in the input window.
-Icy Version 1.0.1, 03-DEC-2007, EDW (JPL) 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 (JPL)
insert an interval into a d.p. window
Wed Apr 5 17:58:05 2017